[ARM] 5421/1: ftrace: fix crash due to tracing of __naked functions
[safe/jmp/linux-2.6] / include / linux / ide.h
index 82d500c..fe235b6 100644 (file)
@@ -32,8 +32,6 @@
 # define SUPPORT_VLB_SYNC 1
 #endif
 
-typedef unsigned char  byte;   /* used everywhere */
-
 /*
  * Probably not wise to fiddle with these
  */
@@ -428,18 +426,14 @@ struct ide_atapi_pc {
        struct idetape_bh *bh;
        char *b_data;
 
-       /* idescsi only for now */
        struct scatterlist *sg;
        unsigned int sg_cnt;
 
-       struct scsi_cmnd *scsi_cmd;
-       void (*done) (struct scsi_cmnd *);
-
        unsigned long timeout;
 };
 
 struct ide_devset;
-struct ide_driver_s;
+struct ide_driver;
 
 #ifdef CONFIG_BLK_DEV_IDEACPI
 struct ide_acpi_drive_link;
@@ -656,6 +650,8 @@ struct ide_drive_s {
        int  (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
                              unsigned int, int);
 
+       ide_startstop_t (*irq_handler)(struct ide_drive_s *);
+
        unsigned long atapi_flags;
 
        struct ide_atapi_pc request_sense_pc;
@@ -667,7 +663,7 @@ typedef struct ide_drive_s ide_drive_t;
 #define to_ide_device(dev)             container_of(dev, ide_drive_t, gendev)
 
 #define to_ide_drv(obj, cont_type)     \
-       container_of(obj, struct cont_type, kref)
+       container_of(obj, struct cont_type, dev)
 
 #define ide_drv_g(disk, cont_type)     \
        container_of((disk)->private_data, struct cont_type, driver)
@@ -678,7 +674,6 @@ struct ide_tp_ops {
        void    (*exec_command)(struct hwif_s *, u8);
        u8      (*read_status)(struct hwif_s *);
        u8      (*read_altstatus)(struct hwif_s *);
-       u8      (*read_sff_dma_status)(struct hwif_s *);
 
        void    (*set_irq)(struct hwif_s *, int);
 
@@ -739,6 +734,11 @@ struct ide_dma_ops {
        int     (*dma_test_irq)(struct ide_drive_s *);
        void    (*dma_lost_irq)(struct ide_drive_s *);
        void    (*dma_timeout)(struct ide_drive_s *);
+       /*
+        * The following method is optional and only required to be
+        * implemented for the SFF-8038i compatible controllers.
+        */
+       u8      (*dma_sff_read_status)(struct hwif_s *);
 };
 
 struct ide_host;
@@ -755,7 +755,7 @@ typedef struct hwif_s {
 
        unsigned long   sata_scr[SATA_NR_PORTS];
 
-       ide_drive_t     drives[MAX_DRIVES];     /* drive info */
+       ide_drive_t     *devices[MAX_DRIVES + 1];
 
        u8 major;       /* our major number */
        u8 index;       /* 0 for ide0; 1 for ide1; ... */
@@ -821,7 +821,6 @@ typedef struct hwif_s {
        unsigned        extra_ports;    /* number of extra dma ports */
 
        unsigned        present    : 1; /* this interface exists */
-       unsigned        sg_mapped  : 1; /* sg_table and sg_nents are ready */
        unsigned        busy       : 1; /* serializes devices on a port */
 
        struct device           gendev;
@@ -863,7 +862,7 @@ typedef struct hwif_s {
 #define MAX_HOST_PORTS 4
 
 struct ide_host {
-       ide_hwif_t      *ports[MAX_HOST_PORTS];
+       ide_hwif_t      *ports[MAX_HOST_PORTS + 1];
        unsigned int    n_ports;
        struct device   *dev[2];
        unsigned int    (*init_chipset)(struct pci_dev *);
@@ -872,7 +871,7 @@ struct ide_host {
        ide_hwif_t      *cur_port;      /* for hosts requiring serialization */
 
        /* used for hosts requiring serialization */
-       volatile long   host_busy;
+       volatile unsigned long  host_busy;
 };
 
 #define IDE_HOST_BUSY 0
@@ -886,8 +885,6 @@ typedef int (ide_expiry_t)(ide_drive_t *);
 /* used by ide-cd, ide-floppy, etc. */
 typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned);
 
-typedef struct ide_driver_s ide_driver_t;
-
 extern struct mutex ide_setting_mtx;
 
 /*
@@ -1013,8 +1010,8 @@ void ide_proc_register_port(ide_hwif_t *);
 void ide_proc_port_register_devices(ide_hwif_t *);
 void ide_proc_unregister_device(ide_drive_t *);
 void ide_proc_unregister_port(ide_hwif_t *);
-void ide_proc_register_driver(ide_drive_t *, ide_driver_t *);
-void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *);
+void ide_proc_register_driver(ide_drive_t *, struct ide_driver *);
+void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *);
 
 read_proc_t proc_ide_read_capacity;
 read_proc_t proc_ide_read_geometry;
@@ -1041,8 +1038,10 @@ static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; }
 static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; }
 static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; }
 static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; }
-static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; }
-static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; }
+static inline void ide_proc_register_driver(ide_drive_t *drive,
+                                           struct ide_driver *driver) { ; }
+static inline void ide_proc_unregister_driver(ide_drive_t *drive,
+                                             struct ide_driver *driver) { ; }
 #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
 #endif
 
@@ -1111,11 +1110,10 @@ void ide_check_pm_state(ide_drive_t *, struct request *);
  * The gendriver.owner field should be set to the module owner of this driver.
  * The gendriver.name field should be set to the name of this driver
  */
-struct ide_driver_s {
+struct ide_driver {
        const char                      *version;
        ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
        int             (*end_request)(ide_drive_t *, int, int);
-       ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
        struct device_driver    gen_driver;
        int             (*probe)(ide_drive_t *);
        void            (*remove)(ide_drive_t *);
@@ -1127,7 +1125,7 @@ struct ide_driver_s {
 #endif
 };
 
-#define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver)
+#define to_ide_driver(drv) container_of(drv, struct ide_driver, gen_driver)
 
 int ide_device_get(ide_drive_t *);
 void ide_device_put(ide_drive_t *);
@@ -1159,9 +1157,7 @@ void ide_execute_pkt_cmd(ide_drive_t *);
 
 void ide_pad_transfer(ide_drive_t *, int, int);
 
-ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
-
-ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
+ide_startstop_t ide_error(ide_drive_t *, const char *, u8);
 
 void ide_fix_driveid(u16 *);
 
@@ -1185,7 +1181,6 @@ void ide_tf_dump(const char *, struct ide_taskfile *);
 void ide_exec_command(ide_hwif_t *, u8);
 u8 ide_read_status(ide_hwif_t *);
 u8 ide_read_altstatus(ide_hwif_t *);
-u8 ide_read_sff_dma_status(ide_hwif_t *);
 
 void ide_set_irq(ide_hwif_t *, int);
 
@@ -1300,11 +1295,11 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif,
 }
 #endif
 
-typedef struct ide_pci_enablebit_s {
+struct ide_pci_enablebit {
        u8      reg;    /* byte pci reg holding the enable-bit */
        u8      mask;   /* mask to isolate the enable-bit */
        u8      val;    /* value of masked reg when "enabled" */
-} ide_pci_enablebit_t;
+};
 
 enum {
        /* Uses ISA control ports not PCI ones. */
@@ -1393,7 +1388,8 @@ struct ide_port_info {
        const struct ide_port_ops       *port_ops;
        const struct ide_dma_ops        *dma_ops;
 
-       ide_pci_enablebit_t     enablebits[2];
+       struct ide_pci_enablebit        enablebits[2];
+
        hwif_chipset_t          chipset;
 
        u16                     max_sectors;    /* if < than the default one */
@@ -1465,6 +1461,7 @@ void ide_dma_exec_cmd(ide_drive_t *, u8);
 extern void ide_dma_start(ide_drive_t *);
 int ide_dma_end(ide_drive_t *);
 int ide_dma_test_irq(ide_drive_t *);
+u8 ide_dma_sff_read_status(ide_hwif_t *);
 extern const struct ide_dma_ops sff_dma_ops;
 #else
 static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
@@ -1604,8 +1601,15 @@ static inline int hwif_to_node(ide_hwif_t *hwif)
 
 static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive)
 {
-       ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1];
+       ide_drive_t *peer = drive->hwif->devices[(drive->dn ^ 1) & 1];
 
        return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL;
 }
+
+#define ide_port_for_each_dev(i, dev, port) \
+       for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)
+
+#define ide_host_for_each_port(i, port, host) \
+       for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++)
+
 #endif /* _IDE_H */