#ifndef _SYS_NVME_OCP_H
#define _SYS_NVME_OCP_H
#include <sys/isa_defs.h>
#include <sys/debug.h>
#include <sys/stdint.h>
#include <sys/stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
OCP_LOG_DSSD_SMART = 0xc0,
OCP_LOG_DSSD_ERROR_REC = 0xc1,
OCP_LOG_DSSD_FWACT = 0xc2,
OCP_LOG_DSSD_LATENCY = 0xc3,
OCP_LOG_DSSD_DEV_CAP = 0xc4,
OCP_LOG_DSSD_UNSUP_REQ = 0xc5,
OCP_LOG_DSSD_TCG = 0xc7,
OCP_LOG_DSSD_TELEMETRY = 0xc9
} ocp_vul_t;
typedef enum {
OCP_FEAT_DSSD_ERR_INJ = 0xc0,
OCP_FEAT_DSSD_CLEAR_FWACT = 0xc1,
OCP_FEAT_DSSD_EOLPLP = 0xc2,
OCP_FEAT_DSSD_CLEAR_PCIE_ERRCOR = 0xc3,
OCP_FEAT_DSSD_IEEE1667 = 0xc4,
OCP_FEAT_DSSD_LATENCY = 0xc5,
OCP_FEAT_DSSD_PLP_HEALTH = 0xc6,
OCP_FEAT_DSSD_POWER_STATE = 0xc7,
OCP_FEAT_DSSD_TEL_PROFILE = 0xc8,
OCP_FEAT_DSSD_ASYNC_EVENT = 0xc9
} ocp_vuf_t;
#pragma pack(1)
typedef struct {
uint8_t osh_pmed_write[16];
uint8_t osh_pmed_read[16];
struct {
uint8_t bunb_raw[6];
uint16_t bunb_norm;
} osh_bunb;
struct {
uint8_t bsnb_raw[6];
uint16_t bsnb_norm;
} osh_bsnb;
uint64_t osh_xor_rec;
uint64_t osh_read_unrec;
uint64_t osh_soft_ecc_err;
struct {
uint32_t e2e_det;
uint32_t e2e_corr;
} osh_e2e;
uint8_t osh_sys_used;
uint8_t osh_refresh[7];
struct {
uint32_t udec_max;
uint32_t udec_min;
} osh_udec;
struct {
uint8_t therm_event;
uint8_t throt_level;
} osh_therm;
struct {
uint8_t dssd_errata;
uint16_t dssd_point;
uint16_t dssd_minor;
uint8_t dssd_major;
} osh_dssd;
uint64_t osh_pcie_errcor;
uint32_t osh_inc_shut;
uint8_t osh_rsvd116[4];
uint8_t osh_free;
uint8_t osh_rsvd121[7];
uint16_t osh_cap_health;
uint8_t osh_nvme_base_errata;
uint8_t osh_nvme_cmd_errata;
uint8_t osh_rsvd132[4];
uint64_t osh_unaligned;
uint64_t osh_sec_vers;
uint64_t osh_nuse;
uint8_t osh_plp_start[16];
uint8_t osh_endurance[16];
uint64_t osh_pcie_retrain;
uint64_t osh_ps_change;
uint64_t osh_min_fwrev;
uint8_t osh_rsvd216[278];
uint16_t osh_vers;
uint8_t osh_guid[16];
} ocp_vul_smart_t;
typedef struct {
uint16_t oer_prwt;
uint8_t oer_pra;
uint8_t oer_dra;
uint64_t oer_panic_id;
uint32_t oer_devcap;
uint8_t oer_vsr_opcode;
uint8_t oer_rsvd17[3];
uint32_t oer_vsr_cdw12;
uint32_t oer_vsr_cdw13;
uint8_t oer_vsr_to;
uint8_t oer_dra2;
uint8_t oer_dra2_to;
uint8_t oer_npanic;
uint64_t oer_old_panics[4];
uint8_t oer_rsvd54[430];
uint16_t oer_vers;
uint8_t oer_guid[16];
} ocp_vul_errrec_t;
typedef enum {
OCP_LOG_ERRREC_F_PRA_CTRL = 1 << 0,
OCP_LOG_ERRREC_F_PRA_SUBSYS = 1 << 1,
OCP_LOG_ERRREC_F_PRA_FLR = 1 << 2,
OCP_LOG_ERRREC_F_PRA_PERST = 1 << 3,
OCP_LOG_ERRREC_F_PRA_POWER = 1 << 4,
OCP_LOG_ERRREC_F_PRA_HOT = 1 << 5
} ocp_errrec_pra_t;
typedef enum {
OCP_LOG_ERRREC_F_DRA_NONE = 1 << 0,
OCP_LOG_ERRREC_F_DRA_FMT = 1 << 1,
OCP_LOG_ERRREC_F_DRA_VSC = 1 << 2,
OCP_LOG_ERRREC_F_DRA_VAR = 1 << 3,
OCP_LOG_ERRREC_F_DRA_REPLACE = 1 << 4,
OCP_LOG_ERRREC_F_DRA_SANITIZE = 1 << 5,
OCP_LOG_ERRREC_F_DRA_DATALOSS = 1 << 6,
} ocp_errrec_dra_t;
typedef enum {
OCP_LOG_ERRREC_F_DEVCAP_AEN = 1 << 0,
OCP_LOG_ERRREC_F_DEVCAP_CFS = 1 << 1
} ocp_errrec_devcap_t;
typedef struct {
uint8_t ofe_vers;
uint8_t ofe_len;
uint8_t ofe_rsvd2[2];
uint16_t ofe_count;
uint64_t ofe_ts;
uint8_t ofe_rsvd14[8];
uint64_t ofe_pcc;
uint64_t ofe_prev_fw;
uint64_t ofe_new_fw;
uint8_t ofe_slot;
uint8_t ofe_ctype;
uint16_t ofe_res;
uint8_t ofe_rsvd50[14];
} ocp_fwact_entry_t;
typedef struct {
uint8_t ofw_lid;
uint8_t ofw_rsvd1[3];
uint32_t ofw_nents;
ocp_fwact_entry_t ofw_hist[20];
uint8_t ofw_rsvd1288[2790];
uint16_t ofw_vers;
uint8_t ofw_guid[16];
} ocp_vul_fwact_t;
typedef struct {
uint32_t obc_read;
uint32_t obc_write;
uint32_t obc_dealloc;
uint32_t obc_rsvd;
} ocp_lat_bkt_ctr_t;
typedef struct {
uint64_t ola_read;
uint64_t ola_write;
uint64_t ola_dealloc;
} ocp_lat_alts_t;
typedef struct {
uint16_t olm_read;
uint16_t olm_write;
uint16_t olm_dealloc;
} ocp_lat_aml_t;
typedef struct {
uint8_t ol_lmfs;
uint8_t ol_rsvd1[1];
uint16_t ol_abt;
uint16_t ol_abt_thresh;
uint8_t ol_thresh_a;
uint8_t ol_thresh_b;
uint8_t ol_thresh_c;
uint8_t ol_thresh_d;
uint16_t ol_alc;
uint8_t ol_alw_min;
uint8_t ol_rsvd13[19];
ocp_lat_bkt_ctr_t ol_ctr0;
ocp_lat_bkt_ctr_t ol_ctr1;
ocp_lat_bkt_ctr_t ol_ctr2;
ocp_lat_bkt_ctr_t ol_ctr3;
ocp_lat_alts_t ol_ts0;
ocp_lat_alts_t ol_ts1;
ocp_lat_alts_t ol_ts2;
ocp_lat_alts_t ol_ts3;
ocp_lat_aml_t ol_aml0;
ocp_lat_aml_t ol_aml1;
ocp_lat_aml_t ol_aml2;
ocp_lat_aml_t ol_aml3;
uint16_t ol_als_units;
uint8_t ol_rsvd218[22];
ocp_lat_bkt_ctr_t ol_sb0;
ocp_lat_bkt_ctr_t ol_sb1;
ocp_lat_bkt_ctr_t ol_sb2;
ocp_lat_bkt_ctr_t ol_sb3;
ocp_lat_alts_t ol_sts0;
ocp_lat_alts_t ol_sts1;
ocp_lat_alts_t ol_sts2;
ocp_lat_alts_t ol_sts3;
ocp_lat_aml_t ol_saml0;
ocp_lat_aml_t ol_saml1;
ocp_lat_aml_t ol_saml2;
ocp_lat_aml_t ol_saml3;
uint16_t ol_als_sunits;
uint8_t ol_rsvd426[10];
uint8_t ol_dbg_ndw[12];
uint16_t ol_dbg_trig;
uint16_t ol_dbg_ml;
uint64_t ol_dbg_ts;
uint16_t ol_dbg_ptr;
uint16_t ol_dbg_src;
uint8_t ol_dbg_units;
uint8_t ol_rsvd465[29];
uint16_t ol_vers;
uint8_t ol_guid[16];
} ocp_vul_lat_t;
typedef enum {
OPC_LOG_LAT_F_LFMS_EN = 1 << 0,
OPC_LOG_LAT_F_LFMS_ALC_SUP = 1 << 1,
OPC_LOG_LAT_F_LFMS_AML_SUP = 1 << 2,
} ocp_lat_lmfs_t;
typedef enum {
OCP_LOG_LAT_F_ALC_B0_READ = 1 << 0,
OCP_LOG_LAT_F_ALC_B0_WRITE = 1 << 1,
OCP_LOG_LAT_F_ALC_B0_DEALLOC = 1 << 2,
OCP_LOG_LAT_F_ALC_B1_READ = 1 << 3,
OCP_LOG_LAT_F_ALC_B1_WRITE = 1 << 4,
OCP_LOG_LAT_F_ALC_B1_DEALLOC = 1 << 5,
OCP_LOG_LAT_F_ALC_B2_READ = 1 << 6,
OCP_LOG_LAT_F_ALC_B2_WRITE = 1 << 7,
OCP_LOG_LAT_F_ALC_B2_DEALLOC = 1 << 8,
OCP_LOG_LAT_F_ALC_B3_READ = 1 << 9,
OCP_LOG_LAT_F_ALC_B3_WRITE = 1 << 10,
OCP_LOG_LAT_F_ALC_B3_DEALLOC = 1 << 11
} ocp_lat_alc_t;
typedef struct {
#ifdef _BIT_FIELDS_LTOH
uint8_t odp_nps:5;
uint8_t odp_rsvd5:2;
uint8_t odp_valid:1;
#else
uint8_t odp_valid:1;
uint8_t odp_rsvd5:2;
uint8_t odp_nps:5;
#endif
} ocp_dssd_ps_t;
typedef struct {
uint16_t odc_nports;
uint16_t odc_oob_sup;
uint16_t odc_wz_sup;
uint16_t odc_san_sup;
uint16_t odc_dsmgmt_sup;
uint16_t odc_wunc_sup;
uint16_t odc_fuse_sup;
uint16_t odc_dssd_min_valid;
ocp_dssd_ps_t odc_dssd[128];
uint8_t odc_rsvd144[3934];
uint16_t odc_vers;
uint8_t odc_guid[16];
} ocp_vul_devcap_t;
typedef enum {
OCP_LOG_DEVCAP_F_OOB_VDM = 1 << 0,
OCP_LOG_DEVCAP_F_OOB_BMC = 1 << 1,
OCP_LOG_DEVCAP_F_OOB_COMPLY = 1 << 15,
} ocp_devcap_oob_t;
typedef enum {
OCP_LOG_DEVCAP_F_WZ_SUP = 1 << 0,
OCP_LOG_DEVCAP_F_WZ_DEAC = 1 << 1,
OCP_LOG_DEVCAP_F_WZ_FUA = 1 << 2,
OCP_LOG_DEVCAP_F_WZ_IO5 = 1 << 3,
OCP_LOG_DEVCAP_F_WZ_IO6 = 1 << 4,
OCP_LOG_DEVCAP_F_WZ_COMPLY = 1 << 15
} ocp_devcap_wz_t;
typedef enum {
OCP_LOG_DEVCAP_F_DSMGMT_SUP = 1 << 0,
OCP_LOG_DEVCAP_F_DSMGMT_AD = 1 << 1,
OCP_LOG_DEVCAP_F_DSMGMT_COMPLY = 1 << 15
} ocp_devcap_dsmgmt_t;
typedef enum {
OCP_LOG_DEVCAP_F_WUNC_SUP = 1 << 0,
OCP_LOG_DEVCAP_F_WUNC_ONE = 1 << 1,
OCP_LOG_DEVCAP_F_WUNC_MAX = 1 << 2,
OCP_LOG_DEVCAP_F_WUNC_IO14 = 1 << 3,
OCP_LOG_DEVCAP_F_WUNC_COMPLY = 1 << 15
} ocp_devcap_wunc_t;
typedef enum {
OCP_LOG_DEVCAP_F_FUSE_SUP = 1 << 0,
OCP_LOG_DEVCAP_F_FUSE_COMPLY = 1 << 15
} ocp_devcap_fuse_t;
typedef struct {
uint8_t ors_str[16];
} ocp_req_str_t;
typedef struct {
uint16_t our_nunsup;
uint8_t our_rsvd2[14];
ocp_req_str_t our_reqs[253];
uint8_t our_rsvd4064[14];
uint16_t our_vers;
uint8_t our_guid[16];
} ocp_vul_unsup_req_t;
typedef struct {
uint8_t ots_vers;
uint8_t ots_rsvd1[15];
uint8_t ots_guid[16];
uint64_t ots_sls;
uint8_t ots_rsvd40[24];
uint64_t ots_sits;
uint64_t ots_sitz;
uint64_t ots_ests;
uint64_t ots_estz;
uint64_t ots_vuests;
uint64_t ots_vuestz;
uint64_t ots_ascts;
uint64_t ots_asctz;
uint8_t ots_fifo0[16];
uint8_t ots_fifo1[16];
uint8_t ots_fifo2[16];
uint8_t ots_fifo3[16];
uint8_t ots_fifo4[16];
uint8_t ots_fifo5[16];
uint8_t ots_fifo6[16];
uint8_t ots_fifo7[16];
uint8_t ots_fifo8[16];
uint8_t ots_fifo9[16];
uint8_t ots_fifo10[16];
uint8_t ots_fifo11[16];
uint8_t ots_fifo12[16];
uint8_t ots_fifo13[16];
uint8_t ots_fifo14[16];
uint8_t ots_fifo15[16];
uint8_t ots_rsvd384[48];
uint8_t ots_data[];
} ocp_vul_telstr_t;
typedef struct {
uint16_t ocp_sit_id;
uint8_t ocp_sit_rsvd2[1];
uint8_t ocp_sit_len;
uint64_t ocp_sit_off;
uint8_t ocp_sit_rsvd12[4];
} ocp_vul_telstr_sit_t;
typedef struct {
uint8_t ocp_est_class;
uint16_t ocp_est_eid;
uint8_t ocp_est_len;
uint64_t ocp_est_off;
uint8_t ocp_est_rsvd12[4];
} ocp_vul_telstr_est_t;
typedef struct {
uint8_t ocp_vuest_class;
uint16_t ocp_vuest_eid;
uint8_t ocp_vuest_len;
uint64_t ocp_vuest_off;
uint8_t ocp_vuest_rsvd12[4];
} ocp_vul_telstr_vuest_t;
#ifndef __CHECKER__
CTASSERT(sizeof (ocp_vul_smart_t) == 512);
CTASSERT(offsetof(ocp_vul_smart_t, osh_therm) == 96);
CTASSERT(offsetof(ocp_vul_smart_t, osh_vers) == 494);
CTASSERT(sizeof (ocp_vul_errrec_t) == 512);
CTASSERT(offsetof(ocp_vul_errrec_t, oer_npanic) == 31);
CTASSERT(offsetof(ocp_vul_errrec_t, oer_npanic) == 31);
CTASSERT(sizeof (ocp_fwact_entry_t) == 64);
CTASSERT(offsetof(ocp_fwact_entry_t, ofe_rsvd50) == 50);
CTASSERT(sizeof (ocp_vul_fwact_t) == 4096);
CTASSERT(offsetof(ocp_vul_fwact_t, ofw_rsvd1288) == 1288);
CTASSERT(offsetof(ocp_vul_fwact_t, ofw_vers) == 4078);
CTASSERT(sizeof (ocp_lat_bkt_ctr_t) == 16);
CTASSERT(sizeof (ocp_lat_alts_t) == 24);
CTASSERT(sizeof (ocp_lat_aml_t) == 6);
CTASSERT(offsetof(ocp_vul_lat_t, ol_aml0) == 192);
CTASSERT(offsetof(ocp_vul_lat_t, ol_rsvd218) == 218);
CTASSERT(offsetof(ocp_vul_lat_t, ol_als_sunits) == 424);
CTASSERT(sizeof (ocp_vul_lat_t) == 512);
CTASSERT(sizeof (ocp_vul_devcap_t) == 4096);
CTASSERT(offsetof(ocp_vul_devcap_t, odc_rsvd144) == 144);
CTASSERT(sizeof (ocp_req_str_t) == 16);
CTASSERT(sizeof (ocp_vul_unsup_req_t) == 4096);
CTASSERT(sizeof (ocp_vul_telstr_t) == 432);
CTASSERT(offsetof(ocp_vul_telstr_t, ots_fifo0) == 128);
CTASSERT(offsetof(ocp_vul_telstr_t, ots_rsvd384) == 384);
CTASSERT(sizeof (ocp_vul_telstr_sit_t) == 16);
CTASSERT(sizeof (ocp_vul_telstr_est_t) == 16);
CTASSERT(sizeof (ocp_vul_telstr_vuest_t) == 16);
#endif
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif