[PATCH] Re: throughput and tx rate in marginal signal conditions
Joe Parks
jphstap
Thu Jun 5 12:12:47 PDT 2003
Marty had trouble getting the list to accept this, so now I'll try:
-Joe
----
Here's a patch that allows you to set the number of consective dropped
packets before lowering the transmit rate. This patch defaults to 2 (per
Jean Tourrilhes' suggestion on June 3), but you can change that easily
enough via WLAN_RATE_DECREASE_THRESHOLD. My colleagues and I are still
testing it, but so far so good.
- Marty
Martin Lamb
ROI Computer Services, Inc.
------------------------------------------------------------
--- driver/modules/hostap_ap.h 2003-05-22 00:09:20.000000000 -0400
+++ driver/modules/hostap_ap.h.rajant 2003-06-05 11:10:43.000000000 -0400
@@ -39,6 +39,9 @@
/* Try to increase TX rate after # successfully sent packets */
#define WLAN_RATE_UPDATE_COUNT 50
+/* Decrease TX rate after # consecutive dropped packets */
+#define WLAN_RATE_DECREASE_THRESHOLD 2
+
struct sta_info {
struct list_head list;
struct sta_info *hnext; /* next entry in hash table list */
@@ -76,6 +79,7 @@
*/
u32 tx_since_last_failure;
u32 txexc;
+ u32 tx_consecutive_exc;
struct prism2_crypt_data *crypt;
--- driver/modules/hostap_ap.c 2003-05-28 23:59:42.000000000 -0400
+++ driver/modules/hostap_ap.c.rajant 2003-06-05 11:15:55.000000000 -0400
@@ -2730,6 +2730,7 @@
sta->tx_count[sta->tx_rate_idx]++;
sta->tx_since_last_failure++;
+ sta->tx_consecutive_exc = 0;
if (sta->tx_since_last_failure > WLAN_RATE_UPDATE_COUNT &&
sta->tx_rate_idx < sta->tx_max_rate) {
/* use next higher rate */
@@ -2904,7 +2905,12 @@
sta->txexc++;
sta->tx_since_last_failure = 0;
- if (sta->tx_rate_idx > 0 && txdesc->tx_rate <= sta->tx_rate) {
+ sta->tx_consecutive_exc++;
+
+ if (sta->tx_consecutive_exc > WLAN_RATE_DECREASE_THRESHOLD
+ && sta->tx_rate_idx > 0
+ && txdesc->tx_rate <= sta->tx_rate) {
+
/* use next lower rate */
int old, rate;
old = rate = sta->tx_rate_idx;
@@ -2927,6 +2933,7 @@
"to %d\n", local->dev->name, MAC2STR(sta->addr),
sta->tx_rate);
}
+ sta->tx_consecutive_exc = 0;
}
spin_unlock(&local->ap->sta_table_lock);
}
More information about the Hostap
mailing list