Commit e1763d3f authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville

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: default avatarRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 506847ad
...@@ -1166,7 +1166,6 @@ EXPORT_SYMBOL(ar9003_mci_cleanup); ...@@ -1166,7 +1166,6 @@ EXPORT_SYMBOL(ar9003_mci_cleanup);
u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data) u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data)
{ {
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
u32 value = 0; u32 value = 0;
u8 query_type; u8 query_type;
...@@ -1239,18 +1238,6 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data) ...@@ -1239,18 +1238,6 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data)
case MCI_STATE_SEND_WLAN_COEX_VERSION: case MCI_STATE_SEND_WLAN_COEX_VERSION:
ar9003_mci_send_coex_version_response(ah, true); ar9003_mci_send_coex_version_response(ah, true);
break; break;
case MCI_STATE_SET_BT_COEX_VERSION:
if (!p_data)
ath_dbg(common, MCI,
"MCI Set BT Coex version with NULL data!!\n");
else {
mci->bt_ver_major = (*p_data >> 8) & 0xff;
mci->bt_ver_minor = (*p_data) & 0xff;
mci->bt_version_known = true;
ath_dbg(common, MCI, "MCI BT version set: %d.%d\n",
mci->bt_ver_major, mci->bt_ver_minor);
}
break;
case MCI_STATE_SEND_WLAN_CHANNELS: case MCI_STATE_SEND_WLAN_CHANNELS:
if (p_data) { if (p_data) {
if (((mci->wlan_channels[1] & 0xffff0000) == if (((mci->wlan_channels[1] & 0xffff0000) ==
...@@ -1454,3 +1441,15 @@ u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more) ...@@ -1454,3 +1441,15 @@ u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more)
return offset; return offset;
} }
EXPORT_SYMBOL(ar9003_mci_get_next_gpm_offset); EXPORT_SYMBOL(ar9003_mci_get_next_gpm_offset);
void ar9003_mci_set_bt_version(struct ath_hw *ah, u8 major, u8 minor)
{
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
mci->bt_ver_major = major;
mci->bt_ver_minor = minor;
mci->bt_version_known = true;
ath_dbg(ath9k_hw_common(ah), MCI, "MCI BT version set: %d.%d\n",
mci->bt_ver_major, mci->bt_ver_minor);
}
EXPORT_SYMBOL(ar9003_mci_set_bt_version);
...@@ -201,7 +201,6 @@ enum mci_state_type { ...@@ -201,7 +201,6 @@ enum mci_state_type {
MCI_STATE_CONT_TXRX, MCI_STATE_CONT_TXRX,
MCI_STATE_RESET_REQ_WAKE, MCI_STATE_RESET_REQ_WAKE,
MCI_STATE_SEND_WLAN_COEX_VERSION, MCI_STATE_SEND_WLAN_COEX_VERSION,
MCI_STATE_SET_BT_COEX_VERSION,
MCI_STATE_SEND_WLAN_CHANNELS, MCI_STATE_SEND_WLAN_CHANNELS,
MCI_STATE_SEND_VERSION_QUERY, MCI_STATE_SEND_VERSION_QUERY,
MCI_STATE_SEND_STATUS_QUERY, MCI_STATE_SEND_STATUS_QUERY,
...@@ -263,6 +262,7 @@ void ar9003_mci_cleanup(struct ath_hw *ah); ...@@ -263,6 +262,7 @@ void ar9003_mci_cleanup(struct ath_hw *ah);
void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr, void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr,
u32 *rx_msg_intr); u32 *rx_msg_intr);
u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more); u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more);
void ar9003_mci_set_bt_version(struct ath_hw *ah, u8 major, u8 minor);
/* /*
* These functions are used by ath9k_hw. * These functions are used by ath9k_hw.
*/ */
......
...@@ -299,22 +299,17 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) ...@@ -299,22 +299,17 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
struct ath_mci_profile_info profile_info; struct ath_mci_profile_info profile_info;
struct ath_mci_profile_status profile_status; struct ath_mci_profile_status profile_status;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
u32 version; u8 major, minor;
u8 major;
u8 minor;
u32 seq_num; u32 seq_num;
switch (opcode) { switch (opcode) {
case MCI_GPM_COEX_VERSION_QUERY: case MCI_GPM_COEX_VERSION_QUERY:
version = ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION, ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION, NULL);
NULL);
break; break;
case MCI_GPM_COEX_VERSION_RESPONSE: case MCI_GPM_COEX_VERSION_RESPONSE:
major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION); major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION);
minor = *(rx_payload + MCI_GPM_COEX_B_MINOR_VERSION); minor = *(rx_payload + MCI_GPM_COEX_B_MINOR_VERSION);
version = (major << 8) + minor; ar9003_mci_set_bt_version(ah, major, minor);
version = ar9003_mci_state(ah, MCI_STATE_SET_BT_COEX_VERSION,
&version);
break; break;
case MCI_GPM_COEX_STATUS_QUERY: case MCI_GPM_COEX_STATUS_QUERY:
ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_CHANNELS, NULL); ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_CHANNELS, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment