[6319] | 1 | /** @file wlan_mac_sta.h |
---|
| 2 | * @brief Station |
---|
| 3 | * |
---|
| 4 | * This contains code for the 802.11 Station. |
---|
| 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 | |
---|
| 14 | /***************************** Include Files *********************************/ |
---|
| 15 | #include "xil_types.h" |
---|
| 16 | |
---|
| 17 | //Forward declarations |
---|
| 18 | struct station_info_t; |
---|
| 19 | struct rx_common_entry; |
---|
| 20 | enum scan_state_t; |
---|
| 21 | struct network_info_t; |
---|
| 22 | struct bss_config_t; |
---|
| 23 | struct eth_rx_queue_buffer_t; |
---|
| 24 | |
---|
| 25 | /*************************** Constant Definitions ****************************/ |
---|
| 26 | #ifndef WLAN_MAC_STA_H_ |
---|
| 27 | #define WLAN_MAC_STA_H_ |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | //----------------------------------------------- |
---|
| 31 | // Enable the WLAN UART Menu |
---|
| 32 | #define WLAN_USE_UART_MENU |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | //----------------------------------------------- |
---|
| 36 | // Common Defines |
---|
| 37 | |
---|
| 38 | #define MAX_TX_QUEUE_LEN 150 /// Max number of entries in any Tx queue |
---|
| 39 | #define MAX_NUM_ASSOC 1 /// Max number of associations the STA will attempt |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | //----------------------------------------------- |
---|
| 43 | // Timing Parameters |
---|
| 44 | |
---|
| 45 | // Timeout for association request-response handshake |
---|
| 46 | #define ASSOCIATION_TIMEOUT_US 100000 |
---|
| 47 | #define ASSOCIATION_NUM_TRYS 5 |
---|
| 48 | |
---|
| 49 | // Timeout for authentication handshake |
---|
| 50 | #define AUTHENTICATION_TIMEOUT_US 100000 |
---|
| 51 | #define AUTHENTICATION_NUM_TRYS 5 |
---|
| 52 | |
---|
| 53 | // Number of probe requests to send per channel when active scanning |
---|
| 54 | #define NUM_PROBE_REQ 5 |
---|
| 55 | |
---|
| 56 | // Time the active scan procedure will dwell on each channel before |
---|
| 57 | // moving to the next channel (microseconds) |
---|
| 58 | // |
---|
| 59 | #define ACTIVE_SCAN_DWELL 100000 |
---|
| 60 | |
---|
| 61 | // The amount of time between full active scans when looking for a particular SSID |
---|
| 62 | // |
---|
| 63 | // NOTE: This value must be larger than the maximum amount of time it takes for |
---|
| 64 | // a single active scan. For an active scan over 11 channels, this value must be larger |
---|
| 65 | // than 11*ACTIVE_SCAN_DWELL. |
---|
| 66 | // |
---|
| 67 | #define ACTIVE_SCAN_UPDATE_RATE 5000000 |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | /*************************** Function Prototypes *****************************/ |
---|
| 71 | int main(); |
---|
| 72 | |
---|
| 73 | void ltg_event(u32 id, void* callback_arg); |
---|
| 74 | |
---|
| 75 | int ethernet_receive(struct eth_rx_queue_buffer_t* eth_rx_queue_buffer); |
---|
| 76 | |
---|
| 77 | u32 mpdu_rx_process(void* pkt_buf_addr, struct station_info_t* station_info, struct rx_common_entry* rx_event_log_entry); |
---|
| 78 | void send_probe_req(); |
---|
| 79 | void process_scan_state_change(enum scan_state_t scan_state); |
---|
| 80 | void poll_tx_queues(); |
---|
| 81 | void purge_all_wireless_tx_queue(); |
---|
| 82 | struct network_info_t * active_network_info_getter(); |
---|
| 83 | |
---|
| 84 | int sta_disassociate(); |
---|
| 85 | u32 configure_bss(struct bss_config_t* bss_config, u32 update_mask); |
---|
| 86 | |
---|
| 87 | void uart_rx(u8 rxByte); |
---|
| 88 | |
---|
| 89 | #endif /* WLAN_MAC_STA_H_ */ |
---|