1 /*
2  *  Copyright 2008-2024 NXP
3  *
4  *  SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 /*! \file wifi_events.h
9  * \brief Wi-Fi events
10  */
11 
12 #ifndef __WIFI_EVENTS_H__
13 #define __WIFI_EVENTS_H__
14 
15 #include <osa.h>
16 
17 /** Wifi events */
18 enum wifi_event
19 {
20     /** uAP Started */
21     WIFI_EVENT_UAP_STARTED = 0,
22     /** uAP Client Assoc */
23     WIFI_EVENT_UAP_CLIENT_ASSOC,
24     /** uAP Client connected */
25     WIFI_EVENT_UAP_CLIENT_CONN,
26     /** uAP Client De-authentication */
27     WIFI_EVENT_UAP_CLIENT_DEAUTH,
28     /** uAP Network Address Configuration */
29     WIFI_EVENT_UAP_NET_ADDR_CONFIG,
30     /** uAP Stopped */
31     WIFI_EVENT_UAP_STOPPED,
32     /** uAP Last */
33     WIFI_EVENT_UAP_LAST,
34     /* All the uAP related events need to be above and STA related events
35      * below */
36     /** Scan start event when scan is started */
37     WIFI_EVENT_SCAN_START,
38     /** Scan Result */
39     WIFI_EVENT_SCAN_RESULT,
40     /** Survey Result Get */
41     WIFI_EVENT_SURVEY_RESULT_GET,
42     /** Get hardware spec */
43     WIFI_EVENT_GET_HW_SPEC,
44     /** Association */
45     WIFI_EVENT_ASSOCIATION,
46 #if CONFIG_WPA_SUPP
47 #if CONFIG_AUTO_RECONNECT
48     /** Association Notify */
49     WIFI_EVENT_ASSOCIATION_NOTIFY,
50 #endif
51 #endif
52     /** PMK */
53     WIFI_EVENT_PMK,
54     /** Authentication */
55     WIFI_EVENT_AUTHENTICATION,
56     /** Disassociation */
57     WIFI_EVENT_DISASSOCIATION,
58     /** De-authentication */
59     WIFI_EVENT_DEAUTHENTICATION,
60     /** Link Loss */
61     WIFI_EVENT_LINK_LOSS,
62     /* WiFi RSSI Low Event */
63     WIFI_EVENT_RSSI_LOW,
64     /** Firmware Hang event */
65     WIFI_EVENT_FW_HANG,
66     /** Firmware Reset event */
67     WIFI_EVENT_FW_RESET,
68 #if CONFIG_SUBSCRIBE_EVENT_SUPPORT
69     /* WiFi RSSI High Event */
70     WIFI_EVENT_RSSI_HIGH,
71     /* WiFi SRN Low Event */
72     WIFI_EVENT_SNR_LOW,
73     /* WiFi SNR High Event */
74     WIFI_EVENT_SNR_HIGH,
75     /* WiFi Max Fail Event */
76     WIFI_EVENT_MAX_FAIL,
77     /* WiFi Beacon miised Event */
78     WIFI_EVENT_BEACON_MISSED,
79     /* WiFi Data RSSI Low Event */
80     WIFI_EVENT_DATA_RSSI_LOW,
81     /* WiFi Data RSSI High Event */
82     WIFI_EVENT_DATA_RSSI_HIGH,
83     /* WiFi Data SNR Low Event */
84     WIFI_EVENT_DATA_SNR_LOW,
85     /* WiFi Data SNR High Event */
86     WIFI_EVENT_DATA_SNR_HIGH,
87     /* WiFi Link Quality Event */
88     WIFI_EVENT_FW_LINK_QUALITY,
89     /* WiFi Pre Beacon Lost Event */
90     WIFI_EVENT_FW_PRE_BCN_LOST,
91 #endif
92 #if CONFIG_HOST_SLEEP
93     /* Host sleep activated */
94     WIFI_EVENT_HS_ACTIVATED,
95     /** HS configuration */
96     WIFI_EVENT_HS_CONFIG,
97     /* Sleep confirm done */
98     WIFI_EVENT_SLEEP_CONFIRM_DONE,
99 #endif
100     /** Network station address configuration */
101     WIFI_EVENT_NET_STA_ADDR_CONFIG,
102     /** Network interface configuration */
103     WIFI_EVENT_NET_INTERFACE_CONFIG,
104     /** WEP configuration */
105     WIFI_EVENT_WEP_CONFIG,
106     /** STA MAC address configuration */
107     WIFI_EVENT_STA_MAC_ADDR_CONFIG,
108     /** UAP MAC address configuration */
109     WIFI_EVENT_UAP_MAC_ADDR_CONFIG,
110     /** Network DHCP configuration */
111     WIFI_EVENT_NET_DHCP_CONFIG,
112     /** Supplicant PMK */
113     WIFI_EVENT_SUPPLICANT_PMK,
114     /** Sleep */
115     WIFI_EVENT_SLEEP,
116     /** IEEE PS */
117     WIFI_EVENT_IEEE_PS,
118     /** Deep Sleep */
119     WIFI_EVENT_DEEP_SLEEP,
120     /** WNM ps */
121     WIFI_EVENT_WNM_PS,
122     /** IEEE and Deep Sleep */
123     WIFI_EVENT_IEEE_DEEP_SLEEP,
124     /** WNM and Deep Sleep */
125     WIFI_EVENT_WNM_DEEP_SLEEP,
126     /** PS Invalid */
127     WIFI_EVENT_PS_INVALID,
128     /** Error Multicast */
129     WIFI_EVENT_ERR_MULTICAST,
130     /** error Unicast */
131     WIFI_EVENT_ERR_UNICAST,
132     /** 802.11K/11V neighbor report */
133     WIFI_EVENT_NLIST_REPORT,
134     /* Add Block Ack */
135     /** 802.11N add block ack */
136     WIFI_EVENT_11N_ADDBA,
137     /** 802.11N block Ack stream timeout */
138     WIFI_EVENT_11N_BA_STREAM_TIMEOUT,
139     /** 802.11n Delete block add */
140     WIFI_EVENT_11N_DELBA,
141     /** 802.11n aggregation control */
142     WIFI_EVENT_11N_AGGR_CTRL,
143     /** Channel Switch Announcement */
144     WIFI_EVENT_CHAN_SWITCH_ANN,
145     /** Channel Switch */
146     WIFI_EVENT_CHAN_SWITCH,
147 #if CONFIG_IPV6
148     /** IPv6 address state change */
149     WIFI_EVENT_NET_IPV6_CONFIG,
150 #endif
151 #if CONFIG_WLAN_BRIDGE
152     /** Auto link switch network */
153     WIFI_EVENT_AUTOLINK_NETWORK_SWITCHED,
154 #endif
155     /* Background Scan Report */
156     WIFI_EVENT_BG_SCAN_REPORT,
157     /* Background Scan Stop */
158     WIFI_EVENT_BG_SCAN_STOPPED,
159     /* Event to indicate RX Management Frame */
160     WIFI_EVENT_MGMT_FRAME,
161     /* Event to indicate remain on channel started */
162     WIFI_EVENT_REMAIN_ON_CHANNEL,
163     /* Event to indicate Management tx status */
164     WIFI_EVENT_MGMT_TX_STATUS,
165 #if CONFIG_CSI
166     /* Recv csi data */
167     WIFI_EVENT_CSI,
168 #endif
169 #if (CONFIG_11MC) || (CONFIG_11AZ)
170     /* Event to trigger or stop ftm*/
171     WIFI_EVENT_FTM_COMPLETE,
172 #if CONFIG_WLS_CSI_PROC
173     WIFI_EVENT_WLS_CSI,
174 #endif
175 #endif
176     /** Event to set region power*/
177     WIFI_EVENT_REGION_POWER_CFG,
178     /** Event to indicate end of Wi-Fi events */
179     WIFI_EVENT_LAST,
180     /* other events can be added after this, however this must
181        be the last event in the wifi module */
182 };
183 
184 /** WiFi Event Reason */
185 enum wifi_event_reason
186 {
187     /** Success */
188     WIFI_EVENT_REASON_SUCCESS,
189     /** Timeout */
190     WIFI_EVENT_REASON_TIMEOUT,
191     /** Failure */
192     WIFI_EVENT_REASON_FAILURE,
193 };
194 
195 /** Network wireless BSS Type */
196 enum wlan_bss_type
197 {
198     /** Station */
199     WLAN_BSS_TYPE_STA = 0,
200     /** uAP */
201     WLAN_BSS_TYPE_UAP = 1,
202 #if CONFIG_P2P
203     /** WiFi Direct */
204     WLAN_BSS_TYPE_WIFIDIRECT = 2,
205 #endif
206     /** Any */
207     WLAN_BSS_TYPE_ANY = 0xff,
208 };
209 
210 /** Network wireless BSS Role */
211 enum wlan_bss_role
212 {
213     /** Infrastructure network. The system will act as a station connected
214      *  to an Access Point. */
215     WLAN_BSS_ROLE_STA = 0,
216     /** uAP (micro-AP) network.  The system will act as an uAP node to
217      * which other Wireless clients can connect. */
218     WLAN_BSS_ROLE_UAP = 1,
219     /** Either Infrastructure network or micro-AP network */
220     WLAN_BSS_ROLE_ANY = 0xff,
221 };
222 
223 /** This enum defines various wakeup events
224  * for which wakeup will occur */
225 enum wifi_wakeup_event_t
226 {
227     /** Wakeup on broadcast  */
228     WIFI_WAKE_ON_ALL_BROADCAST = 1,
229     /** Wakeup on unicast  */
230     WIFI_WAKE_ON_UNICAST = 1 << 1,
231     /** Wakeup on MAC event  */
232     WIFI_WAKE_ON_MAC_EVENT = 1 << 2,
233     /** Wakeup on multicast  */
234     WIFI_WAKE_ON_MULTICAST = 1 << 3,
235     /** Wakeup on ARP broadcast  */
236     WIFI_WAKE_ON_ARP_BROADCAST = 1 << 4,
237     /** Wakeup on receiving a management frame  */
238     WIFI_WAKE_ON_MGMT_FRAME = 1 << 6,
239 };
240 
241 #endif /*__WIFI_EVENTS_H__*/
242