2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-13 23:01:31 +00:00

Make isa_probe_addr a simple integer rather than a struct, to facilitate

specification of ISA_PROBE_ADDRS.
This commit is contained in:
Michael Brown 2005-04-16 09:30:48 +00:00
parent a60aadf9e9
commit 9f02376409
7 changed files with 29 additions and 32 deletions

View File

@ -13,7 +13,10 @@
* instead. Some cards (e.g. the 3c509) implement a proprietary
* ISAPnP-like mechanism.
*
* The ISA probe address list can be overridden by config.c; if
* The ISA probe address list can be overridden by config.c; if the
* user specifies ISA_PROBE_ADDRS then that list will be used first.
* (If ISA_PROBE_ADDRS ends with a zero, the driver's own list will
* never be used).
*/
/*
@ -49,7 +52,7 @@ int find_isa_device ( struct isa_device *isa, struct isa_driver *driver ) {
}
/* Set I/O address */
ioaddr = isa_extra_probe_addrs[i].addr;
ioaddr = isa_extra_probe_addrs[i];
/* An I/O address of 0 in extra_probe_addrs list means
* stop probing (i.e. don't continue to the
@ -80,7 +83,7 @@ int find_isa_device ( struct isa_device *isa, struct isa_driver *driver ) {
}
/* Set I/O address */
ioaddr = driver->probe_addrs[i].addr;
ioaddr = driver->probe_addrs[i];
/* Use probe_addr method to see if there's a device
* present at this address.

View File

@ -463,7 +463,7 @@ static struct nic_operations cs89x0_operations = {
ETH_PROBE - Look for an adapter
***************************************************************************/
static int cs89x0_probe_addr ( uint16_t ioaddr ) {
static int cs89x0_probe_addr ( isa_probe_addr_t ioaddr ) {
/* if they give us an odd I/O address, then do ONE write to
the address port, to get it back to address zero, where we
expect to find the EISA signature word. */
@ -685,14 +685,14 @@ static int cs89x0_probe ( struct dev *dev, struct isa_device *isa ) {
return 1;
}
static struct isa_probe_addr cs89x0_probe_addrs[] = {
static isa_probe_addr_t cs89x0_probe_addrs[] = {
#ifndef EMBEDDED
/* use "conservative" default values for autoprobing */
{ 0x300 }, { 0x320 }, { 0x340 }, { 0x200 }, { 0x220 }, { 0x240 },
{ 0x260 }, { 0x280 }, { 0x2a0 }, { 0x2c0 }, { 0x2e0 },
0x300, 0x320, 0x340, 0x200, 0x220, 0x240,
0x260, 0x280, 0x2a0, 0x2c0, 0x2e0,
/* if that did not work, then be more aggressive */
{ 0x301 }, { 0x321 }, { 0x341 }, { 0x201 }, { 0x221 }, { 0x241 },
{ 0x261 }, { 0x281 }, { 0x2a1 }, { 0x2c1 }, { 0x2e1 },
0x301, 0x321, 0x341, 0x201, 0x221, 0x241,
0x261, 0x281, 0x2a1, 0x2c1, 0x2e1,
#else
0x01000300,
#endif

View File

@ -695,7 +695,7 @@ static void depca_irq(struct nic *nic __unused, irq_action_t action __unused)
static u8 nicsr;
static int depca_probe1 ( uint16_t ioaddr ) {
static int depca_probe1 ( isa_probe_addr_t ioaddr ) {
u8 data;
/* This is only correct for little endian machines, but then
Etherboot doesn't work on anything but a PC */
@ -787,8 +787,8 @@ static int depca_probe ( struct dev *dev, struct isa_device *isa ) {
return 1;
}
static struct isa_probe_addr depca_probe_addrs[] = {
{ 0x300 }, { 0x200 },
static isa_probe_addr_t depca_probe_addrs[] = {
0x300, 0x200,
};
static struct isa_driver depca_driver =

View File

@ -516,7 +516,7 @@ static int read_eeprom(uint16_t ioaddr, int location)
return (retval);
}
static int eepro_probe1 ( uint16_t ioaddr ) {
static int eepro_probe1 ( isa_probe_addr_t ioaddr ) {
int id, counter;
id = inb(ioaddr + ID_REG);
@ -600,10 +600,8 @@ static int eepro_probe ( struct dev *dev, struct isa_device *isa ) {
return 1;
}
static struct isa_probe_addr eepro_probe_addrs[] = {
{ 0x300 },
{ 0x210 }, { 0x240 }, { 0x280 }, { 0x2C0 }, { 0x200 },
{ 0x320 }, { 0x340 }, { 0x360 },
static isa_probe_addr_t eepro_probe_addrs[] = {
0x300, 0x210, 0x240, 0x280, 0x2C0, 0x200, 0x320, 0x340, 0x360,
};
static struct isa_driver eepro_driver =

View File

@ -349,7 +349,7 @@ ISA_ROM ( "skel-mca", "Skeleton MCA Adapter" );
*
**************************************************************************
*/
static int skel_isa_probe_addr ( uint16_t ioaddr __unused ) {
static int skel_isa_probe_addr ( isa_probe_addr_t ioaddr __unused ) {
return 0;
}
@ -372,9 +372,9 @@ static int skel_isa_probe ( struct dev *dev, struct isa_device *isa ) {
return 1;
}
static struct isa_probe_addr skel_isa_probe_addrs[] = {
static isa_probe_addr_t skel_isa_probe_addrs[] = {
/*
{ 0x200 }, { 0x240 },
0x200, 0x240,
*/
};

View File

@ -108,7 +108,7 @@ static void smc_reset(int ioaddr)
*
* ---------------------------------------------------------------------
*/
static int smc9000_probe_addr( unsigned short ioaddr )
static int smc9000_probe_addr( isa_probe_addr_t ioaddr )
{
word bank;
word revision_register;
@ -483,11 +483,9 @@ static int smc9000_probe ( struct dev *dev, struct isa_device *isa ) {
* change for a slightly different card, you can add it to the array.
*
*/
static struct isa_probe_addr smc9000_probe_addrs[] = {
{ 0x200 }, { 0x220 }, { 0x240 }, { 0x260 },
{ 0x280 }, { 0x2A0 }, { 0x2C0 }, { 0x2E0 },
{ 0x300 }, { 0x320 }, { 0x340 }, { 0x360 },
{ 0x380 }, { 0x3A0 }, { 0x3C0 }, { 0x3E0 },
static isa_probe_addr_t smc9000_probe_addrs[] = {
0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0,
0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0, 0x3C0, 0x3E0,
};
static struct isa_driver smc9000_driver =

View File

@ -19,9 +19,7 @@ struct isa_device {
* An individual ISA device, identified by probe address
*
*/
struct isa_probe_addr {
uint16_t addr;
} __attribute__ (( packed ));
typedef uint16_t isa_probe_addr_t;
/*
* An ISA driver, with a probe address list and a probe_addr method.
@ -32,9 +30,9 @@ struct isa_probe_addr {
*/
struct isa_driver {
const char *name;
struct isa_probe_addr *probe_addrs;
isa_probe_addr_t *probe_addrs;
unsigned int addr_count;
int ( * probe_addr ) ( uint16_t addr );
int ( * probe_addr ) ( isa_probe_addr_t addr );
uint16_t mfg_id;
uint16_t prod_id;
};
@ -72,7 +70,7 @@ extern int find_isa_boot_device ( struct dev *dev,
* config.c defines isa_extra_probe_addrs and isa_extra_probe_addr_count.
*
*/
extern struct isa_probe_addr isa_extra_probe_addrs[];
extern isa_probe_addr_t isa_extra_probe_addrs[];
extern unsigned int isa_extra_probe_addr_count;
#endif /* ISA_H */