Date: Mon, 27 Oct 2008 16:46:50 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184345 - in head/sys: dev/ath dev/iwn dev/ral dev/usb dev/wpi net80211 Message-ID: <200810271646.m9RGkoKa045665@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Mon Oct 27 16:46:50 2008 New Revision: 184345 URL: http://svn.freebsd.org/changeset/base/184345 Log: 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 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/iwn/if_iwn.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/usb/if_zyd.c head/sys/dev/wpi/if_wpi.c head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/dev/ath/if_ath.c Mon Oct 27 16:46:50 2008 (r184345) @@ -5722,10 +5722,6 @@ ath_newstate(struct ieee80211vap *vap, e break; case IEEE80211_M_STA: /* - * Fakeup since we're not called by net80211. - */ - ath_newassoc(ni, 1); - /* * Defer beacon timer configuration to the next * beacon frame so we have a current TSF to use * (any TSF collected when scanning is likely old). Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/dev/iwn/if_iwn.c Mon Oct 27 16:46:50 2008 (r184345) @@ -3648,11 +3648,6 @@ iwn_run(struct iwn_softc *sc) return error; } - if (ic->ic_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - iwn_newassoc(ni, 1); - } - error = iwn_init_sensitivity(sc); if (error != 0) { device_printf(sc->sc_dev, Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/dev/ral/rt2560.c Mon Oct 27 16:46:50 2008 (r184345) @@ -831,13 +831,8 @@ rt2560_newstate(struct ieee80211vap *vap /* turn assocation led on */ rt2560_update_led(sc, 1, 0); - if (vap->iv_opmode != IEEE80211_M_MONITOR) { - if (vap->iv_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - rt2560_newassoc(ni, 1); - } + if (vap->iv_opmode != IEEE80211_M_MONITOR) rt2560_enable_tsf_sync(sc); - } } return error; } Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/dev/ral/rt2661.c Mon Oct 27 16:46:50 2008 (r184345) @@ -830,13 +830,8 @@ rt2661_newstate(struct ieee80211vap *vap if (error != 0) return error; } - if (vap->iv_opmode != IEEE80211_M_MONITOR) { - if (vap->iv_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - rt2661_newassoc(ni, 1); - } + if (vap->iv_opmode != IEEE80211_M_MONITOR) rt2661_enable_tsf_sync(sc); - } } return error; } Modified: head/sys/dev/usb/if_zyd.c ============================================================================== --- head/sys/dev/usb/if_zyd.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/dev/usb/if_zyd.c Mon Oct 27 16:46:50 2008 (r184345) @@ -740,11 +740,6 @@ zyd_task(void *arg) IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); zyd_set_bssid(sc, sc->sc_bssid); } - - if (vap->iv_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - zyd_newassoc(ni, 1); - } break; } default: Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/dev/wpi/if_wpi.c Mon Oct 27 16:46:50 2008 (r184345) @@ -2522,11 +2522,6 @@ wpi_run(struct wpi_softc *sc, struct iee return error; } - if (vap->iv_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - wpi_newassoc(ni, 1); - } - /* link LED always on while associated */ wpi_set_led(sc, WPI_LED_LINK, 0, 1); Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/net80211/ieee80211_adhoc.c Mon Oct 27 16:46:50 2008 (r184345) @@ -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, */ 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); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Oct 27 16:20:40 2008 (r184344) +++ head/sys/net80211/ieee80211_sta.c Mon Oct 27 16:46:50 2008 (r184345) @@ -400,6 +400,11 @@ sta_newstate(struct ieee80211vap *vap, e */ 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810271646.m9RGkoKa045665>