aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2011-01-30 07:17:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-31 15:06:22 -0500
commitc5c65761839e3d85cc620cc1c85db8d4a7173f53 (patch)
treea84f8af465cc3fdfe5ed4ff2543aa0a32574dc48 /drivers/net/wireless
parent8d59c4e993427df37fb8bfc3470c298194a68e7a (diff)
rt2x00: Introduce tasklets for interrupt handling
No functional changes, just preparation for moving interrupt handling to tasklets. The tasklets are disabled by default. Drivers making use of them need to enable the tasklets when the device state is set to IRQ_ON. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h13
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c21
2 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 985982bb65e2..696513113d9f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -520,6 +520,10 @@ struct rt2x00lib_ops {
520 * TX status tasklet handler. 520 * TX status tasklet handler.
521 */ 521 */
522 void (*txstatus_tasklet) (unsigned long data); 522 void (*txstatus_tasklet) (unsigned long data);
523 void (*pretbtt_tasklet) (unsigned long data);
524 void (*tbtt_tasklet) (unsigned long data);
525 void (*rxdone_tasklet) (unsigned long data);
526 void (*autowake_tasklet) (unsigned long data);
523 527
524 /* 528 /*
525 * Device init handlers. 529 * Device init handlers.
@@ -905,6 +909,15 @@ struct rt2x00_dev {
905 * Tasklet for processing tx status reports (rt2800pci). 909 * Tasklet for processing tx status reports (rt2800pci).
906 */ 910 */
907 struct tasklet_struct txstatus_tasklet; 911 struct tasklet_struct txstatus_tasklet;
912 struct tasklet_struct pretbtt_tasklet;
913 struct tasklet_struct tbtt_tasklet;
914 struct tasklet_struct rxdone_tasklet;
915 struct tasklet_struct autowake_tasklet;
916
917 /*
918 * Protect the interrupt mask register.
919 */
920 spinlock_t irqmask_lock;
908}; 921};
909 922
910/* 923/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 50b379a6c9ee..7d4dece64c1a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -831,6 +831,26 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
831 } 831 }
832 832
833 /* 833 /*
834 * Initialize tasklets if used by the driver. Tasklets are
835 * disabled until the interrupts are turned on. The driver
836 * has to handle that.
837 */
838#define RT2X00_TASKLET_INIT(taskletname) \
839 if (rt2x00dev->ops->lib->taskletname) { \
840 tasklet_init(&rt2x00dev->taskletname, \
841 rt2x00dev->ops->lib->taskletname, \
842 (unsigned long)rt2x00dev); \
843 tasklet_disable(&rt2x00dev->taskletname); \
844 }
845
846 RT2X00_TASKLET_INIT(pretbtt_tasklet);
847 RT2X00_TASKLET_INIT(tbtt_tasklet);
848 RT2X00_TASKLET_INIT(rxdone_tasklet);
849 RT2X00_TASKLET_INIT(autowake_tasklet);
850
851#undef RT2X00_TASKLET_INIT
852
853 /*
834 * Register HW. 854 * Register HW.
835 */ 855 */
836 status = ieee80211_register_hw(rt2x00dev->hw); 856 status = ieee80211_register_hw(rt2x00dev->hw);
@@ -958,6 +978,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
958{ 978{
959 int retval = -ENOMEM; 979 int retval = -ENOMEM;
960 980
981 spin_lock_init(&rt2x00dev->irqmask_lock);
961 mutex_init(&rt2x00dev->csr_mutex); 982 mutex_init(&rt2x00dev->csr_mutex);
962 983
963 set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); 984 set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);