aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-02-04 18:30:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-07 16:18:27 -0500
commit180205bdb22b79cd7b2a07a5002dd747badc82f3 (patch)
tree8a77db43d660b298c797b9f8cf1eb8213a423bac /net
parentc210de8f88215db31cf3529c9763fc3124d6e09d (diff)
mac80211: Make some mlme timers module paramaters.
This allows users to tune the connection-loss algorithms to be more or less lenient. In particular, larger null-func retries helps when using lots of virtual stations on a loaded network. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e059b3a6f28..f77adf1a520 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -28,8 +28,15 @@
28#include "rate.h" 28#include "rate.h"
29#include "led.h" 29#include "led.h"
30 30
31#define IEEE80211_MAX_NULLFUNC_TRIES 2 31static int max_nullfunc_tries = 2;
32#define IEEE80211_MAX_PROBE_TRIES 5 32module_param(max_nullfunc_tries, int, 0644);
33MODULE_PARM_DESC(max_nullfunc_tries,
34 "Maximum nullfunc tx tries before disconnecting (reason 4).");
35
36static int max_probe_tries = 5;
37module_param(max_probe_tries, int, 0644);
38MODULE_PARM_DESC(max_probe_tries,
39 "Maximum probe tries before disconnecting (reason 4).");
33 40
34/* 41/*
35 * Beacon loss timeout is calculated as N frames times the 42 * Beacon loss timeout is calculated as N frames times the
@@ -51,7 +58,11 @@
51 * a probe request because of beacon loss or for 58 * a probe request because of beacon loss or for
52 * checking the connection still works. 59 * checking the connection still works.
53 */ 60 */
54#define IEEE80211_PROBE_WAIT (HZ / 2) 61static int probe_wait_ms = 500;
62module_param(probe_wait_ms, int, 0644);
63MODULE_PARM_DESC(probe_wait_ms,
64 "Maximum time(ms) to wait for probe response"
65 " before disconnecting (reason 4).");
55 66
56/* 67/*
57 * Weight given to the latest Beacon frame when calculating average signal 68 * Weight given to the latest Beacon frame when calculating average signal
@@ -1116,7 +1127,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
1116 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 1127 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1117 const u8 *ssid; 1128 const u8 *ssid;
1118 u8 *dst = ifmgd->associated->bssid; 1129 u8 *dst = ifmgd->associated->bssid;
1119 u8 unicast_limit = max(1, IEEE80211_MAX_PROBE_TRIES - 3); 1130 u8 unicast_limit = max(1, max_probe_tries - 3);
1120 1131
1121 /* 1132 /*
1122 * Try sending broadcast probe requests for the last three 1133 * Try sending broadcast probe requests for the last three
@@ -1142,7 +1153,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
1142 } 1153 }
1143 1154
1144 ifmgd->probe_send_count++; 1155 ifmgd->probe_send_count++;
1145 ifmgd->probe_timeout = jiffies + IEEE80211_PROBE_WAIT; 1156 ifmgd->probe_timeout = jiffies + msecs_to_jiffies(probe_wait_ms);
1146 run_again(ifmgd, ifmgd->probe_timeout); 1157 run_again(ifmgd, ifmgd->probe_timeout);
1147} 1158}
1148 1159
@@ -1243,7 +1254,8 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata)
1243 1254
1244 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); 1255 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
1245 1256
1246 printk(KERN_DEBUG "Connection to AP %pM lost.\n", bssid); 1257 printk(KERN_DEBUG "%s: Connection to AP %pM lost.\n",
1258 sdata->name, bssid);
1247 1259
1248 ieee80211_set_disassoc(sdata, true, true); 1260 ieee80211_set_disassoc(sdata, true, true);
1249 mutex_unlock(&ifmgd->mtx); 1261 mutex_unlock(&ifmgd->mtx);
@@ -1988,9 +2000,9 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
1988 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); 2000 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
1989 2001
1990 if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) 2002 if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
1991 max_tries = IEEE80211_MAX_NULLFUNC_TRIES; 2003 max_tries = max_nullfunc_tries;
1992 else 2004 else
1993 max_tries = IEEE80211_MAX_PROBE_TRIES; 2005 max_tries = max_probe_tries;
1994 2006
1995 /* ACK received for nullfunc probing frame */ 2007 /* ACK received for nullfunc probing frame */
1996 if (!ifmgd->probe_send_count) 2008 if (!ifmgd->probe_send_count)
@@ -2022,7 +2034,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
2022 "%s: Failed to send nullfunc to AP %pM" 2034 "%s: Failed to send nullfunc to AP %pM"
2023 " after %dms, disconnecting.\n", 2035 " after %dms, disconnecting.\n",
2024 sdata->name, 2036 sdata->name,
2025 bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); 2037 bssid, probe_wait_ms);
2026#endif 2038#endif
2027 ieee80211_sta_connection_lost(sdata, bssid); 2039 ieee80211_sta_connection_lost(sdata, bssid);
2028 } else if (ifmgd->probe_send_count < max_tries) { 2040 } else if (ifmgd->probe_send_count < max_tries) {
@@ -2031,7 +2043,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
2031 "%s: No probe response from AP %pM" 2043 "%s: No probe response from AP %pM"
2032 " after %dms, try %d/%i\n", 2044 " after %dms, try %d/%i\n",
2033 sdata->name, 2045 sdata->name,
2034 bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ, 2046 bssid, probe_wait_ms,
2035 ifmgd->probe_send_count, max_tries); 2047 ifmgd->probe_send_count, max_tries);
2036#endif 2048#endif
2037 ieee80211_mgd_probe_ap_send(sdata); 2049 ieee80211_mgd_probe_ap_send(sdata);
@@ -2044,7 +2056,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
2044 "%s: No probe response from AP %pM" 2056 "%s: No probe response from AP %pM"
2045 " after %dms, disconnecting.\n", 2057 " after %dms, disconnecting.\n",
2046 sdata->name, 2058 sdata->name,
2047 bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); 2059 bssid, probe_wait_ms);
2048 2060
2049 ieee80211_sta_connection_lost(sdata, bssid); 2061 ieee80211_sta_connection_lost(sdata, bssid);
2050 } 2062 }