svn commit: r215557 - in stable/8/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211

Bernhard Schmidt bschmidt at FreeBSD.org
Sat Nov 20 12:24:27 UTC 2010


Author: bschmidt
Date: Sat Nov 20 12:24:26 2010
New Revision: 215557
URL: http://svn.freebsd.org/changeset/base/215557

Log:
  MFC r214894:
  Instead of using the AMRR ratectl algo as default for drivers which have
  the IEEE80211_C_RATECTL flag set, default to NONE for all drivers. Only if
  a driver calls ieee80211_ratectl_init() check if the NONE algo is still
  selected and try to use AMRR in that case. Drivers are still free to use
  any other algo by calling ieee80211_ratectl_set() prior to the
  ieee80211_ratectl_init() call.
  
  After this change it is now safe to assume that a ratectl algo is always
  available and selected, which renders the IEEE80211_C_RATECTL flag pretty
  much useless. Therefore revert r211314 and 211546.

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_ratectl.c
  stable/8/sys/net80211/ieee80211_ratectl.h
  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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/bwi/if_bwi.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -511,8 +511,7 @@ bwi_attach(struct bwi_softc *sc)
 		      IEEE80211_C_SHPREAMBLE |
 		      IEEE80211_C_WPA |
 		      IEEE80211_C_BGSCAN |
-		      IEEE80211_C_MONITOR |
-		      IEEE80211_C_RATECTL;
+		      IEEE80211_C_MONITOR;
 	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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/bwn/if_bwn.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -1070,7 +1070,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/iwn/if_iwn.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -580,7 +580,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/ral/rt2560.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -291,7 +291,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/ral/rt2661.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -294,7 +294,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/usb/wlan/if_rum.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -494,7 +494,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/usb/wlan/if_run.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -632,8 +632,7 @@ 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_RATECTL;	/* use ratectl */
+	    IEEE80211_C_WPA;		/* WPA1|WPA2(RSN) */
 
 	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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/usb/wlan/if_ural.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -486,7 +486,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/usb/wlan/if_zyd.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -397,7 +397,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/dev/wpi/if_wpi.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -634,7 +634,6 @@ 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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/net80211/ieee80211.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -485,9 +485,7 @@ ieee80211_vap_setup(struct ieee80211com 
 	ieee80211_scan_vattach(vap);
 	ieee80211_regdomain_vattach(vap);
 	ieee80211_radiotap_vattach(vap);
-
-	if (vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR);
+	ieee80211_ratectl_set(vap, IEEE80211_RATECTL_NONE);
 
 	return 0;
 }

Modified: stable/8/sys/net80211/ieee80211_node.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_node.c	Sat Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/net80211/ieee80211_node.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -817,8 +817,7 @@ 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);
+	ieee80211_ratectl_node_init(ni);
 
 	return ieee80211_sta_join1(ieee80211_ref_node(ni));
 }
@@ -1038,8 +1037,7 @@ node_free(struct ieee80211_node *ni)
 {
 	struct ieee80211com *ic = ni->ni_ic;
 
-	if (ni->ni_vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_node_deinit(ni);
+	ieee80211_ratectl_node_deinit(ni);
 	ic->ic_node_cleanup(ni);
 	ieee80211_ies_cleanup(&ni->ni_ies);
 	ieee80211_psq_cleanup(&ni->ni_psq);
@@ -1404,8 +1402,7 @@ ieee80211_fakeup_adhoc_node(struct ieee8
 #endif
 		}
 		ieee80211_node_setuptxparms(ni);
-		if (vap->iv_caps & IEEE80211_C_RATECTL)
-			ieee80211_ratectl_node_init(ni);
+		ieee80211_ratectl_node_init(ni);
 		if (ic->ic_newassoc != NULL)
 			ic->ic_newassoc(ni, 1);
 		/* XXX not right for 802.1x/WPA */
@@ -1475,8 +1472,7 @@ 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);
+		ieee80211_ratectl_node_init(ni);
 		if (ic->ic_newassoc != NULL)
 			ic->ic_newassoc(ni, 1);
 		/* XXX not right for 802.1x/WPA */
@@ -2345,8 +2341,7 @@ ieee80211_node_join(struct ieee80211_nod
 	);
 
 	ieee80211_node_setuptxparms(ni);
-	if (vap->iv_caps & IEEE80211_C_RATECTL)
-		ieee80211_ratectl_node_init(ni);
+	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_ratectl.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_ratectl.c	Sat Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/net80211/ieee80211_ratectl.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -66,6 +66,14 @@ ieee80211_ratectl_unregister(int type)
 }
 
 void
+ieee80211_ratectl_init(struct ieee80211vap *vap)
+{
+	if (vap->iv_rate == ratectls[IEEE80211_RATECTL_NONE])
+		ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR);
+	vap->iv_rate->ir_init(vap);
+}
+
+void
 ieee80211_ratectl_set(struct ieee80211vap *vap, int type)
 {
 	if (type >= IEEE80211_RATECTL_MAX)

Modified: stable/8/sys/net80211/ieee80211_ratectl.h
==============================================================================
--- stable/8/sys/net80211/ieee80211_ratectl.h	Sat Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/net80211/ieee80211_ratectl.h	Sat Nov 20 12:24:26 2010	(r215557)
@@ -57,17 +57,12 @@ struct ieee80211_ratectl {
 
 void	ieee80211_ratectl_register(int, const struct ieee80211_ratectl *);
 void	ieee80211_ratectl_unregister(int);
+void	ieee80211_ratectl_init(struct ieee80211vap *);
 void	ieee80211_ratectl_set(struct ieee80211vap *, int);
 
 MALLOC_DECLARE(M_80211_RATECTL);
 
 static void __inline
-ieee80211_ratectl_init(struct ieee80211vap *vap)
-{
-	vap->iv_rate->ir_init(vap);
-}
-
-static void __inline
 ieee80211_ratectl_deinit(struct ieee80211vap *vap)
 {
 	vap->iv_rate->ir_deinit(vap);

Modified: stable/8/sys/net80211/ieee80211_sta.c
==============================================================================
--- stable/8/sys/net80211/ieee80211_sta.c	Sat Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/net80211/ieee80211_sta.c	Sat Nov 20 12:24:26 2010	(r215557)
@@ -1598,8 +1598,7 @@ 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);
+			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 Nov 20 12:22:02 2010	(r215556)
+++ stable/8/sys/net80211/ieee80211_var.h	Sat Nov 20 12:24:26 2010	(r215557)
@@ -597,8 +597,7 @@ 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 */
-#define	IEEE80211_C_RATECTL	0x00080000	/* CAPABILITY: use ratectl */
-/* 0x700000 available */
+/* 0x7c0000 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*/


More information about the svn-src-all mailing list