Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237053
b: refs/heads/master
c: 180205b
h: refs/heads/master
i:
  237051: 169609e
v: v3
  • Loading branch information
Ben Greear authored and John W. Linville committed Feb 7, 2011
1 parent 00aa875 commit 2f1e52d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c210de8f88215db31cf3529c9763fc3124d6e09d
refs/heads/master: 180205bdb22b79cd7b2a07a5002dd747badc82f3
34 changes: 23 additions & 11 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@
#include "rate.h"
#include "led.h"

#define IEEE80211_MAX_NULLFUNC_TRIES 2
#define IEEE80211_MAX_PROBE_TRIES 5
static int max_nullfunc_tries = 2;
module_param(max_nullfunc_tries, int, 0644);
MODULE_PARM_DESC(max_nullfunc_tries,
"Maximum nullfunc tx tries before disconnecting (reason 4).");

static int max_probe_tries = 5;
module_param(max_probe_tries, int, 0644);
MODULE_PARM_DESC(max_probe_tries,
"Maximum probe tries before disconnecting (reason 4).");

/*
* Beacon loss timeout is calculated as N frames times the
Expand All @@ -51,7 +58,11 @@
* a probe request because of beacon loss or for
* checking the connection still works.
*/
#define IEEE80211_PROBE_WAIT (HZ / 2)
static int probe_wait_ms = 500;
module_param(probe_wait_ms, int, 0644);
MODULE_PARM_DESC(probe_wait_ms,
"Maximum time(ms) to wait for probe response"
" before disconnecting (reason 4).");

/*
* Weight given to the latest Beacon frame when calculating average signal
Expand Down Expand Up @@ -1116,7 +1127,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
const u8 *ssid;
u8 *dst = ifmgd->associated->bssid;
u8 unicast_limit = max(1, IEEE80211_MAX_PROBE_TRIES - 3);
u8 unicast_limit = max(1, max_probe_tries - 3);

/*
* Try sending broadcast probe requests for the last three
Expand All @@ -1142,7 +1153,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
}

ifmgd->probe_send_count++;
ifmgd->probe_timeout = jiffies + IEEE80211_PROBE_WAIT;
ifmgd->probe_timeout = jiffies + msecs_to_jiffies(probe_wait_ms);
run_again(ifmgd, ifmgd->probe_timeout);
}

Expand Down Expand Up @@ -1243,7 +1254,8 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata)

memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);

printk(KERN_DEBUG "Connection to AP %pM lost.\n", bssid);
printk(KERN_DEBUG "%s: Connection to AP %pM lost.\n",
sdata->name, bssid);

ieee80211_set_disassoc(sdata, true, true);
mutex_unlock(&ifmgd->mtx);
Expand Down Expand Up @@ -1988,9 +2000,9 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);

if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
max_tries = IEEE80211_MAX_NULLFUNC_TRIES;
max_tries = max_nullfunc_tries;
else
max_tries = IEEE80211_MAX_PROBE_TRIES;
max_tries = max_probe_tries;

/* ACK received for nullfunc probing frame */
if (!ifmgd->probe_send_count)
Expand Down Expand Up @@ -2022,7 +2034,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
"%s: Failed to send nullfunc to AP %pM"
" after %dms, disconnecting.\n",
sdata->name,
bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ);
bssid, probe_wait_ms);
#endif
ieee80211_sta_connection_lost(sdata, bssid);
} else if (ifmgd->probe_send_count < max_tries) {
Expand All @@ -2031,7 +2043,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
"%s: No probe response from AP %pM"
" after %dms, try %d/%i\n",
sdata->name,
bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ,
bssid, probe_wait_ms,
ifmgd->probe_send_count, max_tries);
#endif
ieee80211_mgd_probe_ap_send(sdata);
Expand All @@ -2044,7 +2056,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
"%s: No probe response from AP %pM"
" after %dms, disconnecting.\n",
sdata->name,
bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ);
bssid, probe_wait_ms);

ieee80211_sta_connection_lost(sdata, bssid);
}
Expand Down

0 comments on commit 2f1e52d

Please sign in to comment.