diff options
author | Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> | 2011-11-30 00:11:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-30 15:08:56 -0500 |
commit | 19686ddf638cac8c779216bb1f5e53b2666a9035 (patch) | |
tree | ad27e2edf7f2a8e6f55d6bab700fd9b977eb05b4 | |
parent | 63d3296741e9f556d1edbdc34c07ce7dbe54a471 (diff) |
ath9k: MCI state machine based on MCI interrupt
Cc: Wilson Tsao <wtsao@qca.qualcomm.com>
Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mci.c | 341 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mci.h | 1 |
5 files changed, 359 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index e2860d7cd684..5abe682f2513 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2397,7 +2397,9 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2397 | pCap->hw_caps |= ATH9K_HW_CAP_4KB_SPLITTRANS; | 2397 | pCap->hw_caps |= ATH9K_HW_CAP_4KB_SPLITTRANS; |
2398 | 2398 | ||
2399 | if (common->btcoex_enabled) { | 2399 | if (common->btcoex_enabled) { |
2400 | if (AR_SREV_9300_20_OR_LATER(ah)) { | 2400 | if (AR_SREV_9462(ah)) |
2401 | btcoex_hw->scheme = ATH_BTCOEX_CFG_MCI; | ||
2402 | else if (AR_SREV_9300_20_OR_LATER(ah)) { | ||
2401 | btcoex_hw->scheme = ATH_BTCOEX_CFG_3WIRE; | 2403 | btcoex_hw->scheme = ATH_BTCOEX_CFG_3WIRE; |
2402 | btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO_9300; | 2404 | btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO_9300; |
2403 | btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO_9300; | 2405 | btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO_9300; |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 34b922bbe65d..e9711e2b48c6 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -425,8 +425,16 @@ static int ath9k_init_btcoex(struct ath_softc *sc) | |||
425 | txq = sc->tx.txq_map[WME_AC_BE]; | 425 | txq = sc->tx.txq_map[WME_AC_BE]; |
426 | ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum); | 426 | ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum); |
427 | sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; | 427 | sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; |
428 | break; | ||
429 | case ATH_BTCOEX_CFG_MCI: | ||
430 | sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; | ||
428 | sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE; | 431 | sc->btcoex.duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE; |
429 | INIT_LIST_HEAD(&sc->btcoex.mci.info); | 432 | INIT_LIST_HEAD(&sc->btcoex.mci.info); |
433 | |||
434 | r = ath_mci_setup(sc); | ||
435 | if (r) | ||
436 | return r; | ||
437 | |||
430 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI) { | 438 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI) { |
431 | ah->btcoex_hw.mci.ready = false; | 439 | ah->btcoex_hw.mci.ready = false; |
432 | ah->btcoex_hw.mci.bt_state = 0; | 440 | ah->btcoex_hw.mci.bt_state = 0; |
@@ -861,6 +869,9 @@ static void ath9k_deinit_softc(struct ath_softc *sc) | |||
861 | sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) | 869 | sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) |
862 | ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer); | 870 | ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer); |
863 | 871 | ||
872 | if (sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_MCI) | ||
873 | ath_mci_cleanup(sc); | ||
874 | |||
864 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) | 875 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) |
865 | if (ATH_TXQ_SETUP(sc, i)) | 876 | if (ATH_TXQ_SETUP(sc, i)) |
866 | ath_tx_cleanupq(sc, &sc->tx.txq[i]); | 877 | ath_tx_cleanupq(sc, &sc->tx.txq[i]); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 90d35f265e3d..fd59c1f25c43 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -742,6 +742,9 @@ void ath9k_tasklet(unsigned long data) | |||
742 | if (status & ATH9K_INT_GENTIMER) | 742 | if (status & ATH9K_INT_GENTIMER) |
743 | ath_gen_timer_isr(sc->sc_ah); | 743 | ath_gen_timer_isr(sc->sc_ah); |
744 | 744 | ||
745 | if (status & ATH9K_INT_MCI) | ||
746 | ath_mci_intr(sc); | ||
747 | |||
745 | out: | 748 | out: |
746 | /* re-enable hardware interrupt */ | 749 | /* re-enable hardware interrupt */ |
747 | ath9k_hw_enable_interrupts(ah); | 750 | ath9k_hw_enable_interrupts(ah); |
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c index 5b246766bde5..d6780405d6f5 100644 --- a/drivers/net/wireless/ath/ath9k/mci.c +++ b/drivers/net/wireless/ath/ath9k/mci.c | |||
@@ -184,6 +184,56 @@ static void ath_mci_update_scheme(struct ath_softc *sc) | |||
184 | ath9k_btcoex_timer_resume(sc); | 184 | ath9k_btcoex_timer_resume(sc); |
185 | } | 185 | } |
186 | 186 | ||
187 | |||
188 | static void ath_mci_cal_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) | ||
189 | { | ||
190 | struct ath_hw *ah = sc->sc_ah; | ||
191 | struct ath_common *common = ath9k_hw_common(ah); | ||
192 | u32 payload[4] = {0, 0, 0, 0}; | ||
193 | |||
194 | switch (opcode) { | ||
195 | case MCI_GPM_BT_CAL_REQ: | ||
196 | |||
197 | ath_dbg(common, ATH_DBG_MCI, "MCI received BT_CAL_REQ\n"); | ||
198 | |||
199 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_AWAKE) { | ||
200 | ar9003_mci_state(ah, MCI_STATE_SET_BT_CAL_START, NULL); | ||
201 | ieee80211_queue_work(sc->hw, &sc->hw_reset_work); | ||
202 | } else | ||
203 | ath_dbg(common, ATH_DBG_MCI, | ||
204 | "MCI State mismatches: %d\n", | ||
205 | ar9003_mci_state(ah, MCI_STATE_BT, NULL)); | ||
206 | |||
207 | break; | ||
208 | |||
209 | case MCI_GPM_BT_CAL_DONE: | ||
210 | |||
211 | ath_dbg(common, ATH_DBG_MCI, "MCI received BT_CAL_DONE\n"); | ||
212 | |||
213 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_CAL) | ||
214 | ath_dbg(common, ATH_DBG_MCI, "MCI error illegal!\n"); | ||
215 | else | ||
216 | ath_dbg(common, ATH_DBG_MCI, "MCI BT not in CAL state\n"); | ||
217 | |||
218 | break; | ||
219 | |||
220 | case MCI_GPM_BT_CAL_GRANT: | ||
221 | |||
222 | ath_dbg(common, ATH_DBG_MCI, "MCI received BT_CAL_GRANT\n"); | ||
223 | |||
224 | /* Send WLAN_CAL_DONE for now */ | ||
225 | ath_dbg(common, ATH_DBG_MCI, "MCI send WLAN_CAL_DONE\n"); | ||
226 | MCI_GPM_SET_CAL_TYPE(payload, MCI_GPM_WLAN_CAL_DONE); | ||
227 | ar9003_mci_send_message(sc->sc_ah, MCI_GPM, 0, payload, | ||
228 | 16, false, true); | ||
229 | break; | ||
230 | |||
231 | default: | ||
232 | ath_dbg(common, ATH_DBG_MCI, "MCI Unknown GPM CAL message\n"); | ||
233 | break; | ||
234 | } | ||
235 | } | ||
236 | |||
187 | void ath_mci_process_profile(struct ath_softc *sc, | 237 | void ath_mci_process_profile(struct ath_softc *sc, |
188 | struct ath_mci_profile_info *info) | 238 | struct ath_mci_profile_info *info) |
189 | { | 239 | { |
@@ -256,6 +306,90 @@ void ath_mci_process_status(struct ath_softc *sc, | |||
256 | ath_mci_update_scheme(sc); | 306 | ath_mci_update_scheme(sc); |
257 | } | 307 | } |
258 | 308 | ||
309 | static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) | ||
310 | { | ||
311 | struct ath_hw *ah = sc->sc_ah; | ||
312 | struct ath_mci_profile_info profile_info; | ||
313 | struct ath_mci_profile_status profile_status; | ||
314 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
315 | u32 version; | ||
316 | u8 major; | ||
317 | u8 minor; | ||
318 | u32 seq_num; | ||
319 | |||
320 | switch (opcode) { | ||
321 | |||
322 | case MCI_GPM_COEX_VERSION_QUERY: | ||
323 | ath_dbg(common, ATH_DBG_MCI, | ||
324 | "MCI Recv GPM COEX Version Query.\n"); | ||
325 | version = ar9003_mci_state(ah, | ||
326 | MCI_STATE_SEND_WLAN_COEX_VERSION, NULL); | ||
327 | break; | ||
328 | |||
329 | case MCI_GPM_COEX_VERSION_RESPONSE: | ||
330 | ath_dbg(common, ATH_DBG_MCI, | ||
331 | "MCI Recv GPM COEX Version Response.\n"); | ||
332 | major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION); | ||
333 | minor = *(rx_payload + MCI_GPM_COEX_B_MINOR_VERSION); | ||
334 | ath_dbg(common, ATH_DBG_MCI, | ||
335 | "MCI BT Coex version: %d.%d\n", major, minor); | ||
336 | version = (major << 8) + minor; | ||
337 | version = ar9003_mci_state(ah, | ||
338 | MCI_STATE_SET_BT_COEX_VERSION, &version); | ||
339 | break; | ||
340 | |||
341 | case MCI_GPM_COEX_STATUS_QUERY: | ||
342 | ath_dbg(common, ATH_DBG_MCI, | ||
343 | "MCI Recv GPM COEX Status Query = 0x%02x.\n", | ||
344 | *(rx_payload + MCI_GPM_COEX_B_WLAN_BITMAP)); | ||
345 | ar9003_mci_state(ah, | ||
346 | MCI_STATE_SEND_WLAN_CHANNELS, NULL); | ||
347 | break; | ||
348 | |||
349 | case MCI_GPM_COEX_BT_PROFILE_INFO: | ||
350 | ath_dbg(common, ATH_DBG_MCI, | ||
351 | "MCI Recv GPM Coex BT profile info\n"); | ||
352 | memcpy(&profile_info, | ||
353 | (rx_payload + MCI_GPM_COEX_B_PROFILE_TYPE), 10); | ||
354 | |||
355 | if ((profile_info.type == MCI_GPM_COEX_PROFILE_UNKNOWN) | ||
356 | || (profile_info.type >= | ||
357 | MCI_GPM_COEX_PROFILE_MAX)) { | ||
358 | |||
359 | ath_dbg(common, ATH_DBG_MCI, | ||
360 | "illegal profile type = %d," | ||
361 | "state = %d\n", profile_info.type, | ||
362 | profile_info.start); | ||
363 | break; | ||
364 | } | ||
365 | |||
366 | ath_mci_process_profile(sc, &profile_info); | ||
367 | break; | ||
368 | |||
369 | case MCI_GPM_COEX_BT_STATUS_UPDATE: | ||
370 | profile_status.is_link = *(rx_payload + | ||
371 | MCI_GPM_COEX_B_STATUS_TYPE); | ||
372 | profile_status.conn_handle = *(rx_payload + | ||
373 | MCI_GPM_COEX_B_STATUS_LINKID); | ||
374 | profile_status.is_critical = *(rx_payload + | ||
375 | MCI_GPM_COEX_B_STATUS_STATE); | ||
376 | |||
377 | seq_num = *((u32 *)(rx_payload + 12)); | ||
378 | ath_dbg(common, ATH_DBG_MCI, | ||
379 | "MCI Recv GPM COEX BT_Status_Update: " | ||
380 | "is_link=%d, linkId=%d, state=%d, SEQ=%d\n", | ||
381 | profile_status.is_link, profile_status.conn_handle, | ||
382 | profile_status.is_critical, seq_num); | ||
383 | |||
384 | ath_mci_process_status(sc, &profile_status); | ||
385 | break; | ||
386 | |||
387 | default: | ||
388 | ath_dbg(common, ATH_DBG_MCI, | ||
389 | "MCI Unknown GPM COEX message = 0x%02x\n", opcode); | ||
390 | break; | ||
391 | } | ||
392 | } | ||
259 | 393 | ||
260 | static int ath_mci_buf_alloc(struct ath_softc *sc, struct ath_mci_buf *buf) | 394 | static int ath_mci_buf_alloc(struct ath_softc *sc, struct ath_mci_buf *buf) |
261 | { | 395 | { |
@@ -330,3 +464,210 @@ void ath_mci_cleanup(struct ath_softc *sc) | |||
330 | ath_mci_buf_free(sc, &mci->sched_buf); | 464 | ath_mci_buf_free(sc, &mci->sched_buf); |
331 | ar9003_mci_cleanup(ah); | 465 | ar9003_mci_cleanup(ah); |
332 | } | 466 | } |
467 | |||
468 | void ath_mci_intr(struct ath_softc *sc) | ||
469 | { | ||
470 | struct ath_mci_coex *mci = &sc->mci_coex; | ||
471 | struct ath_hw *ah = sc->sc_ah; | ||
472 | struct ath_common *common = ath9k_hw_common(ah); | ||
473 | u32 mci_int, mci_int_rxmsg; | ||
474 | u32 offset, subtype, opcode; | ||
475 | u32 *pgpm; | ||
476 | u32 more_data = MCI_GPM_MORE; | ||
477 | bool skip_gpm = false; | ||
478 | |||
479 | ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg); | ||
480 | |||
481 | if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) { | ||
482 | |||
483 | ar9003_mci_state(sc->sc_ah, MCI_STATE_INIT_GPM_OFFSET, NULL); | ||
484 | ath_dbg(common, ATH_DBG_MCI, | ||
485 | "MCI interrupt but MCI disabled\n"); | ||
486 | |||
487 | ath_dbg(common, ATH_DBG_MCI, | ||
488 | "MCI interrupt: intr = 0x%x, intr_rxmsg = 0x%x\n", | ||
489 | mci_int, mci_int_rxmsg); | ||
490 | return; | ||
491 | } | ||
492 | |||
493 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE) { | ||
494 | u32 payload[4] = { 0xffffffff, 0xffffffff, | ||
495 | 0xffffffff, 0xffffff00}; | ||
496 | |||
497 | /* | ||
498 | * The following REMOTE_RESET and SYS_WAKING used to sent | ||
499 | * only when BT wake up. Now they are always sent, as a | ||
500 | * recovery method to reset BT MCI's RX alignment. | ||
501 | */ | ||
502 | ath_dbg(common, ATH_DBG_MCI, "MCI interrupt send REMOTE_RESET\n"); | ||
503 | |||
504 | ar9003_mci_send_message(ah, MCI_REMOTE_RESET, 0, | ||
505 | payload, 16, true, false); | ||
506 | ath_dbg(common, ATH_DBG_MCI, "MCI interrupt send SYS_WAKING\n"); | ||
507 | ar9003_mci_send_message(ah, MCI_SYS_WAKING, 0, | ||
508 | NULL, 0, true, false); | ||
509 | |||
510 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE; | ||
511 | ar9003_mci_state(ah, MCI_STATE_RESET_REQ_WAKE, NULL); | ||
512 | |||
513 | /* | ||
514 | * always do this for recovery and 2G/5G toggling and LNA_TRANS | ||
515 | */ | ||
516 | ath_dbg(common, ATH_DBG_MCI, "MCI Set BT state to AWAKE.\n"); | ||
517 | ar9003_mci_state(ah, MCI_STATE_SET_BT_AWAKE, NULL); | ||
518 | } | ||
519 | |||
520 | /* Processing SYS_WAKING/SYS_SLEEPING */ | ||
521 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING) { | ||
522 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING; | ||
523 | |||
524 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_SLEEP) { | ||
525 | |||
526 | if (ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL) | ||
527 | == MCI_BT_SLEEP) | ||
528 | ath_dbg(common, ATH_DBG_MCI, | ||
529 | "MCI BT stays in sleep mode\n"); | ||
530 | else { | ||
531 | ath_dbg(common, ATH_DBG_MCI, | ||
532 | "MCI Set BT state to AWAKE.\n"); | ||
533 | ar9003_mci_state(ah, | ||
534 | MCI_STATE_SET_BT_AWAKE, NULL); | ||
535 | } | ||
536 | } else | ||
537 | ath_dbg(common, ATH_DBG_MCI, | ||
538 | "MCI BT stays in AWAKE mode.\n"); | ||
539 | } | ||
540 | |||
541 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING) { | ||
542 | |||
543 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING; | ||
544 | |||
545 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_AWAKE) { | ||
546 | |||
547 | if (ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL) | ||
548 | == MCI_BT_AWAKE) | ||
549 | ath_dbg(common, ATH_DBG_MCI, | ||
550 | "MCI BT stays in AWAKE mode.\n"); | ||
551 | else { | ||
552 | ath_dbg(common, ATH_DBG_MCI, | ||
553 | "MCI SetBT state to SLEEP\n"); | ||
554 | ar9003_mci_state(ah, MCI_STATE_SET_BT_SLEEP, | ||
555 | NULL); | ||
556 | } | ||
557 | } else | ||
558 | ath_dbg(common, ATH_DBG_MCI, | ||
559 | "MCI BT stays in SLEEP mode\n"); | ||
560 | } | ||
561 | |||
562 | if ((mci_int & AR_MCI_INTERRUPT_RX_INVALID_HDR) || | ||
563 | (mci_int & AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) { | ||
564 | |||
565 | ath_dbg(common, ATH_DBG_MCI, "MCI RX broken, skip GPM msgs\n"); | ||
566 | ar9003_mci_state(ah, MCI_STATE_RECOVER_RX, NULL); | ||
567 | skip_gpm = true; | ||
568 | } | ||
569 | |||
570 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO) { | ||
571 | |||
572 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO; | ||
573 | offset = ar9003_mci_state(ah, MCI_STATE_LAST_SCHD_MSG_OFFSET, | ||
574 | NULL); | ||
575 | } | ||
576 | |||
577 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_GPM) { | ||
578 | |||
579 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_GPM; | ||
580 | |||
581 | while (more_data == MCI_GPM_MORE) { | ||
582 | |||
583 | pgpm = mci->gpm_buf.bf_addr; | ||
584 | offset = ar9003_mci_state(ah, | ||
585 | MCI_STATE_NEXT_GPM_OFFSET, &more_data); | ||
586 | |||
587 | if (offset == MCI_GPM_INVALID) | ||
588 | break; | ||
589 | |||
590 | pgpm += (offset >> 2); | ||
591 | |||
592 | /* | ||
593 | * The first dword is timer. | ||
594 | * The real data starts from 2nd dword. | ||
595 | */ | ||
596 | |||
597 | subtype = MCI_GPM_TYPE(pgpm); | ||
598 | opcode = MCI_GPM_OPCODE(pgpm); | ||
599 | |||
600 | if (!skip_gpm) { | ||
601 | |||
602 | if (MCI_GPM_IS_CAL_TYPE(subtype)) | ||
603 | ath_mci_cal_msg(sc, subtype, | ||
604 | (u8 *) pgpm); | ||
605 | else { | ||
606 | switch (subtype) { | ||
607 | case MCI_GPM_COEX_AGENT: | ||
608 | ath_mci_msg(sc, opcode, | ||
609 | (u8 *) pgpm); | ||
610 | break; | ||
611 | default: | ||
612 | break; | ||
613 | } | ||
614 | } | ||
615 | } | ||
616 | MCI_GPM_RECYCLE(pgpm); | ||
617 | } | ||
618 | } | ||
619 | |||
620 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_HW_MSG_MASK) { | ||
621 | |||
622 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_LNA_CONTROL) | ||
623 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_LNA_CONTROL; | ||
624 | |||
625 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_LNA_INFO) { | ||
626 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_LNA_INFO; | ||
627 | ath_dbg(common, ATH_DBG_MCI, "MCI LNA_INFO\n"); | ||
628 | } | ||
629 | |||
630 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_CONT_INFO) { | ||
631 | |||
632 | int value_dbm = ar9003_mci_state(ah, | ||
633 | MCI_STATE_CONT_RSSI_POWER, NULL); | ||
634 | |||
635 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_CONT_INFO; | ||
636 | |||
637 | if (ar9003_mci_state(ah, MCI_STATE_CONT_TXRX, NULL)) | ||
638 | ath_dbg(common, ATH_DBG_MCI, | ||
639 | "MCI CONT_INFO: " | ||
640 | "(tx) pri = %d, pwr = %d dBm\n", | ||
641 | ar9003_mci_state(ah, | ||
642 | MCI_STATE_CONT_PRIORITY, NULL), | ||
643 | value_dbm); | ||
644 | else | ||
645 | ath_dbg(common, ATH_DBG_MCI, | ||
646 | "MCI CONT_INFO:" | ||
647 | "(rx) pri = %d,pwr = %d dBm\n", | ||
648 | ar9003_mci_state(ah, | ||
649 | MCI_STATE_CONT_PRIORITY, NULL), | ||
650 | value_dbm); | ||
651 | } | ||
652 | |||
653 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_CONT_NACK) { | ||
654 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_CONT_NACK; | ||
655 | ath_dbg(common, ATH_DBG_MCI, "MCI CONT_NACK\n"); | ||
656 | } | ||
657 | |||
658 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_CONT_RST) { | ||
659 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_CONT_RST; | ||
660 | ath_dbg(common, ATH_DBG_MCI, "MCI CONT_RST\n"); | ||
661 | } | ||
662 | } | ||
663 | |||
664 | if ((mci_int & AR_MCI_INTERRUPT_RX_INVALID_HDR) || | ||
665 | (mci_int & AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) | ||
666 | mci_int &= ~(AR_MCI_INTERRUPT_RX_INVALID_HDR | | ||
667 | AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT); | ||
668 | |||
669 | if (mci_int_rxmsg & 0xfffffffe) | ||
670 | ath_dbg(common, ATH_DBG_MCI, | ||
671 | "MCI not processed mci_int_rxmsg = 0x%x\n", | ||
672 | mci_int_rxmsg); | ||
673 | } | ||
diff --git a/drivers/net/wireless/ath/ath9k/mci.h b/drivers/net/wireless/ath/ath9k/mci.h index 4eeb0feafc06..b71bdeda7c78 100644 --- a/drivers/net/wireless/ath/ath9k/mci.h +++ b/drivers/net/wireless/ath/ath9k/mci.h | |||
@@ -134,4 +134,5 @@ void ath_mci_process_status(struct ath_softc *sc, | |||
134 | struct ath_mci_profile_status *status); | 134 | struct ath_mci_profile_status *status); |
135 | int ath_mci_setup(struct ath_softc *sc); | 135 | int ath_mci_setup(struct ath_softc *sc); |
136 | void ath_mci_cleanup(struct ath_softc *sc); | 136 | void ath_mci_cleanup(struct ath_softc *sc); |
137 | void ath_mci_intr(struct ath_softc *sc); | ||
137 | #endif | 138 | #endif |