Commit c1bc899f authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

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: default avatarTejun Heo <htejun@gmail.com>
parent f08048e9
...@@ -665,69 +665,74 @@ struct ata_port { ...@@ -665,69 +665,74 @@ struct ata_port {
}; };
struct ata_port_operations { struct ata_port_operations {
void (*dev_config) (struct ata_device *); /*
* Command execution
*/
int (*qc_defer)(struct ata_queued_cmd *qc);
int (*check_atapi_dma)(struct ata_queued_cmd *qc);
void (*qc_prep)(struct ata_queued_cmd *qc);
unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
void (*set_piomode) (struct ata_port *, struct ata_device *); /*
void (*set_dmamode) (struct ata_port *, struct ata_device *); * Configuration and exception handling
unsigned long (*mode_filter) (struct ata_device *, unsigned long); */
int (*cable_detect)(struct ata_port *ap);
unsigned long (*mode_filter)(struct ata_device *dev, unsigned long xfer_mask);
void (*set_piomode)(struct ata_port *ap, struct ata_device *dev);
void (*set_dmamode)(struct ata_port *ap, struct ata_device *dev);
int (*set_mode)(struct ata_link *link, struct ata_device **r_failed_dev);
void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); void (*dev_config)(struct ata_device *dev);
void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf); void (*freeze)(struct ata_port *ap);
void (*thaw)(struct ata_port *ap);
void (*error_handler)(struct ata_port *ap);
void (*post_internal_cmd)(struct ata_queued_cmd *qc);
/*
* Optional features
*/
int (*scr_read)(struct ata_port *ap, unsigned int sc_reg, u32 *val);
int (*scr_write)(struct ata_port *ap, unsigned int sc_reg, u32 val);
void (*pmp_attach)(struct ata_port *ap);
void (*pmp_detach)(struct ata_port *ap);
int (*enable_pm)(struct ata_port *ap, enum link_pm policy);
void (*disable_pm)(struct ata_port *ap);
/*
* Start, stop, suspend and resume
*/
int (*port_suspend)(struct ata_port *ap, pm_message_t mesg);
int (*port_resume)(struct ata_port *ap);
int (*port_start)(struct ata_port *ap);
void (*port_stop)(struct ata_port *ap);
void (*host_stop)(struct ata_host *host);
/*
* SFF / taskfile oriented ops
*/
void (*dev_select)(struct ata_port *ap, unsigned int device);
u8 (*check_status)(struct ata_port *ap); u8 (*check_status)(struct ata_port *ap);
u8 (*check_altstatus)(struct ata_port *ap); u8 (*check_altstatus)(struct ata_port *ap);
void (*dev_select)(struct ata_port *ap, unsigned int device); void (*tf_load)(struct ata_port *ap, const struct ata_taskfile *tf);
void (*tf_read)(struct ata_port *ap, struct ata_taskfile *tf);
void (*phy_reset) (struct ata_port *ap); /* obsolete */ void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf);
int (*set_mode) (struct ata_link *link, struct ata_device **r_failed_dev); unsigned int (*data_xfer)(struct ata_device *dev, unsigned char *buf,
unsigned int buflen, int rw);
int (*cable_detect) (struct ata_port *ap); u8 (*irq_on)(struct ata_port *);
int (*check_atapi_dma) (struct ata_queued_cmd *qc); void (*irq_clear)(struct ata_port *);
void (*bmdma_setup)(struct ata_queued_cmd *qc);
void (*bmdma_setup) (struct ata_queued_cmd *qc); void (*bmdma_start)(struct ata_queued_cmd *qc);
void (*bmdma_start) (struct ata_queued_cmd *qc); void (*bmdma_stop)(struct ata_queued_cmd *qc);
u8 (*bmdma_status)(struct ata_port *ap);
unsigned int (*data_xfer) (struct ata_device *dev, unsigned char *buf,
unsigned int buflen, int rw); /*
* Obsolete
int (*qc_defer) (struct ata_queued_cmd *qc);
void (*qc_prep) (struct ata_queued_cmd *qc);
unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
/* port multiplier */
void (*pmp_attach) (struct ata_port *ap);
void (*pmp_detach) (struct ata_port *ap);
/* Error handlers. ->error_handler overrides ->eng_timeout and
* indicates that new-style EH is in place.
*/ */
void (*eng_timeout) (struct ata_port *ap); /* obsolete */ void (*phy_reset)(struct ata_port *ap);
void (*eng_timeout)(struct ata_port *ap);
void (*freeze) (struct ata_port *ap);
void (*thaw) (struct ata_port *ap);
void (*error_handler) (struct ata_port *ap);
void (*post_internal_cmd) (struct ata_queued_cmd *qc);
irq_handler_t irq_handler; irq_handler_t irq_handler;
void (*irq_clear) (struct ata_port *);
u8 (*irq_on) (struct ata_port *);
int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
int (*port_resume) (struct ata_port *ap);
int (*enable_pm) (struct ata_port *ap, enum link_pm policy);
void (*disable_pm) (struct ata_port *ap);
int (*port_start) (struct ata_port *ap);
void (*port_stop) (struct ata_port *ap);
void (*host_stop) (struct ata_host *host);
void (*bmdma_stop) (struct ata_queued_cmd *qc);
u8 (*bmdma_status) (struct ata_port *ap);
}; };
struct ata_port_info { struct ata_port_info {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment