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/net80211 | |
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/net80211')
-rw-r--r-- | sys/net80211/ieee80211.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_ddb.c | 1 | ||||
-rw-r--r-- | sys/net80211/ieee80211_freebsd.c | 3 | ||||
-rw-r--r-- | sys/net80211/ieee80211_var.h | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 40af9bb..71c9516 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -239,7 +239,8 @@ null_input(struct ifnet *ifp, struct mbuf *m) * the driver on attach to prior to creating any vap's. */ void -ieee80211_ifattach(struct ieee80211com *ic) +ieee80211_ifattach(struct ieee80211com *ic, + const uint8_t macaddr[IEEE80211_ADDR_LEN]) { struct ifnet *ifp = ic->ic_ifp; struct sockaddr_dl *sdl; @@ -290,7 +291,7 @@ ieee80211_ifattach(struct ieee80211com *ic) sdl = (struct sockaddr_dl *)ifa->ifa_addr; sdl->sdl_type = IFT_ETHER; /* XXX IFT_IEEE80211? */ sdl->sdl_alen = IEEE80211_ADDR_LEN; - IEEE80211_ADDR_COPY(LLADDR(sdl), ic->ic_myaddr); + IEEE80211_ADDR_COPY(LLADDR(sdl), macaddr); } /* diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 09ea89c..0dd27b1 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -445,7 +445,6 @@ _db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showp db_printf(" opmode %s", ieee80211_opmode_name[ic->ic_opmode]); db_printf("\n"); db_printf("\tmedia %p", &ic->ic_media); - db_printf(" myaddr %s", ether_sprintf(ic->ic_myaddr)); db_printf(" inact %p", &ic->ic_inact); db_printf("\n"); diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index 5f44f1c..47a9e00 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <net/if.h> +#include <net/if_dl.h> #include <net/if_clone.h> #include <net/if_media.h> #include <net/if_types.h> @@ -137,7 +138,7 @@ wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) vap = ic->ic_vap_create(ic, ifc->ifc_name, unit, cp.icp_opmode, cp.icp_flags, cp.icp_bssid, cp.icp_flags & IEEE80211_CLONE_MACADDR ? - cp.icp_macaddr : ic->ic_myaddr); + cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp)); return (vap == NULL ? EIO : 0); } diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index f9b115f..d4c95c6 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -115,7 +115,6 @@ struct ieee80211com { enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ enum ieee80211_opmode ic_opmode; /* operation mode */ struct ifmedia ic_media; /* interface media config */ - uint8_t ic_myaddr[IEEE80211_ADDR_LEN]; struct callout ic_inact; /* inactivity processing */ struct task ic_parent_task; /* deferred parent processing */ @@ -575,7 +574,8 @@ MALLOC_DECLARE(M_80211_VAP); "\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \ "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS" -void ieee80211_ifattach(struct ieee80211com *); +void ieee80211_ifattach(struct ieee80211com *, + const uint8_t macaddr[IEEE80211_ADDR_LEN]); void ieee80211_ifdetach(struct ieee80211com *); int ieee80211_vap_setup(struct ieee80211com *, struct ieee80211vap *, const char name[IFNAMSIZ], int unit, int opmode, int flags, |