aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-07-29 20:08:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:14 -0400
commit42935ecaf4e784d0815afa9a7e5fe7e141157ca3 (patch)
treedc0a0dcfff761e98d8a2a23a7edc8f9182c2774c /drivers/net/wireless/b43
parent64344d78228f6346a0462ba2d5fc03494aef4e6b (diff)
mac80211: redefine usage of the mac80211 workqueue
The mac80211 workqueue exists to enable mac80211 and drivers to queue their own work on a single threaded workqueue. mac80211 takes care to flush the workqueue during suspend but we never really had requirements on drivers for how they should use the workqueue in consideration for suspend. We extend mac80211 to document how the mac80211 workqueue should be used, how it should not be used and finally move raw access to the workqueue to mac80211 only. Drivers and mac80211 use helpers to queue work onto the mac80211 workqueue: * ieee80211_queue_work() * ieee80211_queue_delayed_work() These helpers will now warn if mac80211 already completed its suspend cycle and someone is trying to queue work. mac80211 flushes the mac80211 workqueue prior to suspend a few times, but we haven't taken the care to ensure drivers won't add more work after suspend. To help with this we add a warning when someone tries to add work and mac80211 already completed the suspend cycle. Drivers should ensure they cancel any work or delayed work in the mac80211 stop() callback. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/main.c8
-rw-r--r--drivers/net/wireless/b43/phy_common.c2
-rw-r--r--drivers/net/wireless/b43/pio.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 3f4360ad0e4..f985938962e 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1654,7 +1654,7 @@ static void b43_update_templates(struct b43_wl *wl)
1654 wl->current_beacon = beacon; 1654 wl->current_beacon = beacon;
1655 wl->beacon0_uploaded = 0; 1655 wl->beacon0_uploaded = 0;
1656 wl->beacon1_uploaded = 0; 1656 wl->beacon1_uploaded = 0;
1657 queue_work(wl->hw->workqueue, &wl->beacon_update_trigger); 1657 ieee80211_queue_work(wl->hw, &wl->beacon_update_trigger);
1658} 1658}
1659 1659
1660static void b43_set_beacon_int(struct b43_wldev *dev, u16 beacon_int) 1660static void b43_set_beacon_int(struct b43_wldev *dev, u16 beacon_int)
@@ -2914,7 +2914,7 @@ out_requeue:
2914 delay = msecs_to_jiffies(50); 2914 delay = msecs_to_jiffies(50);
2915 else 2915 else
2916 delay = round_jiffies_relative(HZ * 15); 2916 delay = round_jiffies_relative(HZ * 15);
2917 queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay); 2917 ieee80211_queue_delayed_work(wl->hw, &dev->periodic_work, delay);
2918out: 2918out:
2919 mutex_unlock(&wl->mutex); 2919 mutex_unlock(&wl->mutex);
2920} 2920}
@@ -2925,7 +2925,7 @@ static void b43_periodic_tasks_setup(struct b43_wldev *dev)
2925 2925
2926 dev->periodic_state = 0; 2926 dev->periodic_state = 0;
2927 INIT_DELAYED_WORK(work, b43_periodic_work_handler); 2927 INIT_DELAYED_WORK(work, b43_periodic_work_handler);
2928 queue_delayed_work(dev->wl->hw->workqueue, work, 0); 2928 ieee80211_queue_delayed_work(dev->wl->hw, work, 0);
2929} 2929}
2930 2930
2931/* Check if communication with the device works correctly. */ 2931/* Check if communication with the device works correctly. */
@@ -4871,7 +4871,7 @@ void b43_controller_restart(struct b43_wldev *dev, const char *reason)
4871 if (b43_status(dev) < B43_STAT_INITIALIZED) 4871 if (b43_status(dev) < B43_STAT_INITIALIZED)
4872 return; 4872 return;
4873 b43info(dev->wl, "Controller RESET (%s) ...\n", reason); 4873 b43info(dev->wl, "Controller RESET (%s) ...\n", reason);
4874 queue_work(dev->wl->hw->workqueue, &dev->restart_work); 4874 ieee80211_queue_work(dev->wl->hw, &dev->restart_work);
4875} 4875}
4876 4876
4877#ifdef CONFIG_PM 4877#ifdef CONFIG_PM
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 6d241622210..f537bfef690 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -352,7 +352,7 @@ void b43_phy_txpower_check(struct b43_wldev *dev, unsigned int flags)
352 352
353 /* We must adjust the transmission power in hardware. 353 /* We must adjust the transmission power in hardware.
354 * Schedule b43_phy_txpower_adjust_work(). */ 354 * Schedule b43_phy_txpower_adjust_work(). */
355 queue_work(dev->wl->hw->workqueue, &dev->wl->txpower_adjust_work); 355 ieee80211_queue_work(dev->wl->hw, &dev->wl->txpower_adjust_work);
356} 356}
357 357
358int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 shm_offset) 358int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 shm_offset)
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
index 69138e8c1db..73c047d8de4 100644
--- a/drivers/net/wireless/b43/pio.c
+++ b/drivers/net/wireless/b43/pio.c
@@ -783,7 +783,7 @@ void b43_pio_rx(struct b43_pio_rxqueue *q)
783{ 783{
784 /* Due to latency issues we must run the RX path in 784 /* Due to latency issues we must run the RX path in
785 * a workqueue to be able to schedule between packets. */ 785 * a workqueue to be able to schedule between packets. */
786 queue_work(q->dev->wl->hw->workqueue, &q->rx_work); 786 ieee80211_queue_work(q->dev->wl->hw, &q->rx_work);
787} 787}
788 788
789static void b43_pio_tx_suspend_queue(struct b43_pio_txqueue *q) 789static void b43_pio_tx_suspend_queue(struct b43_pio_txqueue *q)