Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/nvmecontrol.h
Show All 36 Lines | |||||
struct nvme_function; | struct nvme_function; | ||||
typedef void (*nvme_fn_t)(const struct nvme_function *nf, int argc, char *argv[]); | typedef void (*nvme_fn_t)(const struct nvme_function *nf, int argc, char *argv[]); | ||||
struct nvme_function { | struct nvme_function { | ||||
const char *name; | const char *name; | ||||
nvme_fn_t fn; | nvme_fn_t fn; | ||||
const char *usage; | const char *usage; | ||||
const char *args; | |||||
const char *descr; | |||||
}; | }; | ||||
#define NVME_SETNAME(set) set | #define NVME_SETNAME(set) set | ||||
#define NVME_CMDSET(set, sym) DATA_SET(NVME_SETNAME(set), sym) | #define NVME_CMDSET(set, sym) DATA_SET(NVME_SETNAME(set), sym) | ||||
#define NVME_COMMAND(set, nam, function, usage_str) \ | #define NVME_COMMAND(set, nam, function, usage_str, args_str, descr_str) \ | ||||
Lint: Possible Spelling Mistake: Possible spelling error. You wrote 'nam', but did you mean 'name'? | |||||
Done Inline Actionsfalse positive. imp: false positive. | |||||
static struct nvme_function function ## _nvme_cmd = \ | static struct nvme_function function ## _nvme_cmd = \ | ||||
{ .name = #nam, .fn = function, .usage = usage_str }; \ | { .name = #nam, .fn = function, .usage = usage_str, \ | ||||
Lint: Possible Spelling Mistake Possible spelling error. You wrote 'nam', but did you mean 'name'? Lint: Possible Spelling Mistake: Possible spelling error. You wrote 'nam', but did you mean 'name'? | |||||
.args = args_str, .descr = descr_str }; \ | |||||
Done Inline Actionsfalse positive imp: false positive | |||||
NVME_CMDSET(set, function ## _nvme_cmd) | NVME_CMDSET(set, function ## _nvme_cmd) | ||||
#define NVME_CMD_BEGIN(set) SET_BEGIN(NVME_SETNAME(set)) | #define NVME_CMD_BEGIN(set) SET_BEGIN(NVME_SETNAME(set)) | ||||
#define NVME_CMD_LIMIT(set) SET_LIMIT(NVME_SETNAME(set)) | #define NVME_CMD_LIMIT(set) SET_LIMIT(NVME_SETNAME(set)) | ||||
#define NVME_CMD_DECLARE(set, t) SET_DECLARE(NVME_SETNAME(set), t) | #define NVME_CMD_DECLARE(set, t) SET_DECLARE(NVME_SETNAME(set), t) | ||||
typedef void (*print_fn_t)(const struct nvme_controller_data *cdata, void *buf, uint32_t size); | typedef void (*print_fn_t)(const struct nvme_controller_data *cdata, void *buf, uint32_t size); | ||||
struct logpage_function { | struct logpage_function { | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
void usage(const struct nvme_function *f); | void usage(const struct nvme_function *f); | ||||
void dispatch_set(int argc, char *argv[], const struct nvme_function * const *tbl, | void dispatch_set(int argc, char *argv[], const struct nvme_function * const *tbl, | ||||
const struct nvme_function * const *tbl_limit); | const struct nvme_function * const *tbl_limit); | ||||
#define DISPATCH(argc, argv, set) \ | #define DISPATCH(argc, argv, set) \ | ||||
dispatch_set(argc, argv, \ | dispatch_set(argc, argv, \ | ||||
(const struct nvme_function * const *)NVME_CMD_BEGIN(set), \ | (const struct nvme_function * const *)NVME_CMD_BEGIN(set), \ | ||||
(const struct nvme_function * const *)NVME_CMD_LIMIT(set)) \ | (const struct nvme_function * const *)NVME_CMD_LIMIT(set)) \ | ||||
struct args; | |||||
int arg_parse_and_open(int argc, char * const * argv, const char *desc, const struct args *args); | |||||
/* Utility Routines */ | /* Utility Routines */ | ||||
/* | /* | ||||
* 128-bit integer augments to standard values. On i386 this | * 128-bit integer augments to standard values. On i386 this | ||||
* doesn't exist, so we use 64-bit values. So, on 32-bit i386, | * doesn't exist, so we use 64-bit values. So, on 32-bit i386, | ||||
* you'll get truncated values until someone implement 128bit | * you'll get truncated values until someone implement 128bit | ||||
* ints in sofware. | * ints in sofware. | ||||
*/ | */ | ||||
Show All 17 Lines |
Possible spelling error. You wrote 'nam', but did you mean 'name'?