aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/mci.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2012-09-12 09:29:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-24 14:59:07 -0400
commit7a03414686d8e01c660bf69df22cafcfd2753626 (patch)
tree839669d1eefb9119a821a38fa62d205520e056de /drivers/net/wireless/ath/ath9k/mci.c
parent8f176a3a16d124285cecd6c53b70689eb3b9ba36 (diff)
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: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/mci.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/mci.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index fa859e3fbc2..8f51e9e358f 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -250,8 +250,8 @@ static void ath9k_mci_work(struct work_struct *work)
250 ath_mci_update_scheme(sc); 250 ath_mci_update_scheme(sc);
251} 251}
252 252
253static void ath_mci_process_profile(struct ath_softc *sc, 253static u8 ath_mci_process_profile(struct ath_softc *sc,
254 struct ath_mci_profile_info *info) 254 struct ath_mci_profile_info *info)
255{ 255{
256 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 256 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
257 struct ath_btcoex *btcoex = &sc->btcoex; 257 struct ath_btcoex *btcoex = &sc->btcoex;
@@ -277,15 +277,15 @@ static void ath_mci_process_profile(struct ath_softc *sc,
277 277
278 if (info->start) { 278 if (info->start) {
279 if (!entry && !ath_mci_add_profile(common, mci, info)) 279 if (!entry && !ath_mci_add_profile(common, mci, info))
280 return; 280 return 0;
281 } else 281 } else
282 ath_mci_del_profile(common, mci, entry); 282 ath_mci_del_profile(common, mci, entry);
283 283
284 ieee80211_queue_work(sc->hw, &sc->mci_work); 284 return 1;
285} 285}
286 286
287static void ath_mci_process_status(struct ath_softc *sc, 287static u8 ath_mci_process_status(struct ath_softc *sc,
288 struct ath_mci_profile_status *status) 288 struct ath_mci_profile_status *status)
289{ 289{
290 struct ath_btcoex *btcoex = &sc->btcoex; 290 struct ath_btcoex *btcoex = &sc->btcoex;
291 struct ath_mci_profile *mci = &btcoex->mci; 291 struct ath_mci_profile *mci = &btcoex->mci;
@@ -294,14 +294,14 @@ static void ath_mci_process_status(struct ath_softc *sc,
294 294
295 /* Link status type are not handled */ 295 /* Link status type are not handled */
296 if (status->is_link) 296 if (status->is_link)
297 return; 297 return 0;
298 298
299 info.conn_handle = status->conn_handle; 299 info.conn_handle = status->conn_handle;
300 if (ath_mci_find_profile(mci, &info)) 300 if (ath_mci_find_profile(mci, &info))
301 return; 301 return 0;
302 302
303 if (status->conn_handle >= ATH_MCI_MAX_PROFILE) 303 if (status->conn_handle >= ATH_MCI_MAX_PROFILE)
304 return; 304 return 0;
305 305
306 if (status->is_critical) 306 if (status->is_critical)
307 __set_bit(status->conn_handle, mci->status); 307 __set_bit(status->conn_handle, mci->status);
@@ -315,7 +315,9 @@ static void ath_mci_process_status(struct ath_softc *sc,
315 } while (++i < ATH_MCI_MAX_PROFILE); 315 } while (++i < ATH_MCI_MAX_PROFILE);
316 316
317 if (old_num_mgmt != mci->num_mgmt) 317 if (old_num_mgmt != mci->num_mgmt)
318 ieee80211_queue_work(sc->hw, &sc->mci_work); 318 return 1;
319
320 return 0;
319} 321}
320 322
321static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) 323static 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 struct ath_mci_profile_info profile_info; 326 struct ath_mci_profile_info profile_info;
325 struct ath_mci_profile_status profile_status; 327 struct ath_mci_profile_status profile_status;
326 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 328 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
327 u8 major, minor; 329 u8 major, minor, update_scheme = 0;
328 u32 seq_num; 330 u32 seq_num;
329 331
330 if (ar9003_mci_state(ah, MCI_STATE_NEED_FLUSH_BT_INFO) && 332 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 break; 361 break;
360 } 362 }
361 363
362 ath_mci_process_profile(sc, &profile_info); 364 update_scheme += ath_mci_process_profile(sc, &profile_info);
363 break; 365 break;
364 case MCI_GPM_COEX_BT_STATUS_UPDATE: 366 case MCI_GPM_COEX_BT_STATUS_UPDATE:
365 profile_status.is_link = *(rx_payload + 367 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 profile_status.is_link, profile_status.conn_handle, 377 profile_status.is_link, profile_status.conn_handle,
376 profile_status.is_critical, seq_num); 378 profile_status.is_critical, seq_num);
377 379
378 ath_mci_process_status(sc, &profile_status); 380 update_scheme += ath_mci_process_status(sc, &profile_status);
379 break; 381 break;
380 default: 382 default:
381 ath_dbg(common, MCI, "Unknown GPM COEX message = 0x%02x\n", opcode); 383 ath_dbg(common, MCI, "Unknown GPM COEX message = 0x%02x\n", opcode);
382 break; 384 break;
383 } 385 }
386 if (update_scheme)
387 ieee80211_queue_work(sc->hw, &sc->mci_work);
384} 388}
385 389
386int ath_mci_setup(struct ath_softc *sc) 390int ath_mci_setup(struct ath_softc *sc)