summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi/if_iwi.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-03-29 17:59:14 +0000
committersam <sam@FreeBSD.org>2009-03-29 17:59:14 +0000
commit7edd0aa8efc500847d789aedf8904ab96a6fe234 (patch)
tree8bb42581e6c46229c54ff76ee3fd9dd1e507f939 /sys/dev/iwi/if_iwi.c
parentcb768e2631a7f373d03c4b3c7fb251e76badc6a7 (diff)
downloadFreeBSD-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/iwi/if_iwi.c')
-rw-r--r--sys/dev/iwi/if_iwi.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index 81e0220..ba4af2a 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -280,6 +280,7 @@ iwi_attach(device_t dev)
uint16_t val;
int i, error;
uint8_t bands;
+ uint8_t macaddr[IEEE80211_ADDR_LEN];
sc->sc_dev = dev;
@@ -403,14 +404,14 @@ iwi_attach(device_t dev)
/* read MAC address from EEPROM */
val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 0);
- ic->ic_myaddr[0] = val & 0xff;
- ic->ic_myaddr[1] = val >> 8;
+ macaddr[0] = val & 0xff;
+ macaddr[1] = val >> 8;
val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 1);
- ic->ic_myaddr[2] = val & 0xff;
- ic->ic_myaddr[3] = val >> 8;
+ macaddr[2] = val & 0xff;
+ macaddr[3] = val >> 8;
val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2);
- ic->ic_myaddr[4] = val & 0xff;
- ic->ic_myaddr[5] = val >> 8;
+ macaddr[4] = val & 0xff;
+ macaddr[5] = val >> 8;
bands = 0;
setbit(&bands, IEEE80211_MODE_11B);
@@ -419,7 +420,7 @@ iwi_attach(device_t dev)
setbit(&bands, IEEE80211_MODE_11A);
ieee80211_init_channels(ic, NULL, &bands);
- ieee80211_ifattach(ic);
+ ieee80211_ifattach(ic, macaddr);
/* override default methods */
ic->ic_node_alloc = iwi_node_alloc;
sc->sc_node_free = ic->ic_node_free;
@@ -2568,9 +2569,8 @@ iwi_config(struct iwi_softc *sc)
IWI_LOCK_ASSERT(sc);
- IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp));
- DPRINTF(("Setting MAC address to %6D\n", ic->ic_myaddr, ":"));
- error = iwi_cmd(sc, IWI_CMD_SET_MAC_ADDRESS, ic->ic_myaddr,
+ DPRINTF(("Setting MAC address to %6D\n", IF_LLADDR(ifp), ":"));
+ error = iwi_cmd(sc, IWI_CMD_SET_MAC_ADDRESS, IF_LLADDR(ifp),
IEEE80211_ADDR_LEN);
if (error != 0)
return error;
OpenPOWER on IntegriCloud