aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:27:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:27:37 -0400
commitbd7fc2f2d807fdb254f7efc542f8eec3f23e289e (patch)
treead84372329bd86eceb36aafed80cfb8a8420c063 /include/linux/libata.h
parentf39d01be4c59a61a08d0cb53f615e7016b85d339 (diff)
parent360ff7833098e944e5003618b03894251e937802 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (49 commits) libata-sff: separate out BMDMA qc_issue libata-sff: prd is BMDMA specific libata-sff: ata_sff_[dumb_]qc_prep are BMDMA specific libata-sff: separate out BMDMA EH libata-sff: port_task is SFF specific libata-sff: ap->[last_]ctl are SFF specific libata-sff: rename ap->ops->drain_fifo() to sff_drain_fifo() libata-sff: introduce ata_sff_init/exit() and ata_sff_port_init() libata-sff: clean up BMDMA initialization libata-sff: clean up inheritance in several drivers libata-sff: reorder SFF/BMDMA functions sata_inic162x: kill PORT_PRD_ADDR initialization libata: kill ATA_FLAG_DISABLED libata-sff: kill unused prototype and make ata_dev_select() static libata-sff: update bmdma host bus error handling sata_mv: remove unnecessary initialization sata_inic162x: inic162x is not dependent on CONFIG_ATA_SFF pata_sch: use ata_pci_sff_init_one() pata_sil680: Do our own exec_command posting libata: Remove excess delay in the tf_load path ...
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h80
1 files changed, 37 insertions, 43 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b2f2003b92e5..ee84e7e12039 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -202,12 +202,6 @@ enum {
202 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity 202 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
203 * led */ 203 * led */
204 204
205 /* The following flag belongs to ap->pflags but is kept in
206 * ap->flags because it's referenced in many LLDs and will be
207 * removed in not-too-distant future.
208 */
209 ATA_FLAG_DISABLED = (1 << 23), /* port is disabled, ignore it */
210
211 /* bits 24:31 of ap->flags are reserved for LLD specific flags */ 205 /* bits 24:31 of ap->flags are reserved for LLD specific flags */
212 206
213 207
@@ -256,12 +250,13 @@ enum {
256 ATA_TMOUT_INTERNAL_QUICK = 5000, 250 ATA_TMOUT_INTERNAL_QUICK = 5000,
257 ATA_TMOUT_MAX_PARK = 30000, 251 ATA_TMOUT_MAX_PARK = 30000,
258 252
259 /* FIXME: GoVault needs 2s but we can't afford that without 253 /*
260 * parallel probing. 800ms is enough for iVDR disk 254 * GoVault needs 2s and iVDR disk HHD424020F7SV00 800ms. 2s
261 * HHD424020F7SV00. Increase to 2secs when parallel probing 255 * is too much without parallel probing. Use 2s if parallel
262 * is in place. 256 * probing is available, 800ms otherwise.
263 */ 257 */
264 ATA_TMOUT_FF_WAIT = 800, 258 ATA_TMOUT_FF_WAIT_LONG = 2000,
259 ATA_TMOUT_FF_WAIT = 800,
265 260
266 /* Spec mandates to wait for ">= 2ms" before checking status 261 /* Spec mandates to wait for ">= 2ms" before checking status
267 * after reset. We wait 150ms, because that was the magic 262 * after reset. We wait 150ms, because that was the magic
@@ -721,15 +716,15 @@ struct ata_port {
721 unsigned int print_id; /* user visible unique port ID */ 716 unsigned int print_id; /* user visible unique port ID */
722 unsigned int port_no; /* 0 based port no. inside the host */ 717 unsigned int port_no; /* 0 based port no. inside the host */
723 718
724 struct ata_prd *prd; /* our SG list */
725 dma_addr_t prd_dma; /* and its DMA mapping */
726
727#ifdef CONFIG_ATA_SFF 719#ifdef CONFIG_ATA_SFF
728 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ 720 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
729#endif /* CONFIG_ATA_SFF */
730
731 u8 ctl; /* cache of ATA control register */ 721 u8 ctl; /* cache of ATA control register */
732 u8 last_ctl; /* Cache last written value */ 722 u8 last_ctl; /* Cache last written value */
723 struct delayed_work sff_pio_task;
724 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */
725 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */
726#endif /* CONFIG_ATA_SFF */
727
733 unsigned int pio_mask; 728 unsigned int pio_mask;
734 unsigned int mwdma_mask; 729 unsigned int mwdma_mask;
735 unsigned int udma_mask; 730 unsigned int udma_mask;
@@ -751,8 +746,6 @@ struct ata_port {
751 struct ata_host *host; 746 struct ata_host *host;
752 struct device *dev; 747 struct device *dev;
753 748
754 void *port_task_data;
755 struct delayed_work port_task;
756 struct delayed_work hotplug_task; 749 struct delayed_work hotplug_task;
757 struct work_struct scsi_rescan_task; 750 struct work_struct scsi_rescan_task;
758 751
@@ -849,6 +842,7 @@ struct ata_port_operations {
849 * SFF / taskfile oriented ops 842 * SFF / taskfile oriented ops
850 */ 843 */
851 void (*sff_dev_select)(struct ata_port *ap, unsigned int device); 844 void (*sff_dev_select)(struct ata_port *ap, unsigned int device);
845 void (*sff_set_devctl)(struct ata_port *ap, u8 ctl);
852 u8 (*sff_check_status)(struct ata_port *ap); 846 u8 (*sff_check_status)(struct ata_port *ap);
853 u8 (*sff_check_altstatus)(struct ata_port *ap); 847 u8 (*sff_check_altstatus)(struct ata_port *ap);
854 void (*sff_tf_load)(struct ata_port *ap, const struct ata_taskfile *tf); 848 void (*sff_tf_load)(struct ata_port *ap, const struct ata_taskfile *tf);
@@ -857,16 +851,15 @@ struct ata_port_operations {
857 const struct ata_taskfile *tf); 851 const struct ata_taskfile *tf);
858 unsigned int (*sff_data_xfer)(struct ata_device *dev, 852 unsigned int (*sff_data_xfer)(struct ata_device *dev,
859 unsigned char *buf, unsigned int buflen, int rw); 853 unsigned char *buf, unsigned int buflen, int rw);
860 u8 (*sff_irq_on)(struct ata_port *); 854 void (*sff_irq_on)(struct ata_port *);
861 bool (*sff_irq_check)(struct ata_port *); 855 bool (*sff_irq_check)(struct ata_port *);
862 void (*sff_irq_clear)(struct ata_port *); 856 void (*sff_irq_clear)(struct ata_port *);
857 void (*sff_drain_fifo)(struct ata_queued_cmd *qc);
863 858
864 void (*bmdma_setup)(struct ata_queued_cmd *qc); 859 void (*bmdma_setup)(struct ata_queued_cmd *qc);
865 void (*bmdma_start)(struct ata_queued_cmd *qc); 860 void (*bmdma_start)(struct ata_queued_cmd *qc);
866 void (*bmdma_stop)(struct ata_queued_cmd *qc); 861 void (*bmdma_stop)(struct ata_queued_cmd *qc);
867 u8 (*bmdma_status)(struct ata_port *ap); 862 u8 (*bmdma_status)(struct ata_port *ap);
868
869 void (*drain_fifo)(struct ata_queued_cmd *qc);
870#endif /* CONFIG_ATA_SFF */ 863#endif /* CONFIG_ATA_SFF */
871 864
872 ssize_t (*em_show)(struct ata_port *ap, char *buf); 865 ssize_t (*em_show)(struct ata_port *ap, char *buf);
@@ -935,7 +928,6 @@ static inline int ata_port_is_dummy(struct ata_port *ap)
935 return ap->ops == &ata_dummy_port_ops; 928 return ap->ops == &ata_dummy_port_ops;
936} 929}
937 930
938extern void ata_port_probe(struct ata_port *);
939extern int sata_set_spd(struct ata_link *link); 931extern int sata_set_spd(struct ata_link *link);
940extern int ata_std_prereset(struct ata_link *link, unsigned long deadline); 932extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
941extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, 933extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
@@ -950,7 +942,6 @@ extern int sata_link_hardreset(struct ata_link *link,
950extern int sata_std_hardreset(struct ata_link *link, unsigned int *class, 942extern int sata_std_hardreset(struct ata_link *link, unsigned int *class,
951 unsigned long deadline); 943 unsigned long deadline);
952extern void ata_std_postreset(struct ata_link *link, unsigned int *classes); 944extern void ata_std_postreset(struct ata_link *link, unsigned int *classes);
953extern void ata_port_disable(struct ata_port *);
954 945
955extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); 946extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports);
956extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, 947extern struct ata_host *ata_host_alloc_pinfo(struct device *dev,
@@ -1006,7 +997,6 @@ extern unsigned long ata_xfer_mode2mask(u8 xfer_mode);
1006extern int ata_xfer_mode2shift(unsigned long xfer_mode); 997extern int ata_xfer_mode2shift(unsigned long xfer_mode);
1007extern const char *ata_mode_string(unsigned long xfer_mask); 998extern const char *ata_mode_string(unsigned long xfer_mask);
1008extern unsigned long ata_id_xfermask(const u16 *id); 999extern unsigned long ata_id_xfermask(const u16 *id);
1009extern int ata_port_start(struct ata_port *ap);
1010extern int ata_std_qc_defer(struct ata_queued_cmd *qc); 1000extern int ata_std_qc_defer(struct ata_queued_cmd *qc);
1011extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 1001extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
1012extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 1002extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
@@ -1039,9 +1029,6 @@ extern int ata_cable_sata(struct ata_port *ap);
1039extern int ata_cable_ignore(struct ata_port *ap); 1029extern int ata_cable_ignore(struct ata_port *ap);
1040extern int ata_cable_unknown(struct ata_port *ap); 1030extern int ata_cable_unknown(struct ata_port *ap);
1041 1031
1042extern void ata_pio_queue_task(struct ata_port *ap, void *data,
1043 unsigned long delay);
1044
1045/* Timing helpers */ 1032/* Timing helpers */
1046extern unsigned int ata_pio_need_iordy(const struct ata_device *); 1033extern unsigned int ata_pio_need_iordy(const struct ata_device *);
1047extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode); 1034extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode);
@@ -1443,7 +1430,11 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
1443{ 1430{
1444 memset(tf, 0, sizeof(*tf)); 1431 memset(tf, 0, sizeof(*tf));
1445 1432
1433#ifdef CONFIG_ATA_SFF
1446 tf->ctl = dev->link->ap->ctl; 1434 tf->ctl = dev->link->ap->ctl;
1435#else
1436 tf->ctl = ATA_DEVCTL_OBS;
1437#endif
1447 if (dev->devno == 0) 1438 if (dev->devno == 0)
1448 tf->device = ATA_DEVICE_OBS; 1439 tf->device = ATA_DEVICE_OBS;
1449 else 1440 else
@@ -1578,8 +1569,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops;
1578 .sg_tablesize = LIBATA_MAX_PRD, \ 1569 .sg_tablesize = LIBATA_MAX_PRD, \
1579 .dma_boundary = ATA_DMA_BOUNDARY 1570 .dma_boundary = ATA_DMA_BOUNDARY
1580 1571
1581extern void ata_sff_qc_prep(struct ata_queued_cmd *qc);
1582extern void ata_sff_dumb_qc_prep(struct ata_queued_cmd *qc);
1583extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); 1572extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
1584extern u8 ata_sff_check_status(struct ata_port *ap); 1573extern u8 ata_sff_check_status(struct ata_port *ap);
1585extern void ata_sff_pause(struct ata_port *ap); 1574extern void ata_sff_pause(struct ata_port *ap);
@@ -1597,10 +1586,11 @@ extern unsigned int ata_sff_data_xfer32(struct ata_device *dev,
1597 unsigned char *buf, unsigned int buflen, int rw); 1586 unsigned char *buf, unsigned int buflen, int rw);
1598extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, 1587extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev,
1599 unsigned char *buf, unsigned int buflen, int rw); 1588 unsigned char *buf, unsigned int buflen, int rw);
1600extern u8 ata_sff_irq_on(struct ata_port *ap); 1589extern void ata_sff_irq_on(struct ata_port *ap);
1601extern void ata_sff_irq_clear(struct ata_port *ap); 1590extern void ata_sff_irq_clear(struct ata_port *ap);
1602extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, 1591extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
1603 u8 status, int in_wq); 1592 u8 status, int in_wq);
1593extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay);
1604extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); 1594extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
1605extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); 1595extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
1606extern unsigned int ata_sff_host_intr(struct ata_port *ap, 1596extern unsigned int ata_sff_host_intr(struct ata_port *ap,
@@ -1621,21 +1611,8 @@ extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class,
1621extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); 1611extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes);
1622extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); 1612extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc);
1623extern void ata_sff_error_handler(struct ata_port *ap); 1613extern void ata_sff_error_handler(struct ata_port *ap);
1624extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc);
1625extern int ata_sff_port_start(struct ata_port *ap);
1626extern int ata_sff_port_start32(struct ata_port *ap);
1627extern void ata_sff_std_ports(struct ata_ioports *ioaddr); 1614extern void ata_sff_std_ports(struct ata_ioports *ioaddr);
1628extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev,
1629 unsigned long xfer_mask);
1630extern void ata_bmdma_setup(struct ata_queued_cmd *qc);
1631extern void ata_bmdma_start(struct ata_queued_cmd *qc);
1632extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
1633extern u8 ata_bmdma_status(struct ata_port *ap);
1634extern void ata_bus_reset(struct ata_port *ap);
1635
1636#ifdef CONFIG_PCI 1615#ifdef CONFIG_PCI
1637extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
1638extern int ata_pci_bmdma_init(struct ata_host *host);
1639extern int ata_pci_sff_init_host(struct ata_host *host); 1616extern int ata_pci_sff_init_host(struct ata_host *host);
1640extern int ata_pci_sff_prepare_host(struct pci_dev *pdev, 1617extern int ata_pci_sff_prepare_host(struct pci_dev *pdev,
1641 const struct ata_port_info * const * ppi, 1618 const struct ata_port_info * const * ppi,
@@ -1648,6 +1625,23 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev,
1648 struct scsi_host_template *sht, void *host_priv, int hflags); 1625 struct scsi_host_template *sht, void *host_priv, int hflags);
1649#endif /* CONFIG_PCI */ 1626#endif /* CONFIG_PCI */
1650 1627
1628extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
1629extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
1630extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
1631extern void ata_bmdma_error_handler(struct ata_port *ap);
1632extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
1633extern void ata_bmdma_setup(struct ata_queued_cmd *qc);
1634extern void ata_bmdma_start(struct ata_queued_cmd *qc);
1635extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
1636extern u8 ata_bmdma_status(struct ata_port *ap);
1637extern int ata_bmdma_port_start(struct ata_port *ap);
1638extern int ata_bmdma_port_start32(struct ata_port *ap);
1639
1640#ifdef CONFIG_PCI
1641extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
1642extern void ata_pci_bmdma_init(struct ata_host *host);
1643#endif /* CONFIG_PCI */
1644
1651/** 1645/**
1652 * ata_sff_busy_wait - Wait for a port status register 1646 * ata_sff_busy_wait - Wait for a port status register
1653 * @ap: Port to wait for. 1647 * @ap: Port to wait for.