From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 16:46:51 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48184106567F; Mon, 27 Oct 2008 16:46:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 358508FC26; Mon, 27 Oct 2008 16:46:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9RGkoUK045674; Mon, 27 Oct 2008 16:46:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9RGkoKa045665; Mon, 27 Oct 2008 16:46:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810271646.m9RGkoKa045665@svn.freebsd.org> From: Sam Leffler Date: Mon, 27 Oct 2008 16:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184345 - in head/sys: dev/ath dev/iwn dev/ral dev/usb dev/wpi net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 16:46:51 -0000 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);