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.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 47cd2a1c5544..be5a43928c84 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -323,6 +323,7 @@ enum ata_completion_errors {
323 AC_ERR_INVALID = (1 << 7), /* invalid argument */ 323 AC_ERR_INVALID = (1 << 7), /* invalid argument */
324 AC_ERR_OTHER = (1 << 8), /* unknown */ 324 AC_ERR_OTHER = (1 << 8), /* unknown */
325 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */ 325 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */
326 AC_ERR_NCQ = (1 << 10), /* marker for offending NCQ qc */
326}; 327};
327 328
328/* forward declarations */ 329/* forward declarations */
@@ -530,6 +531,7 @@ struct ata_port {
530 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 531 unsigned int cbl; /* cable type; ATA_CBL_xxx */
531 unsigned int hw_sata_spd_limit; 532 unsigned int hw_sata_spd_limit;
532 unsigned int sata_spd_limit; /* SATA PHY speed limit */ 533 unsigned int sata_spd_limit; /* SATA PHY speed limit */
534 unsigned int sata_spd; /* current SATA PHY speed */
533 535
534 /* record runtime error info, protected by host lock */ 536 /* record runtime error info, protected by host lock */
535 struct ata_eh_info eh_info; 537 struct ata_eh_info eh_info;
@@ -563,6 +565,9 @@ struct ata_port {
563 pm_message_t pm_mesg; 565 pm_message_t pm_mesg;
564 int *pm_result; 566 int *pm_result;
565 567
568 struct timer_list fastdrain_timer;
569 unsigned long fastdrain_cnt;
570
566 void *private_data; 571 void *private_data;
567 572
568#ifdef CONFIG_ATA_ACPI 573#ifdef CONFIG_ATA_ACPI
@@ -619,9 +624,8 @@ struct ata_port_operations {
619 u8 (*irq_on) (struct ata_port *); 624 u8 (*irq_on) (struct ata_port *);
620 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq); 625 u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
621 626
622 u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 627 int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
623 void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 628 int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
624 u32 val);
625 629
626 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg); 630 int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
627 int (*port_resume) (struct ata_port *ap); 631 int (*port_resume) (struct ata_port *ap);
@@ -764,7 +768,8 @@ extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *);
764 */ 768 */
765extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); 769extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
766extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 770extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
767extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); 771extern void ata_tf_to_fis(const struct ata_taskfile *tf,
772 u8 pmp, int is_cmd, u8 *fis);
768extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 773extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
769extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 774extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
770extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 775extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
@@ -909,27 +914,21 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
909/* 914/*
910 * ata_eh_info helpers 915 * ata_eh_info helpers
911 */ 916 */
912#define ata_ehi_push_desc(ehi, fmt, args...) do { \ 917extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
913 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \ 918extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
914 ATA_EH_DESC_LEN - (ehi)->desc_len, \ 919extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
915 fmt , ##args); \ 920
916} while (0) 921static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
917
918#define ata_ehi_clear_desc(ehi) do { \
919 (ehi)->desc[0] = '\0'; \
920 (ehi)->desc_len = 0; \
921} while (0)
922
923static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
924{ 922{
925 ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK; 923 ehi->flags |= ATA_EHI_RESUME_LINK;
926 ehi->action |= ATA_EH_SOFTRESET; 924 ehi->action |= ATA_EH_SOFTRESET;
927 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1; 925 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
928} 926}
929 927
930static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 928static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
931{ 929{
932 __ata_ehi_hotplugged(ehi); 930 ata_ehi_schedule_probe(ehi);
931 ehi->flags |= ATA_EHI_HOTPLUGGED;
933 ehi->err_mask |= AC_ERR_ATA_BUS; 932 ehi->err_mask |= AC_ERR_ATA_BUS;
934} 933}
935 934