summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-10-30 07:54:38 +0000
committerwpaul <wpaul@FreeBSD.org>2000-10-30 07:54:38 +0000
commit5b7c9f6a51fe9ce55b3846f1ad3e63ee333a12b6 (patch)
tree863ba13a2750fb69edb36481c129683f838e1770 /sys
parentb839b1116f390c669ecb1f948656d39be198bba5 (diff)
downloadFreeBSD-src-5b7c9f6a51fe9ce55b3846f1ad3e63ee333a12b6.zip
FreeBSD-src-5b7c9f6a51fe9ce55b3846f1ad3e63ee333a12b6.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/if_rl.c7
-rw-r--r--sys/pci/if_rlreg.h4
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;
OpenPOWER on IntegriCloud