forked from arthur-simchaev-wdc/ufs-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.h
59 lines (51 loc) · 1.15 KB
/
options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Copyright (C) 2019 Western Digital Corporation or its affiliates */
#ifndef OPTIONS_H_
#define OPTIONS_H_
#include <stdint.h>
#define OK 0
#define ERROR -1
#define INVALID -1
#ifndef _UAPI_LINUX_LIMITS_H
#define PATH_MAX 4096
#endif
#define READ 0
#define WRITE 1
#define CLEAR_FLAG 2
#define SET_FLAG 3
#define TOGGLE_FLAG 4
#define READ_ALL 5
#define ALIGNMENT_CHUNK_SIZE 4096
struct tool_options {
/* one of @ufs_cong_type */
int config_type_inx;
/* opt: -t, type - one of @flag_idn / @attr_idn / @desc_idn
* or @unipro attribute idn
*/
int idn;
/* opt: -r/w/o/c/a, type of the operation read/write/toggle/clear */
int opr;
int index;
int selector;
/* data for writing */
void *data;
/* @DME_LOCAL or @DME_PEER */
int target;
int size;
int offset;
int len;
/* HMR related */
int hmr_method;
int hmr_unit;
/*start block address for rpmb cmd */
int start_block;
int num_block;
int8_t lun;
/*RPMB region*/
int8_t region;
int sg_type;
char keypath[PATH_MAX];
char path[PATH_MAX];
};
int init_options(int opt_cnt, char **opt_arr, struct tool_options *options);
#endif /* OPTIONS_H_ */