Merge branch 'linux-2.6'
[safe/jmp/linux-2.6] / include / linux / libata.h
index 94b37d1..a67bb90 100644 (file)
@@ -216,6 +216,8 @@ enum {
        ATA_HOST_SIMPLEX        = (1 << 0),     /* Host is simplex, one DMA channel per host only */
        ATA_HOST_STARTED        = (1 << 1),     /* Host started */
 
+       /* bits 24:31 of host->flags are reserved for LLD specific flags */
+
        /* various lengths of time */
        ATA_TMOUT_BOOT          = 30 * HZ,      /* heuristic */
        ATA_TMOUT_BOOT_QUICK    = 7 * HZ,       /* heuristic */
@@ -301,6 +303,7 @@ enum {
        ATA_HORKAGE_NODMA       = (1 << 1),     /* DMA problems */
        ATA_HORKAGE_NONCQ       = (1 << 2),     /* Don't use NCQ */
        ATA_HORKAGE_MAX_SEC_128 = (1 << 3),     /* Limit max sects to 128 */
+       ATA_HORKAGE_BROKEN_HPA  = (1 << 4),     /* Broken HPA */
 };
 
 enum hsm_task_states {
@@ -323,6 +326,7 @@ enum ata_completion_errors {
        AC_ERR_INVALID          = (1 << 7), /* invalid argument */
        AC_ERR_OTHER            = (1 << 8), /* unknown */
        AC_ERR_NODEV_HINT       = (1 << 9), /* polling device detection hint */
+       AC_ERR_NCQ              = (1 << 10), /* marker for offending NCQ qc */
 };
 
 /* forward declarations */
@@ -411,6 +415,7 @@ struct ata_queued_cmd {
        ata_qc_cb_t             complete_fn;
 
        void                    *private_data;
+       void                    *lldd_task;
 };
 
 struct ata_port_stats {
@@ -530,6 +535,7 @@ struct ata_port {
        unsigned int            cbl;    /* cable type; ATA_CBL_xxx */
        unsigned int            hw_sata_spd_limit;
        unsigned int            sata_spd_limit; /* SATA PHY speed limit */
+       unsigned int            sata_spd;       /* current SATA PHY speed */
 
        /* record runtime error info, protected by host lock */
        struct ata_eh_info      eh_info;
@@ -563,6 +569,9 @@ struct ata_port {
        pm_message_t            pm_mesg;
        int                     *pm_result;
 
+       struct timer_list       fastdrain_timer;
+       unsigned long           fastdrain_cnt;
+
        void                    *private_data;
 
 #ifdef CONFIG_ATA_ACPI
@@ -619,9 +628,8 @@ struct ata_port_operations {
        u8 (*irq_on) (struct ata_port *);
        u8 (*irq_ack) (struct ata_port *ap, unsigned int chk_drq);
 
-       u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
-       void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
-                          u32 val);
+       int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, u32 *val);
+       int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, u32 val);
 
        int (*port_suspend) (struct ata_port *ap, pm_message_t mesg);
        int (*port_resume) (struct ata_port *ap);
@@ -914,16 +922,17 @@ extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
 extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
 extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
 
-static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
+static inline void ata_ehi_schedule_probe(struct ata_eh_info *ehi)
 {
-       ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
+       ehi->flags |= ATA_EHI_RESUME_LINK;
        ehi->action |= ATA_EH_SOFTRESET;
        ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
 }
 
 static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
 {
-       __ata_ehi_hotplugged(ehi);
+       ata_ehi_schedule_probe(ehi);
+       ehi->flags |= ATA_EHI_HOTPLUGGED;
        ehi->err_mask |= AC_ERR_ATA_BUS;
 }