1 | /** @file wlan_mac_ap.h |
---|
2 | * @brief Access Point |
---|
3 | * |
---|
4 | * This contains code for the 802.11 Access Point. |
---|
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 | /*************************** Constant Definitions ****************************/ |
---|
15 | #ifndef WLAN_MAC_AP_H_ |
---|
16 | #define WLAN_MAC_AP_H_ |
---|
17 | |
---|
18 | /***************************** Include Files *********************************/ |
---|
19 | |
---|
20 | #include "xil_types.h" |
---|
21 | #include "wlan_common_types.h" |
---|
22 | |
---|
23 | // Forward declarations |
---|
24 | struct station_info_t; |
---|
25 | struct rx_common_entry; |
---|
26 | struct network_info_t; |
---|
27 | enum scan_state_t; |
---|
28 | struct bss_config_t; |
---|
29 | struct tx_frame_info_t; |
---|
30 | struct eth_rx_queue_buffer_t; |
---|
31 | struct tx_queue_buffer_t; |
---|
32 | |
---|
33 | //----------------------------------------------- |
---|
34 | // Enable the WLAN UART Menu |
---|
35 | #define WLAN_USE_UART_MENU |
---|
36 | |
---|
37 | |
---|
38 | //----------------------------------------------- |
---|
39 | // Allow Ethernet transmission of packets received by an associated station |
---|
40 | // destined for another associated station |
---|
41 | //#define ALLOW_ETH_TX_OF_WIRELESS_TX |
---|
42 | |
---|
43 | |
---|
44 | //----------------------------------------------- |
---|
45 | // Common Defines |
---|
46 | #define MAX_TX_QUEUE_LEN 150 /// Maximum number of entries in any Tx queue |
---|
47 | |
---|
48 | #define MAX_NUM_ASSOC 10 /// Maximum number of associations allowed |
---|
49 | #define MAX_NUM_AUTH 10 /// Maximum number of authentications allowed |
---|
50 | |
---|
51 | |
---|
52 | //----------------------------------------------- |
---|
53 | // Timing Parameters |
---|
54 | |
---|
55 | // Period for checking association table for stale associations |
---|
56 | #define ASSOCIATION_CHECK_INTERVAL_MS (1000) |
---|
57 | #define ASSOCIATION_CHECK_INTERVAL_US (ASSOCIATION_CHECK_INTERVAL_MS * 1000) |
---|
58 | |
---|
59 | // Timeout for last reception for an association; timed-out associations are subject to de-association |
---|
60 | #define ASSOCIATION_TIMEOUT_S (300) |
---|
61 | #define ASSOCIATION_TIMEOUT_US (ASSOCIATION_TIMEOUT_S * 1000000) |
---|
62 | |
---|
63 | // Interval to allow associations after entering ASSOCIATION_ALLOW_TEMPORARY mode |
---|
64 | #define ASSOCIATION_ALLOW_INTERVAL_MS (30000) |
---|
65 | #define ASSOCIATION_ALLOW_INTERVAL_US (ASSOCIATION_ALLOW_INTERVAL_MS * 1000) |
---|
66 | |
---|
67 | // Blinking period for hex displays, when used to show association mode |
---|
68 | #define ANIMATION_RATE_US (100000) |
---|
69 | |
---|
70 | |
---|
71 | /*********************** Global Structure Definitions ************************/ |
---|
72 | |
---|
73 | /*************************** Function Prototypes *****************************/ |
---|
74 | int main(); |
---|
75 | |
---|
76 | void ltg_event(u32 id, void* callback_arg); |
---|
77 | |
---|
78 | int ethernet_receive(struct eth_rx_queue_buffer_t* eth_rx_queue_buffer); |
---|
79 | u32 mpdu_rx_process(void* pkt_buf_addr, struct station_info_t* station_info, struct rx_common_entry* rx_event_log_entry); |
---|
80 | struct network_info_t* active_network_info_getter(); |
---|
81 | void process_scan_state_change(enum scan_state_t scan_state); |
---|
82 | |
---|
83 | void queue_state_change(u32 aid, u32 queue_len); |
---|
84 | void update_tim_tag_aid(u8 aid, u8 bit_val_in); |
---|
85 | void update_tim_tag_all(u32 sched_id); |
---|
86 | |
---|
87 | void poll_tx_queues(); |
---|
88 | void purge_all_wireless_tx_queue(); |
---|
89 | |
---|
90 | void enable_associations(); |
---|
91 | void disable_associations(); |
---|
92 | void remove_inactive_station_infos(); |
---|
93 | void association_timestamp_adjust(s64 timestamp_diff); |
---|
94 | |
---|
95 | u32 deauthenticate_station( struct station_info_t* station_info ); |
---|
96 | void deauthenticate_all_stations(); |
---|
97 | void handle_cpu_low_reboot(u32 type); |
---|
98 | u32 configure_bss(struct bss_config_t* bss_config, u32 update_mask); |
---|
99 | void mpdu_dequeue(struct tx_queue_buffer_t* tx_80211_queue_buffer); |
---|
100 | |
---|
101 | void button_0_press(); |
---|
102 | void button_0_release(); |
---|
103 | |
---|
104 | void uart_rx(u8 rxByte); |
---|
105 | |
---|
106 | #endif /* WLAN_MAC_AP_H_ */ |
---|