diff options
author | imp <imp@FreeBSD.org> | 2005-02-14 22:27:03 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-02-14 22:27:03 +0000 |
commit | 78aeeebdd3ea8f5ea23db5d5f7a007aab8a10bc1 (patch) | |
tree | 0753278ad1fd6b97f60d0d5d42f756eb06ca76c4 /sys | |
parent | 8fd780af2427a55e915b13e7f8ebde745d1f4a92 (diff) | |
download | FreeBSD-src-78aeeebdd3ea8f5ea23db5d5f7a007aab8a10bc1.zip FreeBSD-src-78aeeebdd3ea8f5ea23db5d5f7a007aab8a10bc1.tar.gz |
o It turns out that most of the ne-2000 cards that I have got real unhappy
with the latest changes. They actually have valid ROM data at location
0 of memory, just like a real NE-2000 ISA card. Use this data, if
the ROM passes a few basic tests, as an additional source for the MAC
address. Prefer the CIS over this source, but have it take precidence
over falling back to reading the attribtue memory.
o Minor cleanup of a few devices that we match on based on CIS string.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ed/if_ed_pccard.c | 51 | ||||
-rw-r--r-- | sys/dev/pccard/pccarddevs | 7 |
2 files changed, 45 insertions, 13 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index dd86f94..f3a7cfb 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -155,6 +155,7 @@ static const struct ed_product { { PCMCIA_CARD(NETGEAR, FA410TXC, 0), NE2000DVF_DL10019}, { PCMCIA_CARD(NETGEAR, FA411, 0), NE2000DVF_AX88190}, { PCMCIA_CARD(NEXTCOM, NEXTHAWK, 0), 0}, + { PCMCIA_CARD(OEM2, ETHERNET, 0), 0}, { PCMCIA_CARD(PLANET, SMARTCOM2000, 0), 0 }, { PCMCIA_CARD(PREMAX, PE200, 0), 0}, { PCMCIA_CARD(RACORE, ETHERNET, 0), 0}, @@ -167,7 +168,7 @@ static const struct ed_product { { PCMCIA_CARD(SOCKET, LP_ETH_10_100_CF, 0), NE2000DVF_DL10019}, { PCMCIA_CARD(SVEC, COMBOCARD, 0), 0}, { PCMCIA_CARD(SVEC, LANCARD, 0), 0}, - { PCMCIA_CARD(SYNERGY21, S21810, 0), 0}, + { PCMCIA_CARD(TAMARACK, ETHERNET, 0), 0}, { PCMCIA_CARD(TDK, LAK_CD031, 0), 0}, { PCMCIA_CARD(TELECOMDEVICE, TCD_HPC100, 0), NE2000DVF_AX88190 }, { PCMCIA_CARD(XIRCOM, CFE_10, 0), 0}, @@ -237,10 +238,34 @@ end2: } static int -ed_pccard_attach(device_t dev) +ed_pccard_rom_mac(device_t dev, uint8_t *enaddr) { - int error; + struct ed_softc *sc = device_get_softc(dev); + uint8_t romdata[16]; int i; + + /* + * Read in the rom data at location 0. We should see one of + * two patterns. Either you'll see odd locations 0xff and + * even locations data, or you'll see odd and even locations + * mirror each other. In addition, the last two even locations + * should be 0. If they aren't 0, then we'll assume that + * there's no valid ROM data on this card and try another method + * to recover the MAC address. Since there are no NE-1000 + * based PC Card devices, we'll assume we're 16-bit. + */ + ed_pio_readmem(sc, 0, romdata, 16); + if (romdata[12] != 0 || romdata[14] != 0) + return 0; + for (i = 0; i < ETHER_ADDR_LEN; i++) + enaddr[i] = romdata[i * 2]; + return 1; +} + +static int +ed_pccard_attach(device_t dev) +{ + int error, i; struct ed_softc *sc = device_get_softc(dev); u_char sum; u_char enaddr[ETHER_ADDR_LEN]; @@ -265,12 +290,14 @@ ed_pccard_attach(device_t dev) } /* - * For the older cards, we have to get the MAC address from the - * card in some way. Let's try the standard way first. If that - * fails, check to see if the card has a hint about where to look - * in its CIS. If that fails, maybe we should look at some default - * value. In all fails, we should fail the attach, but don't right - * now. + * For the older cards, we have to get the MAC address from + * the card in some way. Let's try the standard PCMCIA way + * first. If that fails, then check to see if we have valid + * data from the standard NE-2000 data roms. If that fails, + * check to see if the card has a hint about where to look in + * its CIS. If that fails, maybe we should look at some + * default value. In all fails, we should fail the attach, + * but don't right now. */ if (sc->chip_type == ED_CHIP_TYPE_DP8390) { pccard_get_ether(dev, enaddr); @@ -278,6 +305,12 @@ ed_pccard_attach(device_t dev) device_printf(dev, "CIS MAC %6D\n", enaddr, ":"); for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++) sum |= enaddr[i]; + if (sum == 0 && ed_pccard_rom_mac(dev, enaddr)) { + if (bootverbose) + device_printf(dev, "ROM mac %6D\n", enaddr, + ":"); + sum++; + } if (sum == 0 && pp->flags & NE2000DVF_ENADDR) { for (i = 0; i < ETHER_ADDR_LEN; i++) { ed_pccard_memread(dev, pp->enoff + i * 2, diff --git a/sys/dev/pccard/pccarddevs b/sys/dev/pccard/pccarddevs index 5e5210f..0a0548a 100644 --- a/sys/dev/pccard/pccarddevs +++ b/sys/dev/pccard/pccarddevs @@ -559,7 +559,6 @@ vendor INTERSIL2 -1 Intersil vendor IODATA3 -1 I-O DATA vendor LANTECH -1 Lantech Computer Company vendor MELCO2 -1 Melco Corporation -vendor NAKAGAWAMETAL -1 NAKAGAWA METAL vendor NDC -1 NDC vendor NEC -1 NEC vendor OEM2 -1 Generic OEM @@ -567,7 +566,7 @@ vendor PLANET -1 Planet vendor PREMAX -1 Premax vendor RPTI -1 RPTI vendor SVEC -1 SVEC/Hawking Technology -vendor SYNERGY21 -1 Synergy 21 +vendor TAMARACK -1 Tamarack vendor TEAC -1 TEAC vendor TOSHIBA -1 TOSHIBA vendor WORKBIT2 -1 WORKBIT @@ -631,7 +630,6 @@ product LINKSYS ECARD_2 { "LINKSYS", "E-CARD", NULL, NULL } Linksys E-Card product MACNICA MPS100 { "MACNICA", "MIRACLE&spSCSI", "mPS100", "D.0" } Macnica Miracle SCSI mPS100 product MEGAHERTZ XJ2288 { "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem product MELCO2 LPC2_TX { "MELCO", "LPC2-TX", NULL, NULL } Melco LPC2-TX -product NAKAGAWAMETAL LNT10TN { "PCMCIA", "LNT-10TN", NULL, NULL } NAKAGAWA METAL LNT-10TN NE2000 Compatible Card product NANOSPEED PRISM2 { "NANOSPEED", "HFA384x/IEEE", "Version&sp01.02", NULL } NANOSPEED ROOT-RZ2000 WLAN Card product NDC ND5100_E { "NDC", "Ethernet", "A", NULL } Sohoware ND5100E NE2000 Compatible Card product NEC CMZ_RT_WP { "NEC", "Wireless&spCard&spCMZ-RT-WP", "Version&sp01.01", NULL } NEC Wireless Card CMZ-RT-WP @@ -640,6 +638,7 @@ product NEWMEDIA BASICS_SCSI { "BASICS&spby&spNew&spMedia&spCorporation" "SCSI&s product NTT_ME WLAN { "NTT-ME", "11Mbps&spWireless&spLAN&spPC&spCard", NULL, NULL } NTT-ME 11Mbps Wireless LAN PC Card product OEM2 CDROM1 { "PCMCIA", "CD-ROM", NULL, NULL } Generic PCMCIA CD-ROM product OEM2 IDE { "PCMCIA", "IDE&spCARD", NULL, NULL } Generic PCMCIA IDE CARD +product OEM2 ETHERNET { "PCMCIA", "Ethernet", NULL, NULL } NE2000 PC Card product PLANET SMARTCOM2000 { "PCMCIA", "UE2212", NULL, NULL } Planet SmartCOM 2000 product RPTI EP400 { "RPTI&spLTD.", "EP400", "CISV100", NULL } RPTI EP400 product RPTI EP401 { "RPTI", "EP401&spEthernet&spNE2000&spCompatible", NULL, NULL } RPTI EP401 @@ -655,7 +654,7 @@ product SMC 2632W { "SMC", "SMC2632W", "Version&sp01.02", NULL } SMC 2632 EZ Co product SMC 8041 { "SMC", "8041TX-10/100-PC-Card-V2", NULL, NULL } SMC 8041TX 10/100 PC Card product SVEC COMBOCARD { "Ethernet", "Adapter", NULL, NULL } SVEC/Hawking Tech. Combo Card product SVEC LANCARD { "SVEC", "FD605&spPCMCIA&spEtherNet&spCard", "V1-1", NULL } SVEC PCMCIA Lan Card -product SYNERGY21 S21810 { "PCMCIA", "Ethernet", "A", "004743118001" } Synergy 21 S21810+ NE2000 Compatible Card +product TAMARACK ETHERNET { "TAMARACK", "Ethernet", NULL, NULL } TAMARACK NE2000 PC Card product TEAC IDECARDII { NULL, "NinjaATA-", NULL, NULL } TEAC IDE Card/II product TOSHIBA CBIDE2 { "LOOKMEET", "CBIDE2&sp&sp&sp&sp&sp&sp", NULL, NULL } TOSHIBA PA2673U CBIDE2/16-bit mode (IO-DATA OEM) product WORKBIT2 NINJA_SCSI3 { "WBT", "NinjaSCSI-3", NULL, NULL } WORKBIT Ninja SCSI series |