diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ata.h | 15 | ||||
| -rw-r--r-- | include/linux/libata.h | 5 |
2 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index c8c5a0385414..58c84a4b31f4 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -147,6 +147,7 @@ enum { ATAPI_PKT_DMA = (1 << 0), ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: 0=to device, 1=to host */ + ATAPI_CDB_LEN = 16, /* cable types */ ATA_CBL_NONE = 0, @@ -176,7 +177,8 @@ enum ata_tf_protocols { ATA_PROT_PIO, /* PIO single sector */ ATA_PROT_PIO_MULT, /* PIO multiple sector */ ATA_PROT_DMA, /* DMA */ - ATA_PROT_ATAPI, /* packet command */ + ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ + ATA_PROT_ATAPI_NODATA, /* packet command, no data */ ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ }; @@ -227,9 +229,20 @@ struct ata_taskfile { ((u64) dev->id[(n) + 1] << 16) | \ ((u64) dev->id[(n) + 0]) ) +static inline int atapi_cdb_len(u16 *dev_id) +{ + u16 tmp = dev_id[0] & 0x3; + switch (tmp) { + case 0: return 12; + case 1: return 16; + default: return -1; + } +} + static inline int is_atapi_taskfile(struct ata_taskfile *tf) { return (tf->protocol == ATA_PROT_ATAPI) || + (tf->protocol == ATA_PROT_ATAPI_NODATA) || (tf->protocol == ATA_PROT_ATAPI_DMA); } diff --git a/include/linux/libata.h b/include/linux/libata.h index 42a9bde8e42d..8443cce6971f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -218,6 +218,9 @@ struct ata_queued_cmd { struct scsi_cmnd *scsicmd; void (*scsidone)(struct scsi_cmnd *); + struct ata_taskfile tf; + u8 cdb[ATAPI_CDB_LEN]; + unsigned long flags; /* ATA_QCFLAG_xxx */ unsigned int tag; unsigned int n_elem; @@ -229,7 +232,6 @@ struct ata_queued_cmd { unsigned int cursg; unsigned int cursg_ofs; - struct ata_taskfile tf; struct scatterlist sgent; void *buf_virt; @@ -285,6 +287,7 @@ struct ata_port { unsigned int mwdma_mask; unsigned int udma_mask; unsigned int cbl; /* cable type; ATA_CBL_xxx */ + unsigned int cdb_len; struct ata_device device[ATA_MAX_DEVICES]; |
