aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJeremy Erickson <jerickso@cs.unc.edu>2014-04-18 17:06:00 -0400
committerJeremy Erickson <jerickso@cs.unc.edu>2014-04-18 17:06:00 -0400
commita215aa7b9ab3759c047201199fba64d3042d7f13 (patch)
treebca37493d9b2233450e6d3ffced1261d0e4f71fe /net/mac80211/mlme.c
parentd31199a77ef606f1d06894385f1852181ba6136b (diff)
Update 2.6.36 to 2.6.36.4wip-dissipation2-jerickso
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c48
1 files changed, 33 insertions, 15 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b6c163ac22da..4c5eed9446f4 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -109,7 +109,7 @@ static void run_again(struct ieee80211_if_managed *ifmgd,
109 mod_timer(&ifmgd->timer, timeout); 109 mod_timer(&ifmgd->timer, timeout);
110} 110}
111 111
112static void mod_beacon_timer(struct ieee80211_sub_if_data *sdata) 112void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata)
113{ 113{
114 if (sdata->local->hw.flags & IEEE80211_HW_BEACON_FILTER) 114 if (sdata->local->hw.flags & IEEE80211_HW_BEACON_FILTER)
115 return; 115 return;
@@ -118,6 +118,19 @@ static void mod_beacon_timer(struct ieee80211_sub_if_data *sdata)
118 round_jiffies_up(jiffies + IEEE80211_BEACON_LOSS_TIME)); 118 round_jiffies_up(jiffies + IEEE80211_BEACON_LOSS_TIME));
119} 119}
120 120
121void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata)
122{
123 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
124
125 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
126 return;
127
128 mod_timer(&sdata->u.mgd.conn_mon_timer,
129 round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME));
130
131 ifmgd->probe_send_count = 0;
132}
133
121static int ecw2cw(int ecw) 134static int ecw2cw(int ecw)
122{ 135{
123 return (1 << ecw) - 1; 136 return (1 << ecw) - 1;
@@ -1006,21 +1019,26 @@ void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
1006 if (is_multicast_ether_addr(hdr->addr1)) 1019 if (is_multicast_ether_addr(hdr->addr1))
1007 return; 1020 return;
1008 1021
1009 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) 1022 ieee80211_sta_reset_conn_monitor(sdata);
1010 return;
1011
1012 mod_timer(&sdata->u.mgd.conn_mon_timer,
1013 round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME));
1014} 1023}
1015 1024
1016static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) 1025static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
1017{ 1026{
1018 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 1027 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1019 const u8 *ssid; 1028 const u8 *ssid;
1029 u8 *dst = ifmgd->associated->bssid;
1030 u8 unicast_limit = max(1, IEEE80211_MAX_PROBE_TRIES - 3);
1031
1032 /*
1033 * Try sending broadcast probe requests for the last three
1034 * probe requests after the first ones failed since some
1035 * buggy APs only support broadcast probe requests.
1036 */
1037 if (ifmgd->probe_send_count >= unicast_limit)
1038 dst = NULL;
1020 1039
1021 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1040 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1022 ieee80211_send_probe_req(sdata, ifmgd->associated->bssid, 1041 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0);
1023 ssid + 2, ssid[1], NULL, 0);
1024 1042
1025 ifmgd->probe_send_count++; 1043 ifmgd->probe_send_count++;
1026 ifmgd->probe_timeout = jiffies + IEEE80211_PROBE_WAIT; 1044 ifmgd->probe_timeout = jiffies + IEEE80211_PROBE_WAIT;
@@ -1262,7 +1280,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1262 1280
1263 rates = 0; 1281 rates = 0;
1264 basic_rates = 0; 1282 basic_rates = 0;
1265 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 1283 sband = local->hw.wiphy->bands[wk->chan->band];
1266 1284
1267 for (i = 0; i < elems.supp_rates_len; i++) { 1285 for (i = 0; i < elems.supp_rates_len; i++) {
1268 int rate = (elems.supp_rates[i] & 0x7f) * 5; 1286 int rate = (elems.supp_rates[i] & 0x7f) * 5;
@@ -1298,11 +1316,11 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1298 } 1316 }
1299 } 1317 }
1300 1318
1301 sta->sta.supp_rates[local->hw.conf.channel->band] = rates; 1319 sta->sta.supp_rates[wk->chan->band] = rates;
1302 sdata->vif.bss_conf.basic_rates = basic_rates; 1320 sdata->vif.bss_conf.basic_rates = basic_rates;
1303 1321
1304 /* cf. IEEE 802.11 9.2.12 */ 1322 /* cf. IEEE 802.11 9.2.12 */
1305 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ && 1323 if (wk->chan->band == IEEE80211_BAND_2GHZ &&
1306 have_higher_than_11mbit) 1324 have_higher_than_11mbit)
1307 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE; 1325 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
1308 else 1326 else
@@ -1362,7 +1380,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
1362 * Also start the timer that will detect beacon loss. 1380 * Also start the timer that will detect beacon loss.
1363 */ 1381 */
1364 ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt); 1382 ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt);
1365 mod_beacon_timer(sdata); 1383 ieee80211_sta_reset_beacon_monitor(sdata);
1366 1384
1367 return true; 1385 return true;
1368} 1386}
@@ -1465,7 +1483,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata,
1465 * we have or will be receiving any beacons or data, so let's 1483 * we have or will be receiving any beacons or data, so let's
1466 * schedule the timers again, just in case. 1484 * schedule the timers again, just in case.
1467 */ 1485 */
1468 mod_beacon_timer(sdata); 1486 ieee80211_sta_reset_beacon_monitor(sdata);
1469 1487
1470 mod_timer(&ifmgd->conn_mon_timer, 1488 mod_timer(&ifmgd->conn_mon_timer,
1471 round_jiffies_up(jiffies + 1489 round_jiffies_up(jiffies +
@@ -1540,7 +1558,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1540 ifmgd->last_beacon_signal = rx_status->signal; 1558 ifmgd->last_beacon_signal = rx_status->signal;
1541 if (ifmgd->flags & IEEE80211_STA_RESET_SIGNAL_AVE) { 1559 if (ifmgd->flags & IEEE80211_STA_RESET_SIGNAL_AVE) {
1542 ifmgd->flags &= ~IEEE80211_STA_RESET_SIGNAL_AVE; 1560 ifmgd->flags &= ~IEEE80211_STA_RESET_SIGNAL_AVE;
1543 ifmgd->ave_beacon_signal = rx_status->signal; 1561 ifmgd->ave_beacon_signal = rx_status->signal * 16;
1544 ifmgd->last_cqm_event_signal = 0; 1562 ifmgd->last_cqm_event_signal = 0;
1545 } else { 1563 } else {
1546 ifmgd->ave_beacon_signal = 1564 ifmgd->ave_beacon_signal =
@@ -1588,7 +1606,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1588 * Push the beacon loss detection into the future since 1606 * Push the beacon loss detection into the future since
1589 * we are processing a beacon from the AP just now. 1607 * we are processing a beacon from the AP just now.
1590 */ 1608 */
1591 mod_beacon_timer(sdata); 1609 ieee80211_sta_reset_beacon_monitor(sdata);
1592 1610
1593 ncrc = crc32_be(0, (void *)&mgmt->u.beacon.beacon_int, 4); 1611 ncrc = crc32_be(0, (void *)&mgmt->u.beacon.beacon_int, 4);
1594 ncrc = ieee802_11_parse_elems_crc(mgmt->u.beacon.variable, 1612 ncrc = ieee802_11_parse_elems_crc(mgmt->u.beacon.variable,