MTD: Convert Atmel PRI information to AMD format
[safe/jmp/linux-2.6] / include / linux / ide.h
index 613534b..dc7abef 100644 (file)
@@ -6,7 +6,6 @@
  *  Copyright (C) 1994-2002  Linus Torvalds & authors
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
 #include <linux/hdreg.h>
@@ -18,6 +17,7 @@
 #include <linux/bio.h>
 #include <linux/device.h>
 #include <linux/pci.h>
+#include <linux/completion.h>
 #include <asm/byteorder.h>
 #include <asm/system.h>
 #include <asm/io.h>
@@ -552,7 +552,6 @@ typedef struct ide_drive_s {
        struct hd_driveid       *id;    /* drive model identification info */
        struct proc_dir_entry *proc;    /* /proc/ide/ directory entry */
        struct ide_settings_s *settings;/* /proc/ide/ drive settings */
-       char            devfs_name[64]; /* devfs crap */
 
        struct hwif_s           *hwif;  /* actually (ide_hwif_t *) */
 
@@ -581,7 +580,6 @@ typedef struct ide_drive_s {
        unsigned noprobe        : 1;    /* from:  hdx=noprobe */
        unsigned removable      : 1;    /* 1 if need to do check_media_change */
        unsigned attach         : 1;    /* needed for removable devices */
-       unsigned is_flash       : 1;    /* 1 if probed as flash */
        unsigned forced_geom    : 1;    /* 1 if hdx=c,h,s was given at boot */
        unsigned no_unmask      : 1;    /* disallow setting unmask bit */
        unsigned no_io_32bit    : 1;    /* disallow enabling 32bit I/O */
@@ -631,6 +629,7 @@ typedef struct ide_drive_s {
        unsigned int    usage;          /* current "open()" count for drive */
        unsigned int    failures;       /* current failure count */
        unsigned int    max_failures;   /* maximum allowed failure count */
+       u64             probed_capacity;/* initial reported media capacity (ide-cd only currently) */
 
        u64             capacity64;     /* total number of sectors */
 
@@ -638,7 +637,7 @@ typedef struct ide_drive_s {
        int             crc_count;      /* crc counter to reduce drive speed */
        struct list_head list;
        struct device   gendev;
-       struct semaphore gendev_rel_sem;        /* to deal with device release() */
+       struct completion gendev_rel_comp;      /* to deal with device release() */
 } ide_drive_t;
 
 #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev)
@@ -792,16 +791,18 @@ typedef struct hwif_s {
        unsigned        no_dsc     : 1; /* 0 default, 1 dsc_overlap disabled */
        unsigned        auto_poll  : 1; /* supports nop auto-poll */
        unsigned        sg_mapped  : 1; /* sg_table and sg_nents are ready */
+       unsigned        no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
+       unsigned        err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
 
        struct device   gendev;
-       struct semaphore gendev_rel_sem; /* To deal with device release() */
+       struct completion gendev_rel_comp; /* To deal with device release() */
 
        void            *hwif_data;     /* extra hwif data */
 
        unsigned dma;
 
        void (*led_act)(void *data, int rw);
-} ____cacheline_maxaligned_in_smp ide_hwif_t;
+} ____cacheline_internodealigned_in_smp ide_hwif_t;
 
 /*
  *  internal ide interrupt handler type
@@ -980,13 +981,15 @@ typedef struct ide_driver_s {
        int             (*end_request)(ide_drive_t *, int, int);
        ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
        ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);
-       int             (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);
        ide_proc_entry_t        *proc;
-       void            (*ata_prebuilder)(ide_drive_t *);
-       void            (*atapi_prebuilder)(ide_drive_t *);
        struct device_driver    gen_driver;
+       int             (*probe)(ide_drive_t *);
+       void            (*remove)(ide_drive_t *);
+       void            (*shutdown)(ide_drive_t *);
 } ide_driver_t;
 
+#define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver)
+
 int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
 
 /*
@@ -1003,7 +1006,8 @@ extern    ide_hwif_t      ide_hwifs[];            /* master data repository */
 extern int noautodma;
 
 extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs);
-extern int __ide_end_request (ide_drive_t *drive, struct request *rq, int uptodate, int nrsecs);
+int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq,
+                            int uptodate, int nr_sectors);
 
 /*
  * This is used on exit from the driver to designate the next irq handler
@@ -1218,7 +1222,6 @@ typedef struct ide_pci_enablebit_s {
 enum {
        /* Uses ISA control ports not PCI ones. */
        IDEPCI_FLAG_ISA_PORTS           = (1 << 0),
-       IDEPCI_FLAG_FORCE_PDC           = (1 << 1),
 };
 
 typedef struct ide_pci_device_s {
@@ -1356,7 +1359,7 @@ extern struct semaphore ide_cfg_sem;
  * ide_drive_t->hwif: constant, no locking
  */
 
-#define local_irq_set(flags)   do { local_save_flags((flags)); local_irq_enable(); } while (0)
+#define local_irq_set(flags)   do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0)
 
 extern struct bus_type ide_bus_type;