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.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 620da7be07b7..a3df64677ac3 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -116,6 +116,7 @@ static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
116enum { 116enum {
117 /* various global constants */ 117 /* various global constants */
118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
119 LIBATA_DUMB_MAX_PRD = ATA_MAX_PRD / 4, /* Worst case */
119 ATA_MAX_PORTS = 8, 120 ATA_MAX_PORTS = 8,
120 ATA_DEF_QUEUE = 1, 121 ATA_DEF_QUEUE = 1,
121 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ 122 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
@@ -136,6 +137,8 @@ enum {
136 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ 137 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
137 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ 138 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
138 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ 139 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */
140 ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */
141 ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */
139 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 142 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
140 143
141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 144 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
@@ -196,6 +199,7 @@ enum {
196 ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ 199 ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */
197 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ 200 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
198 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ 201 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
202 ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */
199 203
200 /* struct ata_queued_cmd flags */ 204 /* struct ata_queued_cmd flags */
201 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 205 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
@@ -363,6 +367,9 @@ struct ata_host {
363 void *private_data; 367 void *private_data;
364 const struct ata_port_operations *ops; 368 const struct ata_port_operations *ops;
365 unsigned long flags; 369 unsigned long flags;
370#ifdef CONFIG_ATA_ACPI
371 acpi_handle acpi_handle;
372#endif
366 struct ata_port *simplex_claimed; /* channel owning the DMA */ 373 struct ata_port *simplex_claimed; /* channel owning the DMA */
367 struct ata_port *ports[0]; 374 struct ata_port *ports[0];
368}; 375};
@@ -429,6 +436,9 @@ struct ata_device {
429 unsigned int devno; /* 0 or 1 */ 436 unsigned int devno; /* 0 or 1 */
430 unsigned long flags; /* ATA_DFLAG_xxx */ 437 unsigned long flags; /* ATA_DFLAG_xxx */
431 struct scsi_device *sdev; /* attached SCSI device */ 438 struct scsi_device *sdev; /* attached SCSI device */
439#ifdef CONFIG_ATA_ACPI
440 acpi_handle acpi_handle;
441#endif
432 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 442 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
433 u64 n_sectors; /* size of device, if ATA */ 443 u64 n_sectors; /* size of device, if ATA */
434 unsigned int class; /* ATA_DEV_xxx */ 444 unsigned int class; /* ATA_DEV_xxx */
@@ -457,10 +467,6 @@ struct ata_device {
457 struct ata_ering ering; 467 struct ata_ering ering;
458 int spdn_cnt; 468 int spdn_cnt;
459 unsigned int horkage; /* List of broken features */ 469 unsigned int horkage; /* List of broken features */
460#ifdef CONFIG_ATA_ACPI
461 /* ACPI objects info */
462 acpi_handle obj_handle;
463#endif
464}; 470};
465 471
466/* Offset into struct ata_device. Fields above it are maintained 472/* Offset into struct ata_device. Fields above it are maintained
@@ -489,6 +495,17 @@ struct ata_eh_context {
489 unsigned int did_probe_mask; 495 unsigned int did_probe_mask;
490}; 496};
491 497
498struct ata_acpi_drive
499{
500 u32 pio;
501 u32 dma;
502} __packed;
503
504struct ata_acpi_gtm {
505 struct ata_acpi_drive drive[2];
506 u32 flags;
507} __packed;
508
492struct ata_port { 509struct ata_port {
493 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ 510 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
494 const struct ata_port_operations *ops; 511 const struct ata_port_operations *ops;
@@ -549,6 +566,10 @@ struct ata_port {
549 566
550 void *private_data; 567 void *private_data;
551 568
569#ifdef CONFIG_ATA_ACPI
570 acpi_handle acpi_handle;
571 struct ata_acpi_gtm acpi_gtm;
572#endif
552 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 573 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
553}; 574};
554 575
@@ -758,6 +779,7 @@ extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
758 unsigned int buflen, int write_data); 779 unsigned int buflen, int write_data);
759extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, 780extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
760 unsigned int buflen, int write_data); 781 unsigned int buflen, int write_data);
782extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc);
761extern void ata_qc_prep(struct ata_queued_cmd *qc); 783extern void ata_qc_prep(struct ata_queued_cmd *qc);
762extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 784extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
763extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 785extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);