/** @file wlan_exp_transport.h * @brief Experiment Framework (Transport) * * Implements the Transport protocol layer for the embedded processor. * * @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) */ #ifndef WLAN_EXP_TRANSPORT_H_ #define WLAN_EXP_TRANSPORT_H_ /***************************** Include Files *********************************/ #include "wlan_mac_high_sw_config.h" #include "wlan_high_types.h" // WLAN Exp includes #include "wlan_exp_common.h" // wlan_exp IP/UDP transport includes #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP #include "wlan_exp_ip_udp.h" #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP // Forward Declarations struct wlan_exp_eth_rx_queue_buffer_t; struct eth_tx_queue_buffer_t; struct cmd_resp_hdr_t; #define WLAN_EXP_MAX_QUEUE_LEN 50 #define WLAN_EXP_MAX_RX_PROC_PER_POLL 5 // **************************************************************************** // Define Transport Commands // #define CMDID_TRANSPORT_PING 0x001 #define CMDID_TRANSPORT_SET_MAX_RESP_WORDS 0x002 #define CMDID_TRANSPORT_TEST_MTU 0x003 #define CMDID_TRANSPORT_NODE_GROUP_ID_ADD 0x100 #define CMDID_TRANSPORT_NODE_GROUP_ID_CLEAR 0x101 // Transport header flags (16 bits) #define TRANSPORT_HDR_ROBUST_FLAG 0x0001 #define TRANSPORT_HDR_NODE_NOT_READY_FLAG 0x8000 // Transport header dest_id values #define TRANSPORT_BROADCAST_DEST_ID 0xFFFF #define WLAN_MAX_WLAN_EXP_ETH_TX_PROCESS_PER_ISR 6 // Maximum number of transmissions that will be handled per ISR invocation // Keeping this number small allows other critical interrupts to be dealt with // in between transmissions /*************************** Function Prototypes *****************************/ #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP // Transport functions int transport_init(); int wlan_exp_append_rx(dl_entry* queue_entry); int wlan_exp_append_tx(dl_entry* queue_entry); int wlan_exp_get_tx_queue_length(); int process_transport_cmd(struct cmd_resp_hdr_t* cmd_hdr, struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); void wlan_exp_transport_poll(); u32 wlan_exp_handle_tx_queue(); void wlan_exp_transport_receive(struct wlan_exp_eth_rx_queue_buffer_t* wlan_exp_eth_rx_queue_buffer); void wlan_exp_transport_send(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); void wlan_exp_transport_prepare_headers(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); u32 wlan_exp_transport_get_max_pkt_words(); int wlan_exp_transport_fill_headers_response(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); void transport_set_ip_addr(u8* ip_addr); void transport_get_ip_addr(u8* ip_addr); void transport_set_max_resp_pkt_words(u32 max_words); int transport_config_sockets(u32 unicast_port, u32 broadcast_port); int transport_get_parameters(u32* buffer, u32 max_resp_len, u8 network); #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP #endif /* TRANSPORT_H_ */