diff options
author | Tejun Heo <htejun@gmail.com> | 2008-03-24 23:22:47 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:16 -0400 |
commit | c1bc899f5805771926c9198e2ab4d77122c356a1 (patch) | |
tree | 008dc8c45d55477ba3fc7a9c9abe474ecb5027af | |
parent | f08048e94564d009b19038cfbdd800aa83e79c7f (diff) |
libata: reorganize ata_port_operations
Over the time, ops in ata_port_operations has become a bit confusing.
Reorganize. SFF/BMDMA ops are separated into separate a group as they
will be taken out of ata_port_operations later.
Signed-off-by: Tejun Heo <htejun@gmail.com>
-rw-r--r-- | include/linux/libata.h | 117 |
1 files changed, 61 insertions, 56 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index bc60132c7d33..9476a479691b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -665,69 +665,74 @@ struct ata_port { | |||
665 | }; | 665 | }; |
666 | 666 | ||
667 | struct ata_port_operations { | 667 | struct ata_port_operations { |
668 | void (*dev_config) (struct ata_device *); | 668 | /* |
669 | * Command execution | ||
670 | */ | ||
671 | int (*qc_defer)(struct ata_queued_cmd *qc); | ||
672 | int (*check_atapi_dma)(struct ata_queued_cmd *qc); | ||
673 | void (*qc_prep)(struct ata_queued_cmd *qc); | ||
674 | unsigned int (*qc_issue)(struct ata_queued_cmd *qc); | ||
669 | 675 | ||
670 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 676 | /* |
671 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 677 | * Configuration and exception handling |
672 | unsigned long (*mode_filter) (struct ata_device *, unsigned long); | 678 | */ |
679 | int (*cable_detect)(struct ata_port *ap); | ||
680 | unsigned long (*mode_filter)(struct ata_device *dev, unsigned long xfer_mask); | ||
681 | void (*set_piomode)(struct ata_port *ap, struct ata_device *dev); | ||
682 | void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev); | ||
683 | int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev); | ||
673 | 684 | ||
674 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); | 685 | void (*dev_config)(struct ata_device *dev); |
675 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | ||
676 | 686 | ||
677 | void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf); | 687 | void (*freeze)(struct ata_port *ap); |
688 | void (*thaw)(struct ata_port *ap); | ||
689 | void (*error_handler)(struct ata_port *ap); | ||
690 | void (*post_internal_cmd)(struct ata_queued_cmd *qc); | ||
691 | |||
692 | /* | ||
693 | * Optional features | ||
694 | */ | ||
695 | int (*scr_read)(struct ata_port *ap, unsigned int sc_reg, u32 *val); | ||
696 | int (*scr_write)(struct ata_port *ap, unsigned int sc_reg, u32 val); | ||
697 | void (*pmp_attach)(struct ata_port *ap); | ||
698 | void (*pmp_detach)(struct ata_port *ap); | ||
699 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); | ||
700 | void (*disable_pm)(struct ata_port *ap); | ||
701 | |||
702 | /* | ||
703 | * Start, stop, suspend and resume | ||
704 | */ | ||
705 | int (*port_suspend)(struct ata_port *ap, pm_message_t mesg); | ||
706 | int (*port_resume)(struct ata_port *ap); | ||
707 | int (*port_start)(struct ata_port *ap); | ||
708 | void (*port_stop)(struct ata_port *ap); | ||
709 | void (*host_stop)(struct ata_host *host); | ||
710 | |||
711 | /* | ||
712 | * SFF / taskfile oriented ops | ||
713 | */ | ||
714 | void (*dev_select)(struct ata_port *ap, unsigned int device); | ||
678 | u8 (*check_status)(struct ata_port *ap); | 715 | u8 (*check_status)(struct ata_port *ap); |
679 | u8 (*check_altstatus)(struct ata_port *ap); | 716 | u8 (*check_altstatus)(struct ata_port *ap); |
680 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 717 | void (*tf_load)(struct ata_port *ap, const struct ata_taskfile *tf); |
681 | 718 | void (*tf_read)(struct ata_port *ap, struct ata_taskfile *tf); | |
682 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ | 719 | void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf); |
683 | int (*set_mode) (struct ata_link *link, struct ata_device **r_failed_dev); | 720 | unsigned int (*data_xfer)(struct ata_device *dev, unsigned char *buf, |
684 | 721 | unsigned int buflen, int rw); | |
685 | int (*cable_detect) (struct ata_port *ap); | 722 | u8 (*irq_on)(struct ata_port *); |
686 | 723 | ||
687 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); | 724 | void (*irq_clear)(struct ata_port *); |
688 | 725 | void (*bmdma_setup)(struct ata_queued_cmd *qc); | |
689 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 726 | void (*bmdma_start)(struct ata_queued_cmd *qc); |
690 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 727 | void (*bmdma_stop)(struct ata_queued_cmd *qc); |
691 | 728 | u8 (*bmdma_status)(struct ata_port *ap); | |
692 | unsigned int (*data_xfer) (struct ata_device *dev, unsigned char *buf, | 729 | |
693 | unsigned int buflen, int rw); | 730 | /* |
694 | 731 | * Obsolete | |
695 | int (*qc_defer) (struct ata_queued_cmd *qc); | ||
696 | void (*qc_prep) (struct ata_queued_cmd *qc); | ||
697 | unsigned int (*qc_issue) (struct ata_queued_cmd *qc); | ||
698 | |||
699 | /* port multiplier */ | ||
700 | void (*pmp_attach) (struct ata_port *ap); | ||
701 | void (*pmp_detach) (struct ata_port *ap); | ||
702 | |||
703 | /* Error handlers. ->error_handler overrides ->eng_timeout and | ||
704 | * indicates that new-style EH is in place. | ||
705 | */ | 732 | */ |
706 | void (*eng_timeout) (struct ata_port *ap); /* obsolete */ | 733 | void (*phy_reset)(struct ata_port *ap); |
707 | 734 | void (*eng_timeout)(struct ata_port *ap); | |
708 | void (*freeze) (struct ata_port *ap); | ||
709 | void (*thaw) (struct ata_port *ap); | ||
710 | void (*error_handler) (struct ata_port *ap); | ||
711 | void (*post_internal_cmd) (struct ata_queued_cmd *qc); | ||
712 | |||
713 | irq_handler_t irq_handler; | 735 | irq_handler_t irq_handler; |
714 | void (*irq_clear) (struct ata_port *); | ||
715 | u8 (*irq_on) (struct ata_port *); | ||
716 | |||
717 | int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val); | ||
718 | int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val); | ||
719 | |||
720 | int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); | ||
721 | int (*port_resume) (struct ata_port *ap); | ||
722 | int (*enable_pm) (struct ata_port *ap, enum link_pm policy); | ||
723 | void (*disable_pm) (struct ata_port *ap); | ||
724 | int (*port_start) (struct ata_port *ap); | ||
725 | void (*port_stop) (struct ata_port *ap); | ||
726 | |||
727 | void (*host_stop) (struct ata_host *host); | ||
728 | |||
729 | void (*bmdma_stop) (struct ata_queued_cmd *qc); | ||
730 | u8 (*bmdma_status) (struct ata_port *ap); | ||
731 | }; | 736 | }; |
732 | 737 | ||
733 | struct ata_port_info { | 738 | struct ata_port_info { |