mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Fix support for cardbus cards:
- Add DRIVER_MODULE() declaration to make this driver a child of cardbus - Handle different width EEPROMs The CIS parser still barfs when scanning this card, but it seems to probe/attach correctly anyway. I can't do a traffic test just yet since I don't have a proper crossover cable handy.
This commit is contained in:
parent
a3b266147d
commit
78d2de28df
2 changed files with 9 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue