diff options
author | Hannes Reinecke <hare@suse.de> | 2016-04-25 06:45:55 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-05-09 12:36:46 -0400 |
commit | 856c4663930988118d9f355aad66811dd6df06de (patch) | |
tree | 5b0d59494d213e6ffdc476bf6e1230c4cc8e444d /drivers/ata | |
parent | 284b3b77ea883234dadb2cbf97b145c3c30fe4bd (diff) |
libata: support device-managed ZAC devices
Device-managed ZAC devices just set the zoned capabilities field
in INQUIRY byte 69 (cf ACS-4). This corresponds to the 'zoned'
field in the block device characteristics VPD page.
As this is only defined in SPC-5/SBC-4 we also need to update
the supported SCSI version descriptor.
Reviewed-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Tested-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-scsi.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 43403aa0801f..96abd42c9985 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2082,14 +2082,14 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
2082 | 0x00, | 2082 | 0x00, |
2083 | 0xA0, /* SAM-5 (no version claimed) */ | 2083 | 0xA0, /* SAM-5 (no version claimed) */ |
2084 | 2084 | ||
2085 | 0x04, | 2085 | 0x06, |
2086 | 0xC0, /* SBC-3 (no version claimed) */ | 2086 | 0x00, /* SBC-4 (no version claimed) */ |
2087 | 2087 | ||
2088 | 0x04, | 2088 | 0x05, |
2089 | 0x60, /* SPC-4 (no version claimed) */ | 2089 | 0xC0, /* SPC-5 (no version claimed) */ |
2090 | 2090 | ||
2091 | 0x60, | 2091 | 0x60, |
2092 | 0x20, /* ZBC (no version claimed) */ | 2092 | 0x24, /* ZBC r05 */ |
2093 | }; | 2093 | }; |
2094 | 2094 | ||
2095 | u8 hdr[] = { | 2095 | u8 hdr[] = { |
@@ -2109,10 +2109,8 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
2109 | (args->dev->link->ap->pflags & ATA_PFLAG_EXTERNAL)) | 2109 | (args->dev->link->ap->pflags & ATA_PFLAG_EXTERNAL)) |
2110 | hdr[1] |= (1 << 7); | 2110 | hdr[1] |= (1 << 7); |
2111 | 2111 | ||
2112 | if (args->dev->class == ATA_DEV_ZAC) { | 2112 | if (args->dev->class == ATA_DEV_ZAC) |
2113 | hdr[0] = TYPE_ZBC; | 2113 | hdr[0] = TYPE_ZBC; |
2114 | hdr[2] = 0x6; /* ZBC is defined in SPC-4 */ | ||
2115 | } | ||
2116 | 2114 | ||
2117 | memcpy(rbuf, hdr, sizeof(hdr)); | 2115 | memcpy(rbuf, hdr, sizeof(hdr)); |
2118 | memcpy(&rbuf[8], "ATA ", 8); | 2116 | memcpy(&rbuf[8], "ATA ", 8); |
@@ -2126,7 +2124,7 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
2126 | if (rbuf[32] == 0 || rbuf[32] == ' ') | 2124 | if (rbuf[32] == 0 || rbuf[32] == ' ') |
2127 | memcpy(&rbuf[32], "n/a ", 4); | 2125 | memcpy(&rbuf[32], "n/a ", 4); |
2128 | 2126 | ||
2129 | if (args->dev->class == ATA_DEV_ZAC) | 2127 | if (ata_id_zoned_cap(args->id) || args->dev->class == ATA_DEV_ZAC) |
2130 | memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc)); | 2128 | memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc)); |
2131 | else | 2129 | else |
2132 | memcpy(rbuf + 58, versions, sizeof(versions)); | 2130 | memcpy(rbuf + 58, versions, sizeof(versions)); |
@@ -2322,12 +2320,15 @@ static unsigned int ata_scsiop_inq_b1(struct ata_scsi_args *args, u8 *rbuf) | |||
2322 | { | 2320 | { |
2323 | int form_factor = ata_id_form_factor(args->id); | 2321 | int form_factor = ata_id_form_factor(args->id); |
2324 | int media_rotation_rate = ata_id_rotation_rate(args->id); | 2322 | int media_rotation_rate = ata_id_rotation_rate(args->id); |
2323 | u8 zoned = ata_id_zoned_cap(args->id); | ||
2325 | 2324 | ||
2326 | rbuf[1] = 0xb1; | 2325 | rbuf[1] = 0xb1; |
2327 | rbuf[3] = 0x3c; | 2326 | rbuf[3] = 0x3c; |
2328 | rbuf[4] = media_rotation_rate >> 8; | 2327 | rbuf[4] = media_rotation_rate >> 8; |
2329 | rbuf[5] = media_rotation_rate; | 2328 | rbuf[5] = media_rotation_rate; |
2330 | rbuf[7] = form_factor; | 2329 | rbuf[7] = form_factor; |
2330 | if (zoned) | ||
2331 | rbuf[8] = (zoned << 4); | ||
2331 | 2332 | ||
2332 | return 0; | 2333 | return 0; |
2333 | } | 2334 | } |