aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2015-02-19 15:42:14 -0500
committerKeith Busch <keith.busch@intel.com>2015-02-19 18:15:35 -0500
commit4f1982b4e262c45475a91b4253e9bc7f7c991c13 (patch)
tree3d58e5f342f0c1dc3a01e85ff565e3496f099d3a /include/uapi/linux
parente1e5e5641e6f271321aec257ed26a72715e4a8c2 (diff)
NVMe: Update SCSI Inquiry VPD 83h translation
The original translation created collisions on Inquiry VPD 83 for many existing devices. Newer specifications provide other ways to translate based on the device's version can be used to create unique identifiers. Version 1.1 provides an EUI64 field that uniquely identifies each namespace, and 1.2 added the longer NGUID field for the same reason. Both follow the IEEE EUI format and readily translate to the SCSI device identification EUI designator type 2h. For devices implementing either, the translation will use this type, defaulting to the EUI64 8-byte type if implemented then NGUID's 16 byte version if not. If neither are provided, the 1.0 translation is used, and is updated to use the SCSI String format to guarantee a unique identifier. Knowing when to use the new fields depends on the nvme controller's revision. The NVME_VS macro was not decoding this correctly, so that is fixed in this patch and moved to a more appropriate place. Since the Identify Namespace structure required an update for the NGUID field, this patch adds the remaining new 1.2 fields to the structure. Signed-off-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nvme.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index 406bfc95652c..aef9a81b2d75 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -115,7 +115,13 @@ struct nvme_id_ns {
115 __le16 nawun; 115 __le16 nawun;
116 __le16 nawupf; 116 __le16 nawupf;
117 __le16 nacwu; 117 __le16 nacwu;
118 __u8 rsvd40[80]; 118 __le16 nabsn;
119 __le16 nabo;
120 __le16 nabspf;
121 __u16 rsvd46;
122 __le64 nvmcap[2];
123 __u8 rsvd64[40];
124 __u8 nguid[16];
119 __u8 eui64[8]; 125 __u8 eui64[8];
120 struct nvme_lbaf lbaf[16]; 126 struct nvme_lbaf lbaf[16];
121 __u8 rsvd192[192]; 127 __u8 rsvd192[192];
@@ -565,6 +571,8 @@ struct nvme_passthru_cmd {
565 __u32 result; 571 __u32 result;
566}; 572};
567 573
574#define NVME_VS(major, minor) (((major) << 16) | ((minor) << 8))
575
568#define nvme_admin_cmd nvme_passthru_cmd 576#define nvme_admin_cmd nvme_passthru_cmd
569 577
570#define NVME_IOCTL_ID _IO('N', 0x40) 578#define NVME_IOCTL_ID _IO('N', 0x40)