• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef _WIFI_CFG_NX_H
16 #define _WIFI_CFG_NX_H
17 
18 #include "porting_net_al.h"
19 #include "rwnx_config.h"
20 #include "wifi_msg.h"
21 #include "wifi_host_api.h"
22 #include "rtos_ohos_def.h"
23 
24 /// UDP port for CFGRWNX connection
25 #define CFGRWNX_PORT 1630
26 
27 /// Marker to indicate end of splited message
28 #define CFGRWNX_LAST_BUF 0x1a51b0ff
29 
30 /// CFGRWNX index message
31 enum cfgrwnx_msg_index {
32     /// Sent by supplicant to retrieve HW capability (param: none)
33     CFGRWNX_HW_FEATURE_CMD = 1,
34     /// Response to CFGRWNX_HW_FEATURE_CMD (param: @ref cfgrwnx_hw_feature)
35     CFGRWNX_HW_FEATURE_RESP,
36     /// Sent by supplicant to retrieve FW capability (param: none)
37     CFGRWNX_GET_CAPA_CMD,
38     /// Response to CFGRWNX_GET_CAPA_CMD (param: none)
39     CFGRWNX_GET_CAPA_RESP,
40     /// Sent by Supplicant to install/remove Encryption key (param: @ref cfgrwnx_set_key)
41     CFGRWNX_SET_KEY_CMD,
42     /// Response to CFGRWNX_SET_KEY_CMD (param: @ref cfgrwnx_resp)
43     CFGRWNX_SET_KEY_RESP,
44     /// Sent by Supplicant to start a SCAN (param: @ref cfgrwnx_scan)
45     CFGRWNX_SCAN_CMD,
46     /// Response to CFGRWNX_SCAN_CMD (param: @ref cfgrwnx_resp)
47     CFGRWNX_SCAN_RESP,
48     /// Event sent when scan is done (param: @ref cfgrwnx_scan_completed)
49     CFGRWNX_SCAN_DONE_EVENT,
50     /// Event sent when a new AP is found (param: @ref cfgrwnx_scan_result)
51     CFGRWNX_SCAN_RESULT_EVENT,                                    // 10
52     /// Sent by supplicant to initiate a connection (param: @ref cfgrwnx_connect)
53     CFGRWNX_CONNECT_CMD,
54     /// Response to CFGRWNX_CONNECT_CMD (param: @ref cfgrwnx_resp)
55     CFGRWNX_CONNECT_RESP,
56     /// Event sent when the connection is finished (param: @ref cfgrwnx_connect_event)
57     CFGRWNX_CONNECT_EVENT,
58     /// Sent by supplicant to end a connection (param: @ref cfgrwnx_disconnect)
59     CFGRWNX_DISCONNECT_CMD,
60     /// Response to CFGRWNX_DISCONNECT_CMD (param: @ref cfgrwnx_resp)
61     CFGRWNX_DISCONNECT_RESP,
62     /// Event sent if the connection is lost (param: @ref cfgrwnx_disconnect_event)
63     CFGRWNX_DISCONNECT_EVENT,
64     /// Sent by supplicant to open/close a control port (param: @ref cfgrwnx_ctrl_port)
65     CFGRWNX_CTRL_PORT_CMD,
66     /// Response to CFGRWNX_CTRL_PORT_CMD (param: @ref cfgrwnx_resp)
67     CFGRWNX_CTRL_PORT_RESP,
68     /// Event sent if a Michael MIC failure is detected (param: @ref cfgrwnx_mic_failure_event)
69     CFGRWNX_MIC_FAILURE_EVENT,
70     /// Sent by Application to retrieve system statistics (param: none)
71     CFGRWNX_SYS_STATS_CMD,                                       //20
72     /// Response to CFGRWNX_SYS_STATS_CMD (param: @ref cfgrwnx_sys_stats_resp)
73     CFGRWNX_SYS_STATS_RESP,
74     /// Sent by smartconfig to obtain scan results (param: none)
75     CFGRWNX_SCAN_RESULTS_CMD,
76     /// Response to CFGRWNX_SCAN_RESULTS_CMD (param: @ref cfgrwnx_scan_results_resp)
77     CFGRWNX_SCAN_RESULTS_RESP,
78     /// Sent by Application to retrieve FW/PHY supported features (param: none)
79     CFGRWNX_LIST_FEATURES_CMD,
80     /// Response to CFGRWNX_LIST_FEATURES_CMD (param: @ref cfgrwnx_list_features_resp)
81     CFGRWNX_LIST_FEATURES_RESP,
82     /// Sent to change the type of an vif at MAC level. MAC VIF is deleted (if it exists) and
83     /// re-created with the new type (unless type is VIF_UNKNOWN) (param: @ref cfgrwnx_set_vif_type)
84     CFGRWNX_SET_VIF_TYPE_CMD,
85     /// Response to CFGRWNX_SET_VIF_TYPE_CMD (param: @ref cfgrwnx_resp)
86     CFGRWNX_SET_VIF_TYPE_RESP,
87     /// Sent by Application to configure a monitor interface (param: @ref cfgrwnx_monitor_cfg)
88     CFGRWNX_MONITOR_CFG_CMD,
89     /// Response to CFGRWNX_MONITOR_CFG_CMD (param: @ref cfgrwnx_resp)
90     CFGRWNX_MONITOR_CFG_RESP,
91     /// Event sent by the RX task when management frame is forwarded by the wifi task (param: @ref cfgrwnx_rx_mgmt_event)
92     CFGRWNX_RX_MGMT_EVENT,                                     //30
93     /// Event to defer TX status processing (param: @ref cfgrwnx_tx_status_event)
94     CFGRWNX_TX_STATUS_EVENT,
95     /// Event sent by wifi task to request external authentication (i.e. Supplicant will do the
96     /// authentication procedure for the wifi task, used for SAE) (param: @ref cfgrwnx_external_auth_event)
97     CFGRWNX_EXTERNAL_AUTH_EVENT,
98     /// Sent by Supplicant to pass external authentication status (param: @ref cfgrwnx_external_auth_status)
99     CFGRWNX_EXTERNAL_AUTH_STATUS_RESP,
100 #ifdef CFG_SOFTAP
101     /// Sent by Supplicant to start an AP (param: @ref cfgrwnx_start_ap)
102     CFGRWNX_START_AP_CMD,
103     /// Response to CFGRWNX_START_AP_CMD (param: @ref cfgrwnx_resp)
104     CFGRWNX_START_AP_RESP,
105     /// Sent by Supplicant to stop an AP (param: @ref cfgrwnx_stop_ap)
106     CFGRWNX_STOP_AP_CMD,
107     /// Response to CFGRWNX_STOP_AP_CMD (param: @ref cfgrwnx_resp)
108     CFGRWNX_STOP_AP_RESP,
109 #endif
110     /// Sent by Supplicant to configure EDCA parameter for one AC (param: @ref cfgrwnx_set_edca)
111     CFGRWNX_SET_EDCA_CMD,
112     /// Response to CFGRWNX_SET_EDCA_CMD (param: @ref cfgrwnx_resp)
113     CFGRWNX_SET_EDCA_RESP,
114 #ifdef CFG_SOFTAP
115     /// Sent by Supplicant to update the beacon (param: @ref cfgrwnx_bcn_update)
116     CFGRWNX_BCN_UPDATE_CMD,
117     /// Response to CFGRWNX_BCN_UPDATE (param: @ref cfgrwnx_resp)
118     CFGRWNX_BCN_UPDATE_RESP,
119 #endif
120     /// Send to supplicant to register a new Station (param: @ref cfgrwnx_sta_add)
121     CFGRWNX_STA_ADD_CMD,
122     /// Response to CFGRWNX_STA_ADD_CMD (param: @ref cfgrwnx_resp)
123     CFGRWNX_STA_ADD_RESP,
124     /// Send to supplicant to un-register a Station (param: @ref cfgrwnx_sta_remove)
125     CFGRWNX_STA_REMOVE_CMD,
126     /// Response to CFGRWNX_STA_REMOVE_CMD (param: @ref cfgrwnx_resp)
127     CFGRWNX_STA_REMOVE_RESP,
128     /// Send by supplicant to retrieve Key current sequence number (param: @ref cfgrwnx_key_seqnum)
129     CFGRWNX_KEY_SEQNUM_CMD,
130     /// Response to CFGRWNX_KEY_SEQNUM_CMD (param: @ref cfgrwnx_key_seqnum_resp)
131     CFGRWNX_KEY_SEQNUM_RESP,
132     /// Enable Power Save (param: @ref cfgrwnx_set_ps_mode)
133     CFGRWNX_SET_PS_MODE_CMD,
134     /// Response to CFGRWNX_SET_PS_MODE_CMD (param: @ref cfgrwnx_resp)
135     CFGRWNX_SET_PS_MODE_RESP,
136 
137     CFGRWNX_CH_SWITCH_EVENT,
138 };
139 
140 /// CFGRWNX status
141 enum cfgrwnx_status {
142     /// Success status
143     CFGRWNX_SUCCESS = 0,
144     /// Generic error status
145     CFGRWNX_ERROR,
146     /// Error invalid VIF index parameter
147     CFGRWNX_INVALID_VIF,
148     /// Error invalid STA index parameter
149     CFGRWNX_INVALID_STA,
150     /// Error invalid parameter
151     CFGRWNX_INVALID_PARAM,
152 };
153 
154 /// CFGRWNX message header
155 struct cfgrwnx_msg_hdr {
156     /// For CFGRWNX commands, queue handle to use to push the response
157     rtos_queue resp_queue;
158     /// Length, in bytes, of the message (including this header)
159     uint16_t len;
160     /// ID of the message.
161     uint16_t id;
162 };
163 
164 /// CFGRWNX generic message structure
165 struct cfgrwnx_msg {
166     /// header
167     struct cfgrwnx_msg_hdr hdr;
168 };
169 
170 /// CFGRWNX generic response structure
171 struct cfgrwnx_resp {
172     /// header
173     struct cfgrwnx_msg_hdr hdr;
174     /// Status
175     uint32_t status;
176 };
177 
178 /// structure for CFGRWNX_HW_FEATURE_RESP
179 struct cfgrwnx_hw_feature {
180     /// header
181     struct cfgrwnx_msg_hdr hdr;
182     /// ME configuration
183     struct me_config_req me_config;
184     /// Channel configuration
185     struct me_chan_config_req *chan;
186 };
187 
188 /// structure for CFGRWNX_SET_KEY_CMD
189 struct cfgrwnx_set_key {
190     /// header
191     struct cfgrwnx_msg_hdr hdr;
192     /// Vif idx
193     int fhost_vif_idx;
194     /// MAC addr (may be NULL for group key)
195     const struct mac_addr *addr;
196     /// Cipher
197     int cipher_suite;
198     /// Key index
199     int key_idx;
200     /// Key
201     const uint8_t *key;
202     /// Key length
203     int key_len;
204     /// Initial Sequence number
205     const uint8_t *seq;
206     /// Sequence number length
207     int seq_len;
208 };
209 
210 #ifdef CFG_SOFTAP
211 /// structure for CFGRWNX_AP_TX_MGMT
212 struct cfgrwnx_ap_tx_mgmt {
213     /// header
214     struct cfgrwnx_msg_hdr hdr;
215 
216     uint8_t *msg;
217 
218     uint16_t len;
219 
220     /// Index of the VIF for which the AP is started
221     uint8_t vif_idx;
222 
223     int sock;
224 };
225 /// structure for CFGRWNX_AP_STA_ADD
226 struct cfgrwnx_ap_sta_add {
227     /// header
228     struct cfgrwnx_msg_hdr hdr;
229     // Idx, at wifi task level, of the AP
230     uint32_t sta_idx;
231     /// MAC address of the station to be added
232     struct mac_addr mac_addr;
233     /// Supported legacy rates
234     struct mac_rateset rate_set;
235     /// HT Capabilities
236     struct mac_htcapability ht_cap;
237     /// VHT Capabilities
238     struct mac_vhtcapability vht_cap;
239     /// HE capabilities
240     struct mac_hecapability he_cap;
241     /// Flags giving additional information about the station
242     uint32_t flags;
243     /// Association ID of the station
244     uint16_t aid;
245     /// Bit field indicating which queues have U-APSD enabled
246     uint8_t uapsd_queues;
247     /// Maximum size, in frames, of a APSD service period
248     uint8_t max_sp_len;
249     /// Operation mode information (valid if bit @ref STA_OPMOD_NOTIF is
250     /// set in the flags)
251     uint8_t opmode;
252     /// Index of the VIF the station is attached to
253     uint8_t vif_idx;
254     /// Whether the station is a TDLS station
255     bool tdls_sta;
256     /// Whether the TDLS station is the TDLS link initiator
257     bool tdls_initiator;
258     /// Whether the TDLS Channel Switch is allowed
259     bool tdls_chsw_allowed;
260 
261     int sock;
262 };
263 /// structure for CFGRWNX_AP_STA_REMOVE
264 struct cfgrwnx_ap_sta_del {
265     /// header
266     struct cfgrwnx_msg_hdr hdr;
267     // Idx, at wifi task level, of the AP
268     uint32_t sta_idx;
269     /// Whether the station is a TDLS station
270     bool tdls_sta;
271 };
272 
273 #endif /* CFG_SOFTAP */
274 
275 /// SSID representation used by CFGRWNX_SCAN_CMD and CFGRWNX_CONNECT_CMD
276 struct cfgrwnx_scan_ssid {
277     /// SSID string
278     const uint8_t *ssid;
279     /// Length of the SSID string
280     size_t len;
281 };
282 
283 /// structure for CFGRWNX_SCAN_CMD
284 struct cfgrwnx_scan {
285     /// header
286     struct cfgrwnx_msg_hdr hdr;
287     /// Vif idx
288     int fhost_vif_idx;
289     /// SSID to scan
290     struct cfgrwnx_scan_ssid *ssids;
291     /// Number of SSID in ssids
292     int ssid_cnt;
293     /// Extra IE to add in the proce request
294     const uint8_t *extra_ies;
295     /// Size of the extra IEs
296     int extra_ies_len;
297     /// Array of frequencies to scan or %NULL for all frequencies.
298     /// The frequency is set in MHz. The array is zero-terminated.
299     int *freqs;
300     /// Do not use CCK mode
301     bool no_cck;
302     /// BSSID to scan, can be NULL for wildcard BSSID
303     const uint8_t *bssid;
304     /// Socket to use to send CFGRWNX events
305     int sock;
306 };
307 
308 /// structure for CFGRWNX_SCAN_DONE_EVENT
309 struct cfgrwnx_scan_completed {
310     /// header
311     struct cfgrwnx_msg_hdr hdr;
312     /// Status
313     uint32_t status;
314     /// Nb result available with CFGRWNX_SCAN_RESULTS_CMD
315     uint32_t result_cnt;
316 };
317 
318 /// structure for CFGRWNX_SCAN_RESULT_EVENT
319 struct cfgrwnx_scan_result {
320     /// header
321     struct cfgrwnx_msg_hdr hdr;
322     /// Vif idx
323     uint16_t fhost_vif_idx;
324     /// Frequency
325     uint16_t freq;
326     /// RSSI of the received frame (dBm).
327     int16_t rssi;
328     /// Length of the frame (beacon or probe resposne)
329     uint16_t length;
330     /// Frame payload. Must be freed (using rtos_free) when event has been processed
331     uint8_t *payload;
332 };
333 
334 /// structure for CFGRWNX_CONNECT_CMD
335 struct cfgrwnx_connect {
336     /// header
337     struct cfgrwnx_msg_hdr hdr;
338     /// BSSID tO connect to
339     const uint8_t *bssid;
340     /// SSID to connect to
341     struct cfgrwnx_scan_ssid ssid;
342     /// Channel of the AP
343     struct mac_chan_def chan;
344     /// Vif idx
345     uint16_t fhost_vif_idx;
346     /// Authentication Type
347     uint16_t auth_alg;
348     /// Connection flags
349     uint32_t flags;
350     /// Control port Ethertype
351     uint16_t ctrl_port_ethertype;
352     /// UAPSD queues (bit0: VO, bit1: VI, bit2: BK, bit3: BE). Set to 0xFFFF to use default config
353     uint16_t uapsd;
354     /// Length, in bytes, of the extra IE
355     uint32_t ie_len;
356     /// Extra IE to add to association request
357     const uint8_t *ie;
358     /// Socket to use to send CFGRWNX events
359     int sock;
360 };
361 
362 /// structure for CFGRWNX_CONNECT_EVENT
363 struct cfgrwnx_connect_event {
364     /// header
365     struct cfgrwnx_msg_hdr hdr;
366     /// BSSID
367     struct mac_addr bssid;
368     /// Sta idx
369     int sta_idx;
370     /// Status code of the connection procedure
371     uint16_t status_code;
372     /// Frequency of the operational channel in MHz
373     uint16_t freq;
374     /// Length of the AssocReq IEs (in bytes)
375     uint16_t assoc_req_ie_len;
376     /// Length of the AssocRsp IEs (in bytes)
377     uint16_t assoc_resp_ie_len;
378     /// AssocReq IEs (assoc_req_ie_len) followed by AssocRsp IEs (assoc_resp_ie_len)
379     /// Must be freed (using rtos_free) when event has been processed
380     uint8_t *req_resp_ies;
381 };
382 
383 /// structure for CFGRWNX_DISCONNECT_CMD
384 struct cfgrwnx_disconnect {
385     /// header
386     struct cfgrwnx_msg_hdr hdr;
387     /// Reason of the disconnection
388     uint16_t reason_code;
389     /// Vif idx
390     uint16_t fhost_vif_idx;
391 };
392 
393 /// structure for CFGRWNX_DISCONNECT_EVENT
394 struct cfgrwnx_disconnect_event {
395     /// header
396     struct cfgrwnx_msg_hdr hdr;
397     /// Reason of the disconnection
398     uint16_t reason_code;
399     /// Vif idx
400     uint16_t fhost_vif_idx;
401 };
402 
403 /// structure for CFGRWNX_CTRL_PORT_CMD
404 struct cfgrwnx_ctrl_port {
405     /// header
406     struct cfgrwnx_msg_hdr hdr;
407     /// VIF index
408     uint16_t fhost_vif_idx;
409     /// Address of the STA managed by the port (Needed only for AP interface)
410     struct mac_addr addr;
411     /// Port status
412     uint16_t authorized;
413 };
414 
415 /// structure for CFGRWNX_MIC_FAILURE_EVENT
416 struct cfgrwnx_mic_failure_event {
417     /// header
418     struct cfgrwnx_msg_hdr hdr;
419     /// Address of the sending STA
420     struct mac_addr addr;
421     /// Boolean indicating if the packet was a group or unicast one (true if group)
422     bool ga;
423     /// VIF index
424     uint16_t fhost_vif_idx;
425 };
426 
427 #ifdef CFG_SOFTAP
428 /// structure for CFGRWNX_AP_RX_MGMT
429 struct cfgrwnx_ap_rx_mgmt {
430     /// header
431     struct cfgrwnx_msg_hdr hdr;
432 
433     /// Vif idx
434     uint16_t fhost_vif_idx;
435 
436     uint16_t frame_len;
437 
438     /// Frame payload.
439     uint8_t *payload;
440 
441 };
442 
443 /// structure for CFGRWNX_AP_TX_STATUS
444 struct cfgrwnx_ap_tx_status {
445     /// header
446     struct cfgrwnx_msg_hdr hdr;
447     /// Vif idx
448     uint16_t fhost_vif_idx;
449     int32_t ack;
450 
451     uint16_t type;
452     uint16_t stype;
453     uint8_t dst[MAC_ADDR_LEN];
454     uint16_t data_len;
455     uint8_t *data;
456 };
457 #endif /* CFG_SOFTAP */
458 
459 /// Structure for @ref CFGRWNX_SYS_STATS_RESP
460 struct cfgrwnx_sys_stats_resp {
461     /// header
462     struct cfgrwnx_msg_hdr hdr;
463     /// Statistics
464     struct dbg_get_sys_stat_cfm stats;
465 };
466 
467 /// Structure for CFGRWNX_SCAN_RESULTS_CMD
468 struct cfgrwnx_scan_results {
469     /// header
470     struct cfgrwnx_msg_hdr hdr;
471     /// index of the scan result element
472     uint16_t idx;
473 };
474 
475 /// Structure for CFGRWNX_SCAN_RESULTS_RESP
476 struct cfgrwnx_scan_results_resp {
477     /// header
478     struct cfgrwnx_msg_hdr hdr;
479     /// scan results
480     struct mac_scan_result scan_result;
481     /// Status
482     uint32_t status;
483 };
484 
485 /// Structure for @ref CFGRWNX_LIST_FEATURES_RESP
486 struct cfgrwnx_list_features_resp {
487     /// header
488     struct cfgrwnx_msg_hdr hdr;
489     /// structure containing FW/PHY features
490     struct mm_version_cfm version;
491 };
492 
493 /// Structure for @ref CFGRWNX_SET_VIF_TYPE_CMD
494 struct cfgrwnx_set_vif_type {
495     /// header
496     struct cfgrwnx_msg_hdr hdr;
497     /// Index of the FHOST vif
498     int fhost_vif_idx;
499     /// Type to set on the interface
500     enum mac_vif_type type;
501     /// Is a P2P vif (only read if type is VIF_STA or VIF_AP)
502     bool p2p;
503 };
504 
505 /// Structure for CFGRWNX_MONITOR_CFG_CMD
506 struct cfgrwnx_monitor_cfg {
507     /// header
508     struct cfgrwnx_msg_hdr hdr;
509     /// Vif idx
510     uint16_t fhost_vif_idx;
511     /// Interface configuration
512     struct fhost_vif_monitor_cfg cfg;
513 };
514 
515 /// Structure for CFGRWNX_RX_MGMT_EVENT
516 struct cfgrwnx_rx_mgmt_event {
517     /// header
518     struct cfgrwnx_msg_hdr hdr;
519     /// Vif idx
520     uint16_t fhost_vif_idx;
521     /// Frequency
522     uint16_t freq;
523     /// RSSI of the received frame (dBm).
524     int16_t rssi;
525     /// Length of the frame
526     uint16_t length;
527     /// Frame payload.
528     uint8_t *payload;
529 };
530 
531 /// Structure for CFGRWNX_TX_STATUS_EVENT
532 struct cfgrwnx_tx_status_event {
533     /// header
534     struct cfgrwnx_msg_hdr hdr;
535     /// Frame data
536     const uint8_t *data;
537     /// Frame length
538     uint32_t data_len;
539     /// TX status
540     bool acknowledged;
541 };
542 
543 /// Structure for CFGRWNX_EXTERNAL_AUTH_EVENT
544 struct cfgrwnx_external_auth_event {
545     /// header
546     struct cfgrwnx_msg_hdr hdr;
547     /// Vif idx
548     uint16_t fhost_vif_idx;
549     /// BSSID
550     struct mac_addr bssid;
551     /// SSID
552     struct mac_ssid ssid;
553     /// AKM
554     uint32_t akm;
555 };
556 
557 /// Structure for CFGRWNX_EXTERNAL_AUTH_STATUS_RESP
558 struct cfgrwnx_external_auth_status {
559     /// header
560     struct cfgrwnx_msg_hdr hdr;
561     /// Vif idx
562     uint16_t fhost_vif_idx;
563     /// Authentication status
564     uint16_t status;
565 };
566 
567 /// Structure for CFGRWNX_START_AP_CMD
568 struct cfgrwnx_start_ap {
569     /// header
570     struct cfgrwnx_msg_hdr hdr;
571     /// Vif idx
572     uint16_t fhost_vif_idx;
573     /// Basic rates
574     struct mac_rateset basic_rates;
575     /// Operating Channel for the AP
576     struct mac_chan_op chan;
577     /// Buffer containing the Beacon
578     uint8_t *bcn;
579     /// Size, in bytes, of the Beacon buffer
580     int bcn_len;
581     /// Offset within the beacon of the TIM element (in bytes)
582     int tim_oft;
583     /// Size, in bytes, of the TIM element
584     int tim_len;
585     /// Beacon interval in TU
586     int bcn_int;
587     /// AP flags (@see mac_connection_flags)
588     int flags;
589     /// Port number for ethernet authentication frame
590     uint16_t ctrl_ethertype;
591     /// CFGRWNX event socket (socket to upload CFGRWNX event)
592     int sock;
593 };
594 
595 /// Structure for CFGRWNX_STOP_AP_CMD
596 struct cfgrwnx_stop_ap {
597     /// header
598     struct cfgrwnx_msg_hdr hdr;
599     /// Vif idx
600     uint16_t fhost_vif_idx;
601 };
602 
603 /// Structure for CFGRWNX_CH_SWITCH_EVENT
604 struct cfgrwnx_ch_switch_event {
605     /// header
606     struct cfgrwnx_msg_hdr hdr;
607     int freq;
608     int ht_enabled;
609     int ch_offset;
610     uint16_t ch_width; //enum chan_width
611     int cf1;
612     int cf2;
613 
614 };
615 
616 /// Structure for CFGRWNX_SET_EDCA_CMD
617 struct cfgrwnx_set_edca {
618     /// header
619     struct cfgrwnx_msg_hdr hdr;
620     /// Vif idx
621     uint16_t fhost_vif_idx;
622     /// Access Category index
623     uint8_t aci;
624     /// Arbitration InterFrame Space Number
625     uint8_t aifsn;
626     /// Contention Window minimum
627     uint16_t cwmin;
628     /// Contention Window maximum
629     uint16_t cwmax;
630     /// TXOP (in unit of 32us)
631     uint16_t txop;
632 };
633 
634 /// Structure for CFGRWNX_BCN_UPDATE_CMD
635 struct cfgrwnx_bcn_update {
636     /// header
637     struct cfgrwnx_msg_hdr hdr;
638     /// Vif idx
639     uint16_t fhost_vif_idx;
640     /// Buffer containing the Beacon
641     uint8_t *bcn;
642     /// Size, in bytes, of the Beacon buffer
643     int bcn_len;
644     /// Offset within the beacon of the TIM element (in bytes)
645     int tim_oft;
646     /// Size, in bytes, of the TIM element
647     int tim_len;
648     /// CSA
649     uint8_t csa_oft[BCN_MAX_CSA_CPT];
650 };
651 
652 /// Structure for CFGRWNX_STA_ADD_CMD
653 struct cfgrwnx_sta_add {
654     /// header
655     struct cfgrwnx_msg_hdr hdr;
656     /// Vif idx
657     uint16_t fhost_vif_idx;
658     /// Association ID of the station
659     uint16_t aid;
660     /// MAC address of the station to be added
661     const struct mac_addr *addr;
662     /// Supported legacy rates
663     struct mac_rateset rate_set;
664     /// HT Capabilities
665     struct mac_htcapability ht_cap;
666     /// VHT Capabilities
667     struct mac_vhtcapability vht_cap;
668     /// HE capabilities
669     struct mac_hecapability he_cap;
670     /// STA flags (@ref mac_sta_flags)
671     uint32_t flags;
672     /// Bit field indicating which queues have U-APSD enabled
673     uint8_t uapsd_queues;
674     /// Maximum size, in frames, of a APSD service period
675     uint8_t max_sp_len;
676     /// Operation mode information (valid if bit @ref STA_OPMOD_NOTIF is
677     /// set in the flags)
678     uint8_t opmode;
679 };
680 
681 /// Structure for CFGRWNX_STA_REMOVE_CMD
682 struct cfgrwnx_sta_remove {
683     /// header
684     struct cfgrwnx_msg_hdr hdr;
685     /// Vif idx
686     uint16_t fhost_vif_idx;
687     /// MAC address of the station
688     const struct mac_addr *addr;
689 };
690 
691 /// structure for CFGRWNX_KEY_SEQNUM_CMD
692 struct cfgrwnx_key_seqnum {
693     /// header
694     struct cfgrwnx_msg_hdr hdr;
695     /// Vif idx
696     uint16_t fhost_vif_idx;
697     /// MAC address of the station (null for group key)
698     const struct mac_addr *addr;
699     /// Key index
700     uint16_t key_idx;
701 };
702 
703 /// structure for CFGRWNX_KEY_SEQNUM_RESP
704 struct cfgrwnx_key_seqnum_resp {
705     /// header
706     struct cfgrwnx_msg_hdr hdr;
707     /// Status
708     uint32_t status;
709     /// Seq num
710     uint64_t seqnum;
711 };
712 
713 /// structure for CFGRWNX_SET_PS_MODE_CMD
714 struct cfgrwnx_set_ps_mode {
715     /// header
716     struct cfgrwnx_msg_hdr hdr;
717     /// Vif idx
718     uint16_t fhost_vif_idx;
719     /// PS mode status
720     bool enabled;
721 };
722 
723 #endif // _WIFI_CFG_NX_H
724