aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2012-06-12 10:48:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-13 14:35:58 -0400
commite1763d3f3388968d622a340fed711ae16fc1bc11 (patch)
tree8792bd9202546a5e95824647b98f50a68dfb0b48 /drivers/net
parent506847ad34c08fe4f766ffe1b955713628acf6bd (diff)
ath9k_hw: add utility function to set BT version
Add a utility function to set bluetooth version and remove MCI_STATE_SET_BT_COEX_VERSION. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mci.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_mci.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/mci.c11
3 files changed, 16 insertions, 22 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
index 0433f2b12c53..a021e7474757 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
@@ -1166,7 +1166,6 @@ EXPORT_SYMBOL(ar9003_mci_cleanup);
1166 1166
1167u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data) 1167u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data)
1168{ 1168{
1169 struct ath_common *common = ath9k_hw_common(ah);
1170 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; 1169 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
1171 u32 value = 0; 1170 u32 value = 0;
1172 u8 query_type; 1171 u8 query_type;
@@ -1239,18 +1238,6 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data)
1239 case MCI_STATE_SEND_WLAN_COEX_VERSION: 1238 case MCI_STATE_SEND_WLAN_COEX_VERSION:
1240 ar9003_mci_send_coex_version_response(ah, true); 1239 ar9003_mci_send_coex_version_response(ah, true);
1241 break; 1240 break;
1242 case MCI_STATE_SET_BT_COEX_VERSION:
1243 if (!p_data)
1244 ath_dbg(common, MCI,
1245 "MCI Set BT Coex version with NULL data!!\n");
1246 else {
1247 mci->bt_ver_major = (*p_data >> 8) & 0xff;
1248 mci->bt_ver_minor = (*p_data) & 0xff;
1249 mci->bt_version_known = true;
1250 ath_dbg(common, MCI, "MCI BT version set: %d.%d\n",
1251 mci->bt_ver_major, mci->bt_ver_minor);
1252 }
1253 break;
1254 case MCI_STATE_SEND_WLAN_CHANNELS: 1241 case MCI_STATE_SEND_WLAN_CHANNELS:
1255 if (p_data) { 1242 if (p_data) {
1256 if (((mci->wlan_channels[1] & 0xffff0000) == 1243 if (((mci->wlan_channels[1] & 0xffff0000) ==
@@ -1454,3 +1441,15 @@ out:
1454 return offset; 1441 return offset;
1455} 1442}
1456EXPORT_SYMBOL(ar9003_mci_get_next_gpm_offset); 1443EXPORT_SYMBOL(ar9003_mci_get_next_gpm_offset);
1444
1445void ar9003_mci_set_bt_version(struct ath_hw *ah, u8 major, u8 minor)
1446{
1447 struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
1448
1449 mci->bt_ver_major = major;
1450 mci->bt_ver_minor = minor;
1451 mci->bt_version_known = true;
1452 ath_dbg(ath9k_hw_common(ah), MCI, "MCI BT version set: %d.%d\n",
1453 mci->bt_ver_major, mci->bt_ver_minor);
1454}
1455EXPORT_SYMBOL(ar9003_mci_set_bt_version);
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.h b/drivers/net/wireless/ath/ath9k/ar9003_mci.h
index 163d1562163d..d4e7739b89ff 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.h
@@ -201,7 +201,6 @@ enum mci_state_type {
201 MCI_STATE_CONT_TXRX, 201 MCI_STATE_CONT_TXRX,
202 MCI_STATE_RESET_REQ_WAKE, 202 MCI_STATE_RESET_REQ_WAKE,
203 MCI_STATE_SEND_WLAN_COEX_VERSION, 203 MCI_STATE_SEND_WLAN_COEX_VERSION,
204 MCI_STATE_SET_BT_COEX_VERSION,
205 MCI_STATE_SEND_WLAN_CHANNELS, 204 MCI_STATE_SEND_WLAN_CHANNELS,
206 MCI_STATE_SEND_VERSION_QUERY, 205 MCI_STATE_SEND_VERSION_QUERY,
207 MCI_STATE_SEND_STATUS_QUERY, 206 MCI_STATE_SEND_STATUS_QUERY,
@@ -263,6 +262,7 @@ void ar9003_mci_cleanup(struct ath_hw *ah);
263void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr, 262void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr,
264 u32 *rx_msg_intr); 263 u32 *rx_msg_intr);
265u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more); 264u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more);
265void ar9003_mci_set_bt_version(struct ath_hw *ah, u8 major, u8 minor);
266/* 266/*
267 * These functions are used by ath9k_hw. 267 * These functions are used by ath9k_hw.
268 */ 268 */
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index 9e152316fd5c..6f4188a32ff0 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -299,22 +299,17 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
299 struct ath_mci_profile_info profile_info; 299 struct ath_mci_profile_info profile_info;
300 struct ath_mci_profile_status profile_status; 300 struct ath_mci_profile_status profile_status;
301 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 301 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
302 u32 version; 302 u8 major, minor;
303 u8 major;
304 u8 minor;
305 u32 seq_num; 303 u32 seq_num;
306 304
307 switch (opcode) { 305 switch (opcode) {
308 case MCI_GPM_COEX_VERSION_QUERY: 306 case MCI_GPM_COEX_VERSION_QUERY:
309 version = ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION, 307 ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION, NULL);
310 NULL);
311 break; 308 break;
312 case MCI_GPM_COEX_VERSION_RESPONSE: 309 case MCI_GPM_COEX_VERSION_RESPONSE:
313 major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION); 310 major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION);
314 minor = *(rx_payload + MCI_GPM_COEX_B_MINOR_VERSION); 311 minor = *(rx_payload + MCI_GPM_COEX_B_MINOR_VERSION);
315 version = (major << 8) + minor; 312 ar9003_mci_set_bt_version(ah, major, minor);
316 version = ar9003_mci_state(ah, MCI_STATE_SET_BT_COEX_VERSION,
317 &version);
318 break; 313 break;
319 case MCI_GPM_COEX_STATUS_QUERY: 314 case MCI_GPM_COEX_STATUS_QUERY:
320 ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_CHANNELS, NULL); 315 ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_CHANNELS, NULL);