Commit 4dee32f5 authored by Helmut Schaa's avatar Helmut Schaa Committed by John W. Linville

rt2x00: Allow beacon update without scheduling a work

Since all rt2x00 PCI drivers use threaded interrupts now we don't need
to schedule a work just to update the beacon. The only place where the
beacon still gets updated in atomic context is from the set_tim
callback. Hence, move the work scheduling there.
Signed-off-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 78e256c9
...@@ -181,7 +181,7 @@ static void rt2x00lib_intf_scheduled(struct work_struct *work) ...@@ -181,7 +181,7 @@ static void rt2x00lib_intf_scheduled(struct work_struct *work)
static void rt2x00lib_beacondone_iter(void *data, u8 *mac, static void rt2x00lib_beacondone_iter(void *data, u8 *mac,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct rt2x00_intf *intf = vif_to_intf(vif); struct rt2x00_dev *rt2x00dev = data;
if (vif->type != NL80211_IFTYPE_AP && if (vif->type != NL80211_IFTYPE_AP &&
vif->type != NL80211_IFTYPE_ADHOC && vif->type != NL80211_IFTYPE_ADHOC &&
...@@ -189,9 +189,7 @@ static void rt2x00lib_beacondone_iter(void *data, u8 *mac, ...@@ -189,9 +189,7 @@ static void rt2x00lib_beacondone_iter(void *data, u8 *mac,
vif->type != NL80211_IFTYPE_WDS) vif->type != NL80211_IFTYPE_WDS)
return; return;
spin_lock(&intf->lock); rt2x00queue_update_beacon(rt2x00dev, vif, true);
intf->delayed_flags |= DELAYED_UPDATE_BEACON;
spin_unlock(&intf->lock);
} }
void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
...@@ -199,11 +197,10 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) ...@@ -199,11 +197,10 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
return; return;
ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw, ieee80211_iterate_active_interfaces(rt2x00dev->hw,
rt2x00lib_beacondone_iter, rt2x00lib_beacondone_iter,
rt2x00dev); rt2x00dev);
ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->intf_work);
} }
EXPORT_SYMBOL_GPL(rt2x00lib_beacondone); EXPORT_SYMBOL_GPL(rt2x00lib_beacondone);
......
...@@ -433,12 +433,36 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw, ...@@ -433,12 +433,36 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
} }
EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter);
static void rt2x00mac_set_tim_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct rt2x00_intf *intf = vif_to_intf(vif);
if (vif->type != NL80211_IFTYPE_AP &&
vif->type != NL80211_IFTYPE_ADHOC &&
vif->type != NL80211_IFTYPE_MESH_POINT &&
vif->type != NL80211_IFTYPE_WDS)
return;
spin_lock(&intf->lock);
intf->delayed_flags |= DELAYED_UPDATE_BEACON;
spin_unlock(&intf->lock);
}
int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
bool set) bool set)
{ {
struct rt2x00_dev *rt2x00dev = hw->priv; struct rt2x00_dev *rt2x00dev = hw->priv;
rt2x00lib_beacondone(rt2x00dev); if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
return 0;
ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw,
rt2x00mac_set_tim_iter,
rt2x00dev);
/* queue work to upodate the beacon template */
ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->intf_work);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); EXPORT_SYMBOL_GPL(rt2x00mac_set_tim);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment