Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+61 −56
Original line number Diff line number Diff line
@@ -665,69 +665,74 @@ struct ata_port {
};

struct ata_port_operations {
	void (*dev_config) (struct ata_device *);

	void (*set_piomode) (struct ata_port *, struct ata_device *);
	void (*set_dmamode) (struct ata_port *, struct ata_device *);
	unsigned long (*mode_filter) (struct ata_device *, unsigned long);

	void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf);
	void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);

	void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf);
	u8   (*check_status)(struct ata_port *ap);
	u8   (*check_altstatus)(struct ata_port *ap);
	void (*dev_select)(struct ata_port *ap, unsigned int device);

	void (*phy_reset) (struct ata_port *ap); /* obsolete */
	int  (*set_mode) (struct ata_link *link, struct ata_device **r_failed_dev);

	int (*cable_detect) (struct ata_port *ap);

	int  (*check_atapi_dma) (struct ata_queued_cmd *qc);

	void (*bmdma_setup) (struct ata_queued_cmd *qc);
	void (*bmdma_start) (struct ata_queued_cmd *qc);

	unsigned int (*data_xfer) (struct ata_device *dev, unsigned char *buf,
				   unsigned int buflen, int rw);

	/*
	 * 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);

	/* 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.
	/*
	 * Configuration and exception handling
	 */
	void (*eng_timeout) (struct ata_port *ap); /* obsolete */
	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 (*dev_config)(struct ata_device *dev);

	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;
	void (*irq_clear) (struct ata_port *);
	u8 (*irq_on) (struct ata_port *);

	/*
	 * 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 (*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);

	/*
	 * SFF / taskfile oriented ops
	 */
	void (*dev_select)(struct ata_port *ap, unsigned int device);
	u8   (*check_status)(struct ata_port *ap);
	u8   (*check_altstatus)(struct ata_port *ap);
	void (*tf_load)(struct ata_port *ap, const struct ata_taskfile *tf);
	void (*tf_read)(struct ata_port *ap, struct ata_taskfile *tf);
	void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf);
	unsigned int (*data_xfer)(struct ata_device *dev, unsigned char *buf,
				  unsigned int buflen, int rw);
	u8   (*irq_on)(struct ata_port *);

	void (*irq_clear)(struct ata_port *);
	void (*bmdma_setup)(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);

	/*
	 * Obsolete
	 */
	void (*phy_reset)(struct ata_port *ap);
	void (*eng_timeout)(struct ata_port *ap);
	irq_handler_t irq_handler;
};

struct ata_port_info {