Search Linux Wireless

[PATCH] mac80211: Add module parameter for setting initial rate in rc80211_simple

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The initial rate for STA's using rc80211_simple is set to the last
rate in the rate table. This is too fast for the bcm43xx-mac80211
driver. To correct this situation without affecting any other driver,
an initial_rate parameter is added to the rc80211_simple module. This
parameter is set to 10 times the desired initial rate. If the parameter
is zero or not set, the original behavior is kept. If the parameter
does not match a valid rate, the first rate in the table will be set.

Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
---

Index: wireless-dev/net/mac80211/rc80211_simple.c
===================================================================
--- wireless-dev.orig/net/mac80211/rc80211_simple.c
+++ wireless-dev/net/mac80211/rc80211_simple.c
@@ -31,6 +31,10 @@
 
 MODULE_ALIAS("rc80211_default");
 
+static int modparam_initial_rate;
+module_param_named(initial_rate, modparam_initial_rate, int, 0444);
+MODULE_PARM_DESC(initial_rate, "set initial rate in Mbs*10");
+
 static void rate_control_rate_inc(struct ieee80211_local *local,
 				  struct sta_info *sta)
 {
@@ -283,14 +287,18 @@ static void rate_control_simple_rate_ini
 	int i;
 	sta->txrate = 0;
 	mode = local->oper_hw_mode;
-	/* TODO: what is a good starting rate for STA? About middle? Maybe not
-	 * the lowest or the highest rate.. Could consider using RSSI from
-	 * previous packets? Need to have IEEE 802.1X auth succeed immediately
-	 * after assoc.. */
+	/* The starting rate for STA is set to the last rate in the table
+	 * unless the module was loaded with the 'initial_rate' parameter,
+	 * which is set to 10 times the desired rate. If an illegal value
+	 * is used for the parameter, the first rate in the table will be used. */
 	for (i = 0; i < mode->num_rates; i++) {
 		if ((sta->supp_rates & BIT(i)) &&
 		    (mode->rates[i].flags & IEEE80211_RATE_SUPPORTED))
-			sta->txrate = i;
+			if (modparam_initial_rate) {
+				if (mode->rates[i].rate == modparam_initial_rate)
+					sta->txrate = i;
+			} else
+				sta->txrate = i;
 	}
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux