diff options
author | sam <sam@FreeBSD.org> | 2008-10-27 16:46:50 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-10-27 16:46:50 +0000 |
commit | 94d731286108656a0c968d4d198895895a0ff1bf (patch) | |
tree | 3ce19da60bdf6db3713c58b48e39561d4276c21a /sys/net80211 | |
parent | 306c95be6d13324c52b48ea783e821dcb4926ddc (diff) | |
download | FreeBSD-src-94d731286108656a0c968d4d198895895a0ff1bf.zip FreeBSD-src-94d731286108656a0c968d4d198895895a0ff1bf.tar.gz |
o use the new association callback to notify the driver when joining a bss
in sta and adhoc modes; this should've been done forever ago as most all
drivers use this hook to set per-station transmit parameters such as for
tx rate control
o adjust drivers to remove explicit calls to the driver newassoc method
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_adhoc.c | 8 | ||||
-rw-r--r-- | sys/net80211/ieee80211_sta.c | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index 68fe32d..e9b8128 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -104,9 +104,7 @@ adhoc_vattach(struct ieee80211vap *vap) static int adhoc_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { -#ifdef IEEE80211_DEBUG struct ieee80211com *ic = vap->iv_ic; -#endif struct ieee80211_node *ni; enum ieee80211_state ostate; @@ -208,6 +206,12 @@ adhoc_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) */ if (ni->ni_authmode != IEEE80211_AUTH_8021X) ieee80211_node_authorize(ni); + /* + * Fake association when joining an existing bss. + */ + if (!IEEE80211_ADDR_EQ(ni->ni_macaddr, vap->iv_myaddr) && + ic->ic_newassoc != NULL) + ic->ic_newassoc(ni, ostate != IEEE80211_S_RUN); break; case IEEE80211_S_SLEEP: ieee80211_sta_pwrsave(vap, 0); diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 293616e..ebb28aa 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -400,6 +400,11 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) */ if (ni->ni_authmode != IEEE80211_AUTH_8021X) ieee80211_node_authorize(ni); + /* + * Fake association when joining an existing bss. + */ + if (ic->ic_newassoc != NULL) + ic->ic_newassoc(vap->iv_bss, ostate != IEEE80211_S_RUN); break; case IEEE80211_S_SLEEP: ieee80211_sta_pwrsave(vap, 0); |