aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c57
1 files changed, 44 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 8d7fa59364fe..7727f0966d31 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -206,7 +206,6 @@ static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
206static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, 206static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
207 struct iwl_rx_mem_buffer *rxb) 207 struct iwl_rx_mem_buffer *rxb)
208{ 208{
209#ifdef CONFIG_IWLWIFI_DEBUG
210 struct iwl_rx_packet *pkt = rxb_addr(rxb); 209 struct iwl_rx_packet *pkt = rxb_addr(rxb);
211 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw; 210 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
212 211
@@ -214,7 +213,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
214 scan_notif->scanned_channels, 213 scan_notif->scanned_channels,
215 scan_notif->tsf_low, 214 scan_notif->tsf_low,
216 scan_notif->tsf_high, scan_notif->status); 215 scan_notif->tsf_high, scan_notif->status);
217#endif
218 216
219 /* The HW is no longer scanning */ 217 /* The HW is no longer scanning */
220 clear_bit(STATUS_SCAN_HW, &priv->status); 218 clear_bit(STATUS_SCAN_HW, &priv->status);
@@ -236,6 +234,26 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
236 234
237 clear_bit(STATUS_SCANNING, &priv->status); 235 clear_bit(STATUS_SCANNING, &priv->status);
238 236
237 if (priv->iw_mode != NL80211_IFTYPE_ADHOC &&
238 priv->cfg->advanced_bt_coexist && priv->bt_status !=
239 scan_notif->bt_status) {
240 if (scan_notif->bt_status) {
241 /* BT on */
242 if (!priv->bt_ch_announce)
243 priv->bt_traffic_load =
244 IWL_BT_COEX_TRAFFIC_LOAD_HIGH;
245 /*
246 * otherwise, no traffic load information provided
247 * no changes made
248 */
249 } else {
250 /* BT off */
251 priv->bt_traffic_load =
252 IWL_BT_COEX_TRAFFIC_LOAD_NONE;
253 }
254 priv->bt_status = scan_notif->bt_status;
255 queue_work(priv->workqueue, &priv->bt_traffic_change_work);
256 }
239 queue_work(priv->workqueue, &priv->scan_completed); 257 queue_work(priv->workqueue, &priv->scan_completed);
240} 258}
241 259
@@ -268,18 +286,28 @@ u16 iwl_get_passive_dwell_time(struct iwl_priv *priv,
268 enum ieee80211_band band, 286 enum ieee80211_band band,
269 struct ieee80211_vif *vif) 287 struct ieee80211_vif *vif)
270{ 288{
289 struct iwl_rxon_context *ctx;
271 u16 passive = (band == IEEE80211_BAND_2GHZ) ? 290 u16 passive = (band == IEEE80211_BAND_2GHZ) ?
272 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : 291 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
273 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52; 292 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
274 293
275 if (iwl_is_associated(priv)) { 294 if (iwl_is_any_associated(priv)) {
276 /* If we're associated, we clamp the maximum passive 295 /*
277 * dwell time to be 98% of the beacon interval (minus 296 * If we're associated, we clamp the maximum passive
278 * 2 * channel tune time) */ 297 * dwell time to be 98% of the smallest beacon interval
279 passive = vif ? vif->bss_conf.beacon_int : 0; 298 * (minus 2 * channel tune time)
280 if ((passive > IWL_PASSIVE_DWELL_BASE) || !passive) 299 */
281 passive = IWL_PASSIVE_DWELL_BASE; 300 for_each_context(priv, ctx) {
282 passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2; 301 u16 value;
302
303 if (!iwl_is_associated_ctx(ctx))
304 continue;
305 value = ctx->vif ? ctx->vif->bss_conf.beacon_int : 0;
306 if ((value > IWL_PASSIVE_DWELL_BASE) || !value)
307 value = IWL_PASSIVE_DWELL_BASE;
308 value = (value * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
309 passive = min(value, passive);
310 }
283 } 311 }
284 312
285 return passive; 313 return passive;
@@ -509,6 +537,7 @@ static void iwl_bg_scan_completed(struct work_struct *work)
509 container_of(work, struct iwl_priv, scan_completed); 537 container_of(work, struct iwl_priv, scan_completed);
510 bool internal = false; 538 bool internal = false;
511 bool scan_completed = false; 539 bool scan_completed = false;
540 struct iwl_rxon_context *ctx;
512 541
513 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); 542 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");
514 543
@@ -539,11 +568,13 @@ static void iwl_bg_scan_completed(struct work_struct *work)
539 * Since setting the RXON may have been deferred while 568 * Since setting the RXON may have been deferred while
540 * performing the scan, fire one off if needed 569 * performing the scan, fire one off if needed
541 */ 570 */
542 if (memcmp(&priv->active_rxon, 571 for_each_context(priv, ctx)
543 &priv->staging_rxon, sizeof(priv->staging_rxon))) 572 iwlcore_commit_rxon(priv, ctx);
544 iwlcore_commit_rxon(priv);
545 573
546 out: 574 out:
575 if (priv->cfg->ops->hcmd->set_pan_params)
576 priv->cfg->ops->hcmd->set_pan_params(priv);
577
547 mutex_unlock(&priv->mutex); 578 mutex_unlock(&priv->mutex);
548 579
549 /* 580 /*