Changes between Version 13 and Version 14 of 802.11/app_notes/FDD-NoMAC


Ignore:
Timestamp:
Feb 15, 2017, 11:41:54 AM (7 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/app_notes/FDD-NoMAC

    v13 v14  
    150150
    151151=== 3. NoMAC Application Changes ===
    152 Finally the NoMAC application must be modified to support simultaneous Tx and Rx operations. In the reference code NoMAC implements two callback functions, {{{frame_transmit()}}} and {{{frame_receive()}}}. The lower MAC framework calls these functions to handle new Tx and Rx events. By default these callbacks block during a Tx/Rx event until the corresponding PHY event is complete. In order to support FDD operation these functions must be generalized to not block during PHY events. Instead the callbacks are responsible for starting the Tx/Rx processing and new functions are implemented to finish Tx/Rx processing.
    153 
    154 Fundamentally, FDD changes NoMAC so that Tx and Rx events no longer occur in complete atomic contexts. The NoMAC code still has to operate serially while the Tx and Rx operations operate in parallels. We will need a few new global variables to help us track whether we are currently transmitting and/or receiving and, if so, which packet buffers are currently being used. Add the following to the top of {{{wlan_mac_nomac.c}}}:
     152Finally the NoMAC application must be modified to support simultaneous Tx and Rx operations.
     153
     154In the reference code NoMAC implements two callback functions, {{{frame_transmit()}}} and {{{frame_receive()}}}. The lower MAC framework calls these functions to handle new Tx and Rx events. By default these callbacks block during a Tx/Rx event until the corresponding PHY event is complete. In order to support FDD operation these functions must be generalized to not block during PHY events. In this extension the normal callbacks are modified to start the Tx/Rx processing, then new functions are implemented to finish Tx/Rx processing.
     155
     156The first step is to add two global variables to track whether Tx/Rx events have already been started. Add the following to the top of {{{wlan_mac_nomac.c}}}:
    155157
    156158{{{#!c
     
    164166}}}
    165167
    166 Next, we will update the {{{frame_transmit()}}} function such that it immediately returns after submitting the packet to the MAC Tx Controller rather than wait for the PHY to finish. Replace {{{frame_transmit()}}} with the following:
     168Next the {{{frame_transmit()}}} function must be modified to immediately return (instead of blocking) after submitting the packet to the MAC Tx Controller. Replace {{{frame_transmit()}}} with the following:
    167169
    168170{{{#!c
     
    224226}}}
    225227
    226 Now we need a function that will "finish" the transmission with everything that used to take place after {{{wlan_mac_tx_ctrl_A_start()}}} from NoMAC's original {{{frame_transmit()}}}. This function should poll the status of the transmission and immediately quit if the transmission is still ongoing. Add the following function to {{{wlan_mac_nomac.c}}} and be sure to add a new declaration for it in the header file:
     228The "finish Tx" processing that normally occurs in {{{frame_transmit()}}} must be moved to a new function. This function polls the status of the Tx PHY and immediately returns if the transmission is not yet complete. Add the following function to {{{wlan_mac_nomac.c}}}, then add the functions declaration to {{{include/wlan_mac_nomac.h}}}:
    227229
    228230{{{#!c
     
    263265}}}
    264266
    265 Next, we need to perform a similar dissection of the {{{frame_receive()}}} context to quit early before the reception has finished. Note: it is important to return the value {{{FRAME_RX_RET_SKIP_RX_STARTED_RESET}}} from this context to prevent the MAC Low Framework from resetting the PHY while the reception is still ongoing. Replace {{{frame_receive()}}} with the following:
     267Next the Rx processing must be similarly divided into separate "start" and "finish" functions. First modify {{{frame_receive()}}} to immediately return instead of blocking:
     268
     269 we need to perform a similar dissection of the {{{frame_receive()}}} context to quit early before the reception has finished. Note: it is important to return the value {{{FRAME_RX_RET_SKIP_RX_STARTED_RESET}}} from this context to prevent the MAC Low Framework from resetting the PHY while the reception is still ongoing. Replace {{{frame_receive()}}} with the following:
    266270
    267271{{{#!c
     
    287291}}}
    288292
    289 Next, we need to finish the frame reception in another function. Like {{{finish_frame_transmit()}}} from above, this function should immediately quit if the PHY is still receiving a frame. Add the following function to {{{wlan_mac_nomac.c}}} and declare it in NoMAC's header:
     293Note that this function returns {{{FRAME_RX_RET_SKIP_RX_STARTED_RESET}}}. This flag informs the MAC framework that the application is not finishes processing the current Rx event and that the framework should not reset the Rx state.
     294
     295Next add a new function to handle the "finish" step for Rx processing. Add the following function to {{{wlan_mac_nomac.c}}} and add the function's declaration to {{{include/wlan_mac_nomac.h}}}:
    290296
    291297{{{
     
    345351}}}
    346352
    347 Finally, we will call our new functions for finishing Tx or Rx events from the primary while loop in {{{main()}}}. Replace the existing while loop with the following:
     353The final step is to update the {{{main()}}} function to call the new Tx/Rx start/finish functions, depending on the global Tx/Rx state. Replace the {{{while(1)}}} loop with the following:
    348354
    349355{{{#!c
     
    372378}}}
    373379
     380With this change the NoMAC application will interleave the Tx/Rx start and finish events, realizing simultaneous use of the Tx and Rx PHY cores.
     381
    374382----
    375383