aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2003-06-06 03:30:31 (GMT)
committerJouni Malinen <j@w1.fi>2003-06-06 03:30:31 (GMT)
commit0df8fa6fe9625157e8873d73493018046a9cae2e (patch)
tree16a1316daaf13459f387bc607b1504c73bda45fe
parentd26597c1166c346c230963bc3539c7c9e8bbeb61 (diff)
downloadhostap-history-0df8fa6fe9625157e8873d73493018046a9cae2e.zip
hostap-history-0df8fa6fe9625157e8873d73493018046a9cae2e.tar.gz
hostap-history-0df8fa6fe9625157e8873d73493018046a9cae2e.tar.bz2
Use less aggressive transmit rate decreasing algorithm: decrease rate only
after WLAN_RATE_DECREASE_THRESHOLD consecutive dropped packets. Old behavior matches with value 1, new default is 2. Based on patch from Martin Lamb / Joe Parks.
-rw-r--r--driver/modules/hostap_ap.c9
-rw-r--r--driver/modules/hostap_ap.h6
2 files changed, 12 insertions, 3 deletions
diff --git a/driver/modules/hostap_ap.c b/driver/modules/hostap_ap.c
index 9664edb..f561a9f 100644
--- a/driver/modules/hostap_ap.c
+++ b/driver/modules/hostap_ap.c
@@ -2730,7 +2730,8 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
sta->tx_count[sta->tx_rate_idx]++;
sta->tx_since_last_failure++;
- if (sta->tx_since_last_failure > WLAN_RATE_UPDATE_COUNT &&
+ 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 */
int old_rate, new_rate;
@@ -2904,7 +2905,10 @@ void hostap_handle_sta_tx_exc(local_info_t *local,
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 +2931,7 @@ void hostap_handle_sta_tx_exc(local_info_t *local,
"to %d\n", local->dev->name, MAC2STR(sta->addr),
sta->tx_rate);
}
+ sta->tx_consecutive_exc = 0;
}
spin_unlock(&local->ap->sta_table_lock);
}
diff --git a/driver/modules/hostap_ap.h b/driver/modules/hostap_ap.h
index f5d5692..7ac6955 100644
--- a/driver/modules/hostap_ap.h
+++ b/driver/modules/hostap_ap.h
@@ -36,9 +36,12 @@
* but some pre-standard IEEE 802.11g products use longer elements. */
#define WLAN_SUPP_RATES_MAX 32
-/* Try to increase TX rate after # successfully sent packets */
+/* Try to increase TX rate after # successfully sent consecutive 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 @@ struct sta_info {
*/
u32 tx_since_last_failure;
u32 txexc;
+ u32 tx_consecutive_exc;
struct prism2_crypt_data *crypt;