UPSTREAM: ath9k: flush bt profile whenever it is requested
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Wed, 12 Sep 2012 17:38:52 +0000 (23:08 +0530)
committerGerrit <chrome-bot@google.com>
Tue, 23 Oct 2012 00:38:10 +0000 (17:38 -0700)
Before processing BT profiles or status messages, check whether
it is requested to flush BT profile. Otherwise it might increase
number of BT profiles that affects the WLAN performance. Also
flush the profiles when MCI is recovering from broken rx. After
flushing BT profiles, query BT topology to refetch them.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chrome-os-partner:15083
TEST=Use bluetooth and WiFi

Change-Id: If6b1d76594407dbddc0b6549491846247fe1c3ca
Reviewed-on: https://gerrit.chromium.org/gerrit/36146
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
drivers/net/wireless/ath/ath9k_btcoex/ar9003_mci.c
drivers/net/wireless/ath/ath9k_btcoex/ar9003_mci.h
drivers/net/wireless/ath/ath9k_btcoex/mci.c

index 5b8a758..b724238 100644 (file)
@@ -1241,6 +1241,10 @@ u32 ath9k_btcoex_ar9003_mci_state(struct ath_hw *ah, u32 state_type)
        case MCI_STATE_NEED_FTP_STOMP:
                value = !(mci->config & ATH_MCI_CONFIG_DISABLE_FTP_STOMP);
                break;
+       case MCI_STATE_NEED_FLUSH_BT_INFO:
+               value = (!mci->unhalt_bt_gpm && mci->need_flush_btinfo) ? 1 : 0;
+               mci->need_flush_btinfo = false;
+               break;
        default:
                break;
        }
index 2376575..928a31d 100644 (file)
@@ -202,6 +202,7 @@ enum mci_state_type {
        MCI_STATE_RECOVER_RX,
        MCI_STATE_NEED_FTP_STOMP,
        MCI_STATE_DEBUG,
+       MCI_STATE_NEED_FLUSH_BT_INFO,
        MCI_STATE_MAX
 };
 
@@ -213,7 +214,8 @@ enum mci_gpm_coex_opcode {
        MCI_GPM_COEX_WLAN_CHANNELS,
        MCI_GPM_COEX_BT_PROFILE_INFO,
        MCI_GPM_COEX_BT_STATUS_UPDATE,
-       MCI_GPM_COEX_BT_UPDATE_FLAGS
+       MCI_GPM_COEX_BT_UPDATE_FLAGS,
+       MCI_GPM_COEX_NOOP,
 };
 
 #define MCI_GPM_NOMORE  0
index 098f990..9346412 100644 (file)
@@ -80,6 +80,7 @@ void ath_mci_flush_profile(struct ath_mci_profile *mci)
        struct ath_mci_profile_info *info, *tinfo;
 
        mci->aggr_limit = 0;
+       mci->num_mgmt = 0;
 
        if (list_empty(&mci->info))
                return;
@@ -328,6 +329,13 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
        u8 major, minor;
        u32 seq_num;
 
+       if (ath9k_btcoex_ar9003_mci_state(ah, MCI_STATE_NEED_FLUSH_BT_INFO) &&
+           ath9k_btcoex_ar9003_mci_state(ah, MCI_STATE_ENABLE)) {
+               ath_dbg(common, MCI, "(MCI) Need to flush BT profiles\n");
+               ath_mci_flush_profile(&sc->btcoex.mci);
+               ath9k_btcoex_ar9003_mci_state(ah, MCI_STATE_SEND_STATUS_QUERY);
+       }
+
        switch (opcode) {
        case MCI_GPM_COEX_VERSION_QUERY:
                ath9k_btcoex_ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION);
@@ -568,9 +576,11 @@ void ath_mci_intr(struct ath_softc *sc)
        }
 
        if ((mci_int & AR_MCI_INTERRUPT_RX_INVALID_HDR) ||
-           (mci_int & AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT))
+           (mci_int & AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) {
                mci_int &= ~(AR_MCI_INTERRUPT_RX_INVALID_HDR |
                             AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT);
+               ath_mci_msg(sc, MCI_GPM_COEX_NOOP, NULL);
+       }
 }
 
 void ath_mci_enable(struct ath_softc *sc)