diff options
author | hosokawa <hosokawa@FreeBSD.org> | 2000-01-21 03:08:46 +0000 |
---|---|---|
committer | hosokawa <hosokawa@FreeBSD.org> | 2000-01-21 03:08:46 +0000 |
commit | 7ce7351da146d0eddcacf9714003c07a4369b00c (patch) | |
tree | e41abc40a42cdb05a522a6aeb9a55bf82c6c9101 /sys/dev/ed/if_ed_pccard.c | |
parent | c6da76a1a6b1b60435d8df410d11a7a497db504a (diff) | |
download | FreeBSD-src-7ce7351da146d0eddcacf9714003c07a4369b00c.zip FreeBSD-src-7ce7351da146d0eddcacf9714003c07a4369b00c.tar.gz |
Propagate MAC address in CIS tupple to dev/ed/ driver.
Many ed-based Ethernet PC-cards can't get correct MAC address without
this patch.
Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
Reviewed by: Warner Losh <imp@village.org>
Diffstat (limited to 'sys/dev/ed/if_ed_pccard.c')
-rw-r--r-- | sys/dev/ed/if_ed_pccard.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c index a8c819a..af8cd9a 100644 --- a/sys/dev/ed/if_ed_pccard.c +++ b/sys/dev/ed/if_ed_pccard.c @@ -42,6 +42,7 @@ #include <net/if_mib.h> #include <dev/ed/if_edvar.h> +#include <dev/pccard/pccardvar.h> /* * PC-Card (PCMCIA) specific code. @@ -132,6 +133,9 @@ ed_pccard_attach(device_t dev) struct ed_softc *sc = device_get_softc(dev); int flags = device_get_flags(dev); int error; + int i; + u_char sum; + u_char ether_addr[ETHER_ADDR_LEN]; if (sc->port_used > 0) ed_alloc_port(dev, sc->port_rid, sc->port_used); @@ -147,6 +151,12 @@ ed_pccard_attach(device_t dev) return (error); } + 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); + error = ed_attach(sc, device_get_unit(dev), flags); return (error); } |