diff options
author | sam <sam@FreeBSD.org> | 2009-03-29 17:59:14 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-03-29 17:59:14 +0000 |
commit | 7edd0aa8efc500847d789aedf8904ab96a6fe234 (patch) | |
tree | 8bb42581e6c46229c54ff76ee3fd9dd1e507f939 /sys/dev/malo/if_malo.c | |
parent | cb768e2631a7f373d03c4b3c7fb251e76badc6a7 (diff) | |
download | FreeBSD-src-7edd0aa8efc500847d789aedf8904ab96a6fe234.zip FreeBSD-src-7edd0aa8efc500847d789aedf8904ab96a6fe234.tar.gz |
Eliminate ic_myaddr so changing the mac address of a device works correctly:
o remove ic_myaddr from ieee80211com
o change ieee80211_ifattach to take the mac address of the physical device
and use that to setup the lladdr.
o replace all references to ic_myaddr in drivers by IF_LLADDR
o related cleanups (e.g. kill dead code)
PR: kern/133178
Reviewed by: thompsa, rpaulo
Diffstat (limited to 'sys/dev/malo/if_malo.c')
-rw-r--r-- | sys/dev/malo/if_malo.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index 681c824..851b841 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -175,16 +175,10 @@ malo_bar0_write4(struct malo_softc *sc, bus_size_t off, uint32_t val) bus_space_write_4(sc->malo_io0t, sc->malo_io0h, off, val); } -static uint8_t -malo_bar1_read1(struct malo_softc *sc, bus_size_t off) -{ - return bus_space_read_1(sc->malo_io1t, sc->malo_io1h, off); -} - int malo_attach(uint16_t devid, struct malo_softc *sc) { - int error, i; + int error; struct ieee80211com *ic; struct ifnet *ifp; struct malo_hal *mh; @@ -203,16 +197,6 @@ malo_attach(uint16_t devid, struct malo_softc *sc) if_initname(ifp, device_get_name(sc->malo_dev), device_get_unit(sc->malo_dev)); - /* - * NB: get mac address from hardware directly here before we set DMAs - * for HAL because we don't want to disturb operations of HAL at BAR 1. - */ - for (i = 0; i < IEEE80211_ADDR_LEN; i++) { - /* XXX remove a magic number but we don't have documents. */ - ic->ic_myaddr[i] = malo_bar1_read1(sc, 0xa528 + i); - DELAY(1000); - } - mh = malo_hal_attach(sc->malo_dev, devid, sc->malo_io1h, sc->malo_io1t, sc->malo_dmat); if (mh == NULL) { @@ -319,11 +303,8 @@ malo_attach(uint16_t devid, struct malo_softc *sc) ic->ic_headroom = sizeof(struct malo_txrec) - sizeof(struct ieee80211_frame); - /* get mac address from hardware */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->malo_hwspecs.macaddr); - /* call MI attach routine. */ - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, sc->malo_hwspecs.macaddr); /* override default methods */ ic->ic_vap_create = malo_vap_create; ic->ic_vap_delete = malo_vap_delete; @@ -1636,14 +1617,6 @@ malo_mode_init(struct malo_softc *sc) struct malo_hal *mh = sc->malo_mh; /* - * Handle any link-level address change. Note that we only - * need to force ic_myaddr; any other addresses are handled - * as a byproduct of the ifnet code marking the interface - * down then up. - */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - - /* * NB: Ignore promisc in hostap mode; it's set by the * bridge. This is wrong but we have no way to * identify internal requests (from the bridge) |