diff options
-rw-r--r-- | drivers/ata/libata-scsi.c | 11 | ||||
-rw-r--r-- | include/linux/ata.h | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index c11675f34b9..a8341999135 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2056,6 +2056,17 @@ static unsigned int ata_scsiop_inq_83(struct ata_scsi_args *args, u8 *rbuf) | |||
2056 | ATA_ID_SERNO_LEN); | 2056 | ATA_ID_SERNO_LEN); |
2057 | num += ATA_ID_SERNO_LEN; | 2057 | num += ATA_ID_SERNO_LEN; |
2058 | 2058 | ||
2059 | if (ata_id_has_wwn(args->id)) { | ||
2060 | /* SAT defined lu world wide name */ | ||
2061 | /* piv=0, assoc=lu, code_set=binary, designator=NAA */ | ||
2062 | rbuf[num + 0] = 1; | ||
2063 | rbuf[num + 1] = 3; | ||
2064 | rbuf[num + 3] = ATA_ID_WWN_LEN; | ||
2065 | num += 4; | ||
2066 | ata_id_string(args->id, (unsigned char *) rbuf + num, | ||
2067 | ATA_ID_WWN, ATA_ID_WWN_LEN); | ||
2068 | num += ATA_ID_WWN_LEN; | ||
2069 | } | ||
2059 | rbuf[3] = num - 4; /* page len (assume less than 256 bytes) */ | 2070 | rbuf[3] = num - 4; /* page len (assume less than 256 bytes) */ |
2060 | return 0; | 2071 | return 0; |
2061 | } | 2072 | } |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 0c4929fa34d..198e1ea2b2e 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -89,6 +89,7 @@ enum { | |||
89 | ATA_ID_SPG = 98, | 89 | ATA_ID_SPG = 98, |
90 | ATA_ID_LBA_CAPACITY_2 = 100, | 90 | ATA_ID_LBA_CAPACITY_2 = 100, |
91 | ATA_ID_SECTOR_SIZE = 106, | 91 | ATA_ID_SECTOR_SIZE = 106, |
92 | ATA_ID_WWN = 108, | ||
92 | ATA_ID_LOGICAL_SECTOR_SIZE = 117, /* and 118 */ | 93 | ATA_ID_LOGICAL_SECTOR_SIZE = 117, /* and 118 */ |
93 | ATA_ID_LAST_LUN = 126, | 94 | ATA_ID_LAST_LUN = 126, |
94 | ATA_ID_DLF = 128, | 95 | ATA_ID_DLF = 128, |
@@ -103,6 +104,7 @@ enum { | |||
103 | ATA_ID_SERNO_LEN = 20, | 104 | ATA_ID_SERNO_LEN = 20, |
104 | ATA_ID_FW_REV_LEN = 8, | 105 | ATA_ID_FW_REV_LEN = 8, |
105 | ATA_ID_PROD_LEN = 40, | 106 | ATA_ID_PROD_LEN = 40, |
107 | ATA_ID_WWN_LEN = 8, | ||
106 | 108 | ||
107 | ATA_PCI_CTL_OFS = 2, | 109 | ATA_PCI_CTL_OFS = 2, |
108 | 110 | ||
@@ -815,6 +817,11 @@ static inline int ata_id_has_unload(const u16 *id) | |||
815 | return 0; | 817 | return 0; |
816 | } | 818 | } |
817 | 819 | ||
820 | static inline bool ata_id_has_wwn(const u16 *id) | ||
821 | { | ||
822 | return (id[ATA_ID_CSF_DEFAULT] & 0xC100) == 0x4100; | ||
823 | } | ||
824 | |||
818 | static inline int ata_id_form_factor(const u16 *id) | 825 | static inline int ata_id_form_factor(const u16 *id) |
819 | { | 826 | { |
820 | u16 val = id[168]; | 827 | u16 val = id[168]; |