]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
types: Add PEL set feature event layout definitions
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 17 Mar 2024 06:39:35 +0000 (15:39 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 18 Mar 2024 17:32:11 +0000 (18:32 +0100)
The changes for PEL set feature event print function.

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

index b3dbb6b3bf072f546bf57ba24efbbf6150cad80d..ef2f9a9cae929549d00de820dcd3bb6ff8a72e82 100644 (file)
@@ -3651,6 +3651,34 @@ struct nvme_set_feature_event {
        __le32  cdw_mem[0];
 };
 
+/**
+ * enum nvme_set_feat_event_layout - This field indicates the set feature event layout
+ * @NVME_SET_FEAT_EVENT_DW_COUNT_SHIFT:        Shift amount to get the Dword count from the
+ *                                     &struct nvme_set_feature_event.layout field.
+ * @NVME_SET_FEAT_EVENT_CC_DW0_SHIFT:  Shift amount to get the logged command completion Dword 0
+ *                                     from the &struct nvme_set_feature_event.layout field.
+ * @NVME_SET_FEAT_EVENT_MB_COUNT_SHIFT:        Shift amount to get the memory buffer count from
+ *                                     the &struct nvme_set_feature_event.layout field.
+ * @NVME_SET_FEAT_EVENT_DW_COUNT_MASK: Mask to get the Dword count from the &struct
+ *                                     nvme_set_feature_event.layout field.
+ * @NVME_SET_FEAT_EVENT_CC_DW0_MASK:   Mask to get the logged command completion Dword 0 from
+ *                                     the &struct nvme_set_feature_event.layout field.
+ * @NVME_SET_FEAT_EVENT_MB_COUNT_MASK: Mask to get the memory buffer count from the &struct
+ *                                     nvme_set_feature_event.layout field.
+ */
+enum nvme_set_feat_event_layout {
+       NVME_SET_FEAT_EVENT_DW_COUNT_SHIFT      = 0,
+       NVME_SET_FEAT_EVENT_CC_DW0_SHIFT        = 3,
+       NVME_SET_FEAT_EVENT_MB_COUNT_SHIFT      = 16,
+       NVME_SET_FEAT_EVENT_DW_COUNT_MASK       = 0x7,
+       NVME_SET_FEAT_EVENT_CC_DW0_MASK         = 0x1,
+       NVME_SET_FEAT_EVENT_MB_COUNT_MASK       = 0xffff,
+};
+
+#define NVME_SET_FEAT_EVENT_DW_COUNT(layout)   NVME_GET(layout, SET_FEAT_EVENT_DW_COUNT)
+#define NVME_SET_FEAT_EVENT_CC_DW0(layout)     NVME_GET(layout, SET_FEAT_EVENT_CC_DW0)
+#define NVME_SET_FEAT_EVENT_MB_COUNT(layout)   NVME_GET(layout, SET_FEAT_EVENT_MB_COUNT)
+
 /**
  * struct nvme_thermal_exc_event -  Thermal Excursion Event Data
  * @over_temp: Over Temperature