aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5d87bc09a1f5..3d501db36a26 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -209,6 +209,7 @@ enum {
209 209
210 /* bits 24:31 of ap->flags are reserved for LLD specific flags */ 210 /* bits 24:31 of ap->flags are reserved for LLD specific flags */
211 211
212
212 /* struct ata_port pflags */ 213 /* struct ata_port pflags */
213 ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */ 214 ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */
214 ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */ 215 ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */
@@ -225,6 +226,9 @@ enum {
225 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ 226 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
226 ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */ 227 ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */
227 228
229 ATA_PFLAG_PIO32 = (1 << 20), /* 32bit PIO */
230 ATA_PFLAG_PIO32CHANGE = (1 << 21), /* 32bit PIO can be turned on/off */
231
228 /* struct ata_queued_cmd flags */ 232 /* struct ata_queued_cmd flags */
229 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 233 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
230 ATA_QCFLAG_DMAMAP = (1 << 1), /* SG table is DMA mapped */ 234 ATA_QCFLAG_DMAMAP = (1 << 1), /* SG table is DMA mapped */
@@ -275,7 +279,7 @@ enum {
275 * advised to wait only for the following duration before 279 * advised to wait only for the following duration before
276 * doing SRST. 280 * doing SRST.
277 */ 281 */
278 ATA_TMOUT_PMP_SRST_WAIT = 1000, 282 ATA_TMOUT_PMP_SRST_WAIT = 5000,
279 283
280 /* ATA bus states */ 284 /* ATA bus states */
281 BUS_UNKNOWN = 0, 285 BUS_UNKNOWN = 0,
@@ -379,7 +383,7 @@ enum {
379 ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */ 383 ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */
380 ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands 384 ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands
381 not multiple of 16 bytes */ 385 not multiple of 16 bytes */
382 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firwmare update warning */ 386 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */
383 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ 387 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
384 388
385 /* DMA mask for user DMA control: User visible values; DO NOT 389 /* DMA mask for user DMA control: User visible values; DO NOT
@@ -530,6 +534,7 @@ struct ata_queued_cmd {
530 unsigned long flags; /* ATA_QCFLAG_xxx */ 534 unsigned long flags; /* ATA_QCFLAG_xxx */
531 unsigned int tag; 535 unsigned int tag;
532 unsigned int n_elem; 536 unsigned int n_elem;
537 unsigned int orig_n_elem;
533 538
534 int dma_dir; 539 int dma_dir;
535 540
@@ -688,7 +693,10 @@ struct ata_port {
688 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ 693 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
689 struct ata_port_operations *ops; 694 struct ata_port_operations *ops;
690 spinlock_t *lock; 695 spinlock_t *lock;
696 /* Flags owned by the EH context. Only EH should touch these once the
697 port is active */
691 unsigned long flags; /* ATA_FLAG_xxx */ 698 unsigned long flags; /* ATA_FLAG_xxx */
699 /* Flags that change dynamically, protected by ap->lock */
692 unsigned int pflags; /* ATA_PFLAG_xxx */ 700 unsigned int pflags; /* ATA_PFLAG_xxx */
693 unsigned int print_id; /* user visible unique port ID */ 701 unsigned int print_id; /* user visible unique port ID */
694 unsigned int port_no; /* 0 based port no. inside the host */ 702 unsigned int port_no; /* 0 based port no. inside the host */
@@ -750,7 +758,8 @@ struct ata_port {
750 acpi_handle acpi_handle; 758 acpi_handle acpi_handle;
751 struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ 759 struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
752#endif 760#endif
753 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 761 /* owned by EH */
762 u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned;
754}; 763};
755 764
756/* The following initializer overrides a method to NULL whether one of 765/* The following initializer overrides a method to NULL whether one of
@@ -793,6 +802,7 @@ struct ata_port_operations {
793 ata_reset_fn_t pmp_hardreset; 802 ata_reset_fn_t pmp_hardreset;
794 ata_postreset_fn_t pmp_postreset; 803 ata_postreset_fn_t pmp_postreset;
795 void (*error_handler)(struct ata_port *ap); 804 void (*error_handler)(struct ata_port *ap);
805 void (*lost_interrupt)(struct ata_port *ap);
796 void (*post_internal_cmd)(struct ata_queued_cmd *qc); 806 void (*post_internal_cmd)(struct ata_queued_cmd *qc);
797 807
798 /* 808 /*
@@ -834,6 +844,8 @@ struct ata_port_operations {
834 void (*bmdma_start)(struct ata_queued_cmd *qc); 844 void (*bmdma_start)(struct ata_queued_cmd *qc);
835 void (*bmdma_stop)(struct ata_queued_cmd *qc); 845 void (*bmdma_stop)(struct ata_queued_cmd *qc);
836 u8 (*bmdma_status)(struct ata_port *ap); 846 u8 (*bmdma_status)(struct ata_port *ap);
847
848 void (*drain_fifo)(struct ata_queued_cmd *qc);
837#endif /* CONFIG_ATA_SFF */ 849#endif /* CONFIG_ATA_SFF */
838 850
839 ssize_t (*em_show)(struct ata_port *ap, char *buf); 851 ssize_t (*em_show)(struct ata_port *ap, char *buf);
@@ -1006,6 +1018,9 @@ extern int ata_cable_sata(struct ata_port *ap);
1006extern int ata_cable_ignore(struct ata_port *ap); 1018extern int ata_cable_ignore(struct ata_port *ap);
1007extern int ata_cable_unknown(struct ata_port *ap); 1019extern int ata_cable_unknown(struct ata_port *ap);
1008 1020
1021extern void ata_pio_queue_task(struct ata_port *ap, void *data,
1022 unsigned long delay);
1023
1009/* Timing helpers */ 1024/* Timing helpers */
1010extern unsigned int ata_pio_need_iordy(const struct ata_device *); 1025extern unsigned int ata_pio_need_iordy(const struct ata_device *);
1011extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode); 1026extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode);
@@ -1570,6 +1585,7 @@ extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
1570extern unsigned int ata_sff_host_intr(struct ata_port *ap, 1585extern unsigned int ata_sff_host_intr(struct ata_port *ap,
1571 struct ata_queued_cmd *qc); 1586 struct ata_queued_cmd *qc);
1572extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance); 1587extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance);
1588extern void ata_sff_lost_interrupt(struct ata_port *ap);
1573extern void ata_sff_freeze(struct ata_port *ap); 1589extern void ata_sff_freeze(struct ata_port *ap);
1574extern void ata_sff_thaw(struct ata_port *ap); 1590extern void ata_sff_thaw(struct ata_port *ap);
1575extern int ata_sff_prereset(struct ata_link *link, unsigned long deadline); 1591extern int ata_sff_prereset(struct ata_link *link, unsigned long deadline);
@@ -1582,9 +1598,11 @@ extern int ata_sff_softreset(struct ata_link *link, unsigned int *classes,
1582extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class, 1598extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class,
1583 unsigned long deadline); 1599 unsigned long deadline);
1584extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); 1600extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes);
1601extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc);
1585extern void ata_sff_error_handler(struct ata_port *ap); 1602extern void ata_sff_error_handler(struct ata_port *ap);
1586extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); 1603extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc);
1587extern int ata_sff_port_start(struct ata_port *ap); 1604extern int ata_sff_port_start(struct ata_port *ap);
1605extern int ata_sff_port_start32(struct ata_port *ap);
1588extern void ata_sff_std_ports(struct ata_ioports *ioaddr); 1606extern void ata_sff_std_ports(struct ata_ioports *ioaddr);
1589extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, 1607extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev,
1590 unsigned long xfer_mask); 1608 unsigned long xfer_mask);