Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/identify.c
Show All 39 Lines | |||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "nvmecontrol.h" | #include "nvmecontrol.h" | ||||
#include "nvmecontrol_ext.h" | #include "nvmecontrol_ext.h" | ||||
#define IDENTIFY_USAGE \ | #define IDENTIFY_USAGE \ | ||||
"identify [-x [-v]] <controller id|namespace id>\n" | "identify [-x [-v]] <controller id|namespace id>\n" | ||||
#define IDENTIFY_ARGS \ | |||||
"<controller id|namespace id>" | |||||
#define IDENTIFY_DESCR \ | |||||
"Print a human-readable summary of the IDENTIFY information from namespace or controller" | |||||
static void | static void | ||||
print_namespace(struct nvme_namespace_data *nsdata) | print_namespace(struct nvme_namespace_data *nsdata) | ||||
{ | { | ||||
uint32_t i; | uint32_t i; | ||||
uint32_t lbaf, lbads, ms, rp; | uint32_t lbaf, lbads, ms, rp; | ||||
uint8_t thin_prov, ptype; | uint8_t thin_prov, ptype; | ||||
uint8_t flbas_fmt, t; | uint8_t flbas_fmt, t; | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | identify(const struct nvme_function *nf, int argc, char *argv[]) | ||||
* otherwise, consider it a controller. | * otherwise, consider it a controller. | ||||
*/ | */ | ||||
if (strstr(target, NVME_NS_PREFIX) == NULL) | if (strstr(target, NVME_NS_PREFIX) == NULL) | ||||
identify_ctrlr(nf, argc, argv); | identify_ctrlr(nf, argc, argv); | ||||
else | else | ||||
identify_ns(nf, argc, argv); | identify_ns(nf, argc, argv); | ||||
} | } | ||||
NVME_COMMAND(top, identify, identify, IDENTIFY_USAGE); | NVME_COMMAND(top, identify, identify, IDENTIFY_USAGE, IDENTIFY_ARGS, IDENTIFY_DESCR); |