/** @file wlan_exp_node.h * @brief Experiment Framework (Node) * * This contains the code for WLAN Experimental Framework. * * @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 Files *********************************/ #include "wlan_mac_high_sw_config.h" #include "xil_types.h" #include "wlan_common_types.h" #include "wlan_high_types.h" /*************************** Constant Definitions ****************************/ #ifndef WLAN_EXP_NODE_H_ #define WLAN_EXP_NODE_H_ //Forward Declarations struct eth_rx_queue_buffer_t; struct eth_tx_queue_buffer_t; struct wlan_exp_eth_rx_queue_buffer_t; struct cmd_resp_hdr_t; // **************************************************************************** // Define Node Commands // // All Command IDs (CMDID_*) must be a 24 bit unique number //----------------------------------------------- // Node Commands // #define CMDID_NODE_TYPE 0x000000 #define CMDID_NODE_INFO 0x000001 #define CMDID_NODE_IDENTIFY 0x000002 #define CMD_PARAM_NODE_IDENTIFY_ALL 0xFFFFFFFF #define CMDID_NODE_CONFIG_SETUP 0x000003 #define CMDID_NODE_CONFIG_RESET 0x000004 #define CMD_PARAM_NODE_CONFIG_RESET_ALL 0xFFFFFFFF #define CMDID_NODE_TEMPERATURE 0x000005 //----------------------------------------------- // WLAN Exp Node Commands // #define CMDID_NODE_RESET_STATE 0x001000 #define CMDID_NODE_CONFIGURE 0x001001 #define CMDID_NODE_CONFIG_BSS 0x001002 #define CMDID_NODE_TIME 0x001010 #define CMDID_NODE_CHANNEL 0x001011 #define CMDID_NODE_TX_POWER 0x001012 #define CMDID_NODE_TX_RATE 0x001013 #define CMDID_NODE_TX_ANT_MODE 0x001014 #define CMDID_NODE_RX_ANT_MODE 0x001015 #define CMDID_NODE_LOW_TO_HIGH_FILTER 0x001016 #define CMDID_NODE_RANDOM_SEED 0x001017 #define CMDID_NODE_LOW_PARAM 0x001020 #define CMD_PARAM_WRITE_VAL 0x00000000 #define CMD_PARAM_READ_VAL 0x00000001 #define CMD_PARAM_RSVD 0xFFFFFFFF #define CMD_PARAM_SUCCESS 0x00000000 #define CMD_PARAM_WARNING 0xF0000000 #define CMD_PARAM_ERROR 0xFF000000 #define CMD_PARAM_TXPARAM_MASK_DATA 0x00000001 #define CMD_PARAM_TXPARAM_MASK_MGMT 0x00000002 #define CMD_PARAM_TXPARAM_MASK_CTRL 0x00000004 #define CMD_PARAM_TXPARAM_ADDR_NONE 0x00000000 #define CMD_PARAM_TXPARAM_ADDR_ALL_UNICAST 0x00000001 #define CMD_PARAM_TXPARAM_ADDR_ALL_MULTICAST 0x00000002 #define CMD_PARAM_TXPARAM_ADDR_ALL 0x00000003 #define CMD_PARAM_TXPARAM_ADDR_SINGLE 0x00000004 #define CMD_PARAM_NODE_CONFIG_ALL 0xFFFFFFFF #define CMD_PARAM_NODE_RESET_FLAG_LOG 0x00000001 #define CMD_PARAM_NODE_RESET_FLAG_TXRX_COUNTS 0x00000002 #define CMD_PARAM_NODE_RESET_FLAG_LTG 0x00000004 #define CMD_PARAM_NODE_RESET_FLAG_TX_DATA_QUEUE 0x00000008 #define CMD_PARAM_NODE_RESET_FLAG_BSS 0x00000010 #define CMD_PARAM_NODE_RESET_FLAG_NETWORK_LIST 0x00000020 #define CMD_PARAM_NODE_CONFIG_FLAG_DSSS_ENABLE 0x00000001 #define CMD_PARAM_NODE_CONFIG_FLAG_BEACON_TIME_UPDATE 0x00000002 #define CMD_PARAM_NODE_CONFIG_FLAG_ETH_PORTAL 0x00000004 #define CMD_PARAM_NODE_CONFIG_SET_WLAN_EXP_PRINT_LEVEL 0x80000000 #define CMD_PARAM_NODE_TIME_ADD_TO_LOG_VAL 0x00000002 #define CMD_PARAM_NODE_TIME_RSVD_VAL 0xFFFFFFFF #define CMD_PARAM_NODE_TIME_RSVD_VAL_64 0xFFFFFFFFFFFFFFFF #define CMD_PARAM_NODE_TX_POWER_LOW 0x00000010 #define CMD_PARAM_NODE_TX_POWER_ALL 0x00000020 #define CMD_PARAM_NODE_TX_ANT_ALL 0x00000010 #define CMD_PARAM_RSVD_CHANNEL 0x00000000 #define CMD_PARAM_RSVD_MAC_ADDR 0x00000000 #define CMD_PARAM_RANDOM_SEED_VALID 0x00000001 #define CMD_PARAM_RANDOM_SEED_RSVD 0xFFFFFFFF //----------------------------------------------- // LTG Commands // #define CMDID_LTG_CONFIG 0x002000 #define CMDID_LTG_START 0x002001 #define CMDID_LTG_STOP 0x002002 #define CMDID_LTG_REMOVE 0x002003 #define CMDID_LTG_STATUS 0x002004 #define CMD_PARAM_LTG_ERROR 0x000001 #define CMD_PARAM_LTG_CONFIG_FLAG_AUTOSTART 0x00000001 #define CMD_PARAM_LTG_ALL_LTGS LTG_ID_INVALID #define CMD_PARAM_LTG_RUNNING 0x00000001 #define CMD_PARAM_LTG_STOPPED 0x00000000 //----------------------------------------------- // Log Commands // #define CMDID_LOG_CONFIG 0x003000 #define CMDID_LOG_GET_STATUS 0x003001 #define CMDID_LOG_GET_CAPACITY 0x003002 #define CMDID_LOG_GET_ENTRIES 0x003003 #define CMDID_LOG_ADD_EXP_INFO_ENTRY 0x003004 #define CMD_PARAM_LOG_GET_ALL_ENTRIES 0xFFFFFFFF #define CMD_PARAM_LOG_CONFIG_FLAG_LOGGING 0x00000001 #define CMD_PARAM_LOG_CONFIG_FLAG_WRAP 0x00000002 #define CMD_PARAM_LOG_CONFIG_FLAG_PAYLOADS 0x00000004 #define CMD_PARAM_LOG_CONFIG_FLAG_TXRX_MPDU 0x00000008 #define CMD_PARAM_LOG_CONFIG_FLAG_TXRX_CTRL 0x00000010 //----------------------------------------------- // Queue Commands // #define CMDID_QUEUE_PURGE_ALL_WIRELESS_TX 0x005000 //----------------------------------------------- // Scan Commands // #define CMDID_NODE_SCAN_PARAM 0x006000 #define CMDID_NODE_SCAN 0x006001 #define CMD_PARAM_NODE_SCAN_ENABLE 0x00000001 #define CMD_PARAM_NODE_SCAN_DISABLE 0x00000000 //----------------------------------------------- // Association Commands // #define CMDID_NODE_GET_BSS_MEMBERS 0x007001 #define CMDID_NODE_GET_NETWORK_INFO 0x007002 #define CMDID_NODE_GET_STATION_INFO_LIST 0x007003 #define CMDID_NODE_DISASSOCIATE 0x007010 #define CMDID_NODE_ASSOCIATE 0x007011 #define NODE_ASSOCIATE_ERROR_MEMORY 0x000001 #define NODE_ASSOCIATE_ERROR_TOO_MANY_ASSOC 0x000002 //----------------------------------------------- // Development Commands // #define CMDID_DEV_MEM_HIGH 0xFFF000 #define CMDID_DEV_MEM_LOW 0xFFF001 #define CMDID_DEV_EEPROM 0xFFF002 /*********************** Global Structure Definitions ************************/ typedef struct wlan_exp_node_info_t { u32 platform_id; // Platform ID, unique integer assigned to each supported hardware platform u32 platform_config; // Platform config flags, values are platform-specific u32 serial_number; // Numeric part of node serial number, full serial number format is platform-specific u32 wlan_exp_version; // Version of wlan_exp code running on node u32 node_id; // Node ID for wlan_exp transport messages, typically assigned during wlan_exp init handshake u8 wlan_mac_addr[MAC_ADDR_LEN]; // MAC address of node's wireless interface u8 high_sw_id; // ID for MAC software application in CPU High u8 low_sw_id; // ID for MAC software application in CPU Low u32 high_sw_config; // Config flags for high MAC aplication/framework u32 low_sw_config; // Config flags for low MAC aplication/framework u16 wlan_exp_eth_mtu; // MTU in bytes of wlan_exp Ethernet interface u16 scheduler_interval; // Minimum interval for scheduled events, in usec char high_compilation_date[12]; // Compilation date string for high application char high_compilation_time[12]; // Compilation time string for high application char low_compilation_date[12]; // Compilation date string for low application char low_compilation_time[12]; // Compilation time string for low application } __attribute__((__packed__)) wlan_exp_node_info_t; ASSERT_TYPE_SIZE(wlan_exp_node_info_t, 88); /*************************** Function Prototypes *****************************/ #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP // Initialization Commands int wlan_exp_node_init(); int wlan_exp_process_eth_rx(struct eth_rx_queue_buffer_t* eth_rx_queue_buffer); void wlan_exp_node_set_type_high(application_role_t application_role, char* date, char* time); void wlan_exp_node_set_type_low(u32 sw_id, char* date, char* time); int process_msg_from_host(struct wlan_exp_eth_rx_queue_buffer_t* wlan_exp_eth_rx_queue_buffer, struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); // Callbacks void wlan_exp_reset_all_callbacks (); void wlan_exp_set_process_node_cmd_callback (void(*callback)()); void wlan_exp_set_purge_all_wireless_tx_queue_callback (void(*callback)()); void wlan_exp_set_process_user_cmd_callback (void(*callback)()); void wlan_exp_set_beacon_ts_update_mode_callback (void(*callback)()); void wlan_exp_set_process_config_bss_callback (void(*callback)()); void wlan_exp_set_active_network_info_getter_callback (void(*callback)()); wlan_exp_node_info_t* wlan_exp_get_node_info(); void wlan_exp_add_u32_resp_arg(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer, struct cmd_resp_hdr_t* resp_hdr, u32 arg); #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP #endif /* WLAN_EXP_NODE_H_ */