diff options
author | Mark Lord <liml@rtr.ca> | 2007-03-16 10:22:26 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 14:16:01 -0400 |
commit | 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 (patch) | |
tree | 031eec40ab42ac4ab04e59db539b8126ac31fb6d /drivers/ata/libata-scsi.c | |
parent | 1234010684bb9cde51125ec3d1c71054a9f24f47 (diff) |
libata: add support for READ/WRITE LONG
The READ/WRITE LONG commands are theoretically obsolete,
but the majority of drives in existance still implement them.
The WRITE_LONG and WRITE_LONG_ONCE commands are of particular
interest for fault injection testing -- eg. creating "media errors"
at specific locations on a disk.
The fussy bit is that these commands require a non-standard
sector size, usually 520 bytes instead of 512.
This patch adds support to libata for READ/WRITE LONG commands
issued via SG_IO/ATA_16.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 7d41afe8ccbc..563ef0bfb038 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2678,6 +2678,18 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc) | |||
2678 | tf->device = qc->dev->devno ? | 2678 | tf->device = qc->dev->devno ? |
2679 | tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1; | 2679 | tf->device | ATA_DEV1 : tf->device & ~ATA_DEV1; |
2680 | 2680 | ||
2681 | /* READ/WRITE LONG use a non-standard sect_size */ | ||
2682 | qc->sect_size = ATA_SECT_SIZE; | ||
2683 | switch (tf->command) { | ||
2684 | case ATA_CMD_READ_LONG: | ||
2685 | case ATA_CMD_READ_LONG_ONCE: | ||
2686 | case ATA_CMD_WRITE_LONG: | ||
2687 | case ATA_CMD_WRITE_LONG_ONCE: | ||
2688 | if (tf->protocol != ATA_PROT_PIO || tf->nsect != 1) | ||
2689 | goto invalid_fld; | ||
2690 | qc->sect_size = scmd->request_bufflen; | ||
2691 | } | ||
2692 | |||
2681 | /* | 2693 | /* |
2682 | * Filter SET_FEATURES - XFER MODE command -- otherwise, | 2694 | * Filter SET_FEATURES - XFER MODE command -- otherwise, |
2683 | * SET_FEATURES - XFER MODE must be preceded/succeeded | 2695 | * SET_FEATURES - XFER MODE must be preceded/succeeded |