ISA bus driver updated to report devices as present only if a driver

thinks they are.
Other bus drivers modified for consistency.
This commit is contained in:
Michael Brown
2005-04-26 12:30:14 +00:00
parent 3a7967a38a
commit 3dbdeb588f
10 changed files with 86 additions and 62 deletions

View File

@@ -28,7 +28,7 @@ struct device_driver;
* A physical device location on a bus.
*
*/
#define BUS_LOC_SIZE 4
#define BUS_LOC_SIZE 8
struct bus_loc {
char bytes[BUS_LOC_SIZE];
};

View File

@@ -66,10 +66,11 @@ struct eisa_driver {
* Define an EISA driver
*
*/
#define EISA_DRIVER( _ids ) { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
}
#define EISA_DRIVER( _name, _ids ) \
static struct eisa_driver _name = { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
}
/*
* Functions in eisa.c

View File

@@ -9,10 +9,11 @@
* A location on an ISA bus
*
*/
struct isa_driver;
struct isa_loc {
unsigned int driver;
unsigned int probe_idx;
};
#define ISA_MAX_PROBE_IDX 255 /* Unlikely to ever be more than ~20 */
/*
* A physical ISA device
@@ -20,7 +21,7 @@ struct isa_loc {
*/
struct isa_device {
const char *name;
unsigned int driver_probe_idx;
struct isa_driver *driver;
uint16_t ioaddr;
uint16_t mfg_id;
uint16_t prod_id;
@@ -47,12 +48,14 @@ struct isa_driver {
uint16_t mfg_id;
uint16_t prod_id;
};
#define __isa_driver __attribute__ (( section ( ".drivers.isa" ) ))
/*
* Define an ISA driver
*
*/
#define ISA_DRIVER( _probe_addrs, _probe_addr, _mfg_id, _prod_id ) { \
#define ISA_DRIVER( _name, _probe_addrs, _probe_addr, _mfg_id, _prod_id ) \
static struct isa_driver _name __isa_driver = { \
.probe_addrs = _probe_addrs, \
.addr_count = sizeof ( _probe_addrs ) / sizeof ( _probe_addrs[0] ), \
.probe_addr = _probe_addr, \

View File

@@ -200,10 +200,11 @@ struct isapnp_driver {
* Define an ISAPnP driver
*
*/
#define ISAPNP_DRIVER( _ids ) { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
}
#define ISAPNP_DRIVER( _name, _ids ) \
static struct isapnp_driver _name = { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
}
/*
* Functions in isapnp.c

View File

@@ -67,10 +67,11 @@ struct mca_driver {
* Define an MCA driver
*
*/
#define MCA_DRIVER( _ids ) { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
}
#define MCA_DRIVER( _name, _ids ) \
static struct mca_driver _name = { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
}
/*
* Functions in mca.c

View File

@@ -307,7 +307,8 @@ struct pci_driver {
* Define a PCI driver.
*
*/
#define PCI_DRIVER( _ids, _class ) { \
#define PCI_DRIVER( _name, _ids, _class ) \
static struct pci_driver _name = { \
.ids = _ids, \
.id_count = sizeof ( _ids ) / sizeof ( _ids[0] ), \
.class = _class, \