Changes between Version 3 and Version 4 of 802.11/wlan_exp/app_notes/tutorial_token_mac/CPU_LOW


Ignore:
Timestamp:
Jul 9, 2015, 11:33:04 AM (9 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/app_notes/tutorial_token_mac/CPU_LOW

    v3 v4  
    209209----
    210210
    211 
     211Next, we need to provide the ability for the CPU_LOW project to toggle the whether or not the framework is allowed to process new MPDU transmissions. Disallowing transmissions is easy. Add the following simple function to the MAC Low Framework:
     212
     213{{{
     214#!c
     215
     216void wlan_mac_low_disable_new_mpdu_tx(){
     217        allow_new_mpdu_tx = 0;
     218}
     219}}}
     220
     221Allowing new MPDU transmissions is slightly more complex than setting {{{allow_new_mpdu_tx}}} to 1. If a {{{IPC_MBOX_TX_MPDU_READY}}} message was received from CPU_HIGH while new transmissions were disallowed, we stored the location of that MPDU in the {{{pkt_buf_pending_tx}}} global variable. When allowing new MPDU transmissions, we should see if this variable currently has anything for us to send and immediately do so if it does. Add the following function to the MAC Low Framework:
     222
     223{{{
     224#!c
     225
     226void wlan_mac_low_enable_new_mpdu_tx(){
     227        if(allow_new_mpdu_tx == 0){
     228                allow_new_mpdu_tx = 1;
     229                if(pkt_buf_pending_tx != -1){
     230                        wlan_mac_low_proc_pkt_buf(pkt_buf_pending_tx);
     231                        pkt_buf_pending_tx = -1;
     232                }
     233        }
     234}
     235}}}
     236
     237Here, we are using -1 as a way of saying that there is no pending transmission. Any other value will be interpreted as an actual packet buffer.
     238
     239
     240