summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2002-12-29 21:49:02 -0800
committerGreg Kroah-Hartman <greg@kroah.com>2002-12-29 21:49:02 -0800
commit708d7b682c14fb0c45ec3e917d2e49aca011c5a0 (patch)
tree7cadaeb39f02802fe5d47de13176f8ce0775c0ca /include/linux
parent8ac9b734a670cea1d17f78e6ea15fe458f2d4c66 (diff)
parent45b9faf354d0aa5554dc2607f8168a34ce625a3a (diff)
Merge
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/isapnp.h138
-rw-r--r--include/linux/pci.h19
-rw-r--r--include/linux/pnp.h12
3 files changed, 13 insertions, 156 deletions
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index 7008adef1677..3e03c39fbc40 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -24,6 +24,7 @@
#include <linux/config.h>
#include <linux/errno.h>
+#include <linux/pnp.h>
/*
* Configuration registers (TODO: change by specification)
@@ -54,79 +55,7 @@
#ifdef __KERNEL__
-#include <linux/pci.h>
-
-#define ISAPNP_PORT_FLAG_16BITADDR (1<<0)
-#define ISAPNP_PORT_FLAG_FIXED (1<<1)
-
-struct isapnp_port {
- unsigned short min; /* min base number */
- unsigned short max; /* max base number */
- unsigned char align; /* align boundary */
- unsigned char size; /* size of range */
- unsigned char flags; /* port flags */
- unsigned char pad; /* pad */
- struct isapnp_resources *res; /* parent */
- struct isapnp_port *next; /* next port */
-};
-
-struct isapnp_irq {
- unsigned short map; /* bitmaks for IRQ lines */
- unsigned char flags; /* IRQ flags */
- unsigned char pad; /* pad */
- struct isapnp_resources *res; /* parent */
- struct isapnp_irq *next; /* next IRQ */
-};
-
-struct isapnp_dma {
- unsigned char map; /* bitmask for DMA channels */
- unsigned char flags; /* DMA flags */
- struct isapnp_resources *res; /* parent */
- struct isapnp_dma *next; /* next port */
-};
-
-struct isapnp_mem {
- unsigned int min; /* min base number */
- unsigned int max; /* max base number */
- unsigned int align; /* align boundary */
- unsigned int size; /* size of range */
- unsigned char flags; /* memory flags */
- unsigned char pad; /* pad */
- struct isapnp_resources *res; /* parent */
- struct isapnp_mem *next; /* next memory resource */
-};
-
-struct isapnp_mem32 {
- /* TODO */
- unsigned char data[17];
- struct isapnp_resources *res; /* parent */
- struct isapnp_mem32 *next; /* next 32-bit memory resource */
-};
-
-struct isapnp_fixup {
- unsigned short vendor; /* matching vendor */
- unsigned short device; /* matching device */
- void (*quirk_function)(struct pci_dev *dev); /* fixup function */
-};
-
-
-#define ISAPNP_RES_PRIORITY_PREFERRED 0
-#define ISAPNP_RES_PRIORITY_ACCEPTABLE 1
-#define ISAPNP_RES_PRIORITY_FUNCTIONAL 2
-#define ISAPNP_RES_PRIORITY_INVALID 65535
-
-struct isapnp_resources {
- unsigned short priority; /* priority */
- unsigned short dependent; /* dependent resources */
- struct isapnp_port *port; /* first port */
- struct isapnp_irq *irq; /* first IRQ */
- struct isapnp_dma *dma; /* first DMA */
- struct isapnp_mem *mem; /* first memory resource */
- struct isapnp_mem32 *mem32; /* first 32-bit memory */
- struct pci_dev *dev; /* parent */
- struct isapnp_resources *alt; /* alternative resource (aka dependent resources) */
- struct isapnp_resources *next; /* next resource */
-};
+#define DEVICE_COUNT_COMPATIBLE 4
#define ISAPNP_ANY_ID 0xffff
#define ISAPNP_CARD_DEVS 8
@@ -162,14 +91,6 @@ struct isapnp_device_id {
unsigned long driver_data; /* data private to the driver */
};
-struct isapnp_driver {
- struct list_head node;
- char *name;
- const struct isapnp_device_id *id_table; /* NULL if wants all devices */
- int (*probe) (struct pci_dev *dev, const struct isapnp_device_id *id); /* New device inserted */
- void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
-};
-
#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
#define __ISAPNP__
@@ -188,7 +109,6 @@ void isapnp_wake(unsigned char csn);
void isapnp_device(unsigned char device);
void isapnp_activate(unsigned char device);
void isapnp_deactivate(unsigned char device);
-void isapnp_fixup_device(struct pci_dev *dev);
void *isapnp_alloc(long size);
#ifdef CONFIG_PROC_FS
@@ -199,40 +119,8 @@ static inline isapnp_proc_init(void) { return 0; }
static inline isapnp_proc_done(void) { return 0; }
#endif
-/* misc */
-void isapnp_resource_change(struct resource *resource,
- unsigned long start,
- unsigned long size);
/* init/main.c */
int isapnp_init(void);
-/* manager */
-static inline struct pci_bus *isapnp_find_card(unsigned short vendor,
- unsigned short device,
- struct pci_bus *from) { return NULL; }
-static inline struct pci_dev *isapnp_find_dev(struct pci_bus *card,
- unsigned short vendor,
- unsigned short function,
- struct pci_dev *from) { return NULL; }
-static inline int isapnp_probe_cards(const struct isapnp_card_id *ids,
- int (*probe)(struct pci_bus *card,
- const struct isapnp_card_id *id)) { return -ENODEV; }
-static inline int isapnp_probe_devs(const struct isapnp_device_id *ids,
- int (*probe)(struct pci_dev *dev,
- const struct isapnp_device_id *id)) { return -ENODEV; }
-static inline int isapnp_activate_dev(struct pci_dev *dev, const char *name) { return -ENODEV; }
-
-static inline int isapnp_register_driver(struct isapnp_driver *drv) { return 0; }
-
-static inline void isapnp_unregister_driver(struct isapnp_driver *drv) { }
-
-extern struct list_head isapnp_cards;
-extern struct list_head isapnp_devices;
-extern struct pnp_protocol isapnp_protocol;
-
-#define isapnp_for_each_card(card) \
- for(card = to_pnp_card(isapnp_cards.next); card != to_pnp_card(&isapnp_cards); card = to_pnp_card(card->node.next))
-#define isapnp_for_each_dev(dev) \
- for(dev = protocol_to_pnp_dev(isapnp_protocol.devices.next); dev != protocol_to_pnp_dev(&isapnp_protocol.devices); dev = protocol_to_pnp_dev(dev->dev_list.next))
#else /* !CONFIG_ISAPNP */
@@ -250,28 +138,6 @@ static inline void isapnp_wake(unsigned char csn) { ; }
static inline void isapnp_device(unsigned char device) { ; }
static inline void isapnp_activate(unsigned char device) { ; }
static inline void isapnp_deactivate(unsigned char device) { ; }
-/* manager */
-static inline struct pci_bus *isapnp_find_card(unsigned short vendor,
- unsigned short device,
- struct pci_bus *from) { return NULL; }
-static inline struct pci_dev *isapnp_find_dev(struct pci_bus *card,
- unsigned short vendor,
- unsigned short function,
- struct pci_dev *from) { return NULL; }
-static inline int isapnp_probe_cards(const struct isapnp_card_id *ids,
- int (*probe)(struct pci_bus *card,
- const struct isapnp_card_id *id)) { return -ENODEV; }
-static inline int isapnp_probe_devs(const struct isapnp_device_id *ids,
- int (*probe)(struct pci_dev *dev,
- const struct isapnp_device_id *id)) { return -ENODEV; }
-static inline void isapnp_resource_change(struct resource *resource,
- unsigned long start,
- unsigned long size) { ; }
-static inline int isapnp_activate_dev(struct pci_dev *dev, const char *name) { return -ENODEV; }
-
-static inline int isapnp_register_driver(struct isapnp_driver *drv) { return 0; }
-
-static inline void isapnp_unregister_driver(struct isapnp_driver *drv) { }
#endif /* CONFIG_ISAPNP */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 9d4e269ac1db..553864c6a5fb 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -362,7 +362,7 @@ enum pci_mmap_state {
#define PCI_ANY_ID (~0)
/*
- * The pci_dev structure is used to describe both PCI and ISAPnP devices.
+ * The pci_dev structure is used to describe PCI devices.
*/
struct pci_dev {
struct list_head global_list; /* node in list of all PCI devices */
@@ -410,16 +410,9 @@ struct pci_dev {
struct resource irq_resource[DEVICE_COUNT_IRQ];
char slot_name[8]; /* slot name */
- int active; /* ISAPnP: device is active */
- int ro; /* ISAPnP: read only */
- unsigned short regs; /* ISAPnP: supported registers */
/* These fields are used by common fixups */
- unsigned short transparent:1; /* Transparent PCI bridge */
-
- int (*prepare)(struct pci_dev *dev); /* ISAPnP hooks */
- int (*activate)(struct pci_dev *dev);
- int (*deactivate)(struct pci_dev *dev);
+ unsigned int transparent:1; /* Transparent PCI bridge */
};
#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
@@ -463,13 +456,7 @@ struct pci_bus {
unsigned char subordinate; /* max number of subordinate buses */
char name[48];
- unsigned short vendor;
- unsigned short device;
- unsigned int serial; /* serial number */
- unsigned char pnpver; /* Plug & Play version */
- unsigned char productver; /* product version */
- unsigned char checksum; /* if zero - checksum passed */
- unsigned char pad1;
+
struct device * dev;
};
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index ba87a50fb02d..7d4e9fd6ae0e 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -51,11 +51,15 @@ struct pnp_card {
#define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
#define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
-#define to_pnp_card(n) list_entry(n, struct pnp_card, dev)
+#define to_pnp_card(n) container_of(n, struct pnp_card, dev)
#define pnp_for_each_card(card) \
- for(dev = global_to_pnp_card(pnp_cards.next); \
- dev != global_to_pnp_card(&cards); \
- dev = global_to_pnp_card(card>global_list.next))
+ for((card) = global_to_pnp_card(pnp_cards.next); \
+ (card) != global_to_pnp_card(&pnp_cards); \
+ (card) = global_to_pnp_card((card)->global_list.next))
+#define pnp_card_for_each_dev(card,dev) \
+ for((dev) = card_to_pnp_dev((card)->devices.next); \
+ (dev) != card_to_pnp_dev(&(card)->devices); \
+ (dev) = card_to_pnp_dev((dev)->card_list.next))
static inline void *pnpc_get_drvdata (struct pnp_card *pcard)
{