]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
types: Add persistent event log reporting context definitions
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 25 Feb 2024 15:22:35 +0000 (00:22 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 26 Feb 2024 11:20:15 +0000 (12:20 +0100)
The changes for persistent event log rci print function.

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

index fe79b6e1428ab3f5f8b87bcab995926e86c72023..f2c1ce604bfa702493b6d091e0a74f5142e1f6c5 100644 (file)
@@ -3339,6 +3339,41 @@ struct nvme_persistent_event_log {
        __u8    seb[32];
 } __attribute__((packed));
 
+/**
+ * enum nvme_pel_rci - This field indicates the persistent event log reporting context
+ * @NVME_PEL_RCI_RCPID_SHIFT:  Shift amount to get the reporting context port identifier
+ *                             from the &struct nvme_persistent_event_log.rci field.
+ * @NVME_PEL_RCI_RCPIT_SHIFT:  Shift amount to get the reporting context port identifier
+ *                             type from the &struct nvme_persistent_event_log.rci field.
+ * @NVME_PEL_RCI_RCE_SHIFT:    Shift amount to get the reporting context exists
+ *                             from the &struct nvme_persistent_event_log.rci field.
+ * @NVME_PEL_RCI_RSVD_SHIFT:   Shift amount to get the reserved reporting context
+ *                             from the &struct nvme_persistent_event_log.rci field.
+ * @NVME_PEL_RCI_RCPID_MASK:   Mask to get the reporting context port identifier from
+ *                             the &struct nvme_st_result.dsts field.
+ * @NVME_PEL_RCI_RCPIT_MASK:   Mask to get the reporting context port identifier type from
+ *                             the &struct nvme_st_result.dsts field.
+ * @NVME_PEL_RCI_RCE_MASK:     Mask to get the reporting context exists from
+ *                             the &struct nvme_st_result.dsts field.
+ * @NVME_PEL_RCI_RSVD_MASK:    Mask to get the reserved reporting context from
+ *                             the &struct nvme_st_result.dsts field.
+ */
+enum nvme_pel_rci {
+       NVME_PEL_RCI_RCPID_SHIFT        = 0,
+       NVME_PEL_RCI_RCPIT_SHIFT        = 16,
+       NVME_PEL_RCI_RCE_SHIFT          = 18,
+       NVME_PEL_RCI_RSVD_SHIFT         = 19,
+       NVME_PEL_RCI_RCPID_MASK         = 0xffff,
+       NVME_PEL_RCI_RCPIT_MASK         = 0x3,
+       NVME_PEL_RCI_RCE_MASK           = 0x1,
+       NVME_PEL_RCI_RSVD_MASK          = 0x1fff,
+};
+
+#define NVME_PEL_RCI_RCPID(rci)        NVME_GET(rci, PEL_RCI_RCPID)
+#define NVME_PEL_RCI_RCPIT(rci)        NVME_GET(rci, PEL_RCI_RCPIT)
+#define NVME_PEL_RCI_RCE(rci)  NVME_GET(rci, PEL_RCI_RCE)
+#define NVME_PEL_RCI_RSVD(rci) NVME_GET(rci, PEL_RCI_RSVD)
+
 /**
  * struct nvme_persistent_event_entry - Persistent Event
  * @etype:     Event Type