Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/nvmecontrol/identify.c
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | printf("Data Protection Caps: %s%s%s%s%s%s\n", | ||||
((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) & | ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_END_SHIFT) & | ||||
NVME_NS_DATA_DPC_MD_END_MASK) ? "Last Bytes, " : "", | NVME_NS_DATA_DPC_MD_END_MASK) ? "Last Bytes, " : "", | ||||
((nsdata->dpc >> NVME_NS_DATA_DPC_MD_START_SHIFT) & | ((nsdata->dpc >> NVME_NS_DATA_DPC_MD_START_SHIFT) & | ||||
NVME_NS_DATA_DPC_MD_START_MASK) ? "First Bytes, " : "", | NVME_NS_DATA_DPC_MD_START_MASK) ? "First Bytes, " : "", | ||||
((nsdata->dpc >> NVME_NS_DATA_DPC_PIT3_SHIFT) & | ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT3_SHIFT) & | ||||
NVME_NS_DATA_DPC_PIT3_MASK) ? "Type 3, " : "", | NVME_NS_DATA_DPC_PIT3_MASK) ? "Type 3, " : "", | ||||
((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_SHIFT) & | ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_SHIFT) & | ||||
NVME_NS_DATA_DPC_PIT2_MASK) ? "Type 2, " : "", | NVME_NS_DATA_DPC_PIT2_MASK) ? "Type 2, " : "", | ||||
((nsdata->dpc >> NVME_NS_DATA_DPC_PIT2_MASK) & | ((nsdata->dpc >> NVME_NS_DATA_DPC_PIT1_SHIFT) & | ||||
NVME_NS_DATA_DPC_PIT1_MASK) ? "Type 1" : ""); | NVME_NS_DATA_DPC_PIT1_MASK) ? "Type 1" : ""); | ||||
printf("Data Protection Settings: "); | printf("Data Protection Settings: "); | ||||
ptype = (nsdata->dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & | ptype = (nsdata->dps >> NVME_NS_DATA_DPS_PIT_SHIFT) & | ||||
NVME_NS_DATA_DPS_PIT_MASK; | NVME_NS_DATA_DPS_PIT_MASK; | ||||
if (ptype) { | if (ptype) { | ||||
printf("Type %d, %s Bytes\n", ptype, | printf("Type %d, %s Bytes\n", ptype, | ||||
((nsdata->dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) & | ((nsdata->dps >> NVME_NS_DATA_DPS_MD_START_SHIFT) & | ||||
NVME_NS_DATA_DPS_MD_START_MASK) ? "First" : "Last"); | NVME_NS_DATA_DPS_MD_START_MASK) ? "First" : "Last"); | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
identify(const struct cmd *f, int argc, char *argv[]) | identify(const struct cmd *f, int argc, char *argv[]) | ||||
{ | { | ||||
char *path; | char *path; | ||||
int fd; | int fd; | ||||
uint32_t nsid; | uint32_t nsid; | ||||
arg_parse(argc, argv, f); | if (arg_parse(argc, argv, f)) | ||||
return; | |||||
open_dev(opt.dev, &fd, 1, 1); | open_dev(opt.dev, &fd, 1, 1); | ||||
get_nsid(fd, &path, &nsid); | get_nsid(fd, &path, &nsid); | ||||
if (nsid != 0) { | if (nsid != 0) { | ||||
/* | /* | ||||
* We got namespace device, but we need to send IDENTIFY | * We got namespace device, but we need to send IDENTIFY | ||||
* commands to the controller, not the namespace, since it | * commands to the controller, not the namespace, since it | ||||
* is an admin cmd. The namespace ID will be specified in | * is an admin cmd. The namespace ID will be specified in | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |