From be577c6285c9cb6bac2974895998b1411b6e7650 Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Mon, 26 Feb 2024 00:22:35 +0900 Subject: [PATCH] types: Add persistent event log reporting context definitions The changes for persistent event log rci print function. Signed-off-by: Tokunori Ikegami --- src/nvme/types.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/nvme/types.h b/src/nvme/types.h index fe79b6e1..f2c1ce60 100644 --- a/src/nvme/types.h +++ b/src/nvme/types.h @@ -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