diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mci.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mci.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/gpio.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mci.c | 49 |
4 files changed, 27 insertions, 32 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c index 9a761a1fe1bf..d6e90f5effd0 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c | |||
@@ -321,7 +321,7 @@ void ar9003_mci_set_full_sleep(struct ath_hw *ah) | |||
321 | { | 321 | { |
322 | struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; | 322 | struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; |
323 | 323 | ||
324 | if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) && | 324 | if (ar9003_mci_state(ah, MCI_STATE_ENABLE) && |
325 | (mci->bt_state != MCI_BT_SLEEP) && | 325 | (mci->bt_state != MCI_BT_SLEEP) && |
326 | !mci->halted_bt_gpm) { | 326 | !mci->halted_bt_gpm) { |
327 | ar9003_mci_send_coex_halt_bt_gpm(ah, true, true); | 327 | ar9003_mci_send_coex_halt_bt_gpm(ah, true, true); |
@@ -484,7 +484,7 @@ static void ar9003_mci_sync_bt_state(struct ath_hw *ah) | |||
484 | struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; | 484 | struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; |
485 | u32 cur_bt_state; | 485 | u32 cur_bt_state; |
486 | 486 | ||
487 | cur_bt_state = ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL); | 487 | cur_bt_state = ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP); |
488 | 488 | ||
489 | if (mci->bt_state != cur_bt_state) | 489 | if (mci->bt_state != cur_bt_state) |
490 | mci->bt_state = cur_bt_state; | 490 | mci->bt_state = cur_bt_state; |
@@ -1164,7 +1164,7 @@ void ar9003_mci_cleanup(struct ath_hw *ah) | |||
1164 | } | 1164 | } |
1165 | EXPORT_SYMBOL(ar9003_mci_cleanup); | 1165 | EXPORT_SYMBOL(ar9003_mci_cleanup); |
1166 | 1166 | ||
1167 | u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data) | 1167 | u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type) |
1168 | { | 1168 | { |
1169 | struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; | 1169 | struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci; |
1170 | u32 value = 0; | 1170 | u32 value = 0; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.h b/drivers/net/wireless/ath/ath9k/ar9003_mci.h index a7c17e5b90d4..697a56c3599e 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.h | |||
@@ -253,7 +253,7 @@ enum mci_gpm_coex_opcode { | |||
253 | bool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag, | 253 | bool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag, |
254 | u32 *payload, u8 len, bool wait_done, | 254 | u32 *payload, u8 len, bool wait_done, |
255 | bool check_bt); | 255 | bool check_bt); |
256 | u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type, u32 *p_data); | 256 | u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type); |
257 | void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf, | 257 | void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf, |
258 | u16 len, u32 sched_addr); | 258 | u16 len, u32 sched_addr); |
259 | void ar9003_mci_cleanup(struct ath_hw *ah); | 259 | void ar9003_mci_cleanup(struct ath_hw *ah); |
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c index 00ff5ab5a54f..26032cb59b8a 100644 --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c | |||
@@ -202,7 +202,7 @@ static void ath_btcoex_period_timer(unsigned long data) | |||
202 | 202 | ||
203 | btcoex->bt_wait_time += btcoex->btcoex_period; | 203 | btcoex->bt_wait_time += btcoex->btcoex_period; |
204 | if (btcoex->bt_wait_time > ATH_BTCOEX_RX_WAIT_TIME) { | 204 | if (btcoex->bt_wait_time > ATH_BTCOEX_RX_WAIT_TIME) { |
205 | if (ar9003_mci_state(ah, MCI_STATE_NEED_FTP_STOMP, NULL) && | 205 | if (ar9003_mci_state(ah, MCI_STATE_NEED_FTP_STOMP) && |
206 | (mci->num_pan || mci->num_other_acl)) | 206 | (mci->num_pan || mci->num_other_acl)) |
207 | ah->btcoex_hw.mci.stomp_ftp = | 207 | ah->btcoex_hw.mci.stomp_ftp = |
208 | (sc->rx.num_pkts < ATH_BTCOEX_STOMP_FTP_THRESH); | 208 | (sc->rx.num_pkts < ATH_BTCOEX_STOMP_FTP_THRESH); |
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c index dbc8e1dabad1..61a68e856049 100644 --- a/drivers/net/wireless/ath/ath9k/mci.c +++ b/drivers/net/wireless/ath/ath9k/mci.c | |||
@@ -199,16 +199,16 @@ static void ath_mci_cal_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) | |||
199 | 199 | ||
200 | switch (opcode) { | 200 | switch (opcode) { |
201 | case MCI_GPM_BT_CAL_REQ: | 201 | case MCI_GPM_BT_CAL_REQ: |
202 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_AWAKE) { | 202 | if (ar9003_mci_state(ah, MCI_STATE_BT) == MCI_BT_AWAKE) { |
203 | ar9003_mci_state(ah, MCI_STATE_SET_BT_CAL_START, NULL); | 203 | ar9003_mci_state(ah, MCI_STATE_SET_BT_CAL_START); |
204 | ieee80211_queue_work(sc->hw, &sc->hw_reset_work); | 204 | ieee80211_queue_work(sc->hw, &sc->hw_reset_work); |
205 | } else { | 205 | } else { |
206 | ath_dbg(common, MCI, "MCI State mismatch: %d\n", | 206 | ath_dbg(common, MCI, "MCI State mismatch: %d\n", |
207 | ar9003_mci_state(ah, MCI_STATE_BT, NULL)); | 207 | ar9003_mci_state(ah, MCI_STATE_BT)); |
208 | } | 208 | } |
209 | break; | 209 | break; |
210 | case MCI_GPM_BT_CAL_DONE: | 210 | case MCI_GPM_BT_CAL_DONE: |
211 | ar9003_mci_state(ah, MCI_STATE_BT, NULL); | 211 | ar9003_mci_state(ah, MCI_STATE_BT); |
212 | break; | 212 | break; |
213 | case MCI_GPM_BT_CAL_GRANT: | 213 | case MCI_GPM_BT_CAL_GRANT: |
214 | MCI_GPM_SET_CAL_TYPE(payload, MCI_GPM_WLAN_CAL_DONE); | 214 | MCI_GPM_SET_CAL_TYPE(payload, MCI_GPM_WLAN_CAL_DONE); |
@@ -304,7 +304,7 @@ static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) | |||
304 | 304 | ||
305 | switch (opcode) { | 305 | switch (opcode) { |
306 | case MCI_GPM_COEX_VERSION_QUERY: | 306 | case MCI_GPM_COEX_VERSION_QUERY: |
307 | ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION, NULL); | 307 | ar9003_mci_state(ah, MCI_STATE_SEND_WLAN_COEX_VERSION); |
308 | break; | 308 | break; |
309 | case MCI_GPM_COEX_VERSION_RESPONSE: | 309 | case MCI_GPM_COEX_VERSION_RESPONSE: |
310 | major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION); | 310 | major = *(rx_payload + MCI_GPM_COEX_B_MAJOR_VERSION); |
@@ -415,7 +415,7 @@ void ath_mci_intr(struct ath_softc *sc) | |||
415 | 415 | ||
416 | ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg); | 416 | ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg); |
417 | 417 | ||
418 | if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) { | 418 | if (ar9003_mci_state(ah, MCI_STATE_ENABLE) == 0) { |
419 | ar9003_mci_get_next_gpm_offset(ah, true, NULL); | 419 | ar9003_mci_get_next_gpm_offset(ah, true, NULL); |
420 | return; | 420 | return; |
421 | } | 421 | } |
@@ -435,46 +435,41 @@ void ath_mci_intr(struct ath_softc *sc) | |||
435 | NULL, 0, true, false); | 435 | NULL, 0, true, false); |
436 | 436 | ||
437 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE; | 437 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_REQ_WAKE; |
438 | ar9003_mci_state(ah, MCI_STATE_RESET_REQ_WAKE, NULL); | 438 | ar9003_mci_state(ah, MCI_STATE_RESET_REQ_WAKE); |
439 | 439 | ||
440 | /* | 440 | /* |
441 | * always do this for recovery and 2G/5G toggling and LNA_TRANS | 441 | * always do this for recovery and 2G/5G toggling and LNA_TRANS |
442 | */ | 442 | */ |
443 | ar9003_mci_state(ah, MCI_STATE_SET_BT_AWAKE, NULL); | 443 | ar9003_mci_state(ah, MCI_STATE_SET_BT_AWAKE); |
444 | } | 444 | } |
445 | 445 | ||
446 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING) { | 446 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING) { |
447 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING; | 447 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SYS_WAKING; |
448 | 448 | ||
449 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_SLEEP) { | 449 | if ((ar9003_mci_state(ah, MCI_STATE_BT) == MCI_BT_SLEEP) && |
450 | if (ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL) != | 450 | (ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP) != |
451 | MCI_BT_SLEEP) | 451 | MCI_BT_SLEEP)) |
452 | ar9003_mci_state(ah, MCI_STATE_SET_BT_AWAKE, | 452 | ar9003_mci_state(ah, MCI_STATE_SET_BT_AWAKE); |
453 | NULL); | ||
454 | } | ||
455 | } | 453 | } |
456 | 454 | ||
457 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING) { | 455 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING) { |
458 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING; | 456 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SYS_SLEEPING; |
459 | 457 | ||
460 | if (ar9003_mci_state(ah, MCI_STATE_BT, NULL) == MCI_BT_AWAKE) { | 458 | if ((ar9003_mci_state(ah, MCI_STATE_BT) == MCI_BT_AWAKE) && |
461 | if (ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL) != | 459 | (ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP) != |
462 | MCI_BT_AWAKE) | 460 | MCI_BT_AWAKE)) |
463 | ar9003_mci_state(ah, MCI_STATE_SET_BT_SLEEP, | 461 | ar9003_mci_state(ah, MCI_STATE_SET_BT_SLEEP); |
464 | NULL); | ||
465 | } | ||
466 | } | 462 | } |
467 | 463 | ||
468 | if ((mci_int & AR_MCI_INTERRUPT_RX_INVALID_HDR) || | 464 | if ((mci_int & AR_MCI_INTERRUPT_RX_INVALID_HDR) || |
469 | (mci_int & AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) { | 465 | (mci_int & AR_MCI_INTERRUPT_CONT_INFO_TIMEOUT)) { |
470 | ar9003_mci_state(ah, MCI_STATE_RECOVER_RX, NULL); | 466 | ar9003_mci_state(ah, MCI_STATE_RECOVER_RX); |
471 | skip_gpm = true; | 467 | skip_gpm = true; |
472 | } | 468 | } |
473 | 469 | ||
474 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO) { | 470 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO) { |
475 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO; | 471 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_SCHD_INFO; |
476 | offset = ar9003_mci_state(ah, MCI_STATE_LAST_SCHD_MSG_OFFSET, | 472 | offset = ar9003_mci_state(ah, MCI_STATE_LAST_SCHD_MSG_OFFSET); |
477 | NULL); | ||
478 | } | 473 | } |
479 | 474 | ||
480 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_GPM) { | 475 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_GPM) { |
@@ -526,21 +521,21 @@ void ath_mci_intr(struct ath_softc *sc) | |||
526 | 521 | ||
527 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_CONT_INFO) { | 522 | if (mci_int_rxmsg & AR_MCI_INTERRUPT_RX_MSG_CONT_INFO) { |
528 | int value_dbm = ar9003_mci_state(ah, | 523 | int value_dbm = ar9003_mci_state(ah, |
529 | MCI_STATE_CONT_RSSI_POWER, NULL); | 524 | MCI_STATE_CONT_RSSI_POWER); |
530 | 525 | ||
531 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_CONT_INFO; | 526 | mci_int_rxmsg &= ~AR_MCI_INTERRUPT_RX_MSG_CONT_INFO; |
532 | 527 | ||
533 | if (ar9003_mci_state(ah, MCI_STATE_CONT_TXRX, NULL)) | 528 | if (ar9003_mci_state(ah, MCI_STATE_CONT_TXRX)) |
534 | ath_dbg(common, MCI, | 529 | ath_dbg(common, MCI, |
535 | "MCI CONT_INFO: (tx) pri = %d, pwr = %d dBm\n", | 530 | "MCI CONT_INFO: (tx) pri = %d, pwr = %d dBm\n", |
536 | ar9003_mci_state(ah, | 531 | ar9003_mci_state(ah, |
537 | MCI_STATE_CONT_PRIORITY, NULL), | 532 | MCI_STATE_CONT_PRIORITY), |
538 | value_dbm); | 533 | value_dbm); |
539 | else | 534 | else |
540 | ath_dbg(common, MCI, | 535 | ath_dbg(common, MCI, |
541 | "MCI CONT_INFO: (rx) pri = %d,pwr = %d dBm\n", | 536 | "MCI CONT_INFO: (rx) pri = %d,pwr = %d dBm\n", |
542 | ar9003_mci_state(ah, | 537 | ar9003_mci_state(ah, |
543 | MCI_STATE_CONT_PRIORITY, NULL), | 538 | MCI_STATE_CONT_PRIORITY), |
544 | value_dbm); | 539 | value_dbm); |
545 | } | 540 | } |
546 | 541 | ||