diff options
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 { | |||
132 | ATA_CMD_PACKET = 0xA0, | 132 | ATA_CMD_PACKET = 0xA0, |
133 | ATA_CMD_VERIFY = 0x40, | 133 | ATA_CMD_VERIFY = 0x40, |
134 | ATA_CMD_VERIFY_EXT = 0x42, | 134 | ATA_CMD_VERIFY_EXT = 0x42, |
135 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | ||
135 | 136 | ||
136 | /* SETFEATURES stuff */ | 137 | /* SETFEATURES stuff */ |
137 | SETFEATURES_XFER = 0x03, | 138 | SETFEATURES_XFER = 0x03, |
@@ -146,14 +147,14 @@ enum { | |||
146 | XFER_MW_DMA_2 = 0x22, | 147 | XFER_MW_DMA_2 = 0x22, |
147 | XFER_MW_DMA_1 = 0x21, | 148 | XFER_MW_DMA_1 = 0x21, |
148 | XFER_MW_DMA_0 = 0x20, | 149 | XFER_MW_DMA_0 = 0x20, |
150 | XFER_SW_DMA_2 = 0x12, | ||
151 | XFER_SW_DMA_1 = 0x11, | ||
152 | XFER_SW_DMA_0 = 0x10, | ||
149 | XFER_PIO_4 = 0x0C, | 153 | XFER_PIO_4 = 0x0C, |
150 | XFER_PIO_3 = 0x0B, | 154 | XFER_PIO_3 = 0x0B, |
151 | XFER_PIO_2 = 0x0A, | 155 | XFER_PIO_2 = 0x0A, |
152 | XFER_PIO_1 = 0x09, | 156 | XFER_PIO_1 = 0x09, |
153 | XFER_PIO_0 = 0x08, | 157 | XFER_PIO_0 = 0x08, |
154 | XFER_SW_DMA_2 = 0x12, | ||
155 | XFER_SW_DMA_1 = 0x11, | ||
156 | XFER_SW_DMA_0 = 0x10, | ||
157 | XFER_PIO_SLOW = 0x00, | 158 | XFER_PIO_SLOW = 0x00, |
158 | 159 | ||
159 | /* ATAPI stuff */ | 160 | /* ATAPI stuff */ |
@@ -181,7 +182,8 @@ enum { | |||
181 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ | 182 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ |
182 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ | 183 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ |
183 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ | 184 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ |
184 | ATA_TFLAG_POLLING = (1 << 4), /* set nIEN to 1 and use polling */ | 185 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ |
186 | ATA_TFLAG_POLLING = (1 << 5), /* set nIEN to 1 and use polling */ | ||
185 | }; | 187 | }; |
186 | 188 | ||
187 | enum ata_tf_protocols { | 189 | enum ata_tf_protocols { |
@@ -253,6 +255,18 @@ struct ata_taskfile { | |||
253 | 255 | ||
254 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) | 256 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) |
255 | 257 | ||
258 | static inline int ata_id_current_chs_valid(u16 *id) | ||
259 | { | ||
260 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | ||
261 | has not been issued to the device then the values of | ||
262 | id[54] to id[56] are vendor specific. */ | ||
263 | return (id[53] & 0x01) && /* Current translation valid */ | ||
264 | id[54] && /* cylinders in current translation */ | ||
265 | id[55] && /* heads in current translation */ | ||
266 | id[55] <= 16 && | ||
267 | id[56]; /* sectors in current translation */ | ||
268 | } | ||
269 | |||
256 | static inline int atapi_cdb_len(u16 *dev_id) | 270 | static inline int atapi_cdb_len(u16 *dev_id) |
257 | { | 271 | { |
258 | u16 tmp = dev_id[0] & 0x3; | 272 | u16 tmp = dev_id[0] & 0x3; |