From 691f809a4d6864e56c92326ce7d047f3f479aca3 Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Mon, 25 Mar 2024 22:42:43 +0900 Subject: [PATCH] types: Add optional data present filed mask and shift definition Also add reserved filed definition and macros to get. Signed-off-by: Tokunori Ikegami --- src/nvme/types.h | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/nvme/types.h b/src/nvme/types.h index 733fa373..c4954afa 100644 --- a/src/nvme/types.h +++ b/src/nvme/types.h @@ -3962,13 +3962,41 @@ struct nvme_phy_rx_eom_log { }; /** - * enum nvme_eom_optional_data - EOM Optional Data Present Fields + * enum nvme_eom_optional_data_present - EOM Optional Data Present Fields + * @NVME_EOM_ODP_PEFP_SHIFT: Shift amount to get the printable eye field present + * from the &struct nvme_phy_rx_eom_log.odp field. + * @NVME_EOM_ODP_EDFP_SHIFT: Shift amount to get the eye data field present + * from the &struct nvme_phy_rx_eom_log.odp field. + * @NVME_EOM_ODP_RSVD_SHIFT: Shift amount to get the reserved optional data present + * from the &struct nvme_phy_rx_eom_log.odp field. + * @NVME_EOM_ODP_PEFP_MASK: Mask to get the printable eye field present + * from the &struct nvme_phy_rx_eom_log.odp field. + * @NVME_EOM_ODP_EDFP_MASK: Mask to get the eye data field present + * from the &struct nvme_phy_rx_eom_log.odp field. + * @NVME_EOM_ODP_RSVD_MASK: Mask to get the reserved data present + * from the &struct nvme_phy_rx_eom_log.odp field. + */ +enum nvme_eom_optional_data_present { + NVME_EOM_ODP_PEFP_SHIFT = 0, + NVME_EOM_ODP_EDFP_SHIFT = 1, + NVME_EOM_ODP_RSVD_SHIFT = 2, + NVME_EOM_ODP_PEFP_MASK = 0x1, + NVME_EOM_ODP_EDFP_MASK = 0x1, + NVME_EOM_ODP_RSVD_MASK = 0x3f, +}; + +#define NVME_EOM_ODP_PEFP(odp) NVME_GET(odp, EOM_ODP_PEFP) +#define NVME_EOM_ODP_EDFP(odp) NVME_GET(odp, EOM_ODP_EDFP) +#define NVME_EOM_ODP_RSVD(odp) NVME_GET(odp, EOM_ODP_RSVD) + +/** + * enum nvme_eom_optional_data - EOM Optional Data Present Fields (Deprecated) * @NVME_EOM_PRINTABLE_EYE_PRESENT: Printable Eye Present * @NVME_EOM_EYE_DATA_PRESENT: Eye Data Present */ enum nvme_eom_optional_data { - NVME_EOM_PRINTABLE_EYE_PRESENT = 0x1 << 0, - NVME_EOM_EYE_DATA_PRESENT = 0x1 << 1, + NVME_EOM_PRINTABLE_EYE_PRESENT = NVME_EOM_ODP_PEFP_MASK << NVME_EOM_ODP_PEFP_SHIFT, + NVME_EOM_EYE_DATA_PRESENT = NVME_EOM_ODP_EDFP_MASK << NVME_EOM_ODP_EDFP_SHIFT, }; /**