aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c50
1 files changed, 46 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 3b838c0bf59..4d8d2320c9f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -347,9 +347,11 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
347 /* 347 /*
348 * Some configuration parameters (e.g. channel and antenna values) can 348 * Some configuration parameters (e.g. channel and antenna values) can
349 * only be set when the radio is enabled, but do require the RX to 349 * only be set when the radio is enabled, but do require the RX to
350 * be off. 350 * be off. During this period we should keep link tuning enabled,
351 * if for any reason the link tuner must be reset, this will be
352 * handled by rt2x00lib_config().
351 */ 353 */
352 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF); 354 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK);
353 355
354 /* 356 /*
355 * When we've just turned on the radio, we want to reprogram 357 * When we've just turned on the radio, we want to reprogram
@@ -367,7 +369,7 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
367 rt2x00lib_config_antenna(rt2x00dev, rt2x00dev->default_ant); 369 rt2x00lib_config_antenna(rt2x00dev, rt2x00dev->default_ant);
368 370
369 /* Turn RX back on */ 371 /* Turn RX back on */
370 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON); 372 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);
371 373
372 return 0; 374 return 0;
373} 375}
@@ -431,12 +433,36 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
431} 433}
432EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); 434EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter);
433 435
436static void rt2x00mac_set_tim_iter(void *data, u8 *mac,
437 struct ieee80211_vif *vif)
438{
439 struct rt2x00_intf *intf = vif_to_intf(vif);
440
441 if (vif->type != NL80211_IFTYPE_AP &&
442 vif->type != NL80211_IFTYPE_ADHOC &&
443 vif->type != NL80211_IFTYPE_MESH_POINT &&
444 vif->type != NL80211_IFTYPE_WDS)
445 return;
446
447 spin_lock(&intf->lock);
448 intf->delayed_flags |= DELAYED_UPDATE_BEACON;
449 spin_unlock(&intf->lock);
450}
451
434int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 452int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
435 bool set) 453 bool set)
436{ 454{
437 struct rt2x00_dev *rt2x00dev = hw->priv; 455 struct rt2x00_dev *rt2x00dev = hw->priv;
438 456
439 rt2x00lib_beacondone(rt2x00dev); 457 if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
458 return 0;
459
460 ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
461 rt2x00mac_set_tim_iter,
462 rt2x00dev);
463
464 /* queue work to upodate the beacon template */
465 ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->intf_work);
440 return 0; 466 return 0;
441} 467}
442EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); 468EXPORT_SYMBOL_GPL(rt2x00mac_set_tim);
@@ -540,6 +566,22 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
540EXPORT_SYMBOL_GPL(rt2x00mac_set_key); 566EXPORT_SYMBOL_GPL(rt2x00mac_set_key);
541#endif /* CONFIG_RT2X00_LIB_CRYPTO */ 567#endif /* CONFIG_RT2X00_LIB_CRYPTO */
542 568
569void rt2x00mac_sw_scan_start(struct ieee80211_hw *hw)
570{
571 struct rt2x00_dev *rt2x00dev = hw->priv;
572 __set_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags);
573 rt2x00link_stop_tuner(rt2x00dev);
574}
575EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_start);
576
577void rt2x00mac_sw_scan_complete(struct ieee80211_hw *hw)
578{
579 struct rt2x00_dev *rt2x00dev = hw->priv;
580 __clear_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags);
581 rt2x00link_start_tuner(rt2x00dev);
582}
583EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_complete);
584
543int rt2x00mac_get_stats(struct ieee80211_hw *hw, 585int rt2x00mac_get_stats(struct ieee80211_hw *hw,
544 struct ieee80211_low_level_stats *stats) 586 struct ieee80211_low_level_stats *stats)
545{ 587{