aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-12-17 10:47:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-19 14:46:55 -0500
commit8a30930563521c9dba73c93b5631be1d0993f78f (patch)
tree859d5bd92689fc934aa6c7eea98f1d37891fb293 /drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
parent104cfa881006c18af9b118e1631dcf1f8378994a (diff)
ath9k_hw: make bluetooth coexistence support optional at compile time
Many systems (e.g. embedded systems) do not have wifi modules connected to bluetooth modules, so bluetooth coexistence is irrelevant there. With the addition of MCI support, ath9k picked up quite a bit of extra code that can be compiled out this way. This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for querying the bluetooth coexistence scheme, allowing the compiler to eliminate code that uses it, with only very little use of #ifdef. On MIPS this reduces the total size for the modules by about 20k. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_gpio.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_gpio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index b7c030018403..6506e1fd5036 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
@@ -115,6 +115,9 @@ void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv)
115{ 115{
116 struct ath_btcoex *btcoex = &priv->btcoex; 116 struct ath_btcoex *btcoex = &priv->btcoex;
117 117
118 if (ath9k_hw_get_btcoex_scheme(priv->ah) == ATH_BTCOEX_CFG_NONE)
119 return;
120
118 btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD; 121 btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD;
119 btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) * 122 btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) *
120 btcoex->btcoex_period / 100; 123 btcoex->btcoex_period / 100;
@@ -133,6 +136,9 @@ void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv)
133 struct ath_btcoex *btcoex = &priv->btcoex; 136 struct ath_btcoex *btcoex = &priv->btcoex;
134 struct ath_hw *ah = priv->ah; 137 struct ath_hw *ah = priv->ah;
135 138
139 if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
140 return;
141
136 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex work\n"); 142 ath_dbg(ath9k_hw_common(ah), BTCOEX, "Starting btcoex work\n");
137 143
138 btcoex->bt_priority_cnt = 0; 144 btcoex->bt_priority_cnt = 0;
@@ -147,6 +153,9 @@ void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv)
147 */ 153 */
148void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv) 154void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv)
149{ 155{
156 if (ath9k_hw_get_btcoex_scheme(priv->ah) == ATH_BTCOEX_CFG_NONE)
157 return;
158
150 cancel_delayed_work_sync(&priv->coex_period_work); 159 cancel_delayed_work_sync(&priv->coex_period_work);
151 cancel_delayed_work_sync(&priv->duty_cycle_work); 160 cancel_delayed_work_sync(&priv->duty_cycle_work);
152} 161}