diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2010-07-11 06:27:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-12 16:05:34 -0400 |
commit | 4dee32f51b0beba25a70e8011652858c6e55f792 (patch) | |
tree | ea8ae3b056c4af58435f4e4f9c591ea24b612644 /drivers/net | |
parent | 78e256c9a3717bcae2e9ed05c9ec7bed7bf2c55d (diff) |
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: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 26 |
2 files changed, 30 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index d3ebb4144562..e2557257565c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -181,7 +181,7 @@ static void rt2x00lib_intf_scheduled(struct work_struct *work) | |||
181 | static void rt2x00lib_beacondone_iter(void *data, u8 *mac, | 181 | static void rt2x00lib_beacondone_iter(void *data, u8 *mac, |
182 | struct ieee80211_vif *vif) | 182 | struct ieee80211_vif *vif) |
183 | { | 183 | { |
184 | struct rt2x00_intf *intf = vif_to_intf(vif); | 184 | struct rt2x00_dev *rt2x00dev = data; |
185 | 185 | ||
186 | if (vif->type != NL80211_IFTYPE_AP && | 186 | if (vif->type != NL80211_IFTYPE_AP && |
187 | vif->type != NL80211_IFTYPE_ADHOC && | 187 | vif->type != NL80211_IFTYPE_ADHOC && |
@@ -189,9 +189,7 @@ static void rt2x00lib_beacondone_iter(void *data, u8 *mac, | |||
189 | vif->type != NL80211_IFTYPE_WDS) | 189 | vif->type != NL80211_IFTYPE_WDS) |
190 | return; | 190 | return; |
191 | 191 | ||
192 | spin_lock(&intf->lock); | 192 | rt2x00queue_update_beacon(rt2x00dev, vif, true); |
193 | intf->delayed_flags |= DELAYED_UPDATE_BEACON; | ||
194 | spin_unlock(&intf->lock); | ||
195 | } | 193 | } |
196 | 194 | ||
197 | void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) | 195 | void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) |
@@ -199,11 +197,10 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev) | |||
199 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) | 197 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) |
200 | return; | 198 | return; |
201 | 199 | ||
202 | ieee80211_iterate_active_interfaces_atomic(rt2x00dev->hw, | 200 | ieee80211_iterate_active_interfaces(rt2x00dev->hw, |
203 | rt2x00lib_beacondone_iter, | 201 | rt2x00lib_beacondone_iter, |
204 | rt2x00dev); | 202 | rt2x00dev); |
205 | 203 | ||
206 | ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->intf_work); | ||
207 | } | 204 | } |
208 | EXPORT_SYMBOL_GPL(rt2x00lib_beacondone); | 205 | EXPORT_SYMBOL_GPL(rt2x00lib_beacondone); |
209 | 206 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index bbce496bc182..4d8d2320c9fd 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -433,12 +433,36 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw, | |||
433 | } | 433 | } |
434 | EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); | 434 | EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); |
435 | 435 | ||
436 | static 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 | |||
436 | int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, | 452 | int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
437 | bool set) | 453 | bool set) |
438 | { | 454 | { |
439 | struct rt2x00_dev *rt2x00dev = hw->priv; | 455 | struct rt2x00_dev *rt2x00dev = hw->priv; |
440 | 456 | ||
441 | 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); | ||
442 | return 0; | 466 | return 0; |
443 | } | 467 | } |
444 | EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); | 468 | EXPORT_SYMBOL_GPL(rt2x00mac_set_tim); |