summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-10-28 06:12:58 +0000
committerimp <imp@FreeBSD.org>1999-10-28 06:12:58 +0000
commitd75f84a056b89bcd2baad45ac0e894c0bae3ff19 (patch)
treedaa1ac00f3a855da83e0117ea5198db326194848 /sys/dev/ep
parent15b14d33bd22da5cda5fec13f2695002fea618e2 (diff)
downloadFreeBSD-src-d75f84a056b89bcd2baad45ac0e894c0bae3ff19.zip
FreeBSD-src-d75f84a056b89bcd2baad45ac0e894c0bae3ff19.tar.gz
Fix identify code. This also fixes the eeprom messages.
pccard attachments must activate the resources they want to access. ep didn't do this, so of course thee eeprom came back as busy. ed and sio already did this. It was only due to a bug in the logic that the probe succeeded. These problems have been fixed.
Diffstat (limited to 'sys/dev/ep')
-rw-r--r--sys/dev/ep/if_ep_pccard.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/dev/ep/if_ep_pccard.c b/sys/dev/ep/if_ep_pccard.c
index fb373d0..8255634 100644
--- a/sys/dev/ep/if_ep_pccard.c
+++ b/sys/dev/ep/if_ep_pccard.c
@@ -73,18 +73,13 @@ ep_pccard_probe(device_t dev)
{
struct ep_softc * sc = device_get_softc(dev);
struct ep_board * epb = &sc->epb;
- u_long port_start;
- u_long port_count;
const char * desc;
int error;
- error = bus_get_resource(dev, SYS_RES_IOPORT, 0,
- &port_start, &port_count);
- if (error != 0)
+ error = ep_alloc(dev);
+ if (error)
return error;
- sc->ep_io_addr = port_start;
-
/*
* XXX - Certain (newer?) 3Com cards need epb->cmd_off ==
* 2. Sadly, you need to have a correct cmd_off in order to
@@ -101,13 +96,15 @@ ep_pccard_probe(device_t dev)
"failed (nonfatal)\n");
epb->cmd_off = 2;
epb->prod_id = get_e(sc, EEPROM_PROD_ID);
- if ((desc = ep_pccard_identify(epb->prod_id))) {
+ if ((desc = ep_pccard_identify(epb->prod_id)) == NULL) {
device_printf(dev, "Unit failed to come ready or "
"product ID unknown! (id 0x%x)\n", epb->prod_id);
+ ep_free(dev);
return (ENXIO);
}
}
-
+ device_set_desc(dev, desc);
+ ep_free(dev);
return (0);
}
@@ -119,14 +116,14 @@ ep_pccard_identify(u_short id)
case 0x6055: /* 3C556 */
return ("3Com 3C556");
case 0x4057: /* 3C574 */
- return("3Com 3C574");
+ return ("3Com 3C574");
case 0x4b57: /* 3C574B */
- return("3Com 3C574B, Megahertz 3CCFE574BT or "
+ return ("3Com 3C574B, Megahertz 3CCFE574BT or "
"Fast Etherlink 3C574-TX");
case 0x9058: /* 3C589 */
- return("3Com Etherlink III 3C589[B/C/D]");
+ return ("3Com Etherlink III 3C589");
}
- return (0);
+ return (NULL);
}
static int
@@ -161,6 +158,8 @@ ep_pccard_attach(device_t dev)
goto bad;
}
+ sc->epb.cmd_off = 0;
+ sc->epb.prod_id = get_e(sc, EEPROM_PROD_ID);
if (!ep_pccard_card_attach(&sc->epb)) {
sc->epb.cmd_off = 2;
sc->epb.prod_id = get_e(sc, EEPROM_PROD_ID);
OpenPOWER on IntegriCloud