Skip to content

Commit d335784

Browse files
sc108-leedwsuse
authored andcommitted
types: Add NVM Command Set id-ns structure
Add uuid index argument on nvme_identify_ns_csi Signed-off-by: Steven Seungcheol Lee <[email protected]>
1 parent 8e613b8 commit d335784

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

src/nvme/ioctl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,14 @@ static inline int nvme_identify_uuid(int fd, struct nvme_id_uuid_list *uuid_list
790790
* nvme_identify_ns_csi() -
791791
* @fd: File descriptor of nvme device
792792
* @nsid: Namespace to identify
793+
* @uuidx: UUID Index for differentiating vendor specific encoding
793794
* @csi: Command Set Identifier
794795
* @data: User space destination address to transfer the data
795796
*
796797
* Return: The nvme command status if a response was received (see
797798
* &enum nvme_status_field) or -1 with errno set otherwise.
798799
*/
799-
static inline int nvme_identify_ns_csi(int fd, __u32 nsid,
800+
static inline int nvme_identify_ns_csi(int fd, __u32 nsid, __u8 uuidx,
800801
enum nvme_csi csi, void *data)
801802
{
802803
struct nvme_identify_args args = {
@@ -810,7 +811,7 @@ static inline int nvme_identify_ns_csi(int fd, __u32 nsid,
810811
.nsid = nsid,
811812
.cntid = NVME_CNTLID_NONE,
812813
.cns_specific_id = NVME_CNSSPECID_NONE,
813-
.uuidx = NVME_UUID_NONE,
814+
.uuidx = uuidx,
814815
};
815816

816817
return nvme_identify(&args);

src/nvme/types.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,22 @@ struct nvme_id_ctrl_nvm {
21292129
__u8 rsvd16[4080];
21302130
};
21312131

2132+
/**
2133+
* struct nvme_nvm_id_ns -
2134+
* @lbstm: Logical Block Storage Tag Mask
2135+
* @pic: Protection Information Capabilities
2136+
* @rsvd9: Reserved
2137+
* @elbaf: List of Extended LBA Format Support
2138+
* @rsvd268: Reserved
2139+
*/
2140+
struct nvme_nvm_id_ns {
2141+
__le64 lbstm;
2142+
__u8 pic;
2143+
__u8 rsvd9[3];
2144+
__le32 elbaf[64];
2145+
__u8 rsvd268[3828];
2146+
};
2147+
21322148
/**
21332149
* struct nvme_zns_lbafe -
21342150
* @zsze:

0 commit comments

Comments
 (0)