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.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index f2dbb684ce9e..a43c95f8f968 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -122,6 +122,9 @@ enum {
122 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 122 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once
123 * proper HSM is in place. */ 123 * proper HSM is in place. */
124 ATA_FLAG_DEBUGMSG = (1 << 10), 124 ATA_FLAG_DEBUGMSG = (1 << 10),
125 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */
126
127 ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */
125 128
126 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ 129 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */
127 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ 130 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
@@ -135,6 +138,8 @@ enum {
135 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* hueristic */ 138 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* hueristic */
136 ATA_TMOUT_CDB = 30 * HZ, 139 ATA_TMOUT_CDB = 30 * HZ,
137 ATA_TMOUT_CDB_QUICK = 5 * HZ, 140 ATA_TMOUT_CDB_QUICK = 5 * HZ,
141 ATA_TMOUT_INTERNAL = 30 * HZ,
142 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
138 143
139 /* ATA bus states */ 144 /* ATA bus states */
140 BUS_UNKNOWN = 0, 145 BUS_UNKNOWN = 0,
@@ -194,7 +199,7 @@ struct ata_port;
194struct ata_queued_cmd; 199struct ata_queued_cmd;
195 200
196/* typedefs */ 201/* typedefs */
197typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask); 202typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
198 203
199struct ata_ioports { 204struct ata_ioports {
200 unsigned long cmd_addr; 205 unsigned long cmd_addr;
@@ -279,9 +284,9 @@ struct ata_queued_cmd {
279 /* DO NOT iterate over __sg manually, use ata_for_each_sg() */ 284 /* DO NOT iterate over __sg manually, use ata_for_each_sg() */
280 struct scatterlist *__sg; 285 struct scatterlist *__sg;
281 286
282 ata_qc_cb_t complete_fn; 287 unsigned int err_mask;
283 288
284 struct completion *waiting; 289 ata_qc_cb_t complete_fn;
285 290
286 void *private_data; 291 void *private_data;
287}; 292};
@@ -330,8 +335,6 @@ struct ata_port {
330 335
331 u8 ctl; /* cache of ATA control register */ 336 u8 ctl; /* cache of ATA control register */
332 u8 last_ctl; /* Cache last written value */ 337 u8 last_ctl; /* Cache last written value */
333 unsigned int bus_state;
334 unsigned int port_state;
335 unsigned int pio_mask; 338 unsigned int pio_mask;
336 unsigned int mwdma_mask; 339 unsigned int mwdma_mask;
337 unsigned int udma_mask; 340 unsigned int udma_mask;
@@ -435,6 +438,8 @@ extern void ata_std_ports(struct ata_ioports *ioaddr);
435extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, 438extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
436 unsigned int n_ports); 439 unsigned int n_ports);
437extern void ata_pci_remove_one (struct pci_dev *pdev); 440extern void ata_pci_remove_one (struct pci_dev *pdev);
441extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state);
442extern int ata_pci_device_resume(struct pci_dev *pdev);
438#endif /* CONFIG_PCI */ 443#endif /* CONFIG_PCI */
439extern int ata_device_add(const struct ata_probe_ent *ent); 444extern int ata_device_add(const struct ata_probe_ent *ent);
440extern void ata_host_set_remove(struct ata_host_set *host_set); 445extern void ata_host_set_remove(struct ata_host_set *host_set);
@@ -444,6 +449,10 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
444extern int ata_scsi_error(struct Scsi_Host *host); 449extern int ata_scsi_error(struct Scsi_Host *host);
445extern int ata_scsi_release(struct Scsi_Host *host); 450extern int ata_scsi_release(struct Scsi_Host *host);
446extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 451extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
452extern int ata_scsi_device_resume(struct scsi_device *);
453extern int ata_scsi_device_suspend(struct scsi_device *);
454extern int ata_device_resume(struct ata_port *, struct ata_device *);
455extern int ata_device_suspend(struct ata_port *, struct ata_device *);
447extern int ata_ratelimit(void); 456extern int ata_ratelimit(void);
448 457
449/* 458/*
@@ -477,9 +486,10 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
477extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 486extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
478extern u8 ata_bmdma_status(struct ata_port *ap); 487extern u8 ata_bmdma_status(struct ata_port *ap);
479extern void ata_bmdma_irq_clear(struct ata_port *ap); 488extern void ata_bmdma_irq_clear(struct ata_port *ap);
480extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask); 489extern void ata_qc_complete(struct ata_queued_cmd *qc);
481extern void ata_eng_timeout(struct ata_port *ap); 490extern void ata_eng_timeout(struct ata_port *ap);
482extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, 491extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
492 struct scsi_cmnd *cmd,
483 void (*done)(struct scsi_cmnd *)); 493 void (*done)(struct scsi_cmnd *));
484extern int ata_std_bios_param(struct scsi_device *sdev, 494extern int ata_std_bios_param(struct scsi_device *sdev,
485 struct block_device *bdev, 495 struct block_device *bdev,
@@ -669,6 +679,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
669 qc->cursect = qc->cursg = qc->cursg_ofs = 0; 679 qc->cursect = qc->cursg = qc->cursg_ofs = 0;
670 qc->nsect = 0; 680 qc->nsect = 0;
671 qc->nbytes = qc->curbytes = 0; 681 qc->nbytes = qc->curbytes = 0;
682 qc->err_mask = 0;
672 683
673 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); 684 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno);
674} 685}