diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7ecda9d59d8a..1619e0cd26e2 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -441,6 +441,9 @@ static bool ieee80211_check_tim(struct ieee802_11_elems *elems, u16 aid) | |||
441 | u8 index, indexn1, indexn2; | 441 | u8 index, indexn1, indexn2; |
442 | struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *) elems->tim; | 442 | struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *) elems->tim; |
443 | 443 | ||
444 | if (unlikely(!tim || elems->tim_len < 4)) | ||
445 | return false; | ||
446 | |||
444 | aid &= 0x3fff; | 447 | aid &= 0x3fff; |
445 | index = aid / 8; | 448 | index = aid / 8; |
446 | mask = 1 << (aid & 7); | 449 | mask = 1 << (aid & 7); |
@@ -945,9 +948,13 @@ void ieee80211_beacon_loss_work(struct work_struct *work) | |||
945 | u.mgd.beacon_loss_work); | 948 | u.mgd.beacon_loss_work); |
946 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 949 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
947 | 950 | ||
948 | printk(KERN_DEBUG "%s: driver reports beacon loss from AP %pM " | 951 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
949 | "- sending probe request\n", sdata->dev->name, | 952 | if (net_ratelimit()) { |
950 | sdata->u.mgd.bssid); | 953 | printk(KERN_DEBUG "%s: driver reports beacon loss from AP %pM " |
954 | "- sending probe request\n", sdata->dev->name, | ||
955 | sdata->u.mgd.bssid); | ||
956 | } | ||
957 | #endif | ||
951 | 958 | ||
952 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; | 959 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; |
953 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, | 960 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, |
@@ -1007,9 +1014,13 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata) | |||
1007 | (local->hw.conf.flags & IEEE80211_CONF_PS)) && | 1014 | (local->hw.conf.flags & IEEE80211_CONF_PS)) && |
1008 | time_after(jiffies, | 1015 | time_after(jiffies, |
1009 | ifmgd->last_beacon + IEEE80211_MONITORING_INTERVAL)) { | 1016 | ifmgd->last_beacon + IEEE80211_MONITORING_INTERVAL)) { |
1010 | printk(KERN_DEBUG "%s: beacon loss from AP %pM " | 1017 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
1011 | "- sending probe request\n", | 1018 | if (net_ratelimit()) { |
1012 | sdata->dev->name, ifmgd->bssid); | 1019 | printk(KERN_DEBUG "%s: beacon loss from AP %pM " |
1020 | "- sending probe request\n", | ||
1021 | sdata->dev->name, ifmgd->bssid); | ||
1022 | } | ||
1023 | #endif | ||
1013 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; | 1024 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; |
1014 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, | 1025 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, |
1015 | ifmgd->ssid_len, NULL, 0); | 1026 | ifmgd->ssid_len, NULL, 0); |
@@ -2105,12 +2116,13 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work) | |||
2105 | struct ieee80211_local *local = | 2116 | struct ieee80211_local *local = |
2106 | container_of(work, struct ieee80211_local, | 2117 | container_of(work, struct ieee80211_local, |
2107 | dynamic_ps_enable_work); | 2118 | dynamic_ps_enable_work); |
2119 | /* XXX: using scan_sdata is completely broken! */ | ||
2108 | struct ieee80211_sub_if_data *sdata = local->scan_sdata; | 2120 | struct ieee80211_sub_if_data *sdata = local->scan_sdata; |
2109 | 2121 | ||
2110 | if (local->hw.conf.flags & IEEE80211_CONF_PS) | 2122 | if (local->hw.conf.flags & IEEE80211_CONF_PS) |
2111 | return; | 2123 | return; |
2112 | 2124 | ||
2113 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) | 2125 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK && sdata) |
2114 | ieee80211_send_nullfunc(local, sdata, 1); | 2126 | ieee80211_send_nullfunc(local, sdata, 1); |
2115 | 2127 | ||
2116 | local->hw.conf.flags |= IEEE80211_CONF_PS; | 2128 | local->hw.conf.flags |= IEEE80211_CONF_PS; |