xref: /illumos-gate/usr/src/lib/libnvme/common/libnvme_ocp.c (revision 7655c6d53c36750b508636f48c73a2de57754e5a)
1*7655c6d5SRobert Mustacchi /*
2*7655c6d5SRobert Mustacchi  * This file and its contents are supplied under the terms of the
3*7655c6d5SRobert Mustacchi  * Common Development and Distribution License ("CDDL"), version 1.0.
4*7655c6d5SRobert Mustacchi  * You may only use this file in accordance with the terms of version
5*7655c6d5SRobert Mustacchi  * 1.0 of the CDDL.
6*7655c6d5SRobert Mustacchi  *
7*7655c6d5SRobert Mustacchi  * A full copy of the text of the CDDL should have accompanied this
8*7655c6d5SRobert Mustacchi  * source.  A copy of the CDDL is also available via the Internet at
9*7655c6d5SRobert Mustacchi  * http://www.illumos.org/license/CDDL.
10*7655c6d5SRobert Mustacchi  */
11*7655c6d5SRobert Mustacchi 
12*7655c6d5SRobert Mustacchi /*
13*7655c6d5SRobert Mustacchi  * Copyright 2024 Oxide Computer Company
14*7655c6d5SRobert Mustacchi  */
15*7655c6d5SRobert Mustacchi 
16*7655c6d5SRobert Mustacchi /*
17*7655c6d5SRobert Mustacchi  * libnvme logic that covers the OCP Datacenter NVMe SSD specification.
18*7655c6d5SRobert Mustacchi  */
19*7655c6d5SRobert Mustacchi 
20*7655c6d5SRobert Mustacchi #include <sys/sysmacros.h>
21*7655c6d5SRobert Mustacchi #include <sys/nvme/ocp.h>
22*7655c6d5SRobert Mustacchi 
23*7655c6d5SRobert Mustacchi #include "libnvme_impl.h"
24*7655c6d5SRobert Mustacchi 
25*7655c6d5SRobert Mustacchi const nvme_log_page_info_t ocp_log_smart = {
26*7655c6d5SRobert Mustacchi 	.nlpi_short = "ocp/smart",
27*7655c6d5SRobert Mustacchi 	.nlpi_human = "OCP SMART / Health Information",
28*7655c6d5SRobert Mustacchi 	.nlpi_lid = OCP_LOG_DSSD_SMART,
29*7655c6d5SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
30*7655c6d5SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
31*7655c6d5SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
32*7655c6d5SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
33*7655c6d5SRobert Mustacchi 	.nlpi_len = sizeof (ocp_vul_smart_t),
34*7655c6d5SRobert Mustacchi };
35*7655c6d5SRobert Mustacchi 
36*7655c6d5SRobert Mustacchi const nvme_log_page_info_t ocp_log_errrec = {
37*7655c6d5SRobert Mustacchi 	.nlpi_short = "ocp/errrec",
38*7655c6d5SRobert Mustacchi 	.nlpi_human = "OCP Error Recovery",
39*7655c6d5SRobert Mustacchi 	.nlpi_lid = OCP_LOG_DSSD_ERROR_REC,
40*7655c6d5SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
41*7655c6d5SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
42*7655c6d5SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
43*7655c6d5SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
44*7655c6d5SRobert Mustacchi 	.nlpi_len = sizeof (ocp_vul_errrec_t),
45*7655c6d5SRobert Mustacchi };
46*7655c6d5SRobert Mustacchi 
47*7655c6d5SRobert Mustacchi const nvme_log_page_info_t ocp_log_fwact = {
48*7655c6d5SRobert Mustacchi 	.nlpi_short = "ocp/fwact",
49*7655c6d5SRobert Mustacchi 	.nlpi_human = "OCP Firmware Activation",
50*7655c6d5SRobert Mustacchi 	.nlpi_lid = OCP_LOG_DSSD_FWACT,
51*7655c6d5SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
52*7655c6d5SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
53*7655c6d5SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
54*7655c6d5SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
55*7655c6d5SRobert Mustacchi 	.nlpi_len = sizeof (ocp_vul_fwact_t),
56*7655c6d5SRobert Mustacchi };
57*7655c6d5SRobert Mustacchi 
58*7655c6d5SRobert Mustacchi const nvme_log_page_info_t ocp_log_lat = {
59*7655c6d5SRobert Mustacchi 	.nlpi_short = "ocp/latency",
60*7655c6d5SRobert Mustacchi 	.nlpi_human = "OCP Latency Monitor",
61*7655c6d5SRobert Mustacchi 	.nlpi_lid = OCP_LOG_DSSD_LATENCY,
62*7655c6d5SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
63*7655c6d5SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
64*7655c6d5SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
65*7655c6d5SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
66*7655c6d5SRobert Mustacchi 	.nlpi_len = sizeof (ocp_vul_lat_t),
67*7655c6d5SRobert Mustacchi };
68*7655c6d5SRobert Mustacchi 
69*7655c6d5SRobert Mustacchi const nvme_log_page_info_t ocp_log_devcap = {
70*7655c6d5SRobert Mustacchi 	.nlpi_short = "ocp/devcap",
71*7655c6d5SRobert Mustacchi 	.nlpi_human = "OCP Device Capabilities",
72*7655c6d5SRobert Mustacchi 	.nlpi_lid = OCP_LOG_DSSD_DEV_CAP,
73*7655c6d5SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
74*7655c6d5SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
75*7655c6d5SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
76*7655c6d5SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
77*7655c6d5SRobert Mustacchi 	.nlpi_len = sizeof (ocp_vul_devcap_t),
78*7655c6d5SRobert Mustacchi };
79*7655c6d5SRobert Mustacchi 
80*7655c6d5SRobert Mustacchi const nvme_log_page_info_t ocp_log_unsup = {
81*7655c6d5SRobert Mustacchi 	.nlpi_short = "ocp/unsup",
82*7655c6d5SRobert Mustacchi 	.nlpi_human = "OCP Unsupported Requirements",
83*7655c6d5SRobert Mustacchi 	.nlpi_lid = OCP_LOG_DSSD_UNSUP_REQ,
84*7655c6d5SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
85*7655c6d5SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
86*7655c6d5SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
87*7655c6d5SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
88*7655c6d5SRobert Mustacchi 	.nlpi_len = sizeof (ocp_vul_unsup_req_t),
89*7655c6d5SRobert Mustacchi };
90