1 | /** @file wlan_exp_transport.h |
---|
2 | * @brief Experiment Framework (Transport) |
---|
3 | * |
---|
4 | * Implements the Transport protocol layer for the embedded processor. |
---|
5 | * |
---|
6 | * @copyright Copyright 2013-2019, Mango Communications. All rights reserved. |
---|
7 | * Distributed under the Mango Communications Reference Design License |
---|
8 | * See LICENSE.txt included in the design archive or |
---|
9 | * at http://mangocomm.com/802.11/license |
---|
10 | * |
---|
11 | * This file is part of the Mango 802.11 Reference Design (https://mangocomm.com/802.11) |
---|
12 | */ |
---|
13 | #ifndef WLAN_EXP_TRANSPORT_H_ |
---|
14 | #define WLAN_EXP_TRANSPORT_H_ |
---|
15 | |
---|
16 | |
---|
17 | /***************************** Include Files *********************************/ |
---|
18 | |
---|
19 | #include "wlan_mac_high_sw_config.h" |
---|
20 | #include "wlan_high_types.h" |
---|
21 | |
---|
22 | // WLAN Exp includes |
---|
23 | #include "wlan_exp_common.h" |
---|
24 | |
---|
25 | // wlan_exp IP/UDP transport includes |
---|
26 | #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP |
---|
27 | #include "wlan_exp_ip_udp.h" |
---|
28 | #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP |
---|
29 | |
---|
30 | // Forward Declarations |
---|
31 | struct wlan_exp_eth_rx_queue_buffer_t; |
---|
32 | struct eth_tx_queue_buffer_t; |
---|
33 | struct cmd_resp_hdr_t; |
---|
34 | |
---|
35 | #define WLAN_EXP_MAX_QUEUE_LEN 50 |
---|
36 | #define WLAN_EXP_MAX_RX_PROC_PER_POLL 5 |
---|
37 | |
---|
38 | |
---|
39 | // **************************************************************************** |
---|
40 | // Define Transport Commands |
---|
41 | // |
---|
42 | #define CMDID_TRANSPORT_PING 0x001 |
---|
43 | #define CMDID_TRANSPORT_SET_MAX_RESP_WORDS 0x002 |
---|
44 | #define CMDID_TRANSPORT_TEST_MTU 0x003 |
---|
45 | |
---|
46 | #define CMDID_TRANSPORT_NODE_GROUP_ID_ADD 0x100 |
---|
47 | #define CMDID_TRANSPORT_NODE_GROUP_ID_CLEAR 0x101 |
---|
48 | |
---|
49 | // Transport header flags (16 bits) |
---|
50 | #define TRANSPORT_HDR_ROBUST_FLAG 0x0001 |
---|
51 | #define TRANSPORT_HDR_NODE_NOT_READY_FLAG 0x8000 |
---|
52 | |
---|
53 | // Transport header dest_id values |
---|
54 | #define TRANSPORT_BROADCAST_DEST_ID 0xFFFF |
---|
55 | |
---|
56 | |
---|
57 | #define WLAN_MAX_WLAN_EXP_ETH_TX_PROCESS_PER_ISR 6 // Maximum number of transmissions that will be handled per ISR invocation |
---|
58 | // Keeping this number small allows other critical interrupts to be dealt with |
---|
59 | // in between transmissions |
---|
60 | |
---|
61 | /*************************** Function Prototypes *****************************/ |
---|
62 | #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP |
---|
63 | |
---|
64 | // Transport functions |
---|
65 | int transport_init(); |
---|
66 | |
---|
67 | int wlan_exp_append_rx(dl_entry* queue_entry); |
---|
68 | int wlan_exp_append_tx(dl_entry* queue_entry); |
---|
69 | int wlan_exp_get_tx_queue_length(); |
---|
70 | |
---|
71 | int process_transport_cmd(struct cmd_resp_hdr_t* cmd_hdr, struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); |
---|
72 | void wlan_exp_transport_poll(); |
---|
73 | u32 wlan_exp_handle_tx_queue(); |
---|
74 | |
---|
75 | void wlan_exp_transport_receive(struct wlan_exp_eth_rx_queue_buffer_t* wlan_exp_eth_rx_queue_buffer); |
---|
76 | void wlan_exp_transport_send(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); |
---|
77 | void wlan_exp_transport_prepare_headers(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); |
---|
78 | |
---|
79 | u32 wlan_exp_transport_get_max_pkt_words(); |
---|
80 | |
---|
81 | int wlan_exp_transport_fill_headers_response(struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); |
---|
82 | |
---|
83 | void transport_set_ip_addr(u8* ip_addr); |
---|
84 | void transport_get_ip_addr(u8* ip_addr); |
---|
85 | |
---|
86 | void transport_set_max_resp_pkt_words(u32 max_words); |
---|
87 | |
---|
88 | int transport_config_sockets(u32 unicast_port, u32 broadcast_port); |
---|
89 | |
---|
90 | int transport_get_parameters(u32* buffer, u32 max_resp_len, u8 network); |
---|
91 | |
---|
92 | #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP |
---|
93 | |
---|
94 | #endif /* TRANSPORT_H_ */ |
---|