| 198 | Finally the backoff counter for Tx Controller A can be paused from software via the code below. The backoff counter must be paused when another Tx controller with higher priority is started (i.e. when a Beacon Tx must occur while an MPDU Tx defers). |
| 199 | {{{#!c |
| 200 | // Pause Tx Controller A backoff counter |
| 201 | wlan_mac_pause_backoff_tx_ctrl_A(1); |
| 202 | |
| 203 | // Verify Tx A backoff is paused - must check after asserting Pause in case backoff just expired |
| 204 | u32 mac_tx_ctrl_status; |
| 205 | |
| 206 | mac_tx_ctrl_status = wlan_mac_get_tx_ctrl_status(); |
| 207 | if( ((mac_tx_ctrl_status & WLAN_MAC_TXCTRL_STATUS_MASK_TX_A_STATE) == WLAN_MAC_TXCTRL_STATUS_TX_A_STATE_DEFER) || |
| 208 | ((mac_tx_ctrl_status & WLAN_MAC_TXCTRL_STATUS_MASK_TX_A_STATE) == WLAN_MAC_TXCTRL_STATUS_TX_A_STATE_IDLE) ) { |
| 209 | |
| 210 | // Backoff paused successfully - handle higher-priority Tx here |
| 211 | ... |
| 212 | |
| 213 | } |
| 214 | |
| 215 | // Resume Tx Controller A backoff counter |
| 216 | wlan_mac_pause_backoff_tx_ctrl_A(0); |
| 217 | }}} |
| 218 | |
| 219 | |
| 427 | Finally the backoff counter for Tx Controllers C and D can be paused from software via the code below. The backoff counter must be paused when another Tx controller with higher priority is started. |
| 428 | {{{#!c |
| 429 | // Code below pauses/checks/resumes Tx C backoff |
| 430 | // Replace "C" with "D" in macros to control Tx D backoff |
| 431 | |
| 432 | // Pause Tx Controller C backoff counter |
| 433 | wlan_mac_pause_backoff_tx_ctrl_C(1); |
| 434 | |
| 435 | // Verify Tx C backoff is paused - must check after asserting Pause in case backoff just expired |
| 436 | u32 mac_tx_ctrl_status; |
| 437 | |
| 438 | mac_tx_ctrl_status = wlan_mac_get_tx_ctrl_status(); |
| 439 | if( ((mac_tx_ctrl_status & WLAN_MAC_TXCTRL_STATUS_MASK_TX_C_STATE) == WLAN_MAC_TXCTRL_STATUS_TX_C_STATE_DEFER) || |
| 440 | ((mac_tx_ctrl_status & WLAN_MAC_TXCTRL_STATUS_MASK_TX_C_STATE) == WLAN_MAC_TXCTRL_STATUS_TX_C_STATE_IDLE) ) { |
| 441 | |
| 442 | // Backoff paused successfully - handle higher-priority Tx here |
| 443 | ... |
| 444 | |
| 445 | } |
| 446 | |
| 447 | // Resume Tx Controller C backoff counter |
| 448 | wlan_mac_pause_backoff_tx_ctrl_C(0); |
| 449 | }}} |
| 450 | |
| 451 | |