diff options
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_rl.c | 7 | ||||
-rw-r--r-- | sys/pci/if_rlreg.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 548682e..d1448be 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -228,6 +228,7 @@ static driver_t rl_driver = { static devclass_t rl_devclass; DRIVER_MODULE(if_rl, pci, rl_driver, rl_devclass, 0, 0); +DRIVER_MODULE(if_rl, cardbus, rl_driver, rl_devclass, 0, 0); DRIVER_MODULE(miibus, rl, miibus_driver, miibus_devclass, 0, 0); #define EE_SET(x) \ @@ -247,7 +248,7 @@ static void rl_eeprom_putbyte(sc, addr) { register int d, i; - d = addr | RL_EECMD_READ; + d = addr | sc->rl_eecmd_read; /* * Feed in each bit and strobe the clock. @@ -893,6 +894,10 @@ static int rl_attach(dev) /* Reset the adapter. */ rl_reset(sc); + sc->rl_eecmd_read = RL_EECMD_READ_6BIT; + rl_read_eeprom(sc, (caddr_t)&rl_did, 0, 1, 0); + if (rl_did != 8129) + sc->rl_eecmd_read = RL_EECMD_READ_8BIT; /* * Get station address from the EEPROM. diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h index 60d1836..a023301 100644 --- a/sys/pci/if_rlreg.h +++ b/sys/pci/if_rlreg.h @@ -238,7 +238,8 @@ /* 9346 EEPROM commands */ #define RL_EECMD_WRITE 0x140 -#define RL_EECMD_READ 0x180 +#define RL_EECMD_READ_6BIT 0x180 +#define RL_EECMD_READ_8BIT 0x600 #define RL_EECMD_ERASE 0x1c0 #define RL_EE_ID 0x00 @@ -364,6 +365,7 @@ struct rl_softc { device_t rl_miibus; u_int8_t rl_unit; /* interface number */ u_int8_t rl_type; + int rl_eecmd_read; u_int8_t rl_stats_no_timeout; int rl_txthresh; struct rl_chain_data rl_cdata; |