Change to use NVME_PEL_RCI_RCPIT definitions.
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
__u8 rcpit = NVME_PEL_RCI_RCPIT(rci);
__u16 rcpid = NVME_PEL_RCI_RCPID(rci);
- if(rsvd19)
+ if (rsvd19)
printf(" [31:19] : %#x\tReserved\n", rsvd19);
- printf("\tReporting Context Exists (RCE): %s(%u)\n",
- rce ? "true" : "false", rce);
+ printf("\tReporting Context Exists (RCE): %s(%u)\n", rce ? "true" : "false", rce);
printf("\tReporting Context Port Identifier Type (RCPIT): %u(%s)\n", rcpit,
- (rcpit == 0x00) ? "Does not already exist" :
- (rcpit == 0x01) ? "NVM subsystem port" :
- (rcpit == 0x02) ? "NVMe-MI port" : "Reserved");
+ nvme_pel_rci_rcpit_to_string(rcpit));
printf("\tReporting Context Port Identifier (RCPID): %#x\n\n", rcpid);
}
}
}
+const char *nvme_pel_rci_rcpit_to_string(enum nvme_pel_rci_rcpit rcpit)
+{
+ switch (rcpit) {
+ case NVME_PEL_RCI_RCPIT_NOT_EXIST:
+ return "Does not already exist";
+ case NVME_PEL_RCI_RCPIT_EST_PORT:
+ return "NVM subsystem port";
+ case NVME_PEL_RCI_RCPIT_EST_ME:
+ return "NVMe-MI port";
+ default:
+ break;
+ }
+ return "Reserved";
+}
+
void nvme_feature_show(enum nvme_features_id fid, int sel, unsigned int result)
{
nvme_print(show_feature, NORMAL, fid, sel, result);
const char *nvme_zone_type_to_string(__u8 cond);
const char *nvme_plm_window_to_string(__u32 plm);
const char *nvme_ns_wp_cfg_to_string(enum nvme_ns_write_protect_cfg state);
+const char *nvme_pel_rci_rcpit_to_string(enum nvme_pel_rci_rcpit rcpit);
void nvme_dev_full_path(nvme_ns_t n, char *path, size_t len);
void nvme_generic_full_path(nvme_ns_t n, char *path, size_t len);