Changes between Version 6 and Version 7 of 802.11/wlan_exp/Extending


Ignore:
Timestamp:
Dec 14, 2015, 6:13:37 PM (8 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/Extending

    v6 v7  
    2222 * Command arguments: an optional list of {{{u32}}} arguments supplied by the Python code that is passed to the C code handler
    2323
    24 The command ID is used by the C code to select which code block should process the command payload. The Python and C code must use matching lists of command IDs. All user command IDs must be 24-bit integers (i.e. in ~[0, 2^24-1]). The framework does not reserve any command ID values.
     24The command ID is used by the C code to select which code block should process the command payload. The Python and C code must use matching lists of command IDs. All user command IDs must be 24-bit integers (i.e. in ~[0, 2^24 -1]). The framework does not reserve any command ID values.
    2525
    2626The command arguments are an optional payload supplied by the Python script. The wlan_exp framework sends this payload to the node with no modifications. The arguments must be constructed as a list of unsigned 32-bit integers ({{{u32}}} values). The Python and C code must implement complementary argument construction/parsing functions. The argument list may be omitted if a command requires no payload.
     
    5151If 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.
    5252
    53 A user command consists of the following elements:
    54 
     53The implementations of command handlers are similar in {{{wlan_exp_user.c}}} (for common commands) and in top-level MACs (for MAC-specific behaviors). The command processing flow is:
     54 * Examine the command ID and deterine which code block ({{{case}}}) shoudl handle the command
     55 * Implement the required command behavior
     56 * If a response payload is required, populate the response values into the {{{response->args}}} array
     57 * Update the response header fields for response length ({{{resp_hdr->length}}}) and number of response arguments ({{{resp_hdr->num_args}}})
     58
     59The wlan_exp framework will encapsulate the command response payload in an Ethernet fame and return it to the calling Python script for processing.
     60
     61'''TODO:'''
     62 * Endianness
     63 * Interrupt safety
    5564
    5665=== Example Command: Reading Tx Queue Status ===
     
    6069{{{#!python
    6170
    62 #Define a command ID (must be integer in [0, 65535])
     71#Define a command ID (must be 24-bit integer)
    6372CMDID_USER_TX_QUEUE_STATUS = 100
    6473