aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 11:46:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 11:46:42 -0400
commitdee2383784212c67819fdda1cbd4339f11d23b99 (patch)
treec6ec906c99c220c4a3894504195fc9f9b2d0f286 /include
parente609ccc3161ead8a685b15533d9b6958ed368358 (diff)
parent5ddf24c5ea9d715dc4f5d5d5dd1c9337d90466dc (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (29 commits) libata: implement EH fast drain libata: schedule probing after SError access failure during autopsy libata: clear HOTPLUG flag after a reset libata: reorganize ata_ehi_hotplugged() libata: improve SCSI scan failure handling libata: quickly trigger SATA SPD down after debouncing failed libata: improve SATA PHY speed down logic The SATA controller device ID is different according to ahci: implement SCR_NOTIFICATION r/w ahci: make NO_NCQ handling more consistent libata: make ->scr_read/write callbacks return error code libata: implement AC_ERR_NCQ libata: improve EH report formatting sata_sil24: separate out sil24_do_softreset() sata_sil24: separate out sil24_exec_polled_cmd() sata_sil24: replace sil24_update_tf() with sil24_read_tf() ahci: separate out ahci_do_softreset() ahci: separate out ahci_exec_polled_cmd() ahci: separate out ahci_kick_engine() ahci: use deadline instead of fixed timeout for 1st FIS for SRST ...
Diffstat (limited to 'include')
-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