Changes between Version 6 and Version 7 of 802.11/wlan_exp/Extending
- Timestamp:
- Dec 14, 2015, 6:13:37 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
802.11/wlan_exp/Extending
v6 v7 22 22 * Command arguments: an optional list of {{{u32}}} arguments supplied by the Python code that is passed to the C code handler 23 23 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.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. 25 25 26 26 The 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. … … 51 51 If 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. 52 52 53 A user command consists of the following elements: 54 53 The 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 59 The 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 55 64 56 65 === Example Command: Reading Tx Queue Status === … … 60 69 {{{#!python 61 70 62 #Define a command ID (must be integer in [0, 65535])71 #Define a command ID (must be 24-bit integer) 63 72 CMDID_USER_TX_QUEUE_STATUS = 100 64 73