diff options
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 43a45cf00e06..99b103921a4b 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -98,9 +98,8 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
98 | } | 98 | } |
99 | 99 | ||
100 | /* save the ERP value so that it is available at association time */ | 100 | /* save the ERP value so that it is available at association time */ |
101 | if (elems->erp_info && elems->erp_info_len >= 1 && | 101 | if (elems->erp_info && (!elems->parse_error || |
102 | (!elems->parse_error || | 102 | !(bss->valid_data & IEEE80211_BSS_VALID_ERP))) { |
103 | !(bss->valid_data & IEEE80211_BSS_VALID_ERP))) { | ||
104 | bss->erp_value = elems->erp_info[0]; | 103 | bss->erp_value = elems->erp_info[0]; |
105 | bss->has_erp_value = true; | 104 | bss->has_erp_value = true; |
106 | if (!elems->parse_error) | 105 | if (!elems->parse_error) |
@@ -153,7 +152,6 @@ void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb) | |||
153 | u8 *elements; | 152 | u8 *elements; |
154 | struct ieee80211_channel *channel; | 153 | struct ieee80211_channel *channel; |
155 | size_t baselen; | 154 | size_t baselen; |
156 | bool beacon; | ||
157 | struct ieee802_11_elems elems; | 155 | struct ieee802_11_elems elems; |
158 | 156 | ||
159 | if (skb->len < 24 || | 157 | if (skb->len < 24 || |
@@ -175,17 +173,15 @@ void ieee80211_scan_rx(struct ieee80211_local *local, struct sk_buff *skb) | |||
175 | 173 | ||
176 | elements = mgmt->u.probe_resp.variable; | 174 | elements = mgmt->u.probe_resp.variable; |
177 | baselen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); | 175 | baselen = offsetof(struct ieee80211_mgmt, u.probe_resp.variable); |
178 | beacon = false; | ||
179 | } else { | 176 | } else { |
180 | baselen = offsetof(struct ieee80211_mgmt, u.beacon.variable); | 177 | baselen = offsetof(struct ieee80211_mgmt, u.beacon.variable); |
181 | elements = mgmt->u.beacon.variable; | 178 | elements = mgmt->u.beacon.variable; |
182 | beacon = true; | ||
183 | } | 179 | } |
184 | 180 | ||
185 | if (baselen > skb->len) | 181 | if (baselen > skb->len) |
186 | return; | 182 | return; |
187 | 183 | ||
188 | ieee802_11_parse_elems(elements, skb->len - baselen, &elems); | 184 | ieee802_11_parse_elems(elements, skb->len - baselen, false, &elems); |
189 | 185 | ||
190 | channel = ieee80211_get_channel(local->hw.wiphy, rx_status->freq); | 186 | channel = ieee80211_get_channel(local->hw.wiphy, rx_status->freq); |
191 | 187 | ||
@@ -335,7 +331,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local) | |||
335 | ieee80211_offchannel_stop_vifs(local); | 331 | ieee80211_offchannel_stop_vifs(local); |
336 | 332 | ||
337 | /* ensure nullfunc is transmitted before leaving operating channel */ | 333 | /* ensure nullfunc is transmitted before leaving operating channel */ |
338 | drv_flush(local, false); | 334 | ieee80211_flush_queues(local, NULL); |
339 | 335 | ||
340 | ieee80211_configure_filter(local); | 336 | ieee80211_configure_filter(local); |
341 | 337 | ||
@@ -387,7 +383,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, | |||
387 | { | 383 | { |
388 | int i; | 384 | int i; |
389 | struct ieee80211_sub_if_data *sdata; | 385 | struct ieee80211_sub_if_data *sdata; |
390 | enum ieee80211_band band = local->hw.conf.channel->band; | 386 | enum ieee80211_band band = local->hw.conf.chandef.chan->band; |
391 | u32 tx_flags; | 387 | u32 tx_flags; |
392 | 388 | ||
393 | tx_flags = IEEE80211_TX_INTFL_OFFCHAN_TX_OK; | 389 | tx_flags = IEEE80211_TX_INTFL_OFFCHAN_TX_OK; |
@@ -404,7 +400,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, | |||
404 | local->scan_req->ssids[i].ssid_len, | 400 | local->scan_req->ssids[i].ssid_len, |
405 | local->scan_req->ie, local->scan_req->ie_len, | 401 | local->scan_req->ie, local->scan_req->ie_len, |
406 | local->scan_req->rates[band], false, | 402 | local->scan_req->rates[band], false, |
407 | tx_flags, local->hw.conf.channel, true); | 403 | tx_flags, local->hw.conf.chandef.chan, true); |
408 | 404 | ||
409 | /* | 405 | /* |
410 | * After sending probe requests, wait for probe responses | 406 | * After sending probe requests, wait for probe responses |
@@ -470,7 +466,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, | |||
470 | if (local->ops->hw_scan) { | 466 | if (local->ops->hw_scan) { |
471 | __set_bit(SCAN_HW_SCANNING, &local->scanning); | 467 | __set_bit(SCAN_HW_SCANNING, &local->scanning); |
472 | } else if ((req->n_channels == 1) && | 468 | } else if ((req->n_channels == 1) && |
473 | (req->channels[0] == local->_oper_channel)) { | 469 | (req->channels[0] == local->_oper_chandef.chan)) { |
474 | /* | 470 | /* |
475 | * If we are scanning only on the operating channel | 471 | * If we are scanning only on the operating channel |
476 | * then we do not need to stop normal activities | 472 | * then we do not need to stop normal activities |
@@ -671,7 +667,7 @@ static void ieee80211_scan_state_resume(struct ieee80211_local *local, | |||
671 | ieee80211_offchannel_stop_vifs(local); | 667 | ieee80211_offchannel_stop_vifs(local); |
672 | 668 | ||
673 | if (local->ops->flush) { | 669 | if (local->ops->flush) { |
674 | drv_flush(local, false); | 670 | ieee80211_flush_queues(local, NULL); |
675 | *next_delay = 0; | 671 | *next_delay = 0; |
676 | } else | 672 | } else |
677 | *next_delay = HZ / 10; | 673 | *next_delay = HZ / 10; |