diff options
| author | Hannes Reinecke <hare@suse.de> | 2014-11-05 07:08:22 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2014-11-05 11:22:07 -0500 |
| commit | f9ca5ab832e7ac5bc2b6fe0e82ad46d536f436f9 (patch) | |
| tree | aaa569db1f8c16b3947fc3ba72ca398f4882214e | |
| parent | 9162c6579bf90b3f5ddb7e3a6c6fa946c1b4cbeb (diff) | |
libata-scsi: Update SATL for ZAC drives
ZAC (zoned-access command) drives translate into ZBC (Zoned block
command) device type for SCSI. So implement the correct mappings
into libata-scsi and update the SCSI command set versions.
Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
| -rw-r--r-- | drivers/ata/libata-scsi.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index bea6e7f4ebf0..1db6eab6dac3 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
| @@ -1969,6 +1969,7 @@ static void ata_scsi_rbuf_fill(struct ata_scsi_args *args, | |||
| 1969 | static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | 1969 | static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) |
| 1970 | { | 1970 | { |
| 1971 | const u8 versions[] = { | 1971 | const u8 versions[] = { |
| 1972 | 0x00, | ||
| 1972 | 0x60, /* SAM-3 (no version claimed) */ | 1973 | 0x60, /* SAM-3 (no version claimed) */ |
| 1973 | 1974 | ||
| 1974 | 0x03, | 1975 | 0x03, |
| @@ -1977,6 +1978,20 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
| 1977 | 0x02, | 1978 | 0x02, |
| 1978 | 0x60 /* SPC-3 (no version claimed) */ | 1979 | 0x60 /* SPC-3 (no version claimed) */ |
| 1979 | }; | 1980 | }; |
| 1981 | const u8 versions_zbc[] = { | ||
| 1982 | 0x00, | ||
| 1983 | 0xA0, /* SAM-5 (no version claimed) */ | ||
| 1984 | |||
| 1985 | 0x04, | ||
| 1986 | 0xC0, /* SBC-3 (no version claimed) */ | ||
| 1987 | |||
| 1988 | 0x04, | ||
| 1989 | 0x60, /* SPC-4 (no version claimed) */ | ||
| 1990 | |||
| 1991 | 0x60, | ||
| 1992 | 0x20, /* ZBC (no version claimed) */ | ||
| 1993 | }; | ||
| 1994 | |||
| 1980 | u8 hdr[] = { | 1995 | u8 hdr[] = { |
| 1981 | TYPE_DISK, | 1996 | TYPE_DISK, |
| 1982 | 0, | 1997 | 0, |
| @@ -1991,6 +2006,11 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
| 1991 | if (ata_id_removeable(args->id)) | 2006 | if (ata_id_removeable(args->id)) |
| 1992 | hdr[1] |= (1 << 7); | 2007 | hdr[1] |= (1 << 7); |
| 1993 | 2008 | ||
| 2009 | if (args->dev->class == ATA_DEV_ZAC) { | ||
| 2010 | hdr[0] = TYPE_ZBC; | ||
| 2011 | hdr[2] = 0x6; /* ZBC is defined in SPC-4 */ | ||
| 2012 | } | ||
| 2013 | |||
| 1994 | memcpy(rbuf, hdr, sizeof(hdr)); | 2014 | memcpy(rbuf, hdr, sizeof(hdr)); |
| 1995 | memcpy(&rbuf[8], "ATA ", 8); | 2015 | memcpy(&rbuf[8], "ATA ", 8); |
| 1996 | ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16); | 2016 | ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16); |
| @@ -2003,7 +2023,10 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
| 2003 | if (rbuf[32] == 0 || rbuf[32] == ' ') | 2023 | if (rbuf[32] == 0 || rbuf[32] == ' ') |
| 2004 | memcpy(&rbuf[32], "n/a ", 4); | 2024 | memcpy(&rbuf[32], "n/a ", 4); |
| 2005 | 2025 | ||
| 2006 | memcpy(rbuf + 59, versions, sizeof(versions)); | 2026 | if (args->dev->class == ATA_DEV_ZAC) |
| 2027 | memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc)); | ||
| 2028 | else | ||
| 2029 | memcpy(rbuf + 58, versions, sizeof(versions)); | ||
| 2007 | 2030 | ||
| 2008 | return 0; | 2031 | return 0; |
| 2009 | } | 2032 | } |
