diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-02-22 07:25:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-27 14:06:37 -0500 |
commit | dbccdd1d320e8454e25750ba6adec3b0d0688fe8 (patch) | |
tree | fd56cee9ab701f4b7858baebedddc294c442191d /drivers/net/wireless/ath/ath9k | |
parent | a3f846f12ce75c62bde4b6a1332416520c4fc00a (diff) |
ath9k_hw: Use CONFIG_ATH9K_BTCOEX_SUPPORT
Make use of CONFIG_ATH9K_BTCOEX_SUPPORT in ath9k_hw
to provide a clean way of compilation without BTCOEX
support.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/Makefile | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mci.h | 63 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 21 |
5 files changed, 80 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/Makefile b/drivers/net/wireless/ath/ath9k/Makefile index b3c7b12a3e2c..27d95fe5ade0 100644 --- a/drivers/net/wireless/ath/ath9k/Makefile +++ b/drivers/net/wireless/ath/ath9k/Makefile | |||
@@ -31,14 +31,14 @@ ath9k_hw-y:= \ | |||
31 | eeprom_4k.o \ | 31 | eeprom_4k.o \ |
32 | eeprom_9287.o \ | 32 | eeprom_9287.o \ |
33 | ani.o \ | 33 | ani.o \ |
34 | btcoex.o \ | ||
35 | mac.o \ | 34 | mac.o \ |
36 | ar9002_mac.o \ | 35 | ar9002_mac.o \ |
37 | ar9003_mac.o \ | 36 | ar9003_mac.o \ |
38 | ar9003_eeprom.o \ | 37 | ar9003_eeprom.o \ |
39 | ar9003_paprd.o \ | 38 | ar9003_paprd.o |
40 | ar9003_mci.o | ||
41 | 39 | ||
40 | ath9k_hw-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += btcoex.o \ | ||
41 | ar9003_mci.o | ||
42 | obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o | 42 | obj-$(CONFIG_ATH9K_HW) += ath9k_hw.o |
43 | 43 | ||
44 | obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o | 44 | obj-$(CONFIG_ATH9K_COMMON) += ath9k_common.o |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.h b/drivers/net/wireless/ath/ath9k/ar9003_mci.h index 507527b9f5ab..4842f6c06b8c 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.h | |||
@@ -254,16 +254,32 @@ enum mci_gpm_coex_opcode { | |||
254 | 254 | ||
255 | #define MCI_GPM_IS_CAL_TYPE(_type) ((_type) <= MCI_GPM_WLAN_CAL_DONE) | 255 | #define MCI_GPM_IS_CAL_TYPE(_type) ((_type) <= MCI_GPM_WLAN_CAL_DONE) |
256 | 256 | ||
257 | /* | ||
258 | * Functions that are available to the MCI driver core. | ||
259 | */ | ||
257 | bool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag, | 260 | bool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag, |
258 | u32 *payload, u8 len, bool wait_done, | 261 | u32 *payload, u8 len, bool wait_done, |
259 | bool check_bt); | 262 | bool check_bt); |
260 | void ar9003_mci_stop_bt(struct ath_hw *ah, bool sava_fullsleep); | ||
261 | u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data); | 263 | u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data); |
262 | void ar9003_mci_init_cal_req(struct ath_hw *ah, bool *is_reusable); | ||
263 | void ar9003_mci_init_cal_done(struct ath_hw *ah); | ||
264 | void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf, | 264 | void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf, |
265 | u16 len, u32 sched_addr); | 265 | u16 len, u32 sched_addr); |
266 | void ar9003_mci_cleanup(struct ath_hw *ah); | 266 | void ar9003_mci_cleanup(struct ath_hw *ah); |
267 | void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr, | ||
268 | u32 *rx_msg_intr); | ||
269 | |||
270 | /* | ||
271 | * These functions are used by ath9k_hw. | ||
272 | */ | ||
273 | |||
274 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT | ||
275 | |||
276 | static inline bool ar9003_mci_is_ready(struct ath_hw *ah) | ||
277 | { | ||
278 | return ah->btcoex_hw.mci.ready; | ||
279 | } | ||
280 | void ar9003_mci_stop_bt(struct ath_hw *ah, bool save_fullsleep); | ||
281 | void ar9003_mci_init_cal_req(struct ath_hw *ah, bool *is_reusable); | ||
282 | void ar9003_mci_init_cal_done(struct ath_hw *ah); | ||
267 | void ar9003_mci_set_full_sleep(struct ath_hw *ah); | 283 | void ar9003_mci_set_full_sleep(struct ath_hw *ah); |
268 | void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done); | 284 | void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done); |
269 | void ar9003_mci_check_bt(struct ath_hw *ah); | 285 | void ar9003_mci_check_bt(struct ath_hw *ah); |
@@ -272,13 +288,48 @@ int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
272 | struct ath9k_hw_cal_data *caldata); | 288 | struct ath9k_hw_cal_data *caldata); |
273 | void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g, | 289 | void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g, |
274 | bool is_full_sleep); | 290 | bool is_full_sleep); |
275 | void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr, | ||
276 | u32 *rx_msg_intr); | ||
277 | void ar9003_mci_get_isr(struct ath_hw *ah, enum ath9k_int *masked); | 291 | void ar9003_mci_get_isr(struct ath_hw *ah, enum ath9k_int *masked); |
278 | 292 | ||
293 | #else | ||
294 | |||
279 | static inline bool ar9003_mci_is_ready(struct ath_hw *ah) | 295 | static inline bool ar9003_mci_is_ready(struct ath_hw *ah) |
280 | { | 296 | { |
281 | return ah->btcoex_hw.mci.ready; | 297 | return false; |
298 | } | ||
299 | static inline void ar9003_mci_stop_bt(struct ath_hw *ah, bool save_fullsleep) | ||
300 | { | ||
301 | } | ||
302 | static inline void ar9003_mci_init_cal_req(struct ath_hw *ah, bool *is_reusable) | ||
303 | { | ||
304 | } | ||
305 | static inline void ar9003_mci_init_cal_done(struct ath_hw *ah) | ||
306 | { | ||
307 | } | ||
308 | static inline void ar9003_mci_set_full_sleep(struct ath_hw *ah) | ||
309 | { | ||
310 | } | ||
311 | static inline void ar9003_mci_2g5g_switch(struct ath_hw *ah, bool wait_done) | ||
312 | { | ||
313 | } | ||
314 | static inline void ar9003_mci_check_bt(struct ath_hw *ah) | ||
315 | { | ||
316 | } | ||
317 | static inline bool ar9003_mci_start_reset(struct ath_hw *ah, struct ath9k_channel *chan) | ||
318 | { | ||
319 | return false; | ||
320 | } | ||
321 | static inline int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan, | ||
322 | struct ath9k_hw_cal_data *caldata) | ||
323 | { | ||
324 | return 0; | ||
325 | } | ||
326 | static inline void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g, | ||
327 | bool is_full_sleep) | ||
328 | { | ||
329 | } | ||
330 | static inline void ar9003_mci_get_isr(struct ath_hw *ah, enum ath9k_int *masked) | ||
331 | { | ||
282 | } | 332 | } |
333 | #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ | ||
283 | 334 | ||
284 | #endif | 335 | #endif |
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h index 10627b46ec34..8f93aef4414f 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.h +++ b/drivers/net/wireless/ath/ath9k/btcoex.h | |||
@@ -105,7 +105,6 @@ void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum); | |||
105 | void ath9k_hw_btcoex_set_weight(struct ath_hw *ah, | 105 | void ath9k_hw_btcoex_set_weight(struct ath_hw *ah, |
106 | u32 bt_weight, | 106 | u32 bt_weight, |
107 | u32 wlan_weight); | 107 | u32 wlan_weight); |
108 | void ath9k_hw_btcoex_enable(struct ath_hw *ah); | ||
109 | void ath9k_hw_btcoex_disable(struct ath_hw *ah); | 108 | void ath9k_hw_btcoex_disable(struct ath_hw *ah); |
110 | void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah, | 109 | void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah, |
111 | enum ath_stomp_type stomp_type); | 110 | enum ath_stomp_type stomp_type); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 5f2e30ca8eff..8c840cad3ac2 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1800,8 +1800,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1800 | #endif | 1800 | #endif |
1801 | } | 1801 | } |
1802 | 1802 | ||
1803 | if (ah->btcoex_hw.enabled && | 1803 | if (ath9k_hw_btcoex_is_enabled(ah)) |
1804 | ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) | ||
1805 | ath9k_hw_btcoex_enable(ah); | 1804 | ath9k_hw_btcoex_enable(ah); |
1806 | 1805 | ||
1807 | if (mci) | 1806 | if (mci) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 96494a612650..29b65adade60 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -802,8 +802,9 @@ struct ath_hw { | |||
802 | int firpwr[5]; | 802 | int firpwr[5]; |
803 | enum ath9k_ani_cmd ani_function; | 803 | enum ath9k_ani_cmd ani_function; |
804 | 804 | ||
805 | /* Bluetooth coexistance */ | 805 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT |
806 | struct ath_btcoex_hw btcoex_hw; | 806 | struct ath_btcoex_hw btcoex_hw; |
807 | #endif | ||
807 | 808 | ||
808 | u32 intr_txqs; | 809 | u32 intr_txqs; |
809 | u8 txchainmask; | 810 | u8 txchainmask; |
@@ -1052,13 +1053,29 @@ void ath9k_hw_proc_mib_event(struct ath_hw *ah); | |||
1052 | void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); | 1053 | void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); |
1053 | 1054 | ||
1054 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT | 1055 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT |
1056 | static inline bool ath9k_hw_btcoex_is_enabled(struct ath_hw *ah) | ||
1057 | { | ||
1058 | return ah->btcoex_hw.enabled; | ||
1059 | } | ||
1060 | void ath9k_hw_btcoex_enable(struct ath_hw *ah); | ||
1055 | static inline enum ath_btcoex_scheme | 1061 | static inline enum ath_btcoex_scheme |
1056 | ath9k_hw_get_btcoex_scheme(struct ath_hw *ah) | 1062 | ath9k_hw_get_btcoex_scheme(struct ath_hw *ah) |
1057 | { | 1063 | { |
1058 | return ah->btcoex_hw.scheme; | 1064 | return ah->btcoex_hw.scheme; |
1059 | } | 1065 | } |
1060 | #else | 1066 | #else |
1061 | #define ath9k_hw_get_btcoex_scheme(...) ATH_BTCOEX_CFG_NONE | 1067 | static inline bool ath9k_hw_btcoex_is_enabled(struct ath_hw *ah) |
1068 | { | ||
1069 | return false; | ||
1070 | } | ||
1071 | static inline void ath9k_hw_btcoex_enable(struct ath_hw *ah) | ||
1072 | { | ||
1073 | } | ||
1074 | static inline enum ath_btcoex_scheme | ||
1075 | ath9k_hw_get_btcoex_scheme(struct ath_hw *ah) | ||
1076 | { | ||
1077 | return ATH_BTCOEX_CFG_NONE; | ||
1078 | } | ||
1062 | #endif | 1079 | #endif |
1063 | 1080 | ||
1064 | #define ATH9K_CLOCK_RATE_CCK 22 | 1081 | #define ATH9K_CLOCK_RATE_CCK 22 |