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/ipw | |
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/ipw')
-rw-r--r-- | sys/dev/ipw/if_ipw.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c index b20d3f6..f7c3ea5 100644 --- a/sys/dev/ipw/if_ipw.c +++ b/sys/dev/ipw/if_ipw.c @@ -231,6 +231,7 @@ ipw_attach(device_t dev) struct ieee80211_channel *c; uint16_t val; int error, i; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -315,14 +316,14 @@ ipw_attach(device_t dev) /* read MAC address from EEPROM */ val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 0); - ic->ic_myaddr[0] = val >> 8; - ic->ic_myaddr[1] = val & 0xff; + macaddr[0] = val >> 8; + macaddr[1] = val & 0xff; val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 1); - ic->ic_myaddr[2] = val >> 8; - ic->ic_myaddr[3] = val & 0xff; + macaddr[2] = val >> 8; + macaddr[3] = val & 0xff; val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 2); - ic->ic_myaddr[4] = val >> 8; - ic->ic_myaddr[5] = val & 0xff; + macaddr[4] = val >> 8; + macaddr[5] = val & 0xff; /* set supported .11b channels (read from EEPROM) */ if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0) @@ -341,7 +342,7 @@ ipw_attach(device_t dev) if (!(ipw_read_prom_word(sc, IPW_EEPROM_RADIO) & 8)) sc->flags |= IPW_FLAG_HAS_RADIO_SWITCH; - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_scan_start = ipw_scan_start; ic->ic_scan_end = ipw_scan_end; ic->ic_set_channel = ipw_set_channel; |