From 5a5dbd18a7496ed403f6f54bb20c955c65482fa5 Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Fri, 16 Mar 2007 10:22:26 -0400 Subject: 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 Signed-off-by: Jeff Garzik --- include/linux/ata.h | 6 ++++++ include/linux/libata.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/ata.h b/include/linux/ata.h index 6caeb98e29dd..ffb6cdc5010d 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -164,6 +164,12 @@ enum { /* READ_LOG_EXT pages */ ATA_LOG_SATA_NCQ = 0x10, + /* READ/WRITE LONG (obsolete) */ + ATA_CMD_READ_LONG = 0x22, + ATA_CMD_READ_LONG_ONCE = 0x23, + ATA_CMD_WRITE_LONG = 0x32, + ATA_CMD_WRITE_LONG_ONCE = 0x33, + /* SETFEATURES stuff */ SETFEATURES_XFER = 0x03, XFER_UDMA_7 = 0x47, diff --git a/include/linux/libata.h b/include/linux/libata.h index 5a40a8d95114..12237d4b9f9b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -427,6 +427,7 @@ struct ata_queued_cmd { int dma_dir; unsigned int pad_len; + unsigned int sect_size; unsigned int nbytes; unsigned int curbytes; @@ -1182,6 +1183,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) qc->n_elem = 0; qc->err_mask = 0; qc->pad_len = 0; + qc->sect_size = ATA_SECT_SIZE; ata_tf_init(qc->dev, &qc->tf); -- cgit v1.2.3-59-g8ed1b