diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-03-11 19:21:17 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-11 19:21:17 -0500 |
commit | ce1e7a2ac721eb9d825b63f74752d0c9e0c635c2 (patch) | |
tree | a7c0d18d6486734dffb9498e30db5b226b6e23bf /include/linux/libata.h | |
parent | c2956a3b0d1c17b38da369811a6ce93eb7a01a04 (diff) | |
parent | 75deb6fa985bd3162b9472f1fc394e23294da816 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 2558abac9fb2..d051a823758b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -152,7 +152,7 @@ enum { | |||
152 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ | 152 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ |
153 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ | 153 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ |
154 | 154 | ||
155 | ATA_FLAG_FLUSH_PIO_TASK = (1 << 15), /* Flush PIO task */ | 155 | ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ |
156 | ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ | 156 | ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ |
157 | 157 | ||
158 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 158 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ |
@@ -191,11 +191,19 @@ enum { | |||
191 | PORT_DISABLED = 2, | 191 | PORT_DISABLED = 2, |
192 | 192 | ||
193 | /* encoding various smaller bitmaps into a single | 193 | /* encoding various smaller bitmaps into a single |
194 | * unsigned long bitmap | 194 | * unsigned int bitmap |
195 | */ | 195 | */ |
196 | ATA_SHIFT_UDMA = 0, | 196 | ATA_BITS_PIO = 5, |
197 | ATA_SHIFT_MWDMA = 8, | 197 | ATA_BITS_MWDMA = 3, |
198 | ATA_SHIFT_PIO = 11, | 198 | ATA_BITS_UDMA = 8, |
199 | |||
200 | ATA_SHIFT_PIO = 0, | ||
201 | ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_BITS_PIO, | ||
202 | ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_BITS_MWDMA, | ||
203 | |||
204 | ATA_MASK_PIO = ((1 << ATA_BITS_PIO) - 1) << ATA_SHIFT_PIO, | ||
205 | ATA_MASK_MWDMA = ((1 << ATA_BITS_MWDMA) - 1) << ATA_SHIFT_MWDMA, | ||
206 | ATA_MASK_UDMA = ((1 << ATA_BITS_UDMA) - 1) << ATA_SHIFT_UDMA, | ||
199 | 207 | ||
200 | /* size of buffer to pad xfers ending on unaligned boundaries */ | 208 | /* size of buffer to pad xfers ending on unaligned boundaries */ |
201 | ATA_DMA_PAD_SZ = 4, | 209 | ATA_DMA_PAD_SZ = 4, |
@@ -344,7 +352,7 @@ struct ata_device { | |||
344 | unsigned long flags; /* ATA_DFLAG_xxx */ | 352 | unsigned long flags; /* ATA_DFLAG_xxx */ |
345 | unsigned int class; /* ATA_DEV_xxx */ | 353 | unsigned int class; /* ATA_DEV_xxx */ |
346 | unsigned int devno; /* 0 or 1 */ | 354 | unsigned int devno; /* 0 or 1 */ |
347 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 355 | u16 *id; /* IDENTIFY xxx DEVICE data */ |
348 | u8 pio_mode; | 356 | u8 pio_mode; |
349 | u8 dma_mode; | 357 | u8 dma_mode; |
350 | u8 xfer_mode; | 358 | u8 xfer_mode; |
@@ -393,7 +401,8 @@ struct ata_port { | |||
393 | struct ata_host_stats stats; | 401 | struct ata_host_stats stats; |
394 | struct ata_host_set *host_set; | 402 | struct ata_host_set *host_set; |
395 | 403 | ||
396 | struct work_struct pio_task; | 404 | struct work_struct port_task; |
405 | |||
397 | unsigned int hsm_task_state; | 406 | unsigned int hsm_task_state; |
398 | unsigned long pio_task_timeout; | 407 | unsigned long pio_task_timeout; |
399 | 408 | ||
@@ -488,6 +497,8 @@ extern int ata_std_softreset(struct ata_port *ap, int verbose, | |||
488 | extern int sata_std_hardreset(struct ata_port *ap, int verbose, | 497 | extern int sata_std_hardreset(struct ata_port *ap, int verbose, |
489 | unsigned int *class); | 498 | unsigned int *class); |
490 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); | 499 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); |
500 | extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, | ||
501 | int post_reset); | ||
491 | extern void ata_port_disable(struct ata_port *); | 502 | extern void ata_port_disable(struct ata_port *); |
492 | extern void ata_std_ports(struct ata_ioports *ioaddr); | 503 | extern void ata_std_ports(struct ata_ioports *ioaddr); |
493 | #ifdef CONFIG_PCI | 504 | #ifdef CONFIG_PCI |
@@ -516,6 +527,8 @@ extern int ata_ratelimit(void); | |||
516 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 527 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
517 | unsigned long timeout_pat, | 528 | unsigned long timeout_pat, |
518 | unsigned long timeout); | 529 | unsigned long timeout); |
530 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), | ||
531 | void *data, unsigned long delay); | ||
519 | 532 | ||
520 | /* | 533 | /* |
521 | * Default driver ops implementations | 534 | * Default driver ops implementations |
@@ -545,7 +558,6 @@ extern void ata_id_string(const u16 *id, unsigned char *s, | |||
545 | unsigned int ofs, unsigned int len); | 558 | unsigned int ofs, unsigned int len); |
546 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 559 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
547 | unsigned int ofs, unsigned int len); | 560 | unsigned int ofs, unsigned int len); |
548 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | ||
549 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 561 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
550 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 562 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
551 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 563 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
@@ -648,10 +660,14 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
648 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 660 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
649 | } | 661 | } |
650 | 662 | ||
663 | static inline unsigned int ata_class_present(unsigned int class) | ||
664 | { | ||
665 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | ||
666 | } | ||
667 | |||
651 | static inline unsigned int ata_dev_present(const struct ata_device *dev) | 668 | static inline unsigned int ata_dev_present(const struct ata_device *dev) |
652 | { | 669 | { |
653 | return ((dev->class == ATA_DEV_ATA) || | 670 | return ata_class_present(dev->class); |
654 | (dev->class == ATA_DEV_ATAPI)); | ||
655 | } | 671 | } |
656 | 672 | ||
657 | static inline u8 ata_chk_status(struct ata_port *ap) | 673 | static inline u8 ata_chk_status(struct ata_port *ap) |