diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 5501c13f7b7..48eec98c74c 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -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); diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 65d17b49474..e9f4c85882d 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -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 */ diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 12d1bcd960a..be617fc17d5 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -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 */ diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index 8589768d422..097771f46ed 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -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; diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index 9b77c23dc0e..04729be035e 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -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; diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 3baa09a3d2f..d8378f846f4 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -497,6 +497,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; diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index f76bbdceb13..c594f2148fd 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -636,7 +636,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 | diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index 54ad7f97b0f..c3e60cd59fb 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -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; diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 1a298f8ff58..94ad559a50d 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -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; diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index f6edc916569..26336bfc3b8 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -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 */ ; /* diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 97ff7c21ad4..684882490b1 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -487,7 +487,8 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct ieee80211vap *vap, 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; } diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 2c1acffe3b0..e3c2769259f 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -817,7 +817,8 @@ ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, if (ieee80211_iserp_rateset(&ni->ni_rates)) ni->ni_flags |= IEEE80211_NODE_ERP; ieee80211_node_setuptxparms(ni); - ieee80211_ratectl_node_init(ni); + if (vap->iv_caps & IEEE80211_C_RATECTL) + ieee80211_ratectl_node_init(ni); return ieee80211_sta_join1(ieee80211_ref_node(ni)); } @@ -1037,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); diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index f93c3ed7346..5764fa017cb 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1597,7 +1597,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, htinfo); ieee80211_node_setuptxparms(ni); - ieee80211_ratectl_node_init(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)) diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index eea8dbe2855..c80ee9ee9d3 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -601,7 +601,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*/