diff options
author | hosokawa <hosokawa@FreeBSD.org> | 2000-01-21 09:05:49 +0000 |
---|---|---|
committer | hosokawa <hosokawa@FreeBSD.org> | 2000-01-21 09:05:49 +0000 |
commit | cdccd2138aae9ccf11f60d140c42b06e19ddcb90 (patch) | |
tree | 6b142183251e6ffd7ab157f79f14b6c703dc5bf5 /sys/dev/sn | |
parent | 0d26a5787c7ace21f59b57c6a8bcb639602cecfe (diff) | |
download | FreeBSD-src-cdccd2138aae9ccf11f60d140c42b06e19ddcb90.zip FreeBSD-src-cdccd2138aae9ccf11f60d140c42b06e19ddcb90.tar.gz |
Added support for hex-encoded MAC address of Megahertz X-Jack Ethernet Card
Reviewed by: Warner Losh <imp@village.org>
Diffstat (limited to 'sys/dev/sn')
-rw-r--r-- | sys/dev/sn/if_sn.c | 20 | ||||
-rw-r--r-- | sys/dev/sn/if_sn_pccard.c | 13 |
2 files changed, 19 insertions, 14 deletions
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 4bf1553..e03e868 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -148,9 +148,6 @@ static u_int smc_crc(u_char *); */ #define SW_PAD -/* XXX KLUDGE XXX */ -u_char sn_pccard_macaddr[6] = { 0x00, 0x00, 0x86, 0x10, 0x2b, 0xc0 }; - static const char *chip_ids[15] = { NULL, NULL, NULL, /* 3 */ "SMC91C90/91C92", @@ -173,6 +170,7 @@ sn_attach(device_t dev) struct sockaddr_dl *sdl; int rev; u_short address; + int j; sn_activate(dev); @@ -192,18 +190,12 @@ sn_attach(device_t dev) i = inw(BASE + CONFIG_REG_W); printf(i & CR_AUI_SELECT ? "AUI" : "UTP"); - if (1) { - /* XXX The pccard probe routine for megahearts needs to */ - /* XXX snag this from your info 2 */ - int j; - - for (j = 0; j < 3; j++) { - u_short w; + for (j = 0; j < 3; j++) { + u_short w; - w = (u_short)sn_pccard_macaddr[j * 2] | - (((u_short)sn_pccard_macaddr[j * 2 + 1]) << 8); - outw(BASE + IAR_ADDR0_REG_W + j * 2, w); - } + w = (u_short)sc->arpcom.ac_enaddr[j * 2] | + (((u_short)sc->arpcom.ac_enaddr[j * 2 + 1]) << 8); + outw(BASE + IAR_ADDR0_REG_W + j * 2, w); } /* diff --git a/sys/dev/sn/if_sn_pccard.c b/sys/dev/sn/if_sn_pccard.c index 7b0d608..5af8405 100644 --- a/sys/dev/sn/if_sn_pccard.c +++ b/sys/dev/sn/if_sn_pccard.c @@ -44,6 +44,7 @@ #include <machine/resource.h> #include <sys/rman.h> +#include <net/ethernet.h> #include <net/if.h> #include <net/if_arp.h> #include <net/if_media.h> @@ -52,6 +53,7 @@ #include <dev/sn/if_snreg.h> #include <dev/sn/if_snvar.h> +#include <dev/pccard/pccardvar.h> /* * Initialize the device - called from Slot manager. @@ -65,6 +67,17 @@ sn_pccard_probe(device_t dev) static int sn_pccard_attach(device_t dev) { + struct sn_softc *sc = device_get_softc(dev); + int i; + u_char sum; + u_char ether_addr[ETHER_ADDR_LEN]; + + pccard_get_ether(dev, ether_addr); + for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++) + sum |= ether_addr[i]; + if (sum) + bcopy(ether_addr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN); + return (sn_attach(dev)); } |