summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_rl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r--sys/pci/if_rl.c59
1 files changed, 18 insertions, 41 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 0007e71..96996e7 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -175,8 +175,7 @@ static struct rl_type rl_devs[] = {
{ LEVEL1_VENDORID, LEVEL1_DEVICEID_FPC0106TX, RL_8139,
"LevelOne FPC-0106TX" },
{ EDIMAX_VENDORID, EDIMAX_DEVICEID_EP4103DL, RL_8139,
- "Edimax EP-4103DL CardBus" },
- { 0, 0, 0, NULL }
+ "Edimax EP-4103DL CardBus" }
};
static int rl_attach(device_t);
@@ -730,48 +729,26 @@ rl_reset(struct rl_softc *sc)
static int
rl_probe(device_t dev)
{
- struct rl_softc *sc;
- struct rl_type *t = rl_devs;
- int rid;
- uint32_t hwrev;
-
- sc = device_get_softc(dev);
-
- while (t->rl_name != NULL) {
- if ((pci_get_vendor(dev) == t->rl_vid) &&
- (pci_get_device(dev) == t->rl_did)) {
- /*
- * Temporarily map the I/O space
- * so we can read the chip ID register.
- */
- rid = RL_RID;
- sc->rl_res = bus_alloc_resource_any(dev, RL_RES, &rid,
- RF_ACTIVE);
- if (sc->rl_res == NULL) {
- device_printf(dev,
- "couldn't map ports/memory\n");
- return (ENXIO);
- }
- sc->rl_btag = rman_get_bustag(sc->rl_res);
- sc->rl_bhandle = rman_get_bushandle(sc->rl_res);
-
- hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
- bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res);
-
- /* Don't attach to 8139C+ or 8169/8110 chips. */
- if (hwrev == RL_HWREV_8139CPLUS ||
- (hwrev == RL_HWREV_8169 &&
- t->rl_did == RT_DEVICEID_8169) ||
- hwrev == RL_HWREV_8169S ||
- hwrev == RL_HWREV_8110S) {
- t++;
- continue;
- }
-
+ struct rl_type *t;
+ uint16_t devid, revid, vendor;
+ int i;
+
+ vendor = pci_get_vendor(dev);
+ devid = pci_get_device(dev);
+ revid = pci_get_revid(dev);
+
+ if (vendor == RT_VENDORID && devid == RT_DEVICEID_8139) {
+ if (revid == 0x20) {
+ /* 8139C+, let re(4) take care of this device. */
+ return (ENXIO);
+ }
+ }
+ t = rl_devs;
+ for (i = 0; i < sizeof(rl_devs) / sizeof(rl_devs[0]); i++, t++) {
+ if (vendor == t->rl_vid && devid == t->rl_did) {
device_set_desc(dev, t->rl_name);
return (BUS_PROBE_DEFAULT);
}
- t++;
}
return (ENXIO);
OpenPOWER on IntegriCloud