linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Add module parameter for setting initial rate  in rc80211_simple
@ 2007-06-02 18:51 Larry Finger
  2007-06-03 10:33 ` Olivier Cornu
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Larry Finger @ 2007-06-02 18:51 UTC (permalink / raw)
  To: Jiri Benc; +Cc: linux-wireless

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@lwfinger.net>
---

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;
 	}
 }
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2007-06-08 12:27 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-02 18:51 [PATCH] mac80211: Add module parameter for setting initial rate in rc80211_simple Larry Finger
2007-06-03 10:33 ` Olivier Cornu
2007-06-03 10:45   ` Michael Buesch
2007-06-03 10:50     ` stefano.brivio
2007-06-03 19:14     ` Larry Finger
2007-06-03 18:51   ` Larry Finger
2007-06-04 11:44 ` Johannes Berg
2007-06-04 17:36 ` James Ketrenos
2007-06-04 18:05   ` James Ketrenos
2007-06-05 12:40     ` Larry Finger
2007-06-07 20:19 ` Jiri Benc
2007-06-07 20:21   ` [PATCH] mac80211: allow changing of rate control algorithm Jiri Benc
2007-06-07 20:22     ` [PATCH] mac80211: rc80211_lowest, a dumb " Jiri Benc
2007-06-07 20:54       ` Jouni Malinen
2007-06-07 21:06         ` Jiri Benc
2007-06-08  0:50       ` Larry Finger
2007-06-08  8:59         ` Jiri Benc
2007-06-08  9:04           ` Johannes Berg
2007-06-08  9:06           ` Johannes Berg
2007-06-08 12:27             ` Larry Finger
2007-06-07 21:22   ` [PATCH] mac80211: Add module parameter for setting initial rate in rc80211_simple Larry Finger
2007-06-07 22:19     ` Jiri Benc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).