Changes between Version 7 and Version 8 of 802.11/wlan_exp/app_notes/tutorial_hop_mac/fast_hopping


Ignore:
Timestamp:
Aug 3, 2015, 12:00:15 PM (9 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/app_notes/tutorial_hop_mac/fast_hopping

    v7 v8  
    120120}}}
    121121
     122=== MAC Low Framework ===
     123
     124Changes should be made to {{{wlan_mac_low.c}}} in the project SDK workspace zip.
     125
     126----
     127
     128We need to process the new IPC message we created above and notify the DCF code that it should enable or disable the fast hopping mechanism. To begin, we create two new function callbacks as global variables at the top of the MAC low framework:
     129
     130{{{
     131#!c
     132
     133static function_ptr_t        enable_hopping_callback;
     134static function_ptr_t        disable_hopping_callback;
     135
     136}}}
     137
     138These callback should be set to the {{{nullCallback}}} in {{{wlan_mac_low_init()}}}. This will prevent any CPU_LOW crashes if these callbacks are executed prior to being assigned as valid function pointers.
     139
     140{{{
     141#!c
     142
     143        enable_hopping_callback = (function_ptr_t)nullCallback;
     144        disable_hopping_callback = (function_ptr_t)nullCallback;
     145}}}
     146
     147We need to provide the DCF with the ability to assign these callbacks. Add the following functions to the MAC low framework:
     148
     149{{{
     150#!c
     151
     152inline void wlan_mac_low_set_enable_hopping_callback(function_ptr_t callback){
     153        enable_hopping_callback = callback;
     154}
     155
     156inline void wlan_mac_low_set_disable_hopping_callback(function_ptr_t callback){
     157        disable_hopping_callback = callback;
     158}
     159}}}
     160
     161Finally, we need to execute one of these callbacks when we receive the new IPC message. In the {{{process_ipc_msg_from_high()}}} function, add the following case to the large {{{switch}}} statement:
     162
     163{{{
     164#!c
     165
     166                case IPC_MBOX_CONFIG_HOPPING:
     167                        if(ipc_msg_from_high_payload[0]){
     168                                enable_hopping_callback();
     169                        } else {
     170                                disable_hopping_callback();
     171                        }
     172                break;
     173
     174}}}
     175
    122176
    123177