]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
types: Add PEL header additional information definitions
authorTokunori Ikegami <ikegami.t@gmail.com>
Fri, 15 Mar 2024 14:31:28 +0000 (23:31 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 18 Mar 2024 17:15:21 +0000 (18:15 +0100)
The changes for persistent event entry ehai print function.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
src/nvme/types.h

index 02d5604054b988891c53a0b18fc34c413dfa5085..bbf74e8834f666f301bc59c28ca41ebce7625bce 100644 (file)
@@ -3444,6 +3444,41 @@ enum nvme_persistent_event_types {
        NVME_PEL_THERMAL_EXCURSION_EVENT        = 0x0d,
 };
 
+/**
+ * enum nvme_pel_ehai - This field indicates the persistent event header additional information
+ * @NVME_PEL_EHAI_PIT_SHIFT:   Shift amount to get the reporting context port identifier
+ *                             from the &struct nvme_persistent_event_log.rci field.
+ * @NVME_PEL_EHAI_RSVD_SHIFT:  Shift amount to get the reserved reporting context
+ *                             from the &struct nvme_persistent_event_log.rci field.
+ * @NVME_PEL_EHAI_PIT_MASK:    Mask to get the reporting context port identifier from
+ *                             the &struct nvme_st_result.dsts field.
+ * @NVME_PEL_EHAI_RSVD_MASK:   Mask to get the reserved reporting context from
+ *                             the &struct nvme_st_result.dsts field.
+ */
+enum nvme_pel_ehai {
+       NVME_PEL_EHAI_PIT_SHIFT         = 0,
+       NVME_PEL_EHAI_RSVD_SHIFT        = 2,
+       NVME_PEL_EHAI_PIT_MASK          = 0x3,
+       NVME_PEL_EHAI_RSVD_MASK         = 0x3f,
+};
+
+#define NVME_PEL_EHAI_PIT(ehai)                NVME_GET(ehai, PEL_EHAI_PIT)
+#define NVME_PEL_EHAI_RSVD(ehai)       NVME_GET(ehai, PEL_EHAI_RSVD)
+
+/**
+ * enum nvme_pel_ehai_pit - Persistent Event Header Additional Information - Port Identifier Type
+ * @NVME_PEL_EHAI_PIT_NOT_REPORTED:    PIT not reported and PELPID does not apply
+ * @NVME_PEL_EHAI_PIT_NSS_PORT:                NVM subsystem port
+ * @NVME_PEL_EHAI_PIT_NMI_PORT:                NVMe-MI port
+ * @NVME_PEL_EHAI_PIT_NOT_ASSOCIATED:  Event not associated with any port and PELPID does not apply
+ */
+enum nvme_pel_ehai_pit {
+       NVME_PEL_EHAI_PIT_NOT_REPORTED          = 0,
+       NVME_PEL_EHAI_PIT_NSS_PORT              = 1,
+       NVME_PEL_EHAI_PIT_NMI_PORT              = 2,
+       NVME_PEL_EHAI_PIT_NOT_ASSOCIATED        = 3,
+};
+
 /**
  * struct nvme_fw_commit_event - Firmware Commit Event Data
  * @old_fw_rev:                        Old Firmware Revision