Skip to contentSkip to conversation

ath9k: fix incorrect profile type manupulation

PATCH New Bala Shanmugam 1 participant 1 message Jun 18, 2012 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: fix incorrect profile type manupulation

Two MCI interrupts are generated while adding A2DP and headset profiles with different types and same connection handle. While disconnecting, only one MCI interrupt is generated with last added profile type value for both profiles.

While adding second profile type decrement first one.

---
 drivers/net/wireless/ath/ath9k/mci.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/mci.c +14 -1
index 7d34a50..ebd7c12 100644
@@ -233,8 +233,21 @@ static void ath_mci_process_profile(struct ath_softc *sc,
 	struct ath_mci_profile_info *entry = NULL;
 
 	entry = ath_mci_find_profile(mci, info);
-	if (entry)
+	if (entry) {
+		/*
+		 * Two MCI interrupts are generated while connecting to
+		 * headset and A2DP profile, but only one MCI interrupt
+		 * is generated with last added profile type while disconnecting
+		 * both profiles.
+		 * So while adding second profile type decrement
+		 * the first one.
+		 */
+		if (entry->type != info->type) {
+			DEC_PROF(mci, entry);
+			INC_PROF(mci, info);
+		}
 		memcpy(entry, info, 10);
+	}
 
 	if (info->start) {
 		if (!entry && !ath_mci_add_profile(common, mci, info))
Signature · 1 line
1.7.4.1