From owner-svn-src-all@FreeBSD.ORG Sat Aug 28 07:21:16 2010 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 F08D110656AB; Sat, 28 Aug 2010 07:21:15 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8138FC20; Sat, 28 Aug 2010 07:21:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7S7LFEp022512; Sat, 28 Aug 2010 07:21:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7S7LFG9022497; Sat, 28 Aug 2010 07:21:15 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201008280721.o7S7LFG9022497@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 28 Aug 2010 07:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211921 - in stable/8/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan 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: Sat, 28 Aug 2010 07:21:16 -0000 Author: bschmidt Date: Sat Aug 28 07:21:15 2010 New Revision: 211921 URL: http://svn.freebsd.org/changeset/base/211921 Log: MFC r211295,211314,211546: Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework should set this capability. Initialize ni_txrate after txparams have been setup. Some drivers calculate various things prior to association based on ni_txrate and rely on it being nonzero. PR: kern/149185 Modified: stable/8/sys/dev/bwi/if_bwi.c stable/8/sys/dev/bwn/if_bwn.c stable/8/sys/dev/iwn/if_iwn.c stable/8/sys/dev/ral/rt2560.c stable/8/sys/dev/ral/rt2661.c stable/8/sys/dev/usb/wlan/if_rum.c stable/8/sys/dev/usb/wlan/if_run.c stable/8/sys/dev/usb/wlan/if_ural.c stable/8/sys/dev/usb/wlan/if_zyd.c stable/8/sys/dev/wpi/if_wpi.c stable/8/sys/net80211/ieee80211.c stable/8/sys/net80211/ieee80211_node.c stable/8/sys/net80211/ieee80211_sta.c stable/8/sys/net80211/ieee80211_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/bwi/if_bwi.c Sat Aug 28 07:21:15 2010 (r211921) @@ -511,7 +511,8 @@ bwi_attach(struct bwi_softc *sc) IEEE80211_C_SHPREAMBLE | IEEE80211_C_WPA | IEEE80211_C_BGSCAN | - IEEE80211_C_MONITOR; + IEEE80211_C_MONITOR | + IEEE80211_C_RATECTL; ic->ic_opmode = IEEE80211_M_STA; ieee80211_ifattach(ic, macaddr); Modified: stable/8/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/8/sys/dev/bwn/if_bwn.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/bwn/if_bwn.c Sat Aug 28 07:21:15 2010 (r211921) @@ -1070,6 +1070,7 @@ bwn_attach_post(struct bwn_softc *sc) | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_TXPMGT /* capable of txpow mgt */ + | IEEE80211_C_RATECTL /* use ratectl */ ; ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS; /* s/w bmiss */ Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/iwn/if_iwn.c Sat Aug 28 07:21:15 2010 (r211921) @@ -580,6 +580,7 @@ iwn_attach(device_t dev) | IEEE80211_C_IBSS /* ibss/adhoc mode */ #endif | IEEE80211_C_WME /* WME */ + | IEEE80211_C_RATECTL /* use ratectl */ ; #if 0 /* HT */ /* XXX disable until HT channel setup works */ Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/ral/rt2560.c Sat Aug 28 07:21:15 2010 (r211921) @@ -291,6 +291,7 @@ rt2560_attach(device_t dev, int id) #ifdef notyet | IEEE80211_C_TXFRAG /* handle tx frags */ #endif + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/ral/rt2661.c ============================================================================== --- stable/8/sys/dev/ral/rt2661.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/ral/rt2661.c Sat Aug 28 07:21:15 2010 (r211921) @@ -294,6 +294,7 @@ rt2661_attach(device_t dev, int id) | IEEE80211_C_TXFRAG /* handle tx frags */ | IEEE80211_C_WME /* 802.11e */ #endif + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_rum.c Sat Aug 28 07:21:15 2010 (r211921) @@ -496,6 +496,7 @@ rum_attach(device_t self) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* bg scanning supported */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_run.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_run.c Sat Aug 28 07:21:15 2010 (r211921) @@ -634,7 +634,8 @@ run_attach(device_t self) IEEE80211_C_SHPREAMBLE | /* short preamble supported */ IEEE80211_C_SHSLOT | /* short slot time supported */ IEEE80211_C_WME | /* WME */ - IEEE80211_C_WPA; /* WPA1|WPA2(RSN) */ + IEEE80211_C_WPA | /* WPA1|WPA2(RSN) */ + IEEE80211_C_RATECTL; /* use ratectl */ ic->ic_cryptocaps = IEEE80211_CRYPTO_WEP | Modified: stable/8/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_ural.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_ural.c Sat Aug 28 07:21:15 2010 (r211921) @@ -485,6 +485,7 @@ ural_attach(device_t self) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* bg scanning supported */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_zyd.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/usb/wlan/if_zyd.c Sat Aug 28 07:21:15 2010 (r211921) @@ -397,6 +397,7 @@ zyd_attach(device_t dev) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_RATECTL /* use ratectl */ ; bands = 0; Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/dev/wpi/if_wpi.c Sat Aug 28 07:21:15 2010 (r211921) @@ -634,6 +634,7 @@ wpi_attach(device_t dev) | IEEE80211_C_WME /* 802.11e */ | IEEE80211_C_HOSTAP /* Host access point mode */ #endif + | IEEE80211_C_RATECTL /* use ratectl */ ; /* Modified: stable/8/sys/net80211/ieee80211.c ============================================================================== --- stable/8/sys/net80211/ieee80211.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211.c Sat Aug 28 07:21:15 2010 (r211921) @@ -486,7 +486,8 @@ ieee80211_vap_setup(struct ieee80211com ieee80211_regdomain_vattach(vap); ieee80211_radiotap_vattach(vap); - ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR); return 0; } Modified: stable/8/sys/net80211/ieee80211_node.c ============================================================================== --- stable/8/sys/net80211/ieee80211_node.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211_node.c Sat Aug 28 07:21:15 2010 (r211921) @@ -817,6 +817,8 @@ ieee80211_sta_join(struct ieee80211vap * if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); return ieee80211_sta_join1(ieee80211_ref_node(ni)); } @@ -1036,7 +1038,8 @@ node_free(struct ieee80211_node *ni) { struct ieee80211com *ic = ni->ni_ic; - ieee80211_ratectl_node_deinit(ni); + if (ni->ni_vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_deinit(ni); ic->ic_node_cleanup(ni); ieee80211_ies_cleanup(&ni->ni_ies); ieee80211_psq_cleanup(&ni->ni_psq); @@ -1401,6 +1404,8 @@ ieee80211_fakeup_adhoc_node(struct ieee8 #endif } ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); /* XXX not right for 802.1x/WPA */ @@ -1470,6 +1475,8 @@ ieee80211_add_neighbor(struct ieee80211v if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, 1); /* XXX not right for 802.1x/WPA */ @@ -2338,6 +2345,8 @@ ieee80211_node_join(struct ieee80211_nod ); ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); /* give driver a chance to setup state like ni_txrate */ if (ic->ic_newassoc != NULL) ic->ic_newassoc(ni, newassoc); Modified: stable/8/sys/net80211/ieee80211_sta.c ============================================================================== --- stable/8/sys/net80211/ieee80211_sta.c Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211_sta.c Sat Aug 28 07:21:15 2010 (r211921) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_SUPERG #include #endif +#include #define IEEE80211_RATE2MBS(r) (((r) & IEEE80211_RATE_VAL) / 2) @@ -1597,6 +1598,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, htinfo); ieee80211_node_setuptxparms(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); } else { #ifdef IEEE80211_SUPPORT_SUPERG if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_ATH)) Modified: stable/8/sys/net80211/ieee80211_var.h ============================================================================== --- stable/8/sys/net80211/ieee80211_var.h Sat Aug 28 07:10:51 2010 (r211920) +++ stable/8/sys/net80211/ieee80211_var.h Sat Aug 28 07:21:15 2010 (r211921) @@ -597,7 +597,8 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_C_MONITOR 0x00010000 /* CAPABILITY: monitor mode */ #define IEEE80211_C_DFS 0x00020000 /* CAPABILITY: DFS/radar avail*/ #define IEEE80211_C_MBSS 0x00040000 /* CAPABILITY: MBSS available */ -/* 0x7c0000 available */ +#define IEEE80211_C_RATECTL 0x00080000 /* CAPABILITY: use ratectl */ +/* 0x700000 available */ #define IEEE80211_C_WPA1 0x00800000 /* CAPABILITY: WPA1 avail */ #define IEEE80211_C_WPA2 0x01000000 /* CAPABILITY: WPA2 avail */ #define IEEE80211_C_WPA 0x01800000 /* CAPABILITY: WPA1+WPA2 avail*/