diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-04 03:48:49 +0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-04 03:48:49 +0400 |
commit | 0fbbbf2bde4da5cb01a949c3d7b21c0627f520a8 (patch) | |
tree | f081ef10f3067b28a1ee316a8e7292eeda143419 /include/linux/ata.h | |
parent | 54f00389563c80fa1de250a21256313ba01ca07d (diff) | |
parent | 2b235826098bb653982894dfc3f70fd029f6c2e4 (diff) | |
download | linux-0fbbbf2bde4da5cb01a949c3d7b21c0627f520a8.tar.xz |
Merge libata upstream (which includes C/H/S support) include irq-pio branch.
Merge branch 'upstream'
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r-- | include/linux/ata.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 6fec2f6f2d59..65cd7e5b2f18 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -132,6 +132,7 @@ enum { ATA_CMD_PACKET = 0xA0, ATA_CMD_VERIFY = 0x40, ATA_CMD_VERIFY_EXT = 0x42, + ATA_CMD_INIT_DEV_PARAMS = 0x91, /* SETFEATURES stuff */ SETFEATURES_XFER = 0x03, @@ -146,14 +147,14 @@ enum { XFER_MW_DMA_2 = 0x22, XFER_MW_DMA_1 = 0x21, XFER_MW_DMA_0 = 0x20, + XFER_SW_DMA_2 = 0x12, + XFER_SW_DMA_1 = 0x11, + XFER_SW_DMA_0 = 0x10, XFER_PIO_4 = 0x0C, XFER_PIO_3 = 0x0B, XFER_PIO_2 = 0x0A, XFER_PIO_1 = 0x09, XFER_PIO_0 = 0x08, - XFER_SW_DMA_2 = 0x12, - XFER_SW_DMA_1 = 0x11, - XFER_SW_DMA_0 = 0x10, XFER_PIO_SLOW = 0x00, /* ATAPI stuff */ @@ -181,7 +182,8 @@ enum { ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ - ATA_TFLAG_POLLING = (1 << 4), /* set nIEN to 1 and use polling */ + ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ + ATA_TFLAG_POLLING = (1 << 5), /* set nIEN to 1 and use polling */ }; enum ata_tf_protocols { @@ -253,6 +255,18 @@ struct ata_taskfile { #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) +static inline int ata_id_current_chs_valid(u16 *id) +{ + /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command + has not been issued to the device then the values of + id[54] to id[56] are vendor specific. */ + return (id[53] & 0x01) && /* Current translation valid */ + id[54] && /* cylinders in current translation */ + id[55] && /* heads in current translation */ + id[55] <= 16 && + id[56]; /* sectors in current translation */ +} + static inline int atapi_cdb_len(u16 *dev_id) { u16 tmp = dev_id[0] & 0x3; |