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

ath9k: fix queuing MCI work twice

Right now MCI work is being queued twice by profile and status
updation. Queue MCI work once when it is needed.
Signed-off-by: default avatarRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8f176a3a
...@@ -250,8 +250,8 @@ static void ath9k_mci_work(struct work_struct *work) ...@@ -250,8 +250,8 @@ static void ath9k_mci_work(struct work_struct *work)
ath_mci_update_scheme(sc); ath_mci_update_scheme(sc);
} }
static void ath_mci_process_profile(struct ath_softc *sc, static u8 ath_mci_process_profile(struct ath_softc *sc,
struct ath_mci_profile_info *info) struct ath_mci_profile_info *info)
{ {
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_btcoex *btcoex = &sc->btcoex; struct ath_btcoex *btcoex = &sc->btcoex;
...@@ -277,15 +277,15 @@ static void ath_mci_process_profile(struct ath_softc *sc, ...@@ -277,15 +277,15 @@ static void ath_mci_process_profile(struct ath_softc *sc,
if (info->start) { if (info->start) {
if (!entry && !ath_mci_add_profile(common, mci, info)) if (!entry && !ath_mci_add_profile(common, mci, info))
return; return 0;
} else } else
ath_mci_del_profile(common, mci, entry); ath_mci_del_profile(common, mci, entry);
ieee80211_queue_work(sc->hw, &sc->mci_work); return 1;
} }
static void ath_mci_process_status(struct ath_softc *sc, static u8 ath_mci_process_status(struct ath_softc *sc,
struct ath_mci_profile_status *status) struct ath_mci_profile_status *status)
{ {
struct ath_btcoex *btcoex = &sc->btcoex; struct ath_btcoex *btcoex = &sc->btcoex;
struct ath_mci_profile *mci = &btcoex->mci; struct ath_mci_profile *mci = &btcoex->mci;
...@@ -294,14 +294,14 @@ static void ath_mci_process_status(struct ath_softc *sc, ...@@ -294,14 +294,14 @@ static void ath_mci_process_status(struct ath_softc *sc,
/* Link status type are not handled */ /* Link status type are not handled */
if (status->is_link) if (status->is_link)
return; return 0;
info.conn_handle = status->conn_handle; info.conn_handle = status->conn_handle;
if (ath_mci_find_profile(mci, &info)) if (ath_mci_find_profile(mci, &info))
return; return 0;
if (status->conn_handle >= ATH_MCI_MAX_PROFILE) if (status->conn_handle >= ATH_MCI_MAX_PROFILE)
return; return 0;
if (status->is_critical) if (status->is_critical)
__set_bit(status->conn_handle, mci->status); __set_bit(status->conn_handle, mci->status);
...@@ -315,7 +315,9 @@ static void ath_mci_process_status(struct ath_softc *sc, ...@@ -315,7 +315,9 @@ static void ath_mci_process_status(struct ath_softc *sc,
} while (++i < ATH_MCI_MAX_PROFILE); } while (++i < ATH_MCI_MAX_PROFILE);
if (old_num_mgmt != mci->num_mgmt) if (old_num_mgmt != mci->num_mgmt)
ieee80211_queue_work(sc->hw, &sc->mci_work); return 1;
return 0;
} }
static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
...@@ -324,7 +326,7 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) ...@@ -324,7 +326,7 @@ 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);
u8 major, minor; u8 major, minor, update_scheme = 0;
u32 seq_num; u32 seq_num;
if (ar9003_mci_state(ah, MCI_STATE_NEED_FLUSH_BT_INFO) && if (ar9003_mci_state(ah, MCI_STATE_NEED_FLUSH_BT_INFO) &&
...@@ -359,7 +361,7 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) ...@@ -359,7 +361,7 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
break; break;
} }
ath_mci_process_profile(sc, &profile_info); update_scheme += ath_mci_process_profile(sc, &profile_info);
break; break;
case MCI_GPM_COEX_BT_STATUS_UPDATE: case MCI_GPM_COEX_BT_STATUS_UPDATE:
profile_status.is_link = *(rx_payload + profile_status.is_link = *(rx_payload +
...@@ -375,12 +377,14 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) ...@@ -375,12 +377,14 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
profile_status.is_link, profile_status.conn_handle, profile_status.is_link, profile_status.conn_handle,
profile_status.is_critical, seq_num); profile_status.is_critical, seq_num);
ath_mci_process_status(sc, &profile_status); update_scheme += ath_mci_process_status(sc, &profile_status);
break; break;
default: default:
ath_dbg(common, MCI, "Unknown GPM COEX message = 0x%02x\n", opcode); ath_dbg(common, MCI, "Unknown GPM COEX message = 0x%02x\n", opcode);
break; break;
} }
if (update_scheme)
ieee80211_queue_work(sc->hw, &sc->mci_work);
} }
int ath_mci_setup(struct ath_softc *sc) int ath_mci_setup(struct ath_softc *sc)
......
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