diff options
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index dd45c6a03e5d..e364e86e84d7 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -235,7 +235,8 @@ static ssize_t ata_scsi_park_store(struct device *device, | |||
235 | rc = -ENODEV; | 235 | rc = -ENODEV; |
236 | goto unlock; | 236 | goto unlock; |
237 | } | 237 | } |
238 | if (dev->class != ATA_DEV_ATA) { | 238 | if (dev->class != ATA_DEV_ATA && |
239 | dev->class != ATA_DEV_ZAC) { | ||
239 | rc = -EOPNOTSUPP; | 240 | rc = -EOPNOTSUPP; |
240 | goto unlock; | 241 | goto unlock; |
241 | } | 242 | } |
@@ -1961,6 +1962,7 @@ static void ata_scsi_rbuf_fill(struct ata_scsi_args *args, | |||
1961 | static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | 1962 | static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) |
1962 | { | 1963 | { |
1963 | const u8 versions[] = { | 1964 | const u8 versions[] = { |
1965 | 0x00, | ||
1964 | 0x60, /* SAM-3 (no version claimed) */ | 1966 | 0x60, /* SAM-3 (no version claimed) */ |
1965 | 1967 | ||
1966 | 0x03, | 1968 | 0x03, |
@@ -1969,6 +1971,20 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
1969 | 0x02, | 1971 | 0x02, |
1970 | 0x60 /* SPC-3 (no version claimed) */ | 1972 | 0x60 /* SPC-3 (no version claimed) */ |
1971 | }; | 1973 | }; |
1974 | const u8 versions_zbc[] = { | ||
1975 | 0x00, | ||
1976 | 0xA0, /* SAM-5 (no version claimed) */ | ||
1977 | |||
1978 | 0x04, | ||
1979 | 0xC0, /* SBC-3 (no version claimed) */ | ||
1980 | |||
1981 | 0x04, | ||
1982 | 0x60, /* SPC-4 (no version claimed) */ | ||
1983 | |||
1984 | 0x60, | ||
1985 | 0x20, /* ZBC (no version claimed) */ | ||
1986 | }; | ||
1987 | |||
1972 | u8 hdr[] = { | 1988 | u8 hdr[] = { |
1973 | TYPE_DISK, | 1989 | TYPE_DISK, |
1974 | 0, | 1990 | 0, |
@@ -1983,6 +1999,11 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
1983 | if (ata_id_removeable(args->id)) | 1999 | if (ata_id_removeable(args->id)) |
1984 | hdr[1] |= (1 << 7); | 2000 | hdr[1] |= (1 << 7); |
1985 | 2001 | ||
2002 | if (args->dev->class == ATA_DEV_ZAC) { | ||
2003 | hdr[0] = TYPE_ZBC; | ||
2004 | hdr[2] = 0x6; /* ZBC is defined in SPC-4 */ | ||
2005 | } | ||
2006 | |||
1986 | memcpy(rbuf, hdr, sizeof(hdr)); | 2007 | memcpy(rbuf, hdr, sizeof(hdr)); |
1987 | memcpy(&rbuf[8], "ATA ", 8); | 2008 | memcpy(&rbuf[8], "ATA ", 8); |
1988 | ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16); | 2009 | ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16); |
@@ -1995,7 +2016,10 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf) | |||
1995 | if (rbuf[32] == 0 || rbuf[32] == ' ') | 2016 | if (rbuf[32] == 0 || rbuf[32] == ' ') |
1996 | memcpy(&rbuf[32], "n/a ", 4); | 2017 | memcpy(&rbuf[32], "n/a ", 4); |
1997 | 2018 | ||
1998 | memcpy(rbuf + 59, versions, sizeof(versions)); | 2019 | if (args->dev->class == ATA_DEV_ZAC) |
2020 | memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc)); | ||
2021 | else | ||
2022 | memcpy(rbuf + 58, versions, sizeof(versions)); | ||
1999 | 2023 | ||
2000 | return 0; | 2024 | return 0; |
2001 | } | 2025 | } |
@@ -2564,7 +2588,6 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) | |||
2564 | 2588 | ||
2565 | DPRINTK("ATAPI request sense\n"); | 2589 | DPRINTK("ATAPI request sense\n"); |
2566 | 2590 | ||
2567 | /* FIXME: is this needed? */ | ||
2568 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 2591 | memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
2569 | 2592 | ||
2570 | #ifdef CONFIG_ATA_SFF | 2593 | #ifdef CONFIG_ATA_SFF |
@@ -3405,7 +3428,7 @@ static inline int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, | |||
3405 | ata_xlat_func_t xlat_func; | 3428 | ata_xlat_func_t xlat_func; |
3406 | int rc = 0; | 3429 | int rc = 0; |
3407 | 3430 | ||
3408 | if (dev->class == ATA_DEV_ATA) { | 3431 | if (dev->class == ATA_DEV_ATA || dev->class == ATA_DEV_ZAC) { |
3409 | if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len)) | 3432 | if (unlikely(!scmd->cmd_len || scmd->cmd_len > dev->cdb_len)) |
3410 | goto bad_cdb_len; | 3433 | goto bad_cdb_len; |
3411 | 3434 | ||