aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2009-06-09 23:43:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-10 13:28:39 -0400
commita6ae0716e5c3b5f9dbe5ed8f473a6c7b89692365 (patch)
tree03cb4056959ccf538b26f565c1e4509e4e0a5250 /drivers/net/wireless
parent27004b10ce56985d8a010ce966af179f1b34193f (diff)
ath5k: minor rfkill cleanup
Always enable rfkill since the ifdefs in the code is not really worth the Kconfig option. Also fix a few code style things, and remove the usage of the ah_gpio[] array so we can remove it later. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath5k/Kconfig8
-rw-r--r--drivers/net/wireless/ath/ath5k/Makefile2
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h5
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c5
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/rfkill.c12
6 files changed, 8 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig
index 4863f4bbf768..509b6f94f73b 100644
--- a/drivers/net/wireless/ath/ath5k/Kconfig
+++ b/drivers/net/wireless/ath/ath5k/Kconfig
@@ -39,11 +39,3 @@ config ATH5K_DEBUG
39 39
40 modprobe ath5k debug=0x00000400 40 modprobe ath5k debug=0x00000400
41 41
42config ATH5K_RFKILL
43 bool "Atheros 5xxx rfkill support"
44 depends on ATH5K
45 default y
46 ---help---
47 Include support for enabling/disabling WiFi via rfkill switch
48 with Atheros 5xxx cards
49
diff --git a/drivers/net/wireless/ath/ath5k/Makefile b/drivers/net/wireless/ath/ath5k/Makefile
index f1e281c5a213..090dc6d268a3 100644
--- a/drivers/net/wireless/ath/ath5k/Makefile
+++ b/drivers/net/wireless/ath/ath5k/Makefile
@@ -11,6 +11,6 @@ ath5k-y += reset.o
11ath5k-y += attach.o 11ath5k-y += attach.o
12ath5k-y += base.o 12ath5k-y += base.o
13ath5k-y += led.o 13ath5k-y += led.o
14ath5k-y += rfkill.o
14ath5k-$(CONFIG_ATH5K_DEBUG) += debug.o 15ath5k-$(CONFIG_ATH5K_DEBUG) += debug.o
15ath5k-$(CONFIG_ATH5K_RFKILL) += rfkill.o
16obj-$(CONFIG_ATH5K) += ath5k.o 16obj-$(CONFIG_ATH5K) += ath5k.o
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 4c84e308763c..6358233bac99 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1257,13 +1257,8 @@ extern int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val);
1257extern void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level); 1257extern void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level);
1258 1258
1259/* rfkill Functions */ 1259/* rfkill Functions */
1260#ifdef CONFIG_ATH5K_RFKILL
1261extern void ath5k_rfkill_hw_start(struct ath5k_hw *ah); 1260extern void ath5k_rfkill_hw_start(struct ath5k_hw *ah);
1262extern void ath5k_rfkill_hw_stop(struct ath5k_hw *ah); 1261extern void ath5k_rfkill_hw_stop(struct ath5k_hw *ah);
1263#else
1264static inline void ath5k_rfkill_hw_start(struct ath5k_hw *ah) {}
1265static inline void ath5k_rfkill_hw_stop(struct ath5k_hw *ah) {}
1266#endif
1267 1262
1268/* Misc functions */ 1263/* Misc functions */
1269int ath5k_hw_set_capabilities(struct ath5k_hw *ah); 1264int ath5k_hw_set_capabilities(struct ath5k_hw *ah);
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index f55675c23f2e..55f7de09d134 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2530,12 +2530,9 @@ ath5k_intr(int irq, void *dev_id)
2530 */ 2530 */
2531 ath5k_hw_update_mib_counters(ah, &sc->ll_stats); 2531 ath5k_hw_update_mib_counters(ah, &sc->ll_stats);
2532 } 2532 }
2533#ifdef CONFIG_ATH5K_RFKILL
2534 if (status & AR5K_INT_GPIO) 2533 if (status & AR5K_INT_GPIO)
2535 {
2536 tasklet_schedule(&sc->rf_kill.toggleq); 2534 tasklet_schedule(&sc->rf_kill.toggleq);
2537 } 2535
2538#endif
2539 } 2536 }
2540 } while (ath5k_hw_is_intr_pending(ah) && --counter > 0); 2537 } while (ath5k_hw_is_intr_pending(ah) && --counter > 0);
2541 2538
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 7a0ecdd9c258..f9b7f2f819b7 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -177,9 +177,7 @@ struct ath5k_softc {
177 struct tasklet_struct txtq; /* tx intr tasklet */ 177 struct tasklet_struct txtq; /* tx intr tasklet */
178 struct ath5k_led tx_led; /* tx led */ 178 struct ath5k_led tx_led; /* tx led */
179 179
180#ifdef CONFIG_ATH5K_RFKILL
181 struct ath5k_rfkill rf_kill; 180 struct ath5k_rfkill rf_kill;
182#endif
183 181
184 spinlock_t block; /* protects beacon */ 182 spinlock_t block; /* protects beacon */
185 struct tasklet_struct beacontq; /* beacon intr tasklet */ 183 struct tasklet_struct beacontq; /* beacon intr tasklet */
diff --git a/drivers/net/wireless/ath/ath5k/rfkill.c b/drivers/net/wireless/ath/ath5k/rfkill.c
index 492ada92db56..41a877b73fce 100644
--- a/drivers/net/wireless/ath/ath5k/rfkill.c
+++ b/drivers/net/wireless/ath/ath5k/rfkill.c
@@ -56,10 +56,12 @@ static inline void ath5k_rfkill_enable(struct ath5k_softc *sc)
56static inline void ath5k_rfkill_set_intr(struct ath5k_softc *sc, bool enable) 56static inline void ath5k_rfkill_set_intr(struct ath5k_softc *sc, bool enable)
57{ 57{
58 struct ath5k_hw *ah = sc->ah; 58 struct ath5k_hw *ah = sc->ah;
59 u32 curval;
60
59 ath5k_hw_set_gpio_input(ah, sc->rf_kill.gpio); 61 ath5k_hw_set_gpio_input(ah, sc->rf_kill.gpio);
60 ah->ah_gpio[0] = ath5k_hw_get_gpio(ah, sc->rf_kill.gpio); 62 curval = ath5k_hw_get_gpio(ah, sc->rf_kill.gpio);
61 ath5k_hw_set_gpio_intr(ah, sc->rf_kill.gpio, enable ? 63 ath5k_hw_set_gpio_intr(ah, sc->rf_kill.gpio, enable ?
62 !!ah->ah_gpio[0] : !ah->ah_gpio[0]); 64 !!curval : !curval);
63} 65}
64 66
65static bool 67static bool
@@ -97,9 +99,8 @@ ath5k_rfkill_hw_start(struct ath5k_hw *ah)
97 ath5k_rfkill_disable(sc); 99 ath5k_rfkill_disable(sc);
98 100
99 /* enable interrupt for rfkill switch */ 101 /* enable interrupt for rfkill switch */
100 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header)) { 102 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
101 ath5k_rfkill_set_intr(sc, true); 103 ath5k_rfkill_set_intr(sc, true);
102 }
103} 104}
104 105
105 106
@@ -109,9 +110,8 @@ ath5k_rfkill_hw_stop(struct ath5k_hw *ah)
109 struct ath5k_softc *sc = ah->ah_sc; 110 struct ath5k_softc *sc = ah->ah_sc;
110 111
111 /* disable interrupt for rfkill switch */ 112 /* disable interrupt for rfkill switch */
112 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header)) { 113 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
113 ath5k_rfkill_set_intr(sc, false); 114 ath5k_rfkill_set_intr(sc, false);
114 }
115 115
116 tasklet_kill(&sc->rf_kill.toggleq); 116 tasklet_kill(&sc->rf_kill.toggleq);
117 117