Skip to content

Commit

Permalink
ioctl: add nvme_get_log_rotational_media_info()
Browse files Browse the repository at this point in the history
Since added the NVMe 2.1 log page.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t committed Jan 4, 2025
1 parent 2395c95 commit c2e00bb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/nvme/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ static inline int nvme_get_log_reclaim_unit_handle_usage(int fd, __u16 egid,
* @egid: Endurance group identifier
* @offset: Offset into log page
* @len: Length (in bytes) of provided user buffer to hold the log data
* @log: Log page data buffer
* @log: User address to store the log page
*/
static inline int nvme_get_log_fdp_stats(int fd, __u16 egid, __u32 offset, __u32 len, void *log)
{
Expand Down Expand Up @@ -2111,6 +2111,24 @@ static inline int nvme_get_log_boot_partition(int fd, bool rae,
return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
}

/**
* nvme_get_log_rotational_media_info() - Retrieve Rotational Media Information Log
* @fd: File descriptor of nvme device
* @endgid: Endurance Group Identifier
* @offset: Offset into log page
* @len: The allocated size, minimum
* struct nvme_phy_rx_eom_log
* @log: User address to store the log page
*
* Return: The nvme command status if a response was received (see
* &enum nvme_status_field) or -1 with errno set otherwise
*/
static inline int nvme_get_log_rotational_media_info(int fd, __u16 endgid, __u32 offset, __u32 len,
struct nvme_rotational_media_info_log *log)
{
return nvme_get_endgid_log(fd, false, NVME_LOG_LID_ROTATIONAL_MEDIA_INFO, endgid, len, log);
}

/**
* nvme_get_log_phy_rx_eom() - Retrieve Physical Interface Receiver Eye Opening Measurement Log
* @fd: File descriptor of nvme device
Expand Down
24 changes: 24 additions & 0 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -4765,6 +4765,30 @@ enum nvme_boot_partition_info {
#define NVME_BOOT_PARTITION_INFO_BPSZ(bpinfo) NVME_GET(bpinfo, BOOT_PARTITION_INFO_BPSZ)
#define NVME_BOOT_PARTITION_INFO_ABPID(bpinfo) NVME_GET(bpinfo, BOOT_PARTITION_INFO_ABPID)

/**
* struct nvme_rotational_media_info_log - Rotational Media Information Log
* @endgid: Endurance Group Identifier
* @numa: Number of Actuators
* @nrs: Nominal Rotational Speed
* @rsvd6: Reserved
* @spinc: Spinup Count
* @fspinc: Failed Spinup Count
* @ldc: Load Count
* @fldc: Failed Load Count
* @rsvd24: Reserved
*/
struct nvme_rotational_media_info_log {
__le16 endgid;
__le16 numa;
__le16 nrs;
__u8 rsvd6[2];
__le32 spinc;
__le32 fspinc;
__le32 ldc;
__le32 fldc;
__u8 rsvd24[488];
};

/**
* struct nvme_eom_lane_desc - EOM Lane Descriptor
* @rsvd0: Reserved
Expand Down

0 comments on commit c2e00bb

Please sign in to comment.