ide: move IDE settings handling to ide-proc.c
[powerpc.git] / include / linux / libata.h
index 5d32c15..7906d75 100644 (file)
@@ -282,11 +282,13 @@ enum {
        ATA_EHI_NO_AUTOPSY      = (1 << 2),  /* no autopsy */
        ATA_EHI_QUIET           = (1 << 3),  /* be quiet */
 
-       ATA_EHI_DID_RESET       = (1 << 16), /* already reset this port */
-       ATA_EHI_PRINTINFO       = (1 << 17), /* print configuration info */
-       ATA_EHI_SETMODE         = (1 << 18), /* configure transfer mode */
-       ATA_EHI_POST_SETMODE    = (1 << 19), /* revaildating after setmode */
+       ATA_EHI_DID_SOFTRESET   = (1 << 16), /* already soft-reset this port */
+       ATA_EHI_DID_HARDRESET   = (1 << 17), /* already soft-reset this port */
+       ATA_EHI_PRINTINFO       = (1 << 18), /* print configuration info */
+       ATA_EHI_SETMODE         = (1 << 19), /* configure transfer mode */
+       ATA_EHI_POST_SETMODE    = (1 << 20), /* revaildating after setmode */
 
+       ATA_EHI_DID_RESET       = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET,
        ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
 
        /* max repeat if error condition is still set after ->error_handler */
@@ -294,18 +296,8 @@ enum {
 
        /* how hard are we gonna try to probe/recover devices */
        ATA_PROBE_MAX_TRIES     = 3,
-       ATA_EH_RESET_TRIES      = 3,
        ATA_EH_DEV_TRIES        = 3,
 
-       /* Drive spinup time (time from power-on to the first D2H FIS)
-        * in msecs - 8s currently.  Failing to get ready in this time
-        * isn't critical.  It will result in reset failure for
-        * controllers which can't wait for the first D2H FIS.  libata
-        * will retry, so it just has to be long enough to spin up
-        * most devices.
-        */
-       ATA_SPINUP_WAIT         = 8000,
-
        /* Horkage types. May be set by libata or controller on drives
           (some horkage may be drive/controller pair dependant */
 
@@ -346,8 +338,9 @@ struct ata_queued_cmd;
 
 /* typedefs */
 typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
-typedef int (*ata_prereset_fn_t)(struct ata_port *ap);
-typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes);
+typedef int (*ata_prereset_fn_t)(struct ata_port *ap, unsigned long deadline);
+typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes,
+                             unsigned long deadline);
 typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
 
 struct ata_ioports {
@@ -368,34 +361,6 @@ struct ata_ioports {
        void __iomem            *scr_addr;
 };
 
-struct ata_probe_ent {
-       struct list_head        node;
-       struct device           *dev;
-       const struct ata_port_operations *port_ops;
-       struct scsi_host_template *sht;
-       struct ata_ioports      port[ATA_MAX_PORTS];
-       unsigned int            n_ports;
-       unsigned int            dummy_port_mask;
-       unsigned int            pio_mask;
-       unsigned int            mwdma_mask;
-       unsigned int            udma_mask;
-       unsigned long           irq;
-       unsigned long           irq2;
-       unsigned int            irq_flags;
-       unsigned long           port_flags;
-       unsigned long           _host_flags;
-       void __iomem * const    *iomap;
-       void                    *private_data;
-
-       /* port_info for the secondary port.  Together with irq2, it's
-        * used to implement non-uniform secondary port.  Currently,
-        * the only user is ata_piix combined mode.  This workaround
-        * will be removed together with ata_probe_ent when init model
-        * is updated.
-        */
-       const struct ata_port_info *pinfo2;
-};
-
 struct ata_host {
        spinlock_t              lock;
        struct device           *dev;
@@ -474,6 +439,7 @@ struct ata_device {
        struct scsi_device      *sdev;          /* attached SCSI device */
        /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
        u64                     n_sectors;      /* size of device, if ATA */
+       u64                     n_sectors_boot; /* size of ATA device at startup */
        unsigned int            class;          /* ATA_DEV_xxx */
        u16                     id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
        u8                      pio_mode;
@@ -519,7 +485,6 @@ struct ata_eh_info {
        unsigned int            dev_action[ATA_MAX_DEVICES]; /* dev EH action */
        unsigned int            flags;          /* ATA_EHI_* flags */
 
-       unsigned long           hotplug_timestamp;
        unsigned int            probe_mask;
 
        char                    desc[ATA_EH_DESC_LEN];
@@ -713,13 +678,17 @@ extern void __sata_phy_reset(struct ata_port *ap);
 extern void sata_phy_reset(struct ata_port *ap);
 extern void ata_bus_reset(struct ata_port *ap);
 extern int sata_set_spd(struct ata_port *ap);
-extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param);
-extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param);
-extern int ata_std_prereset(struct ata_port *ap);
-extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
-extern int sata_port_hardreset(struct ata_port *ap,
-                              const unsigned long *timing);
-extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
+extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param,
+                            unsigned long deadline);
+extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param,
+                          unsigned long deadline);
+extern int ata_std_prereset(struct ata_port *ap, unsigned long deadline);
+extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes,
+                            unsigned long deadline);
+extern int sata_port_hardreset(struct ata_port *ap, const unsigned long *timing,
+                              unsigned long deadline);
+extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class,
+                             unsigned long deadline);
 extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
 extern void ata_port_disable(struct ata_port *);
 extern void ata_std_ports(struct ata_ioports *ioaddr);
@@ -744,7 +713,6 @@ extern int ata_host_register(struct ata_host *host,
 extern int ata_host_activate(struct ata_host *host, int irq,
                             irq_handler_t irq_handler, unsigned long irq_flags,
                             struct scsi_host_template *sht);
-extern int ata_device_add(const struct ata_probe_ent *ent);
 extern void ata_host_detach(struct ata_host *host);
 extern void ata_host_init(struct ata_host *, struct device *,
                          unsigned long, const struct ata_port_operations *);
@@ -776,6 +744,7 @@ extern void ata_host_resume(struct ata_host *host);
 extern int ata_ratelimit(void);
 extern int ata_busy_sleep(struct ata_port *ap,
                          unsigned long timeout_pat, unsigned long timeout);
+extern int ata_wait_ready(struct ata_port *ap, unsigned long deadline);
 extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
                                void *data, unsigned long delay);
 extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
@@ -892,8 +861,6 @@ struct pci_bits {
        unsigned long           val;
 };
 
-extern struct ata_probe_ent *
-ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
 extern int ata_pci_init_native_host(struct ata_host *host,
                                    unsigned int port_mask);
 extern int ata_pci_prepare_native_host(struct pci_dev *pdev,
@@ -947,12 +914,7 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
 
 static inline void __ata_ehi_hotplugged(struct ata_eh_info *ehi)
 {
-       if (ehi->flags & ATA_EHI_HOTPLUGGED)
-               return;
-
        ehi->flags |= ATA_EHI_HOTPLUGGED | ATA_EHI_RESUME_LINK;
-       ehi->hotplug_timestamp = jiffies;
-
        ehi->action |= ATA_EH_SOFTRESET;
        ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
 }