Skip to content

Commit

Permalink
types: Add optional data present filed mask and shift definition
Browse files Browse the repository at this point in the history
Also add reserved filed definition and macros to get.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Mar 26, 2024
1 parent 67a9b13 commit 691f809
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/**
Expand Down

0 comments on commit 691f809

Please sign in to comment.