linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Set low initial rate in rc80211_simple
@ 2007-06-08  0:47 Larry Finger
  2007-06-08  1:37 ` Michael Wu
  0 siblings, 1 reply; 7+ messages in thread
From: Larry Finger @ 2007-06-08  0:47 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. For situations for which the signal is weak,
the rate may be too high for authentication and association. Although
the rc80211_simple module will adjust the speed, the response may not
be fast enough for a successful connection. This modification sets the
initial rate to the lowest supported value.

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
@@ -281,16 +281,21 @@ static void rate_control_simple_rate_ini
 {
 	struct ieee80211_hw_mode *mode;
 	int i;
+	int min_rate = 1000;
+
 	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.. */
-	for (i = 0; i < mode->num_rates; i++) {
+	/* TODO: This routine should consider using RSSI from previous packets
+	 * as we need to have IEEE 802.1X auth succeed immediately after assoc..
+	 * Until that method is implemented, we will use the lowest supported rate
+	 * as a workaround, */
+	for (i = 0; i < mode->num_rates; i++)
 		if ((sta->supp_rates & BIT(i)) &&
-		    (mode->rates[i].flags & IEEE80211_RATE_SUPPORTED))
-			sta->txrate = i;
+		    (mode->rates[i].flags & IEEE80211_RATE_SUPPORTED)) {
+			if (mode->rates[i].rate < min_rate) {
+				min_rate = mode->rates[i].rate;
+				sta->txrate = i;
+			}
 	}
 }
 

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

end of thread, other threads:[~2007-07-03  5:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20070610.181704.73383002.davem@davemloft.net>
2007-06-12  1:22 ` mac80211 patches for 2.6.23 John W. Linville
2007-06-12  1:23   ` [PATCH] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information John W. Linville
2007-06-12  1:24     ` [PATCH] mac80211: Set low initial rate in rc80211_simple John W. Linville
2007-07-03  5:38       ` David Miller
2007-07-03  5:38     ` [PATCH] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information David Miller
2007-06-08  0:47 [PATCH] mac80211: Set low initial rate in rc80211_simple Larry Finger
2007-06-08  1:37 ` Michael Wu

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).