diff options
Diffstat (limited to 'include/linux/libata.h')
| -rw-r--r-- | include/linux/libata.h | 35 | 
1 files changed, 25 insertions, 10 deletions
| diff --git a/include/linux/libata.h b/include/linux/libata.h index 41ea7dbc1755..9e5db2949c58 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -124,18 +124,25 @@ enum { | |||
| 124 | ATA_FLAG_DEBUGMSG = (1 << 10), | 124 | ATA_FLAG_DEBUGMSG = (1 << 10), | 
| 125 | ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ | 125 | ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ | 
| 126 | 126 | ||
| 127 | ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */ | ||
| 128 | |||
| 129 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ | ||
| 130 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ | ||
| 131 | |||
| 127 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 132 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 
| 128 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ | 133 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ | 
| 129 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ | 134 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ | 
| 130 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, | 135 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, | 
| 131 | 136 | ||
| 132 | /* various lengths of time */ | 137 | /* various lengths of time */ | 
| 133 | ATA_TMOUT_EDD = 5 * HZ, /* hueristic */ | 138 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ | 
| 134 | ATA_TMOUT_PIO = 30 * HZ, | 139 | ATA_TMOUT_PIO = 30 * HZ, | 
| 135 | ATA_TMOUT_BOOT = 30 * HZ, /* hueristic */ | 140 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 
| 136 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* hueristic */ | 141 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 
| 137 | ATA_TMOUT_CDB = 30 * HZ, | 142 | ATA_TMOUT_CDB = 30 * HZ, | 
| 138 | ATA_TMOUT_CDB_QUICK = 5 * HZ, | 143 | ATA_TMOUT_CDB_QUICK = 5 * HZ, | 
| 144 | ATA_TMOUT_INTERNAL = 30 * HZ, | ||
| 145 | ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, | ||
| 139 | 146 | ||
| 140 | /* ATA bus states */ | 147 | /* ATA bus states */ | 
| 141 | BUS_UNKNOWN = 0, | 148 | BUS_UNKNOWN = 0, | 
| @@ -195,7 +202,7 @@ struct ata_port; | |||
| 195 | struct ata_queued_cmd; | 202 | struct ata_queued_cmd; | 
| 196 | 203 | ||
| 197 | /* typedefs */ | 204 | /* typedefs */ | 
| 198 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask); | 205 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc); | 
| 199 | 206 | ||
| 200 | struct ata_ioports { | 207 | struct ata_ioports { | 
| 201 | unsigned long cmd_addr; | 208 | unsigned long cmd_addr; | 
| @@ -280,9 +287,9 @@ struct ata_queued_cmd { | |||
| 280 | /* DO NOT iterate over __sg manually, use ata_for_each_sg() */ | 287 | /* DO NOT iterate over __sg manually, use ata_for_each_sg() */ | 
| 281 | struct scatterlist *__sg; | 288 | struct scatterlist *__sg; | 
| 282 | 289 | ||
| 283 | ata_qc_cb_t complete_fn; | 290 | unsigned int err_mask; | 
| 284 | 291 | ||
| 285 | struct completion *waiting; | 292 | ata_qc_cb_t complete_fn; | 
| 286 | 293 | ||
| 287 | void *private_data; | 294 | void *private_data; | 
| 288 | }; | 295 | }; | 
| @@ -331,8 +338,6 @@ struct ata_port { | |||
| 331 | 338 | ||
| 332 | u8 ctl; /* cache of ATA control register */ | 339 | u8 ctl; /* cache of ATA control register */ | 
| 333 | u8 last_ctl; /* Cache last written value */ | 340 | u8 last_ctl; /* Cache last written value */ | 
| 334 | unsigned int bus_state; | ||
| 335 | unsigned int port_state; | ||
| 336 | unsigned int pio_mask; | 341 | unsigned int pio_mask; | 
| 337 | unsigned int mwdma_mask; | 342 | unsigned int mwdma_mask; | 
| 338 | unsigned int udma_mask; | 343 | unsigned int udma_mask; | 
| @@ -436,6 +441,8 @@ extern void ata_std_ports(struct ata_ioports *ioaddr); | |||
| 436 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, | 441 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, | 
| 437 | unsigned int n_ports); | 442 | unsigned int n_ports); | 
| 438 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 443 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 
| 444 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); | ||
| 445 | extern int ata_pci_device_resume(struct pci_dev *pdev); | ||
| 439 | #endif /* CONFIG_PCI */ | 446 | #endif /* CONFIG_PCI */ | 
| 440 | extern int ata_device_add(const struct ata_probe_ent *ent); | 447 | extern int ata_device_add(const struct ata_probe_ent *ent); | 
| 441 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 448 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 
| @@ -445,6 +452,10 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn | |||
| 445 | extern int ata_scsi_error(struct Scsi_Host *host); | 452 | extern int ata_scsi_error(struct Scsi_Host *host); | 
| 446 | extern int ata_scsi_release(struct Scsi_Host *host); | 453 | extern int ata_scsi_release(struct Scsi_Host *host); | 
| 447 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 454 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 
| 455 | extern int ata_scsi_device_resume(struct scsi_device *); | ||
| 456 | extern int ata_scsi_device_suspend(struct scsi_device *); | ||
| 457 | extern int ata_device_resume(struct ata_port *, struct ata_device *); | ||
| 458 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); | ||
| 448 | extern int ata_ratelimit(void); | 459 | extern int ata_ratelimit(void); | 
| 449 | 460 | ||
| 450 | /* | 461 | /* | 
| @@ -478,9 +489,10 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc); | |||
| 478 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 489 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 
| 479 | extern u8 ata_bmdma_status(struct ata_port *ap); | 490 | extern u8 ata_bmdma_status(struct ata_port *ap); | 
| 480 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 491 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 
| 481 | extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask); | 492 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | 
| 482 | extern void ata_eng_timeout(struct ata_port *ap); | 493 | extern void ata_eng_timeout(struct ata_port *ap); | 
| 483 | extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, | 494 | extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, | 
| 495 | struct scsi_cmnd *cmd, | ||
| 484 | void (*done)(struct scsi_cmnd *)); | 496 | void (*done)(struct scsi_cmnd *)); | 
| 485 | extern int ata_std_bios_param(struct scsi_device *sdev, | 497 | extern int ata_std_bios_param(struct scsi_device *sdev, | 
| 486 | struct block_device *bdev, | 498 | struct block_device *bdev, | 
| @@ -490,6 +502,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev); | |||
| 490 | /* | 502 | /* | 
| 491 | * Timing helpers | 503 | * Timing helpers | 
| 492 | */ | 504 | */ | 
| 505 | |||
| 506 | extern unsigned int ata_pio_need_iordy(const struct ata_device *); | ||
| 493 | extern int ata_timing_compute(struct ata_device *, unsigned short, | 507 | extern int ata_timing_compute(struct ata_device *, unsigned short, | 
| 494 | struct ata_timing *, int, int); | 508 | struct ata_timing *, int, int); | 
| 495 | extern void ata_timing_merge(const struct ata_timing *, | 509 | extern void ata_timing_merge(const struct ata_timing *, | 
| @@ -670,6 +684,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
| 670 | qc->cursect = qc->cursg = qc->cursg_ofs = 0; | 684 | qc->cursect = qc->cursg = qc->cursg_ofs = 0; | 
| 671 | qc->nsect = 0; | 685 | qc->nsect = 0; | 
| 672 | qc->nbytes = qc->curbytes = 0; | 686 | qc->nbytes = qc->curbytes = 0; | 
| 687 | qc->err_mask = 0; | ||
| 673 | 688 | ||
| 674 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); | 689 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); | 
| 675 | } | 690 | } | 
