Changes between Version 14 and Version 15 of 802.11/wlan_exp/app_notes/tutorial_token_mac/CPU_LOW


Ignore:
Timestamp:
Jul 15, 2015, 9:21:30 AM (9 years ago)
Author:
chunter
Comment:

--

Legend:

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

    v14 v15  
    55= Alterations to CPU_LOW =
    66
    7 In this section, we will describe and discuss the changes needed to the low-level MAC code to realize the design. Here, we will not start off with the DCF code since the vast majority of that DCF behavior is irrelevant to TokenMAC. Instead, we will use the very simple [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_nomac NoMAC] project as a starting point. Unaltered, this project acts as a straight passthrough connection between the high-level MAC and the PHY.
     7In this section, we will describe and discuss the changes needed to the low-level MAC code to realize the design. Here, we will not start off with the DCF code since the vast majority of that DCF behavior is irrelevant to TokenMAC. Instead, we will use the very simple NoMAC project as a starting point. Unaltered, this project acts as a straight passthrough connection between the high-level MAC and the PHY.
    88
    99Furthermore, we will make some changes to the MAC Low Framework to handle new inter-processor communication (IPC) messages with CPU_HIGH.
     
    1414=== MAC Low Framework ===
    1515
    16 Changes should be made to [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_framework/wlan_mac_low.c wlan_mac_low.c].
     16Changes should be made to {{{wlan_mac_low.c}}} in the project SDK workspace zip.
    1717
    1818----
    1919
    20 In [wiki:802.11/wlan_exp/app_notes/tutorial_token_mac/CPU_HIGH#CodeCommontoCPU_HIGHandCPU_LOW the CPU_HIGH alterations section], we created the {{{TOKEN_NEW_RESERVATION}}} and {{{TOKEN_END_RESERVATION}}} IPC messages. Now we need to alter the MAC Low Framework to deal with these messages and pass their contents to whatever CPU_LOW project uses the framework. First, we need to create some new global variables at the top of [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_framework/wlan_mac_low.c wlan_mac_low.c]:
     20In [wiki:802.11/wlan_exp/app_notes/tutorial_token_mac/CPU_HIGH#CodeCommontoCPU_HIGHandCPU_LOW the CPU_HIGH alterations section], we created the {{{TOKEN_NEW_RESERVATION}}} and {{{TOKEN_END_RESERVATION}}} IPC messages. Now we need to alter the MAC Low Framework to deal with these messages and pass their contents to whatever CPU_LOW project uses the framework. First, we need to create some new global variables at the top of {{{wlan_mac_low.c}}}:
    2121
    2222{{{
     
    259259=== NoMAC ===
    260260
    261 Changes should be made to [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_nomac/wlan_mac_nomac.c wlan_mac_nomac.c] and [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_nomac/include/wlan_mac_nomac.h wlan_mac_nomac.h].
     261Changes should be made to {{{wlan_mac_nomac.c}}} and {{{wlan_mac_nomac.h}}} in the project SDK workspace zip.
    262262
    263263NoMAC is intended to be a near "blank slate" to make building totally custom MACs more straightforward. It does not have any of the complexities of the DCF. Transmissions are directly connected to the PHY. There is no carrier sensing, no acknowledgments, no retransmissions, no random backoffs, etc. NoMAC is the perfect place for us to add the low-level behavior of TokenMAC. We will construct TokenMAC in such a way that the same CPU_LOW project can be attached to either the AP or STA CPU_HIGH project to program a board. In other words, our modifications to NoMAC will have to work for either role of issuing tokens or accepting tokens.
     
    265265----
    266266
    267 First, we need to modify [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_nomac/include/wlan_mac_nomac.h wlan_mac_nomac.h] with a few new definitions.
     267First, we need to modify {{{wlan_mac_nomac.h}}} with a few new definitions.
    268268
    269269{{{
     
    331331----
    332332
    333 Next, we will perform a little bit of bookkeeping and declare two new global variables we will need at the top of [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_low_nomac/wlan_mac_nomac.c wlan_mac_nomac.c]:
     333Next, we will perform a little bit of bookkeeping and declare two new global variables we will need at the top of {{{wlan_mac_nomac.c}}}:
    334334
    335335{{{
     
    418418                                                                                   eeprom_addr,
    419419                                                                                   0,
    420                                                                                    new_reservation->res_duration); //TODO: Calculate appropriate duration
     420                                                                                   new_reservation->res_duration);
    421421
    422422
     
    513513                wlan_mac_low_disable_new_mpdu_tx();
    514514                ipc_payload.reason = TOKEN_DURATION_COMPLETE;
    515                 //ipc_payload.low_tx_details; //TODO
    516515                ipc_mailbox_write_msg(&ipc_msg_to_high);
    517516        }
     
    598597                                                                                                      eeprom_addr,
    599598                                                                                                      0,
    600                                                                                                       rx_token_frame->res_duration_usec); //TODO: Calculate appropriate duration
     599                                                                                                      rx_token_frame->res_duration_usec);
    601600
    602601
     
    686685
    687686We assigned this function to the new callback in the MAC Low Framework in a previous change.
    688