diff options
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r-- | include/linux/ata.h | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index ee0bd9524055..f63fb1afc5cc 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -446,22 +446,6 @@ enum { | |||
446 | SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */ | 446 | SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */ |
447 | SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */ | 447 | SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */ |
448 | SERR_DEV_XCHG = (1 << 26), /* device exchanged */ | 448 | SERR_DEV_XCHG = (1 << 26), /* device exchanged */ |
449 | |||
450 | /* struct ata_taskfile flags */ | ||
451 | ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ | ||
452 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ | ||
453 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ | ||
454 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ | ||
455 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ | ||
456 | ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ | ||
457 | ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */ | ||
458 | |||
459 | /* protocol flags */ | ||
460 | ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */ | ||
461 | ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */ | ||
462 | ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA, | ||
463 | ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */ | ||
464 | ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */ | ||
465 | }; | 449 | }; |
466 | 450 | ||
467 | enum ata_tf_protocols { | 451 | enum ata_tf_protocols { |
@@ -488,83 +472,6 @@ struct ata_bmdma_prd { | |||
488 | __le32 flags_len; | 472 | __le32 flags_len; |
489 | }; | 473 | }; |
490 | 474 | ||
491 | struct ata_taskfile { | ||
492 | unsigned long flags; /* ATA_TFLAG_xxx */ | ||
493 | u8 protocol; /* ATA_PROT_xxx */ | ||
494 | |||
495 | u8 ctl; /* control reg */ | ||
496 | |||
497 | u8 hob_feature; /* additional data */ | ||
498 | u8 hob_nsect; /* to support LBA48 */ | ||
499 | u8 hob_lbal; | ||
500 | u8 hob_lbam; | ||
501 | u8 hob_lbah; | ||
502 | |||
503 | u8 feature; | ||
504 | u8 nsect; | ||
505 | u8 lbal; | ||
506 | u8 lbam; | ||
507 | u8 lbah; | ||
508 | |||
509 | u8 device; | ||
510 | |||
511 | u8 command; /* IO operation */ | ||
512 | }; | ||
513 | |||
514 | /* | ||
515 | * protocol tests | ||
516 | */ | ||
517 | static inline unsigned int ata_prot_flags(u8 prot) | ||
518 | { | ||
519 | switch (prot) { | ||
520 | case ATA_PROT_NODATA: | ||
521 | return 0; | ||
522 | case ATA_PROT_PIO: | ||
523 | return ATA_PROT_FLAG_PIO; | ||
524 | case ATA_PROT_DMA: | ||
525 | return ATA_PROT_FLAG_DMA; | ||
526 | case ATA_PROT_NCQ: | ||
527 | return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ; | ||
528 | case ATAPI_PROT_NODATA: | ||
529 | return ATA_PROT_FLAG_ATAPI; | ||
530 | case ATAPI_PROT_PIO: | ||
531 | return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO; | ||
532 | case ATAPI_PROT_DMA: | ||
533 | return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA; | ||
534 | } | ||
535 | return 0; | ||
536 | } | ||
537 | |||
538 | static inline int ata_is_atapi(u8 prot) | ||
539 | { | ||
540 | return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI; | ||
541 | } | ||
542 | |||
543 | static inline int ata_is_nodata(u8 prot) | ||
544 | { | ||
545 | return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA); | ||
546 | } | ||
547 | |||
548 | static inline int ata_is_pio(u8 prot) | ||
549 | { | ||
550 | return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO; | ||
551 | } | ||
552 | |||
553 | static inline int ata_is_dma(u8 prot) | ||
554 | { | ||
555 | return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA; | ||
556 | } | ||
557 | |||
558 | static inline int ata_is_ncq(u8 prot) | ||
559 | { | ||
560 | return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ; | ||
561 | } | ||
562 | |||
563 | static inline int ata_is_data(u8 prot) | ||
564 | { | ||
565 | return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA; | ||
566 | } | ||
567 | |||
568 | /* | 475 | /* |
569 | * id tests | 476 | * id tests |
570 | */ | 477 | */ |
@@ -1060,15 +967,6 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer, | |||
1060 | return used_bytes; | 967 | return used_bytes; |
1061 | } | 968 | } |
1062 | 969 | ||
1063 | static inline int is_multi_taskfile(struct ata_taskfile *tf) | ||
1064 | { | ||
1065 | return (tf->command == ATA_CMD_READ_MULTI) || | ||
1066 | (tf->command == ATA_CMD_WRITE_MULTI) || | ||
1067 | (tf->command == ATA_CMD_READ_MULTI_EXT) || | ||
1068 | (tf->command == ATA_CMD_WRITE_MULTI_EXT) || | ||
1069 | (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT); | ||
1070 | } | ||
1071 | |||
1072 | static inline bool ata_ok(u8 status) | 970 | static inline bool ata_ok(u8 status) |
1073 | { | 971 | { |
1074 | return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) | 972 | return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) |