aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-06 14:23:30 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-09 11:34:35 -0500
commit8b2c98243e8d00f9c6b6059976d6de51491ee0c7 (patch)
treeff4d3dacbbe67d7886ac00b8738a532bb9bb8c76 /drivers/net/wireless/mac80211_hwsim.c
parent9214ad7f9a0bfbfb2c204305e7391ce8b7fe4d29 (diff)
mac80211: clarify interface iteration and make it configurable
During hardware restart, all interfaces are iterated even though they haven't been re-added to the driver, document this behaviour. The same also happens during resume, which is even more confusing since all of the interfaces were previously removed from the driver. Make this optional so drivers relying on the current behaviour can still use it, but to let drivers that don't want this behaviour disable it. Also convert all API users, keeping the old semantics except in hwsim, where the new normal ones are desired. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 9b4f76718db7..a8ec7086ad09 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -571,6 +571,7 @@ static bool mac80211_hwsim_addr_match(struct mac80211_hwsim_data *data,
571 md.ret = false; 571 md.ret = false;
572 md.addr = addr; 572 md.addr = addr;
573 ieee80211_iterate_active_interfaces_atomic(data->hw, 573 ieee80211_iterate_active_interfaces_atomic(data->hw,
574 IEEE80211_IFACE_ITER_NORMAL,
574 mac80211_hwsim_addr_iter, 575 mac80211_hwsim_addr_iter,
575 &md); 576 &md);
576 577
@@ -744,8 +745,8 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
744 if (!hwsim_chans_compat(chan, data2->tmp_chan) && 745 if (!hwsim_chans_compat(chan, data2->tmp_chan) &&
745 !hwsim_chans_compat(chan, data2->channel)) { 746 !hwsim_chans_compat(chan, data2->channel)) {
746 ieee80211_iterate_active_interfaces_atomic( 747 ieee80211_iterate_active_interfaces_atomic(
747 data2->hw, mac80211_hwsim_tx_iter, 748 data2->hw, IEEE80211_IFACE_ITER_NORMAL,
748 &tx_iter_data); 749 mac80211_hwsim_tx_iter, &tx_iter_data);
749 if (!tx_iter_data.receive) 750 if (!tx_iter_data.receive)
750 continue; 751 continue;
751 } 752 }
@@ -958,7 +959,8 @@ static void mac80211_hwsim_beacon(unsigned long arg)
958 return; 959 return;
959 960
960 ieee80211_iterate_active_interfaces_atomic( 961 ieee80211_iterate_active_interfaces_atomic(
961 hw, mac80211_hwsim_beacon_tx, hw); 962 hw, IEEE80211_IFACE_ITER_NORMAL,
963 mac80211_hwsim_beacon_tx, hw);
962 964
963 data->beacon_timer.expires = jiffies + data->beacon_int; 965 data->beacon_timer.expires = jiffies + data->beacon_int;
964 add_timer(&data->beacon_timer); 966 add_timer(&data->beacon_timer);
@@ -1680,14 +1682,17 @@ static int hwsim_fops_ps_write(void *dat, u64 val)
1680 1682
1681 if (val == PS_MANUAL_POLL) { 1683 if (val == PS_MANUAL_POLL) {
1682 ieee80211_iterate_active_interfaces(data->hw, 1684 ieee80211_iterate_active_interfaces(data->hw,
1685 IEEE80211_IFACE_ITER_NORMAL,
1683 hwsim_send_ps_poll, data); 1686 hwsim_send_ps_poll, data);
1684 data->ps_poll_pending = true; 1687 data->ps_poll_pending = true;
1685 } else if (old_ps == PS_DISABLED && val != PS_DISABLED) { 1688 } else if (old_ps == PS_DISABLED && val != PS_DISABLED) {
1686 ieee80211_iterate_active_interfaces(data->hw, 1689 ieee80211_iterate_active_interfaces(data->hw,
1690 IEEE80211_IFACE_ITER_NORMAL,
1687 hwsim_send_nullfunc_ps, 1691 hwsim_send_nullfunc_ps,
1688 data); 1692 data);
1689 } else if (old_ps != PS_DISABLED && val == PS_DISABLED) { 1693 } else if (old_ps != PS_DISABLED && val == PS_DISABLED) {
1690 ieee80211_iterate_active_interfaces(data->hw, 1694 ieee80211_iterate_active_interfaces(data->hw,
1695 IEEE80211_IFACE_ITER_NORMAL,
1691 hwsim_send_nullfunc_no_ps, 1696 hwsim_send_nullfunc_no_ps,
1692 data); 1697 data);
1693 } 1698 }