aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a7c41f3df8f4..1cbeb434af9a 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -212,6 +212,7 @@ enum {
212 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 212 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
213 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 213 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
214 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 214 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
215 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
215}; 216};
216 217
217enum ata_tf_protocols { 218enum ata_tf_protocols {
@@ -285,6 +286,8 @@ struct ata_taskfile {
285 ((u64) (id)[(n) + 1] << 16) | \ 286 ((u64) (id)[(n) + 1] << 16) | \
286 ((u64) (id)[(n) + 0]) ) 287 ((u64) (id)[(n) + 0]) )
287 288
289#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
290
288static inline unsigned int ata_id_major_version(const u16 *id) 291static inline unsigned int ata_id_major_version(const u16 *id)
289{ 292{
290 unsigned int mver; 293 unsigned int mver;
@@ -324,6 +327,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
324 (tf->protocol == ATA_PROT_ATAPI_DMA); 327 (tf->protocol == ATA_PROT_ATAPI_DMA);
325} 328}
326 329
330static inline int is_multi_taskfile(struct ata_taskfile *tf)
331{
332 return (tf->command == ATA_CMD_READ_MULTI) ||
333 (tf->command == ATA_CMD_WRITE_MULTI) ||
334 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
335 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
336 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
337}
338
327static inline int ata_ok(u8 status) 339static inline int ata_ok(u8 status)
328{ 340{
329 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 341 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))