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.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index ef52a07c43d8..124033cb5e9b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -119,6 +119,8 @@ enum {
119 ATA_DEF_BUSY_WAIT = 10000, 119 ATA_DEF_BUSY_WAIT = 10000,
120 ATA_SHORT_PAUSE = (HZ >> 6) + 1, 120 ATA_SHORT_PAUSE = (HZ >> 6) + 1,
121 121
122 ATAPI_MAX_DRAIN = 16 << 10,
123
122 ATA_SHT_EMULATED = 1, 124 ATA_SHT_EMULATED = 1,
123 ATA_SHT_CMD_PER_LUN = 1, 125 ATA_SHT_CMD_PER_LUN = 1,
124 ATA_SHT_THIS_ID = -1, 126 ATA_SHT_THIS_ID = -1,
@@ -211,7 +213,7 @@ enum {
211 213
212 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ 214 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
213 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ 215 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
214 ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */ 216 ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */
215 217
216 /* struct ata_queued_cmd flags */ 218 /* struct ata_queued_cmd flags */
217 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 219 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
@@ -498,6 +500,7 @@ struct ata_device {
498 struct scsi_device *sdev; /* attached SCSI device */ 500 struct scsi_device *sdev; /* attached SCSI device */
499#ifdef CONFIG_ATA_ACPI 501#ifdef CONFIG_ATA_ACPI
500 acpi_handle acpi_handle; 502 acpi_handle acpi_handle;
503 union acpi_object *gtf_cache;
501#endif 504#endif
502 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 505 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
503 u64 n_sectors; /* size of device, if ATA */ 506 u64 n_sectors; /* size of device, if ATA */
@@ -653,7 +656,7 @@ struct ata_port {
653 656
654#ifdef CONFIG_ATA_ACPI 657#ifdef CONFIG_ATA_ACPI
655 acpi_handle acpi_handle; 658 acpi_handle acpi_handle;
656 struct ata_acpi_gtm acpi_gtm; 659 struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
657#endif 660#endif
658 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 661 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
659}; 662};
@@ -939,10 +942,20 @@ enum {
939 942
940/* libata-acpi.c */ 943/* libata-acpi.c */
941#ifdef CONFIG_ATA_ACPI 944#ifdef CONFIG_ATA_ACPI
945static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap)
946{
947 if (ap->pflags & ATA_PFLAG_INIT_GTM_VALID)
948 return &ap->__acpi_init_gtm;
949 return NULL;
950}
942extern int ata_acpi_cbl_80wire(struct ata_port *ap); 951extern int ata_acpi_cbl_80wire(struct ata_port *ap);
943int ata_acpi_stm(const struct ata_port *ap, struct ata_acpi_gtm *stm); 952int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm);
944int ata_acpi_gtm(const struct ata_port *ap, struct ata_acpi_gtm *stm); 953int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm);
945#else 954#else
955static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap)
956{
957 return NULL;
958}
946static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; } 959static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; }
947#endif 960#endif
948 961
@@ -1013,18 +1026,18 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
1013 * printk helpers 1026 * printk helpers
1014 */ 1027 */
1015#define ata_port_printk(ap, lv, fmt, args...) \ 1028#define ata_port_printk(ap, lv, fmt, args...) \
1016 printk(lv"ata%u: "fmt, (ap)->print_id , ##args) 1029 printk("%sata%u: "fmt, lv, (ap)->print_id , ##args)
1017 1030
1018#define ata_link_printk(link, lv, fmt, args...) do { \ 1031#define ata_link_printk(link, lv, fmt, args...) do { \
1019 if ((link)->ap->nr_pmp_links) \ 1032 if ((link)->ap->nr_pmp_links) \
1020 printk(lv"ata%u.%02u: "fmt, (link)->ap->print_id, \ 1033 printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \
1021 (link)->pmp , ##args); \ 1034 (link)->pmp , ##args); \
1022 else \ 1035 else \
1023 printk(lv"ata%u: "fmt, (link)->ap->print_id , ##args); \ 1036 printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
1024 } while(0) 1037 } while(0)
1025 1038
1026#define ata_dev_printk(dev, lv, fmt, args...) \ 1039#define ata_dev_printk(dev, lv, fmt, args...) \
1027 printk(lv"ata%u.%02u: "fmt, (dev)->link->ap->print_id, \ 1040 printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \
1028 (dev)->link->pmp + (dev)->devno , ##args) 1041 (dev)->link->pmp + (dev)->devno , ##args)
1029 1042
1030/* 1043/*