Skip to content

Commit 454b5e0

Browse files
ikegami-tigaw
authored andcommitted
ioctl: add nvme_get_log_rotational_media_info()
Since added the NVMe 2.1 log page. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 2a0e220 commit 454b5e0

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

src/nvme/ioctl.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,22 @@ static inline int nvme_get_log_boot_partition(int fd, bool rae,
21192119
return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
21202120
}
21212121

2122+
/**
2123+
* nvme_get_log_rotational_media_info() - Retrieve Rotational Media Information Log
2124+
* @fd: File descriptor of nvme device
2125+
* @endgid: Endurance Group Identifier
2126+
* @len: The allocated length of the log page
2127+
* @log: User address to store the log page
2128+
*
2129+
* Return: The nvme command status if a response was received (see
2130+
* &enum nvme_status_field) or -1 with errno set otherwise
2131+
*/
2132+
static inline int nvme_get_log_rotational_media_info(int fd, __u16 endgid, __u32 len,
2133+
struct nvme_rotational_media_info_log *log)
2134+
{
2135+
return nvme_get_endgid_log(fd, false, NVME_LOG_LID_ROTATIONAL_MEDIA_INFO, endgid, len, log);
2136+
}
2137+
21222138
/**
21232139
* nvme_get_log_phy_rx_eom() - Retrieve Physical Interface Receiver Eye Opening Measurement Log
21242140
* @fd: File descriptor of nvme device

src/nvme/types.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,6 +4765,30 @@ enum nvme_boot_partition_info {
47654765
#define NVME_BOOT_PARTITION_INFO_BPSZ(bpinfo) NVME_GET(bpinfo, BOOT_PARTITION_INFO_BPSZ)
47664766
#define NVME_BOOT_PARTITION_INFO_ABPID(bpinfo) NVME_GET(bpinfo, BOOT_PARTITION_INFO_ABPID)
47674767

4768+
/**
4769+
* struct nvme_rotational_media_info_log - Rotational Media Information Log
4770+
* @endgid: Endurance Group Identifier
4771+
* @numa: Number of Actuators
4772+
* @nrs: Nominal Rotational Speed
4773+
* @rsvd6: Reserved
4774+
* @spinc: Spinup Count
4775+
* @fspinc: Failed Spinup Count
4776+
* @ldc: Load Count
4777+
* @fldc: Failed Load Count
4778+
* @rsvd24: Reserved
4779+
*/
4780+
struct nvme_rotational_media_info_log {
4781+
__le16 endgid;
4782+
__le16 numa;
4783+
__le16 nrs;
4784+
__u8 rsvd6[2];
4785+
__le32 spinc;
4786+
__le32 fspinc;
4787+
__le32 ldc;
4788+
__le32 fldc;
4789+
__u8 rsvd24[488];
4790+
};
4791+
47684792
/**
47694793
* struct nvme_eom_lane_desc - EOM Lane Descriptor
47704794
* @rsvd0: Reserved

0 commit comments

Comments
 (0)