make exported headers use strict posix types
[safe/jmp/linux-2.6] / include / linux / ide.h
index fcbcfa2..194da5a 100644 (file)
@@ -426,13 +426,9 @@ 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;
 };
 
@@ -654,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;
@@ -676,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);
 
@@ -737,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;
@@ -753,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; ... */
@@ -819,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;
@@ -861,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 *);
@@ -870,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
@@ -1113,7 +1114,6 @@ 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 *);
@@ -1157,8 +1157,6 @@ 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 *, const char *, u8);
 
 void ide_fix_driveid(u16 *);
@@ -1183,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);
 
@@ -1464,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; }
@@ -1603,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 */