Loading drivers/nvme/host/constants.c +16 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,14 @@ static const char * const nvme_admin_ops[] = { [nvme_admin_get_lba_status] = "Get LBA Status", }; static const char * const nvme_fabrics_ops[] = { [nvme_fabrics_type_property_set] = "Property Set", [nvme_fabrics_type_property_get] = "Property Get", [nvme_fabrics_type_connect] = "Connect", [nvme_fabrics_type_auth_send] = "Authentication Send", [nvme_fabrics_type_auth_receive] = "Authentication Receive", }; static const char * const nvme_statuses[] = { [NVME_SC_SUCCESS] = "Success", [NVME_SC_INVALID_OPCODE] = "Invalid Command Opcode", Loading Loading @@ -185,3 +193,11 @@ const unsigned char *nvme_get_admin_opcode_str(u8 opcode) return nvme_admin_ops[opcode]; return "Unknown"; } EXPORT_SYMBOL_GPL(nvme_get_admin_opcode_str); const unsigned char *nvme_get_fabrics_opcode_str(u8 opcode) { if (opcode < ARRAY_SIZE(nvme_fabrics_ops) && nvme_fabrics_ops[opcode]) return nvme_fabrics_ops[opcode]; return "Unknown"; } EXPORT_SYMBOL_GPL(nvme_get_fabrics_opcode_str); drivers/nvme/host/nvme.h +13 −0 Original line number Diff line number Diff line Loading @@ -1087,6 +1087,7 @@ static inline bool nvme_multi_css(struct nvme_ctrl *ctrl) const unsigned char *nvme_get_error_status_str(u16 status); const unsigned char *nvme_get_opcode_str(u8 opcode); const unsigned char *nvme_get_admin_opcode_str(u8 opcode); const unsigned char *nvme_get_fabrics_opcode_str(u8 opcode); #else /* CONFIG_NVME_VERBOSE_ERRORS */ static inline const unsigned char *nvme_get_error_status_str(u16 status) { Loading @@ -1100,6 +1101,18 @@ static inline const unsigned char *nvme_get_admin_opcode_str(u8 opcode) { return "Admin Cmd"; } static inline const unsigned char *nvme_get_fabrics_opcode_str(u8 opcode) { return "Fabrics Cmd"; } #endif /* CONFIG_NVME_VERBOSE_ERRORS */ static inline const unsigned char *nvme_opcode_str(int qid, u8 opcode, u8 fctype) { if (opcode == nvme_fabrics_command) return nvme_get_fabrics_opcode_str(fctype); return qid ? nvme_get_opcode_str(opcode) : nvme_get_admin_opcode_str(opcode); } #endif /* _NVME_H */ Loading
drivers/nvme/host/constants.c +16 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,14 @@ static const char * const nvme_admin_ops[] = { [nvme_admin_get_lba_status] = "Get LBA Status", }; static const char * const nvme_fabrics_ops[] = { [nvme_fabrics_type_property_set] = "Property Set", [nvme_fabrics_type_property_get] = "Property Get", [nvme_fabrics_type_connect] = "Connect", [nvme_fabrics_type_auth_send] = "Authentication Send", [nvme_fabrics_type_auth_receive] = "Authentication Receive", }; static const char * const nvme_statuses[] = { [NVME_SC_SUCCESS] = "Success", [NVME_SC_INVALID_OPCODE] = "Invalid Command Opcode", Loading Loading @@ -185,3 +193,11 @@ const unsigned char *nvme_get_admin_opcode_str(u8 opcode) return nvme_admin_ops[opcode]; return "Unknown"; } EXPORT_SYMBOL_GPL(nvme_get_admin_opcode_str); const unsigned char *nvme_get_fabrics_opcode_str(u8 opcode) { if (opcode < ARRAY_SIZE(nvme_fabrics_ops) && nvme_fabrics_ops[opcode]) return nvme_fabrics_ops[opcode]; return "Unknown"; } EXPORT_SYMBOL_GPL(nvme_get_fabrics_opcode_str);
drivers/nvme/host/nvme.h +13 −0 Original line number Diff line number Diff line Loading @@ -1087,6 +1087,7 @@ static inline bool nvme_multi_css(struct nvme_ctrl *ctrl) const unsigned char *nvme_get_error_status_str(u16 status); const unsigned char *nvme_get_opcode_str(u8 opcode); const unsigned char *nvme_get_admin_opcode_str(u8 opcode); const unsigned char *nvme_get_fabrics_opcode_str(u8 opcode); #else /* CONFIG_NVME_VERBOSE_ERRORS */ static inline const unsigned char *nvme_get_error_status_str(u16 status) { Loading @@ -1100,6 +1101,18 @@ static inline const unsigned char *nvme_get_admin_opcode_str(u8 opcode) { return "Admin Cmd"; } static inline const unsigned char *nvme_get_fabrics_opcode_str(u8 opcode) { return "Fabrics Cmd"; } #endif /* CONFIG_NVME_VERBOSE_ERRORS */ static inline const unsigned char *nvme_opcode_str(int qid, u8 opcode, u8 fctype) { if (opcode == nvme_fabrics_command) return nvme_get_fabrics_opcode_str(fctype); return qid ? nvme_get_opcode_str(opcode) : nvme_get_admin_opcode_str(opcode); } #endif /* _NVME_H */