/** @file wlan_exp_user.c * @brief Experiment Framework (User) * * @copyright Copyright 2013-2019, Mango Communications. All rights reserved. * Distributed under the Mango Communications Reference Design License * See LICENSE.txt included in the design archive or * at http://mangocomm.com/802.11/license * * This file is part of the Mango 802.11 Reference Design (https://mangocomm.com/802.11) */ #include "wlan_mac_high_sw_config.h" #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP // Xilinx / Standard library includes #include #include #include #include #include // WLAN Exp includes #include "wlan_exp_common.h" #include "wlan_exp_node.h" #include "wlan_exp_user.h" #include "wlan_mac_queue.h" extern function_ptr_t wlan_exp_process_user_cmd_callback; /*****************************************************************************/ /** * @brief Process User Commands * * Process commands from a host meant for the user group * * @param cmd_hdr - pointer to the command header * @param eth_tx_queue_buffer - pointer to a Ethernet queue buffer that should be * filled in with response arguments * * @return int - NO_RESP_SENT or RESP_SENT * *****************************************************************************/ int process_user_cmd(cmd_resp_hdr_t* cmd_hdr, eth_tx_queue_buffer_t* eth_tx_queue_buffer) { // // IMPORTANT ENDIAN NOTES: // - command // - header - Already endian swapped by the framework (safe to access directly) // - args - Must be endian swapped as necessary by code (framework does not know the contents of the command) // - response // - header - Will be endian swapped by the framework (safe to write directly) // - args - Must be endian swapped as necessary by code (framework does not know the contents of the response) // // Standard variables // // Used for accessing command arguments and constructing the command response header/payload // // NOTE: Some of the standard variables below have been commented out. This was to remove // compiler warnings for "unused variables" since the default implementation is empty. As // you add commands, you should un-comment the standard variables. // u32 resp_sent = NO_RESP_SENT; u32 cmd_id = CMD_TO_CMDID(cmd_hdr->cmd); // Process the command switch(cmd_id){ //----------------------------------------------------------------------------- // Child Commands (Callback is implemented in each child project, eg. AP, STA, IBSS) //----------------------------------------------------------------------------- //--------------------------------------------------------------------- default: { // Call standard function in child class to parse parameters implemented there resp_sent = wlan_exp_process_user_cmd_callback(cmd_hdr, eth_tx_queue_buffer); } break; } return resp_sent; } #endif // End WLAN_SW_CONFIG_ENABLE_WLAN_EXP