diff options
Diffstat (limited to 'include/linux/libata.h')
| -rw-r--r-- | include/linux/libata.h | 80 |
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 | ||
| 938 | extern void ata_port_probe(struct ata_port *); | ||
| 939 | extern int sata_set_spd(struct ata_link *link); | 931 | extern int sata_set_spd(struct ata_link *link); |
| 940 | extern int ata_std_prereset(struct ata_link *link, unsigned long deadline); | 932 | extern int ata_std_prereset(struct ata_link *link, unsigned long deadline); |
| 941 | extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, | 933 | extern 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, | |||
| 950 | extern int sata_std_hardreset(struct ata_link *link, unsigned int *class, | 942 | extern int sata_std_hardreset(struct ata_link *link, unsigned int *class, |
| 951 | unsigned long deadline); | 943 | unsigned long deadline); |
| 952 | extern void ata_std_postreset(struct ata_link *link, unsigned int *classes); | 944 | extern void ata_std_postreset(struct ata_link *link, unsigned int *classes); |
| 953 | extern void ata_port_disable(struct ata_port *); | ||
| 954 | 945 | ||
| 955 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); | 946 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); |
| 956 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, | 947 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, |
| @@ -1006,7 +997,6 @@ extern unsigned long ata_xfer_mode2mask(u8 xfer_mode); | |||
| 1006 | extern int ata_xfer_mode2shift(unsigned long xfer_mode); | 997 | extern int ata_xfer_mode2shift(unsigned long xfer_mode); |
| 1007 | extern const char *ata_mode_string(unsigned long xfer_mask); | 998 | extern const char *ata_mode_string(unsigned long xfer_mask); |
| 1008 | extern unsigned long ata_id_xfermask(const u16 *id); | 999 | extern unsigned long ata_id_xfermask(const u16 *id); |
| 1009 | extern int ata_port_start(struct ata_port *ap); | ||
| 1010 | extern int ata_std_qc_defer(struct ata_queued_cmd *qc); | 1000 | extern int ata_std_qc_defer(struct ata_queued_cmd *qc); |
| 1011 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); | 1001 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
| 1012 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 1002 | extern 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); | |||
| 1039 | extern int ata_cable_ignore(struct ata_port *ap); | 1029 | extern int ata_cable_ignore(struct ata_port *ap); |
| 1040 | extern int ata_cable_unknown(struct ata_port *ap); | 1030 | extern int ata_cable_unknown(struct ata_port *ap); |
| 1041 | 1031 | ||
| 1042 | extern void ata_pio_queue_task(struct ata_port *ap, void *data, | ||
| 1043 | unsigned long delay); | ||
| 1044 | |||
| 1045 | /* Timing helpers */ | 1032 | /* Timing helpers */ |
| 1046 | extern unsigned int ata_pio_need_iordy(const struct ata_device *); | 1033 | extern unsigned int ata_pio_need_iordy(const struct ata_device *); |
| 1047 | extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode); | 1034 | extern 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 | ||
| 1581 | extern void ata_sff_qc_prep(struct ata_queued_cmd *qc); | ||
| 1582 | extern void ata_sff_dumb_qc_prep(struct ata_queued_cmd *qc); | ||
| 1583 | extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); | 1572 | extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); |
| 1584 | extern u8 ata_sff_check_status(struct ata_port *ap); | 1573 | extern u8 ata_sff_check_status(struct ata_port *ap); |
| 1585 | extern void ata_sff_pause(struct ata_port *ap); | 1574 | extern 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); |
| 1598 | extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, | 1587 | extern 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); |
| 1600 | extern u8 ata_sff_irq_on(struct ata_port *ap); | 1589 | extern void ata_sff_irq_on(struct ata_port *ap); |
| 1601 | extern void ata_sff_irq_clear(struct ata_port *ap); | 1590 | extern void ata_sff_irq_clear(struct ata_port *ap); |
| 1602 | extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, | 1591 | extern 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); |
| 1593 | extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay); | ||
| 1604 | extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); | 1594 | extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); |
| 1605 | extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); | 1595 | extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); |
| 1606 | extern unsigned int ata_sff_host_intr(struct ata_port *ap, | 1596 | extern 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, | |||
| 1621 | extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); | 1611 | extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); |
| 1622 | extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); | 1612 | extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); |
| 1623 | extern void ata_sff_error_handler(struct ata_port *ap); | 1613 | extern void ata_sff_error_handler(struct ata_port *ap); |
| 1624 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); | ||
| 1625 | extern int ata_sff_port_start(struct ata_port *ap); | ||
| 1626 | extern int ata_sff_port_start32(struct ata_port *ap); | ||
| 1627 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); | 1614 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); |
| 1628 | extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, | ||
| 1629 | unsigned long xfer_mask); | ||
| 1630 | extern void ata_bmdma_setup(struct ata_queued_cmd *qc); | ||
| 1631 | extern void ata_bmdma_start(struct ata_queued_cmd *qc); | ||
| 1632 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | ||
| 1633 | extern u8 ata_bmdma_status(struct ata_port *ap); | ||
| 1634 | extern void ata_bus_reset(struct ata_port *ap); | ||
| 1635 | |||
| 1636 | #ifdef CONFIG_PCI | 1615 | #ifdef CONFIG_PCI |
| 1637 | extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); | ||
| 1638 | extern int ata_pci_bmdma_init(struct ata_host *host); | ||
| 1639 | extern int ata_pci_sff_init_host(struct ata_host *host); | 1616 | extern int ata_pci_sff_init_host(struct ata_host *host); |
| 1640 | extern int ata_pci_sff_prepare_host(struct pci_dev *pdev, | 1617 | extern 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 | ||
| 1628 | extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc); | ||
| 1629 | extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc); | ||
| 1630 | extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc); | ||
| 1631 | extern void ata_bmdma_error_handler(struct ata_port *ap); | ||
| 1632 | extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc); | ||
| 1633 | extern void ata_bmdma_setup(struct ata_queued_cmd *qc); | ||
| 1634 | extern void ata_bmdma_start(struct ata_queued_cmd *qc); | ||
| 1635 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | ||
| 1636 | extern u8 ata_bmdma_status(struct ata_port *ap); | ||
| 1637 | extern int ata_bmdma_port_start(struct ata_port *ap); | ||
| 1638 | extern int ata_bmdma_port_start32(struct ata_port *ap); | ||
| 1639 | |||
| 1640 | #ifdef CONFIG_PCI | ||
| 1641 | extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); | ||
| 1642 | extern 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. |
