netfilter: xtables: provide invoked family value to extensions
[safe/jmp/linux-2.6] / include / linux / ide.h
index 46d5bfe..1524829 100644 (file)
@@ -211,13 +211,16 @@ static inline int __ide_default_irq(unsigned long base)
        return 0;
 }
 
+#if defined(CONFIG_ARM) || defined(CONFIG_FRV) || defined(CONFIG_M68K) || \
+    defined(CONFIG_MIPS) || defined(CONFIG_MN10300) || defined(CONFIG_PARISC) \
+    || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || defined(CONFIG_SPARC64)
 #include <asm/ide.h>
-
-#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
-#undef MAX_HWIFS
-#define MAX_HWIFS      CONFIG_IDE_MAX_HWIFS
+#else
+#include <asm-generic/ide_iops.h>
 #endif
 
+#define MAX_HWIFS      10
+
 /* Currently only m68k, apus and m8xx need it */
 #ifndef IDE_ARCH_ACK_INTR
 # define ide_ack_intr(hwif) (1)
@@ -308,7 +311,65 @@ struct ide_acpi_drive_link;
 struct ide_acpi_hwif_link;
 #endif
 
-typedef struct ide_drive_s {
+/* ATAPI device flags */
+enum {
+       IDE_AFLAG_DRQ_INTERRUPT         = (1 << 0),
+       IDE_AFLAG_MEDIA_CHANGED         = (1 << 1),
+
+       /* ide-cd */
+       /* Drive cannot lock the door. */
+       IDE_AFLAG_NO_DOORLOCK           = (1 << 2),
+       /* Drive cannot eject the disc. */
+       IDE_AFLAG_NO_EJECT              = (1 << 3),
+       /* Drive is a pre ATAPI 1.2 drive. */
+       IDE_AFLAG_PRE_ATAPI12           = (1 << 4),
+       /* TOC addresses are in BCD. */
+       IDE_AFLAG_TOCADDR_AS_BCD        = (1 << 5),
+       /* TOC track numbers are in BCD. */
+       IDE_AFLAG_TOCTRACKS_AS_BCD      = (1 << 6),
+       /*
+        * Drive does not provide data in multiples of SECTOR_SIZE
+        * when more than one interrupt is needed.
+        */
+       IDE_AFLAG_LIMIT_NFRAMES         = (1 << 7),
+       /* Seeking in progress. */
+       IDE_AFLAG_SEEKING               = (1 << 8),
+       /* Saved TOC information is current. */
+       IDE_AFLAG_TOC_VALID             = (1 << 9),
+       /* We think that the drive door is locked. */
+       IDE_AFLAG_DOOR_LOCKED           = (1 << 10),
+       /* SET_CD_SPEED command is unsupported. */
+       IDE_AFLAG_NO_SPEED_SELECT       = (1 << 11),
+       IDE_AFLAG_VERTOS_300_SSD        = (1 << 12),
+       IDE_AFLAG_VERTOS_600_ESD        = (1 << 13),
+       IDE_AFLAG_SANYO_3CD             = (1 << 14),
+       IDE_AFLAG_FULL_CAPS_PAGE        = (1 << 15),
+       IDE_AFLAG_PLAY_AUDIO_OK         = (1 << 16),
+       IDE_AFLAG_LE_SPEED_FIELDS       = (1 << 17),
+
+       /* ide-floppy */
+       /* Format in progress */
+       IDE_AFLAG_FORMAT_IN_PROGRESS    = (1 << 18),
+       /* Avoid commands not supported in Clik drive */
+       IDE_AFLAG_CLIK_DRIVE            = (1 << 19),
+       /* Requires BH algorithm for packets */
+       IDE_AFLAG_ZIP_DRIVE             = (1 << 20),
+
+       /* ide-tape */
+       IDE_AFLAG_IGNORE_DSC            = (1 << 21),
+       /* 0 When the tape position is unknown */
+       IDE_AFLAG_ADDRESS_VALID         = (1 << 22),
+       /* Device already opened */
+       IDE_AFLAG_BUSY                  = (1 << 23),
+       /* Attempt to auto-detect the current user block size */
+       IDE_AFLAG_DETECT_BS             = (1 << 24),
+       /* 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)
+};
+
+struct ide_drive_s {
        char            name[4];        /* drive name, such as "hda" */
         char            driver_req[10];        /* requests specific driver */
 
@@ -400,7 +461,14 @@ typedef struct ide_drive_s {
        struct list_head list;
        struct device   gendev;
        struct completion gendev_rel_comp;      /* to deal with device release() */
-} ide_drive_t;
+
+       /* callback for packet commands */
+       void (*pc_callback)(struct ide_drive_s *);
+
+       unsigned long atapi_flags;
+};
+
+typedef struct ide_drive_s ide_drive_t;
 
 #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev)
 
@@ -430,24 +498,33 @@ struct ide_tp_ops {
 
 extern const struct ide_tp_ops default_tp_ops;
 
+/**
+ * struct ide_port_ops - IDE port operations
+ *
+ * @init_dev:          host specific initialization of a device
+ * @set_pio_mode:      routine to program host for PIO mode
+ * @set_dma_mode:      routine to program host for DMA mode
+ * @selectproc:                tweaks hardware to select drive
+ * @reset_poll:                chipset polling based on hba specifics
+ * @pre_reset:         chipset specific changes to default for device-hba resets
+ * @resetproc:         routine to reset controller after a disk reset
+ * @maskproc:          special host masking for drive selection
+ * @quirkproc:         check host's drive quirk list
+ *
+ * @mdma_filter:       filter MDMA modes
+ * @udma_filter:       filter UDMA modes
+ *
+ * @cable_detect:      detect cable type
+ */
 struct ide_port_ops {
-       /* host specific initialization of a device */
        void    (*init_dev)(ide_drive_t *);
-       /* routine to program host for PIO mode */
        void    (*set_pio_mode)(ide_drive_t *, const u8);
-       /* routine to program host for DMA mode */
        void    (*set_dma_mode)(ide_drive_t *, const u8);
-       /* tweaks hardware to select drive */
        void    (*selectproc)(ide_drive_t *);
-       /* chipset polling based on hba specifics */
        int     (*reset_poll)(ide_drive_t *);
-       /* chipset specific changes to default for device-hba resets */
        void    (*pre_reset)(ide_drive_t *);
-       /* routine to reset controller after a disk reset */
        void    (*resetproc)(ide_drive_t *);
-       /* special host masking for drive selection */
        void    (*maskproc)(ide_drive_t *, int);
-       /* check host's drive quirk list */
        void    (*quirkproc)(ide_drive_t *);
 
        u8      (*mdma_filter)(ide_drive_t *);
@@ -467,12 +544,16 @@ struct ide_dma_ops {
        void    (*dma_timeout)(struct ide_drive_s *);
 };
 
+struct ide_host;
+
 typedef struct hwif_s {
        struct hwif_s *next;            /* for linked-list in ide_hwgroup_t */
        struct hwif_s *mate;            /* other hwif from same PCI chip */
        struct hwgroup_s *hwgroup;      /* actually (ide_hwgroup_t *) */
        struct proc_dir_entry *proc;    /* /proc/ide/ directory entry */
 
+       struct ide_host *host;
+
        char name[6];                   /* name of interface, eg. "ide0" */
 
        struct ide_io_ports     io_ports;
@@ -561,6 +642,9 @@ typedef struct hwif_s {
 struct ide_host {
        ide_hwif_t      *ports[MAX_HWIFS];
        unsigned int    n_ports;
+       struct device   *dev[2];
+       unsigned long   host_flags;
+       void            *host_priv;
 };
 
 /*
@@ -622,8 +706,6 @@ enum {
        PC_FLAG_WRITING                 = (1 << 6),
        /* command timed out */
        PC_FLAG_TIMEDOUT                = (1 << 7),
-       PC_FLAG_ZIP_DRIVE               = (1 << 8),
-       PC_FLAG_DRQ_INTERRUPT           = (1 << 9),
 };
 
 struct ide_atapi_pc {
@@ -657,8 +739,6 @@ struct ide_atapi_pc {
         */
        u8 pc_buf[256];
 
-       void (*callback)(ide_drive_t *);
-
        /* idetape only */
        struct idetape_bh *bh;
        char *b_data;
@@ -813,6 +893,9 @@ struct ide_driver_s {
 
 #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver)
 
+int ide_device_get(ide_drive_t *);
+void ide_device_put(ide_drive_t *);
+
 int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
 
 extern int ide_vlb_clk;
@@ -1028,7 +1111,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
@@ -1121,7 +1203,7 @@ enum {
 
 struct ide_port_info {
        char                    *name;
-       unsigned int            (*init_chipset)(struct pci_dev *, const char *);
+       unsigned int            (*init_chipset)(struct pci_dev *);
        void                    (*init_iops)(ide_hwif_t *);
        void                    (*init_hwif)(ide_hwif_t *);
        int                     (*init_dma)(ide_hwif_t *,
@@ -1140,8 +1222,10 @@ struct ide_port_info {
        u8                      udma_mask;
 };
 
-int ide_setup_pci_device(struct pci_dev *, const struct ide_port_info *);
-int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, const struct ide_port_info *);
+int ide_pci_init_one(struct pci_dev *, const struct ide_port_info *, void *);
+int ide_pci_init_two(struct pci_dev *, struct pci_dev *,
+                    const struct ide_port_info *, void *);
+void ide_pci_remove(struct pci_dev *);
 
 void ide_map_sg(ide_drive_t *, struct request *);
 void ide_init_sg_cmd(ide_drive_t *, struct request *);
@@ -1190,6 +1274,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
@@ -1363,8 +1448,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)