]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/ide.h
ide: remove drive->driveid
[linux-2.6-omap-h63xx.git] / include / linux / ide.h
index 87c12ed969548a233a8f9d8e8440ed0bc972a566..e887927e00e61d968b792442d0b35ba6fd3a20b2 100644 (file)
@@ -366,7 +366,9 @@ enum {
        /* Currently on a filemark */
        IDE_AFLAG_FILEMARK              = (1 << 25),
        /* 0 = no tape is loaded, so we don't rewind after ejecting */
-       IDE_AFLAG_MEDIUM_PRESENT        = (1 << 26)
+       IDE_AFLAG_MEDIUM_PRESENT        = (1 << 26),
+
+       IDE_AFLAG_NO_AUTOCLOSE          = (1 << 27),
 };
 
 struct ide_drive_s {
@@ -378,7 +380,7 @@ struct ide_drive_s {
        struct request          *rq;    /* current request */
        struct ide_drive_s      *next;  /* circular list of hwgroup drives */
        void            *driver_data;   /* extra driver data */
-       struct hd_driveid       *id;    /* drive model identification info */
+       u16                     *id;    /* identification info */
 #ifdef CONFIG_IDE_PROC_FS
        struct proc_dir_entry *proc;    /* /proc/ide/ directory entry */
        struct ide_settings_s *settings;/* /proc/ide/ drive settings */
@@ -918,7 +920,7 @@ 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);
 
-extern void ide_fix_driveid(struct hd_driveid *);
+void ide_fix_driveid(u16 *);
 
 extern void ide_fixstring(u8 *, const int, const int);
 
@@ -1111,7 +1113,6 @@ void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 int ide_pci_set_master(struct pci_dev *, const char *);
 unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *);
-extern const struct ide_dma_ops sff_dma_ops;
 int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *);
 int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
 #else
@@ -1239,7 +1240,7 @@ struct drive_list_entry {
        const char *id_firmware;
 };
 
-int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
+int ide_in_drive_list(u16 *, const struct drive_list_entry *);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
 int __ide_dma_bad_drive(ide_drive_t *);
@@ -1275,6 +1276,7 @@ extern int __ide_dma_end(ide_drive_t *);
 int ide_dma_test_irq(ide_drive_t *);
 extern void ide_dma_lost_irq(ide_drive_t *);
 extern void ide_dma_timeout(ide_drive_t *);
+extern const struct ide_dma_ops sff_dma_ops;
 #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 #else
@@ -1345,12 +1347,12 @@ const char *ide_xfer_verbose(u8 mode);
 extern void ide_toggle_bounce(ide_drive_t *drive, int on);
 extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
 
-static inline int ide_dev_has_iordy(struct hd_driveid *id)
+static inline int ide_dev_has_iordy(u16 *id)
 {
-       return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0;
+       return ((id[ATA_ID_FIELD_VALID] & 2) && ata_id_has_iordy(id)) ? 1 : 0;
 }
 
-static inline int ide_dev_is_sata(struct hd_driveid *id)
+static inline int ide_dev_is_sata(u16 *id)
 {
        /*
         * See if word 93 is 0 AND drive is at least ATA-5 compatible
@@ -1358,7 +1360,7 @@ static inline int ide_dev_is_sata(struct hd_driveid *id)
         * this trick allows us to filter out the reserved values of
         * 0x0000 and 0xffff along with the earlier ATA revisions...
         */
-       if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020)
+       if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020)
                return 1;
        return 0;
 }
@@ -1435,11 +1437,11 @@ extern struct bus_type ide_bus_type;
 extern struct class *ide_port_class;
 
 /* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */
-#define ide_id_has_flush_cache(id)     ((id)->cfs_enable_2 & 0x3000)
+#define ide_id_has_flush_cache(id)     ((id)[ATA_ID_CFS_ENABLE_2] & 0x3000)
 
 /* some Maxtor disks have bit 13 defined incorrectly so check bit 10 too */
 #define ide_id_has_flush_cache_ext(id) \
-       (((id)->cfs_enable_2 & 0x2400) == 0x2400)
+       (((id)[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400)
 
 static inline void ide_dump_identify(u8 *id)
 {
@@ -1448,8 +1450,7 @@ static inline void ide_dump_identify(u8 *id)
 
 static inline int hwif_to_node(ide_hwif_t *hwif)
 {
-       struct pci_dev *dev = to_pci_dev(hwif->dev);
-       return hwif->dev ? pcibus_to_node(dev->bus) : -1;
+       return hwif->dev ? dev_to_node(hwif->dev) : -1;
 }
 
 static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)