Changes between Initial Version and Version 1 of 802.11/wlan_exp/Extending


Ignore:
Timestamp:
Dec 14, 2015, 12:20:45 PM (8 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/Extending

    v1 v1  
     1{{{#!comment
     2[[Include(wiki:802.11/beta-note)]]
     3}}}
     4
     5[[TracNav(802.11/TOC)]]
     6
     7= Extending the Experiments Framework =
     8
     9The 802.11 Reference Design Experiments Framework provides a variety of commands to control and observe WARP v3 nodes in real time. However many experiments will require additional commands, especially when users extend the reference code with new behaviors. Starting in 802.11 Reference Design v1.4 we have greatly simplified the process of implementing extensions to the experiments framework.
     10
     11There are two kinds of framework extensions:
     12 * '''User Commands''': commands interact with the MAC High Framework and the upper-level MAC running in CPU High
     13 * '''Low Params''': a write-only path for setting parameters in the MAC Low Framework and the lower-level MAC running in CPU Low
     14
     15== User Commands ==
     16
     17The 802.11 MAC code running on the WARP node handles user commands at two levels.
     18
     19If the command behavior is common to all MAC applications, the command is handled in the {{{process_user_cmd()}}} function in {{{wlan_exp_user.c}}}. You should modify {{{process_user_cmd()}}} to handle any new framework-level commands required for your application. Any command IDs not hanlded in {{{process_user_cmd()}}} will be passed through to the MAC application.
     20
     21If a command behavior depends on the upper-level MAC application, the command is handled in the {{{wlan_exp_process_user_cmd()}}} callback function in the top-level MAC. You should modify the {{{wlan_exp_process_user_cmd()}}} function in the {{{wlan_mac_ap.c}}}, {{{wlan_mac_sta.c}}} and {{{wlan_mac_ibss.c}}} files to implement any MAC-specific command behaviors.
     22
     23A user command consists of the following elements:
     24 * Command ID: an arbitrary 24-bit integer defined in the Python and C code
     25 * Command arguments: an optional list of arguments supplied by the Python code that is passed to the C code handler. Each argument must be an unsigned 32-bit integer. Python and C can reinterpret the {{{u32}}} values as needed.
     26
     27
     28=== Example Command: Reading Tx Queue Status ===
     29
     30{{{my_node}}} is an instance of a wlan_exp node object that has already been initialized.
     31
     32{{{#!python
     33
     34#Define a command ID (must be integer in [0, 65535])
     35CMDID_USER_TX_QUEUE_STATUS = 100
     36
     37my_node.send_user_command(CMDID_USR_QUEUE_STATUS, args=None)
     38
     39}}}
     40
     41
     42Each upper-level MAC application implements its own callback function for handling application-specific user commands. By default these functions are empty. You must modify the C code to implement the behaviors required for your custom command.
     43
     44In this example the custom command will query the lengths of Tx queues.
     45Modify the {{{wlan_exp_user_ap_process_cmd()}}} function in {{{wlan_mac_ap.c}}}.
     46{{{#!c
     47
     48
     49}}}
     50
     51
     52== Low Params ==
     53The User Command flow described above is can configure and reading state in CPU High. Some applications will also require interacting with CPU Low.