diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-09-04 16:51:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-08 16:31:06 -0400 |
commit | 36dbd9548e92268127b0c31b0e121e63e9207108 (patch) | |
tree | 41d95c5dd824ea43c5f0055bd790b64d7ba8a33a /drivers/net/wireless/b43/b43.h | |
parent | b275f28535fc774325bb8ad5f664e6c44a8fbc9b (diff) |
b43: Use a threaded IRQ handler
Use a threaded IRQ handler to allow locking the mutex and
sleeping while executing an interrupt.
This removes usage of the irq_lock spinlock, but introduces
a new hardirq_lock, which is _only_ used for the PCI/SSB lowlevel
hard-irq handler. Sleeping busses (SDIO) will use mutex instead.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/b43.h')
-rw-r--r-- | drivers/net/wireless/b43/b43.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index a1b3b731935b..d63af926d058 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -616,6 +616,12 @@ struct b43_wl { | |||
616 | /* Pointer to the ieee80211 hardware data structure */ | 616 | /* Pointer to the ieee80211 hardware data structure */ |
617 | struct ieee80211_hw *hw; | 617 | struct ieee80211_hw *hw; |
618 | 618 | ||
619 | /* Global driver mutex. Every operation must run with this mutex locked. */ | ||
620 | struct mutex mutex; | ||
621 | /* Hard-IRQ spinlock. This lock protects things used in the hard-IRQ | ||
622 | * handler, only. This basically is just the IRQ mask register. */ | ||
623 | spinlock_t hardirq_lock; | ||
624 | |||
619 | /* The number of queues that were registered with the mac80211 subsystem | 625 | /* The number of queues that were registered with the mac80211 subsystem |
620 | * initially. This is a backup copy of hw->queues in case hw->queues has | 626 | * initially. This is a backup copy of hw->queues in case hw->queues has |
621 | * to be dynamically lowered at runtime (Firmware does not support QoS). | 627 | * to be dynamically lowered at runtime (Firmware does not support QoS). |
@@ -623,8 +629,6 @@ struct b43_wl { | |||
623 | * from the mac80211 subsystem. */ | 629 | * from the mac80211 subsystem. */ |
624 | u16 mac80211_initially_registered_queues; | 630 | u16 mac80211_initially_registered_queues; |
625 | 631 | ||
626 | struct mutex mutex; | ||
627 | spinlock_t irq_lock; | ||
628 | /* R/W lock for data transmission. | 632 | /* R/W lock for data transmission. |
629 | * Transmissions on 2+ queues can run concurrently, but somebody else | 633 | * Transmissions on 2+ queues can run concurrently, but somebody else |
630 | * might sync with TX by write_lock_irqsave()'ing. */ | 634 | * might sync with TX by write_lock_irqsave()'ing. */ |
@@ -665,8 +669,7 @@ struct b43_wl { | |||
665 | bool radiotap_enabled; | 669 | bool radiotap_enabled; |
666 | bool radio_enabled; | 670 | bool radio_enabled; |
667 | 671 | ||
668 | /* The beacon we are currently using (AP or IBSS mode). | 672 | /* The beacon we are currently using (AP or IBSS mode). */ |
669 | * This beacon stuff is protected by the irq_lock. */ | ||
670 | struct sk_buff *current_beacon; | 673 | struct sk_buff *current_beacon; |
671 | bool beacon0_uploaded; | 674 | bool beacon0_uploaded; |
672 | bool beacon1_uploaded; | 675 | bool beacon1_uploaded; |
@@ -754,14 +757,6 @@ enum { | |||
754 | smp_wmb(); \ | 757 | smp_wmb(); \ |
755 | } while (0) | 758 | } while (0) |
756 | 759 | ||
757 | /* XXX--- HOW LOCKING WORKS IN B43 ---XXX | ||
758 | * | ||
759 | * You should always acquire both, wl->mutex and wl->irq_lock unless: | ||
760 | * - You don't need to acquire wl->irq_lock, if the interface is stopped. | ||
761 | * - You don't need to acquire wl->mutex in the IRQ handler, IRQ tasklet | ||
762 | * and packet TX path (and _ONLY_ there.) | ||
763 | */ | ||
764 | |||
765 | /* Data structure for one wireless device (802.11 core) */ | 760 | /* Data structure for one wireless device (802.11 core) */ |
766 | struct b43_wldev { | 761 | struct b43_wldev { |
767 | struct ssb_device *dev; | 762 | struct ssb_device *dev; |
@@ -807,14 +802,12 @@ struct b43_wldev { | |||
807 | u32 dma_reason[6]; | 802 | u32 dma_reason[6]; |
808 | /* The currently active generic-interrupt mask. */ | 803 | /* The currently active generic-interrupt mask. */ |
809 | u32 irq_mask; | 804 | u32 irq_mask; |
805 | |||
810 | /* Link Quality calculation context. */ | 806 | /* Link Quality calculation context. */ |
811 | struct b43_noise_calculation noisecalc; | 807 | struct b43_noise_calculation noisecalc; |
812 | /* if > 0 MAC is suspended. if == 0 MAC is enabled. */ | 808 | /* if > 0 MAC is suspended. if == 0 MAC is enabled. */ |
813 | int mac_suspended; | 809 | int mac_suspended; |
814 | 810 | ||
815 | /* Interrupt Service Routine tasklet (bottom-half) */ | ||
816 | struct tasklet_struct isr_tasklet; | ||
817 | |||
818 | /* Periodic tasks */ | 811 | /* Periodic tasks */ |
819 | struct delayed_work periodic_work; | 812 | struct delayed_work periodic_work; |
820 | unsigned int periodic_state; | 813 | unsigned int periodic_state; |