aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-09-09 17:52:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:22 -0400
commit766ec4a9a813ae262b61842020f150f865c1b10a (patch)
treed02074b1242ef41d0e144515a4bf9074f022e61c
parent46289e1e5f2155ba1502b079e786e91755919823 (diff)
ath9k: rename ath_btcoex_info to ath_btcoex_hw
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/btcoex.c60
-rw-r--r--drivers/net/wireless/ath/ath9k/btcoex.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c46
5 files changed, 64 insertions, 64 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c
index aa0ec2c2f326..0b5a7d4a6d55 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.c
+++ b/drivers/net/wireless/ath/ath9k/btcoex.c
@@ -43,13 +43,13 @@ bool ath_btcoex_supported(u16 subsysid)
43 return false; 43 return false;
44} 44}
45 45
46void ath9k_hw_init_btcoex_hw_info(struct ath_hw *ah, int qnum) 46void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum)
47{ 47{
48 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 48 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
49 u32 i; 49 u32 i;
50 50
51 btcoex_info->bt_coex_mode = 51 btcoex_hw->bt_coex_mode =
52 (btcoex_info->bt_coex_mode & AR_BT_QCU_THRESH) | 52 (btcoex_hw->bt_coex_mode & AR_BT_QCU_THRESH) |
53 SM(ath_bt_config.bt_time_extend, AR_BT_TIME_EXTEND) | 53 SM(ath_bt_config.bt_time_extend, AR_BT_TIME_EXTEND) |
54 SM(ath_bt_config.bt_txstate_extend, AR_BT_TXSTATE_EXTEND) | 54 SM(ath_bt_config.bt_txstate_extend, AR_BT_TXSTATE_EXTEND) |
55 SM(ath_bt_config.bt_txframe_extend, AR_BT_TX_FRAME_EXTEND) | 55 SM(ath_bt_config.bt_txframe_extend, AR_BT_TX_FRAME_EXTEND) |
@@ -60,7 +60,7 @@ void ath9k_hw_init_btcoex_hw_info(struct ath_hw *ah, int qnum)
60 SM(ath_bt_config.bt_first_slot_time, AR_BT_FIRST_SLOT_TIME) | 60 SM(ath_bt_config.bt_first_slot_time, AR_BT_FIRST_SLOT_TIME) |
61 SM(qnum, AR_BT_QCU_THRESH); 61 SM(qnum, AR_BT_QCU_THRESH);
62 62
63 btcoex_info->bt_coex_mode2 = 63 btcoex_hw->bt_coex_mode2 =
64 SM(ath_bt_config.bt_hold_rx_clear, AR_BT_HOLD_RX_CLEAR) | 64 SM(ath_bt_config.bt_hold_rx_clear, AR_BT_HOLD_RX_CLEAR) |
65 SM(ATH_BTCOEX_BMISS_THRESH, AR_BT_BCN_MISS_THRESH) | 65 SM(ATH_BTCOEX_BMISS_THRESH, AR_BT_BCN_MISS_THRESH) |
66 AR_BT_DISABLE_BT_ANT; 66 AR_BT_DISABLE_BT_ANT;
@@ -71,7 +71,7 @@ void ath9k_hw_init_btcoex_hw_info(struct ath_hw *ah, int qnum)
71 71
72void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah) 72void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah)
73{ 73{
74 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 74 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
75 75
76 /* connect bt_active to baseband */ 76 /* connect bt_active to baseband */
77 REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL, 77 REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL,
@@ -84,15 +84,15 @@ void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah)
84 /* Set input mux for bt_active to gpio pin */ 84 /* Set input mux for bt_active to gpio pin */
85 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, 85 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1,
86 AR_GPIO_INPUT_MUX1_BT_ACTIVE, 86 AR_GPIO_INPUT_MUX1_BT_ACTIVE,
87 btcoex_info->btactive_gpio); 87 btcoex_hw->btactive_gpio);
88 88
89 /* Configure the desired gpio port for input */ 89 /* Configure the desired gpio port for input */
90 ath9k_hw_cfg_gpio_input(ah, btcoex_info->btactive_gpio); 90 ath9k_hw_cfg_gpio_input(ah, btcoex_hw->btactive_gpio);
91} 91}
92 92
93void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah) 93void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah)
94{ 94{
95 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 95 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
96 96
97 /* btcoex 3-wire */ 97 /* btcoex 3-wire */
98 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, 98 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL,
@@ -103,51 +103,51 @@ void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah)
103 * bt_active_async to GPIO pins */ 103 * bt_active_async to GPIO pins */
104 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, 104 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1,
105 AR_GPIO_INPUT_MUX1_BT_ACTIVE, 105 AR_GPIO_INPUT_MUX1_BT_ACTIVE,
106 btcoex_info->btactive_gpio); 106 btcoex_hw->btactive_gpio);
107 107
108 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1, 108 REG_RMW_FIELD(ah, AR_GPIO_INPUT_MUX1,
109 AR_GPIO_INPUT_MUX1_BT_PRIORITY, 109 AR_GPIO_INPUT_MUX1_BT_PRIORITY,
110 btcoex_info->btpriority_gpio); 110 btcoex_hw->btpriority_gpio);
111 111
112 /* Configure the desired GPIO ports for input */ 112 /* Configure the desired GPIO ports for input */
113 113
114 ath9k_hw_cfg_gpio_input(ah, btcoex_info->btactive_gpio); 114 ath9k_hw_cfg_gpio_input(ah, btcoex_hw->btactive_gpio);
115 ath9k_hw_cfg_gpio_input(ah, btcoex_info->btpriority_gpio); 115 ath9k_hw_cfg_gpio_input(ah, btcoex_hw->btpriority_gpio);
116} 116}
117 117
118static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah) 118static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah)
119{ 119{
120 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 120 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
121 121
122 /* Configure the desired GPIO port for TX_FRAME output */ 122 /* Configure the desired GPIO port for TX_FRAME output */
123 ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, 123 ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio,
124 AR_GPIO_OUTPUT_MUX_AS_TX_FRAME); 124 AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
125} 125}
126 126
127static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah) 127static void ath9k_hw_btcoex_enable_3wire(struct ath_hw *ah)
128{ 128{
129 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 129 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
130 130
131 /* 131 /*
132 * Program coex mode and weight registers to 132 * Program coex mode and weight registers to
133 * enable coex 3-wire 133 * enable coex 3-wire
134 */ 134 */
135 REG_WRITE(ah, AR_BT_COEX_MODE, btcoex_info->bt_coex_mode); 135 REG_WRITE(ah, AR_BT_COEX_MODE, btcoex_hw->bt_coex_mode);
136 REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex_info->bt_coex_weights); 136 REG_WRITE(ah, AR_BT_COEX_WEIGHT, btcoex_hw->bt_coex_weights);
137 REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex_info->bt_coex_mode2); 137 REG_WRITE(ah, AR_BT_COEX_MODE2, btcoex_hw->bt_coex_mode2);
138 138
139 REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); 139 REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1);
140 REG_RMW_FIELD(ah, AR_PCU_MISC, AR_PCU_BT_ANT_PREVENT_RX, 0); 140 REG_RMW_FIELD(ah, AR_PCU_MISC, AR_PCU_BT_ANT_PREVENT_RX, 0);
141 141
142 ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, 142 ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio,
143 AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL); 143 AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL);
144} 144}
145 145
146void ath9k_hw_btcoex_enable(struct ath_hw *ah) 146void ath9k_hw_btcoex_enable(struct ath_hw *ah)
147{ 147{
148 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 148 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
149 149
150 switch (btcoex_info->scheme) { 150 switch (btcoex_hw->scheme) {
151 case ATH_BTCOEX_CFG_NONE: 151 case ATH_BTCOEX_CFG_NONE:
152 break; 152 break;
153 case ATH_BTCOEX_CFG_2WIRE: 153 case ATH_BTCOEX_CFG_2WIRE:
@@ -159,26 +159,26 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah)
159 } 159 }
160 160
161 REG_RMW(ah, AR_GPIO_PDPU, 161 REG_RMW(ah, AR_GPIO_PDPU,
162 (0x2 << (btcoex_info->btactive_gpio * 2)), 162 (0x2 << (btcoex_hw->btactive_gpio * 2)),
163 (0x3 << (btcoex_info->btactive_gpio * 2))); 163 (0x3 << (btcoex_hw->btactive_gpio * 2)));
164 164
165 ah->btcoex_info.enabled = true; 165 ah->btcoex_hw.enabled = true;
166} 166}
167 167
168void ath9k_hw_btcoex_disable(struct ath_hw *ah) 168void ath9k_hw_btcoex_disable(struct ath_hw *ah)
169{ 169{
170 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 170 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
171 171
172 ath9k_hw_set_gpio(ah, btcoex_info->wlanactive_gpio, 0); 172 ath9k_hw_set_gpio(ah, btcoex_hw->wlanactive_gpio, 0);
173 173
174 ath9k_hw_cfg_output(ah, btcoex_info->wlanactive_gpio, 174 ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio,
175 AR_GPIO_OUTPUT_MUX_AS_OUTPUT); 175 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
176 176
177 if (btcoex_info->scheme == ATH_BTCOEX_CFG_3WIRE) { 177 if (btcoex_hw->scheme == ATH_BTCOEX_CFG_3WIRE) {
178 REG_WRITE(ah, AR_BT_COEX_MODE, AR_BT_QUIET | AR_BT_MODE); 178 REG_WRITE(ah, AR_BT_COEX_MODE, AR_BT_QUIET | AR_BT_MODE);
179 REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0); 179 REG_WRITE(ah, AR_BT_COEX_WEIGHT, 0);
180 REG_WRITE(ah, AR_BT_COEX_MODE2, 0); 180 REG_WRITE(ah, AR_BT_COEX_MODE2, 0);
181 } 181 }
182 182
183 ah->btcoex_info.enabled = false; 183 ah->btcoex_hw.enabled = false;
184} 184}
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h
index aea6d3fbb5b4..296ddd8ce813 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.h
+++ b/drivers/net/wireless/ath/ath9k/btcoex.h
@@ -55,7 +55,7 @@ struct ath_btcoex_config {
55 bool bt_hold_rx_clear; 55 bool bt_hold_rx_clear;
56}; 56};
57 57
58struct ath_btcoex_info { 58struct ath_btcoex_hw {
59 enum ath_btcoex_scheme scheme; 59 enum ath_btcoex_scheme scheme;
60 bool enabled; 60 bool enabled;
61 u8 wlanactive_gpio; 61 u8 wlanactive_gpio;
@@ -69,7 +69,7 @@ struct ath_btcoex_info {
69bool ath_btcoex_supported(u16 subsysid); 69bool ath_btcoex_supported(u16 subsysid);
70void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah); 70void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah);
71void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah); 71void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah);
72void ath9k_hw_init_btcoex_hw_info(struct ath_hw *ah, int qnum); 72void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum);
73void ath9k_hw_btcoex_enable(struct ath_hw *ah); 73void ath9k_hw_btcoex_enable(struct ath_hw *ah);
74void ath9k_hw_btcoex_disable(struct ath_hw *ah); 74void ath9k_hw_btcoex_disable(struct ath_hw *ah);
75 75
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 0b7e2859c1ef..93b3258190cb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2578,7 +2578,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
2578#endif 2578#endif
2579 } 2579 }
2580 2580
2581 if (ah->btcoex_info.enabled) 2581 if (ah->btcoex_hw.enabled)
2582 ath9k_hw_btcoex_enable(ah); 2582 ath9k_hw_btcoex_enable(ah);
2583 2583
2584 return 0; 2584 return 0;
@@ -3559,7 +3559,7 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
3559{ 3559{
3560 struct ath9k_hw_capabilities *pCap = &ah->caps; 3560 struct ath9k_hw_capabilities *pCap = &ah->caps;
3561 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); 3561 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
3562 struct ath_btcoex_info *btcoex_info = &ah->btcoex_info; 3562 struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
3563 3563
3564 u16 capField = 0, eeval; 3564 u16 capField = 0, eeval;
3565 3565
@@ -3729,17 +3729,17 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
3729 3729
3730 if (AR_SREV_9280_10_OR_LATER(ah) && 3730 if (AR_SREV_9280_10_OR_LATER(ah) &&
3731 ath_btcoex_supported(ah->hw_version.subsysid)) { 3731 ath_btcoex_supported(ah->hw_version.subsysid)) {
3732 btcoex_info->btactive_gpio = ATH_BTACTIVE_GPIO; 3732 btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO;
3733 btcoex_info->wlanactive_gpio = ATH_WLANACTIVE_GPIO; 3733 btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
3734 3734
3735 if (AR_SREV_9285(ah)) { 3735 if (AR_SREV_9285(ah)) {
3736 btcoex_info->scheme = ATH_BTCOEX_CFG_3WIRE; 3736 btcoex_hw->scheme = ATH_BTCOEX_CFG_3WIRE;
3737 btcoex_info->btpriority_gpio = ATH_BTPRIORITY_GPIO; 3737 btcoex_hw->btpriority_gpio = ATH_BTPRIORITY_GPIO;
3738 } else { 3738 } else {
3739 btcoex_info->scheme = ATH_BTCOEX_CFG_2WIRE; 3739 btcoex_hw->scheme = ATH_BTCOEX_CFG_2WIRE;
3740 } 3740 }
3741 } else { 3741 } else {
3742 btcoex_info->scheme = ATH_BTCOEX_CFG_NONE; 3742 btcoex_hw->scheme = ATH_BTCOEX_CFG_NONE;
3743 } 3743 }
3744} 3744}
3745 3745
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index b244225ca050..4d187aa8b8d2 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -555,7 +555,7 @@ struct ath_hw {
555 enum ath9k_ani_cmd ani_function; 555 enum ath9k_ani_cmd ani_function;
556 556
557 /* Bluetooth coexistance */ 557 /* Bluetooth coexistance */
558 struct ath_btcoex_info btcoex_info; 558 struct ath_btcoex_hw btcoex_hw;
559 559
560 u32 intr_txqs; 560 u32 intr_txqs;
561 enum ath9k_ht_extprotspacing extprotspacing; 561 enum ath9k_ht_extprotspacing extprotspacing;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3d0eb68c863c..a096e4c8e49a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -443,7 +443,7 @@ void ath_update_chainmask(struct ath_softc *sc, int is_ht)
443 struct ath_hw *ah = sc->sc_ah; 443 struct ath_hw *ah = sc->sc_ah;
444 444
445 if ((sc->sc_flags & SC_OP_SCANNING) || is_ht || 445 if ((sc->sc_flags & SC_OP_SCANNING) || is_ht ||
446 (ah->btcoex_info.scheme != ATH_BTCOEX_CFG_NONE)) { 446 (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE)) {
447 sc->tx_chainmask = sc->sc_ah->caps.tx_chainmask; 447 sc->tx_chainmask = sc->sc_ah->caps.tx_chainmask;
448 sc->rx_chainmask = sc->sc_ah->caps.rx_chainmask; 448 sc->rx_chainmask = sc->sc_ah->caps.rx_chainmask;
449 } else { 449 } else {
@@ -511,7 +511,7 @@ static void ath9k_tasklet(unsigned long data)
511 sc->sc_flags |= SC_OP_WAIT_FOR_BEACON | SC_OP_BEACON_SYNC; 511 sc->sc_flags |= SC_OP_WAIT_FOR_BEACON | SC_OP_BEACON_SYNC;
512 } 512 }
513 513
514 if (ah->btcoex_info.scheme == ATH_BTCOEX_CFG_3WIRE) 514 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
515 if (status & ATH9K_INT_GENTIMER) 515 if (status & ATH9K_INT_GENTIMER)
516 ath_gen_timer_isr(sc->sc_ah); 516 ath_gen_timer_isr(sc->sc_ah);
517 517
@@ -1287,7 +1287,7 @@ void ath_detach(struct ath_softc *sc)
1287 ath_tx_cleanupq(sc, &sc->tx.txq[i]); 1287 ath_tx_cleanupq(sc, &sc->tx.txq[i]);
1288 1288
1289 if ((sc->btcoex.no_stomp_timer) && 1289 if ((sc->btcoex.no_stomp_timer) &&
1290 ah->btcoex_info.scheme == ATH_BTCOEX_CFG_3WIRE) 1290 ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
1291 ath_gen_timer_free(ah, sc->btcoex.no_stomp_timer); 1291 ath_gen_timer_free(ah, sc->btcoex.no_stomp_timer);
1292 1292
1293 ath9k_hw_detach(ah); 1293 ath9k_hw_detach(ah);
@@ -1314,7 +1314,7 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
1314 struct ath_btcoex *btcoex = &sc->btcoex; 1314 struct ath_btcoex *btcoex = &sc->btcoex;
1315 struct ath_hw *ah = sc->sc_ah; 1315 struct ath_hw *ah = sc->sc_ah;
1316 1316
1317 if (ath9k_hw_gpio_get(sc->sc_ah, ah->btcoex_info.btpriority_gpio)) 1317 if (ath9k_hw_gpio_get(sc->sc_ah, ah->btcoex_hw.btpriority_gpio))
1318 btcoex->bt_priority_cnt++; 1318 btcoex->bt_priority_cnt++;
1319 1319
1320 if (time_after(jiffies, btcoex->bt_priority_time + 1320 if (time_after(jiffies, btcoex->bt_priority_time +
@@ -1332,17 +1332,17 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
1332 } 1332 }
1333} 1333}
1334 1334
1335static void ath_btcoex_set_weight(struct ath_btcoex_info *btcoex_info, 1335static void ath_btcoex_set_weight(struct ath_btcoex_hw *btcoex_hw,
1336 u32 bt_weight, 1336 u32 bt_weight,
1337 u32 wlan_weight) 1337 u32 wlan_weight)
1338{ 1338{
1339 btcoex_info->bt_coex_weights = SM(bt_weight, AR_BTCOEX_BT_WGHT) | 1339 btcoex_hw->bt_coex_weights = SM(bt_weight, AR_BTCOEX_BT_WGHT) |
1340 SM(wlan_weight, AR_BTCOEX_WL_WGHT); 1340 SM(wlan_weight, AR_BTCOEX_WL_WGHT);
1341} 1341}
1342 1342
1343static void ath9k_hw_btcoex_init_weight(struct ath_hw *ah) 1343static void ath9k_hw_btcoex_init_weight(struct ath_hw *ah)
1344{ 1344{
1345 ath_btcoex_set_weight(&ah->btcoex_info, AR_BT_COEX_WGHT, 1345 ath_btcoex_set_weight(&ah->btcoex_hw, AR_BT_COEX_WGHT,
1346 AR_STOMP_LOW_WLAN_WGHT); 1346 AR_STOMP_LOW_WLAN_WGHT);
1347} 1347}
1348 1348
@@ -1350,21 +1350,21 @@ static void ath9k_hw_btcoex_init_weight(struct ath_hw *ah)
1350 * Configures appropriate weight based on stomp type. 1350 * Configures appropriate weight based on stomp type.
1351 */ 1351 */
1352static void ath_btcoex_bt_stomp(struct ath_softc *sc, 1352static void ath_btcoex_bt_stomp(struct ath_softc *sc,
1353 struct ath_btcoex_info *btinfo, 1353 struct ath_btcoex_hw *btcoex_hw,
1354 int stomp_type) 1354 int stomp_type)
1355{ 1355{
1356 1356
1357 switch (stomp_type) { 1357 switch (stomp_type) {
1358 case ATH_BTCOEX_STOMP_ALL: 1358 case ATH_BTCOEX_STOMP_ALL:
1359 ath_btcoex_set_weight(btinfo, AR_BT_COEX_WGHT, 1359 ath_btcoex_set_weight(btcoex_hw, AR_BT_COEX_WGHT,
1360 AR_STOMP_ALL_WLAN_WGHT); 1360 AR_STOMP_ALL_WLAN_WGHT);
1361 break; 1361 break;
1362 case ATH_BTCOEX_STOMP_LOW: 1362 case ATH_BTCOEX_STOMP_LOW:
1363 ath_btcoex_set_weight(btinfo, AR_BT_COEX_WGHT, 1363 ath_btcoex_set_weight(btcoex_hw, AR_BT_COEX_WGHT,
1364 AR_STOMP_LOW_WLAN_WGHT); 1364 AR_STOMP_LOW_WLAN_WGHT);
1365 break; 1365 break;
1366 case ATH_BTCOEX_STOMP_NONE: 1366 case ATH_BTCOEX_STOMP_NONE:
1367 ath_btcoex_set_weight(btinfo, AR_BT_COEX_WGHT, 1367 ath_btcoex_set_weight(btcoex_hw, AR_BT_COEX_WGHT,
1368 AR_STOMP_NONE_WLAN_WGHT); 1368 AR_STOMP_NONE_WLAN_WGHT);
1369 break; 1369 break;
1370 default: 1370 default:
@@ -1385,13 +1385,13 @@ static void ath_btcoex_period_timer(unsigned long data)
1385 struct ath_softc *sc = (struct ath_softc *) data; 1385 struct ath_softc *sc = (struct ath_softc *) data;
1386 struct ath_hw *ah = sc->sc_ah; 1386 struct ath_hw *ah = sc->sc_ah;
1387 struct ath_btcoex *btcoex = &sc->btcoex; 1387 struct ath_btcoex *btcoex = &sc->btcoex;
1388 struct ath_btcoex_info *btinfo = &ah->btcoex_info; 1388 struct ath_btcoex_hw *btcoex_hw= &ah->btcoex_hw;
1389 1389
1390 ath_detect_bt_priority(sc); 1390 ath_detect_bt_priority(sc);
1391 1391
1392 spin_lock_bh(&btcoex->btcoex_lock); 1392 spin_lock_bh(&btcoex->btcoex_lock);
1393 1393
1394 ath_btcoex_bt_stomp(sc, btinfo, btcoex->bt_stomp_type); 1394 ath_btcoex_bt_stomp(sc, btcoex_hw, btcoex->bt_stomp_type);
1395 1395
1396 spin_unlock_bh(&btcoex->btcoex_lock); 1396 spin_unlock_bh(&btcoex->btcoex_lock);
1397 1397
@@ -1420,16 +1420,16 @@ static void ath_btcoex_no_stomp_timer(void *arg)
1420 struct ath_softc *sc = (struct ath_softc *)arg; 1420 struct ath_softc *sc = (struct ath_softc *)arg;
1421 struct ath_hw *ah = sc->sc_ah; 1421 struct ath_hw *ah = sc->sc_ah;
1422 struct ath_btcoex *btcoex = &sc->btcoex; 1422 struct ath_btcoex *btcoex = &sc->btcoex;
1423 struct ath_btcoex_info *btinfo = &ah->btcoex_info; 1423 struct ath_btcoex_hw *btcoex_hw= &ah->btcoex_hw;
1424 1424
1425 DPRINTF(ah, ATH_DBG_BTCOEX, "no stomp timer running \n"); 1425 DPRINTF(ah, ATH_DBG_BTCOEX, "no stomp timer running \n");
1426 1426
1427 spin_lock_bh(&btcoex->btcoex_lock); 1427 spin_lock_bh(&btcoex->btcoex_lock);
1428 1428
1429 if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW) 1429 if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_LOW)
1430 ath_btcoex_bt_stomp(sc, btinfo, ATH_BTCOEX_STOMP_NONE); 1430 ath_btcoex_bt_stomp(sc, btcoex_hw, ATH_BTCOEX_STOMP_NONE);
1431 else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL) 1431 else if (btcoex->bt_stomp_type == ATH_BTCOEX_STOMP_ALL)
1432 ath_btcoex_bt_stomp(sc, btinfo, ATH_BTCOEX_STOMP_LOW); 1432 ath_btcoex_bt_stomp(sc, btcoex_hw, ATH_BTCOEX_STOMP_LOW);
1433 1433
1434 spin_unlock_bh(&btcoex->btcoex_lock); 1434 spin_unlock_bh(&btcoex->btcoex_lock);
1435} 1435}
@@ -1674,7 +1674,7 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid)
1674 ARRAY_SIZE(ath9k_5ghz_chantable); 1674 ARRAY_SIZE(ath9k_5ghz_chantable);
1675 } 1675 }
1676 1676
1677 switch (ah->btcoex_info.scheme) { 1677 switch (ah->btcoex_hw.scheme) {
1678 case ATH_BTCOEX_CFG_NONE: 1678 case ATH_BTCOEX_CFG_NONE:
1679 break; 1679 break;
1680 case ATH_BTCOEX_CFG_2WIRE: 1680 case ATH_BTCOEX_CFG_2WIRE:
@@ -1686,7 +1686,7 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid)
1686 if (r) 1686 if (r)
1687 goto bad2; 1687 goto bad2;
1688 qnum = ath_tx_get_qnum(sc, ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BE); 1688 qnum = ath_tx_get_qnum(sc, ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BE);
1689 ath9k_hw_init_btcoex_hw_info(ah, qnum); 1689 ath9k_hw_init_btcoex_hw(ah, qnum);
1690 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; 1690 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
1691 break; 1691 break;
1692 default: 1692 default:
@@ -2199,13 +2199,13 @@ static int ath9k_start(struct ieee80211_hw *hw)
2199 2199
2200 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); 2200 ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
2201 2201
2202 if ((ah->btcoex_info.scheme != ATH_BTCOEX_CFG_NONE) && 2202 if ((ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) &&
2203 !ah->btcoex_info.enabled) { 2203 !ah->btcoex_hw.enabled) {
2204 ath9k_hw_btcoex_init_weight(ah); 2204 ath9k_hw_btcoex_init_weight(ah);
2205 ath9k_hw_btcoex_enable(ah); 2205 ath9k_hw_btcoex_enable(ah);
2206 2206
2207 ath_pcie_aspm_disable(sc); 2207 ath_pcie_aspm_disable(sc);
2208 if (ah->btcoex_info.scheme == ATH_BTCOEX_CFG_3WIRE) 2208 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
2209 ath9k_btcoex_timer_resume(sc); 2209 ath9k_btcoex_timer_resume(sc);
2210 } 2210 }
2211 2211
@@ -2359,9 +2359,9 @@ static void ath9k_stop(struct ieee80211_hw *hw)
2359 return; /* another wiphy still in use */ 2359 return; /* another wiphy still in use */
2360 } 2360 }
2361 2361
2362 if (ah->btcoex_info.enabled) { 2362 if (ah->btcoex_hw.enabled) {
2363 ath9k_hw_btcoex_disable(ah); 2363 ath9k_hw_btcoex_disable(ah);
2364 if (ah->btcoex_info.scheme == ATH_BTCOEX_CFG_3WIRE) 2364 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
2365 ath9k_btcoex_timer_pause(sc); 2365 ath9k_btcoex_timer_pause(sc);
2366 } 2366 }
2367 2367