Skip to content

Commit

Permalink
types: error information log entry status field definitions
Browse files Browse the repository at this point in the history
This is to use libnvme register definitions instead of the shift operator.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Jan 3, 2025
1 parent 7da47db commit 2d38fe7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3402,6 +3402,23 @@ enum nvme_err_pel {
NVME_ERR_PEL_BIT_MASK = 0x70,
};

/**
* enum nvme_err_status_field - This field indicates the error information log entry status field
* @NVME_ERR_SF_PHASE_TAG_SHIFT: Shift amount to get the phase tag
* @NVME_ERR_SF_STATUS_FIELD_SHIFT: Shift amount to get the status field
* @NVME_ERR_SF_PHASE_TAG_MASK: Mask to get the phase tag
* @NVME_ERR_SF_STATUS_FIELD_MASK: Mask to get the status field
*/
enum nvme_err_status_field {
NVME_ERR_SF_PHASE_TAG_SHIFT = 0,
NVME_ERR_SF_STATUS_FIELD_SHIFT = 1,
NVME_ERR_SF_PHASE_TAG_MASK = 1,
NVME_ERR_SF_STATUS_FIELD_MASK = 0x7fff,
};

#define NVME_ERR_SF_PHASE_TAG(status_field) NVME_GET(status_field, ERR_SF_PHASE_TAG)
#define NVME_ERR_SF_STATUS_FIELD(status_field) NVME_GET(status_field, ERR_SF_STATUS_FIELD)

/**
* struct nvme_smart_log - SMART / Health Information Log (Log Identifier 02h)
* @critical_warning: This field indicates critical warnings for the state
Expand Down

0 comments on commit 2d38fe7

Please sign in to comment.