From: Tejun Heo <htejun@gmail.com>
To: jeff@garzik.org, linux-ide@vger.kernel.org, liml@rtr.ca,
alan@lxorguk.ukuu.org.uk, kngregertsen@norway.atmel.com,
sonic.adi@gmail.com, rmk@arm.linux.org.uk,
alessandro.zummo@towertech
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 1/9] libata: reorganize ata_port_operations
Date: Tue, 11 Mar 2008 21:05:57 +0900 [thread overview]
Message-ID: <12052371651890-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <12052371651181-git-send-email-htejun@gmail.com>
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>
---
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 0fef10e..90ecec8 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -663,69 +663,74 @@ struct ata_port {
};
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 *);
- unsigned long (*mode_filter) (struct ata_device *, unsigned long);
+ /*
+ * Configuration and exception handling
+ */
+ 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 (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
+ void (*dev_config)(struct ata_device *dev);
- 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_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);
-
- 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 (*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 (*eng_timeout) (struct ata_port *ap); /* obsolete */
-
- 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);
-
+ void (*phy_reset)(struct ata_port *ap);
+ void (*eng_timeout)(struct ata_port *ap);
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 {
--
1.5.2.4
next prev parent reply other threads:[~2008-03-11 12:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 12:05 [PATCHSET] libata: clean up scsi_host_templates and ata_port_operations, take #3 Tejun Heo
2008-03-11 12:05 ` Tejun Heo [this message]
2008-03-11 12:05 ` [PATCH 2/9] libata: implement and use ata_noop_irq_clear() Tejun Heo
2008-03-11 12:05 ` [PATCH 3/9] libata: normalize port_info, port_operations and sht tables Tejun Heo
2008-03-11 12:06 ` [PATCH 4/9] libata: implement and use SHT initializers Tejun Heo
2008-03-11 12:06 ` [PATCH 5/9] libata: implement and use ops inheritance Tejun Heo
2008-03-11 12:06 ` [PATCH 6/9] libata: make ata_pci_init_one() not use ops->irq_handler and pi->sht Tejun Heo
2008-03-11 12:06 ` [PATCH 7/9] libata: stop overloading port_info->private_data Tejun Heo
2008-03-11 12:06 ` [PATCH 8/9] libata: kill port_info->sht and ->irq_handler Tejun Heo
2008-03-11 12:06 ` [PATCH 9/9] libata: make reset related methods proper port operations Tejun Heo
2008-03-11 15:09 ` [PATCHSET] libata: clean up scsi_host_templates and ata_port_operations, take #3 Mark Lord
2008-03-12 6:48 ` Tejun Heo
2008-03-17 12:28 ` Jeff Garzik
2008-03-19 5:43 ` Tejun Heo
2008-03-19 5:45 ` [PATCH] sata_promise: hardreset is broken Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12052371651890-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alessandro.zummo@towertech \
--cc=jeff@garzik.org \
--cc=kngregertsen@norway.atmel.com \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=sonic.adi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).