• 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_LMAC_MSG_H
16 #define _WIFI_LMAC_MSG_H
17 
18 // for MAC related elements (mac_addr, mac_ssid...)
19 #include "wifi_types.h"
20 #include "wifi_mac.h"
21 #include "wb_co_math.h"
22 
23 /* Task identifiers for communication between LMAC and DRIVER */
24 enum
25 {
26     TASK_NONE = (u8_l) -1,
27 
28     // MAC Management task.
29     TASK_MM = 0,
30     // DEBUG task
31     TASK_DBG,   // 1
32     /// SCAN task
33     TASK_SCAN,  // 2
34     /// TDLS task
35     TASK_TDLS,  // 3
36     /// SCANU task
37     TASK_SCANU, // 4
38     /// ME task
39     TASK_ME,    // 5
40     /// SM task
41     TASK_SM,    // 6
42     /// APM task
43     TASK_APM,   // 7
44     /// BAM task
45     TASK_BAM,   // 8
46     /// MESH task
47     TASK_MESH,  // 9
48     /// RXU task
49     TASK_RXU,   // 10
50     // This is used to define the last task that is running on the EMB processor
51     TASK_LAST_EMB = TASK_RXU,
52     // nX API task
53     TASK_API,   // 11
54     TASK_MAX,
55 };
56 
57 
58 /// For MAC HW States copied from "hal_machw.h"
59 enum
60 {
61     /// MAC HW IDLE State.
62     HW_IDLE = 0,
63     /// MAC HW RESERVED State.
64     HW_RESERVED,
65     /// MAC HW DOZE State.
66     HW_DOZE,
67     /// MAC HW ACTIVE State.
68     HW_ACTIVE
69 };
70 
71 /// Power Save mode setting
72 enum mm_ps_mode_state
73 {
74     MM_PS_MODE_OFF,
75     MM_PS_MODE_ON,
76     MM_PS_MODE_ON_DYN,
77 };
78 
79 /// Status/error codes used in the MAC software.
80 enum
81 {
82     CO_OK,
83     CO_FAIL,
84     CO_EMPTY,
85     CO_FULL,
86     CO_BAD_PARAM,
87     CO_NOT_FOUND,
88     CO_NO_MORE_ELT_AVAILABLE,
89     CO_NO_ELT_IN_USE,
90     CO_BUSY,
91     CO_OP_IN_PROGRESS,
92 };
93 
94 /// Remain on channel operation codes
95 enum mm_remain_on_channel_op
96 {
97     MM_ROC_OP_START = 0,
98     MM_ROC_OP_CANCEL,
99 };
100 
101 #define DRV_TASK_ID 100
102 
103 /// Message Identifier. The number of messages is limited to 0xFFFF.
104 /// The message ID is divided in two parts:
105 /// - bits[15..10] : task index (no more than 64 tasks supported).
106 /// - bits[9..0] : message index (no more that 1024 messages per task).
107 typedef uint16_t lmac_msg_id_t;
108 
109 typedef uint16_t lmac_task_id_t;
110 
111 /// Build the first message ID of a task.
112 #define LMAC_FIRST_MSG(task) ((lmac_msg_id_t)((task) << 10))
113 
114 #define MSG_T(msg) ((lmac_task_id_t)((msg) >> 10))
115 #define MSG_I(msg) ((msg) & ((1<<10)-1))
116 
117 /// Message structure.
118 struct lmac_msg
119 {
120     lmac_msg_id_t     id;         ///< Message id.
121     lmac_task_id_t    dest_id;    ///< Destination kernel identifier.
122     lmac_task_id_t    src_id;     ///< Source kernel identifier.
123     uint16_t        param_len;  ///< Parameter embedded struct length.
124     uint32_t        param[];   ///< Parameter embedded struct. Must be word-aligned.
125 };
126 
127 /// List of messages related to the task.
128 enum mm_msg_tag
129 {
130     /// RESET Request.
131     MM_RESET_REQ = LMAC_FIRST_MSG(TASK_MM),
132     /// RESET Confirmation.
133     MM_RESET_CFM,
134     /// START Request.
135     MM_START_REQ,
136     /// START Confirmation.
137     MM_START_CFM,
138     /// Read Version Request.
139     MM_VERSION_REQ,
140     /// Read Version Confirmation.
141     MM_VERSION_CFM,
142     /// ADD INTERFACE Request.
143     MM_ADD_IF_REQ,
144     /// ADD INTERFACE Confirmation.
145     MM_ADD_IF_CFM,
146     /// REMOVE INTERFACE Request.
147     MM_REMOVE_IF_REQ,
148     /// REMOVE INTERFACE Confirmation.
149     MM_REMOVE_IF_CFM,
150     /// STA ADD Request.
151     MM_STA_ADD_REQ,                                                         // 10
152     /// STA ADD Confirm.
153     MM_STA_ADD_CFM,
154     /// STA DEL Request.
155     MM_STA_DEL_REQ,
156     /// STA DEL Confirm.
157     MM_STA_DEL_CFM,
158     /// RX FILTER CONFIGURATION Request.
159     MM_SET_FILTER_REQ,
160     /// RX FILTER CONFIGURATION Confirmation.
161     MM_SET_FILTER_CFM,
162     /// CHANNEL CONFIGURATION Request.
163     MM_SET_CHANNEL_REQ,
164     /// CHANNEL CONFIGURATION Confirmation.
165     MM_SET_CHANNEL_CFM,
166     /// DTIM PERIOD CONFIGURATION Request.
167     MM_SET_DTIM_REQ,
168     /// DTIM PERIOD CONFIGURATION Confirmation.
169     MM_SET_DTIM_CFM,
170     /// BEACON INTERVAL CONFIGURATION Request.
171     MM_SET_BEACON_INT_REQ,                                                  //20
172     /// BEACON INTERVAL CONFIGURATION Confirmation.
173     MM_SET_BEACON_INT_CFM,
174     /// BASIC RATES CONFIGURATION Request.
175     MM_SET_BASIC_RATES_REQ,
176     /// BASIC RATES CONFIGURATION Confirmation.
177     MM_SET_BASIC_RATES_CFM,
178     /// BSSID CONFIGURATION Request.
179     MM_SET_BSSID_REQ,
180     /// BSSID CONFIGURATION Confirmation.
181     MM_SET_BSSID_CFM,
182     /// EDCA PARAMETERS CONFIGURATION Request.
183     MM_SET_EDCA_REQ,
184     /// EDCA PARAMETERS CONFIGURATION Confirmation.
185     MM_SET_EDCA_CFM,
186     /// ABGN MODE CONFIGURATION Request.
187     MM_SET_MODE_REQ,
188     /// ABGN MODE CONFIGURATION Confirmation.
189     MM_SET_MODE_CFM,
190     /// Request setting the VIF active state (i.e associated or AP started)
191     MM_SET_VIF_STATE_REQ,                                                   // 30
192     /// Confirmation of the @ref MM_SET_VIF_STATE_REQ message.
193     MM_SET_VIF_STATE_CFM,
194     /// SLOT TIME PARAMETERS CONFIGURATION Request.
195     MM_SET_SLOTTIME_REQ,
196     /// SLOT TIME PARAMETERS CONFIGURATION Confirmation.
197     MM_SET_SLOTTIME_CFM,
198     /// Power Mode Change Request.
199     MM_SET_IDLE_REQ,
200     /// Power Mode Change Confirm.
201     MM_SET_IDLE_CFM,
202     /// KEY ADD Request.
203     MM_KEY_ADD_REQ,
204     /// KEY ADD Confirm.
205     MM_KEY_ADD_CFM,
206     /// KEY DEL Request.
207     MM_KEY_DEL_REQ,
208     /// KEY DEL Confirm.
209     MM_KEY_DEL_CFM,
210     /// Block Ack agreement info addition
211     MM_BA_ADD_REQ,                                                          //40
212     /// Block Ack agreement info addition confirmation
213     MM_BA_ADD_CFM,
214     /// Block Ack agreement info deletion
215     MM_BA_DEL_REQ,
216     /// Block Ack agreement info deletion confirmation
217     MM_BA_DEL_CFM,
218     /// Indication of the primary TBTT to the upper MAC. Upon the reception of this
219     // message the upper MAC has to push the beacon(s) to the beacon transmission queue.
220     MM_PRIMARY_TBTT_IND,
221     /// Indication of the secondary TBTT to the upper MAC. Upon the reception of this
222     // message the upper MAC has to push the beacon(s) to the beacon transmission queue.
223     MM_SECONDARY_TBTT_IND,
224     /// Request for changing the TX power
225     MM_SET_POWER_REQ,
226     /// Confirmation of the TX power change
227     MM_SET_POWER_CFM,
228     /// Request to the LMAC to trigger the embedded logic analyzer and forward the debug
229     /// dump.
230     MM_DBG_TRIGGER_REQ,
231     /// Set Power Save mode
232     MM_SET_PS_MODE_REQ,
233     /// Set Power Save mode confirmation
234     MM_SET_PS_MODE_CFM,                                                     // 50
235     /// Request to add a channel context
236     MM_CHAN_CTXT_ADD_REQ,
237     /// Confirmation of the channel context addition
238     MM_CHAN_CTXT_ADD_CFM,
239     /// Request to delete a channel context
240     MM_CHAN_CTXT_DEL_REQ,
241     /// Confirmation of the channel context deletion
242     MM_CHAN_CTXT_DEL_CFM,
243     /// Request to link a channel context to a VIF
244     MM_CHAN_CTXT_LINK_REQ,
245     /// Confirmation of the channel context link
246     MM_CHAN_CTXT_LINK_CFM,
247     /// Request to unlink a channel context from a VIF
248     MM_CHAN_CTXT_UNLINK_REQ,
249     /// Confirmation of the channel context unlink
250     MM_CHAN_CTXT_UNLINK_CFM,
251     /// Request to update a channel context
252     MM_CHAN_CTXT_UPDATE_REQ,
253     /// Confirmation of the channel context update
254     MM_CHAN_CTXT_UPDATE_CFM,                                                // 60
255     /// Request to schedule a channel context
256     MM_CHAN_CTXT_SCHED_REQ,
257     /// Confirmation of the channel context scheduling
258     MM_CHAN_CTXT_SCHED_CFM,
259     /// Request to change the beacon template in LMAC
260     MM_BCN_CHANGE_REQ,
261     /// Confirmation of the beacon change
262     MM_BCN_CHANGE_CFM,
263     /// Request to update the TIM in the beacon (i.e to indicate traffic bufferized at AP)
264     MM_TIM_UPDATE_REQ,
265     /// Confirmation of the TIM update
266     MM_TIM_UPDATE_CFM,
267     /// Connection loss indication
268     MM_CONNECTION_LOSS_IND,
269     /// Channel context switch indication to the upper layers
270     MM_CHANNEL_SWITCH_IND,
271     /// Channel context pre-switch indication to the upper layers
272     MM_CHANNEL_PRE_SWITCH_IND,
273     /// Request to remain on channel or cancel remain on channel
274     MM_REMAIN_ON_CHANNEL_REQ,                                               // 70
275     /// Confirmation of the (cancel) remain on channel request
276     MM_REMAIN_ON_CHANNEL_CFM,
277     /// Remain on channel expired indication
278     MM_REMAIN_ON_CHANNEL_EXP_IND,
279     /// Indication of a PS state change of a peer device
280     MM_PS_CHANGE_IND,
281     /// Indication that some buffered traffic should be sent to the peer device
282     MM_TRAFFIC_REQ_IND,
283     /// Request to modify the STA Power-save mode options
284     MM_SET_PS_OPTIONS_REQ,
285     /// Confirmation of the PS options setting
286     MM_SET_PS_OPTIONS_CFM,
287     /// Indication of PS state change for a P2P VIF
288     MM_P2P_VIF_PS_CHANGE_IND,
289     /// Indication that CSA counter has been updated
290     MM_CSA_COUNTER_IND,
291     /// Channel occupation report indication
292     MM_CHANNEL_SURVEY_IND,
293     /// Message containing Beamformer Information
294     MM_BFMER_ENABLE_REQ,                                                    // 80
295     /// Request to Start/Stop/Update NOA - GO Only
296     MM_SET_P2P_NOA_REQ,
297     /// Request to Start/Stop/Update Opportunistic PS - GO Only
298     MM_SET_P2P_OPPPS_REQ,
299     /// Start/Stop/Update NOA Confirmation
300     MM_SET_P2P_NOA_CFM,
301     /// Start/Stop/Update Opportunistic PS Confirmation
302     MM_SET_P2P_OPPPS_CFM,
303     /// P2P NoA Update Indication - GO Only
304     MM_P2P_NOA_UPD_IND,
305     /// Request to set RSSI threshold and RSSI hysteresis
306     MM_CFG_RSSI_REQ,
307     /// Indication that RSSI level is below or above the threshold
308     MM_RSSI_STATUS_IND,
309     /// Indication that CSA is done
310     MM_CSA_FINISH_IND,
311     /// Indication that CSA is in prorgess (resp. done) and traffic must be stopped (resp. restarted)
312     MM_CSA_TRAFFIC_IND,
313     /// Request to update the group information of a station
314     MM_MU_GROUP_UPDATE_REQ,                                                 // 90
315     /// Confirmation of the @ref MM_MU_GROUP_UPDATE_REQ message
316     MM_MU_GROUP_UPDATE_CFM,
317     /// Request to initialize the antenna diversity algorithm
318     MM_ANT_DIV_INIT_REQ,
319     /// Request to stop the antenna diversity algorithm
320     MM_ANT_DIV_STOP_REQ,
321     /// Request to update the antenna switch status
322     MM_ANT_DIV_UPDATE_REQ,
323     /// Request to switch the antenna connected to path_0
324     MM_SWITCH_ANTENNA_REQ,
325     /// Indication that a packet loss has occurred
326     MM_PKTLOSS_IND,
327 
328     MM_SET_ARPOFFLOAD_REQ, //add by cs
329     MM_SET_ARPOFFLOAD_CFM, //add by cs
330     MM_SET_AGG_DISABLE_REQ, //add by cs
331     MM_SET_AGG_DISABLE_CFM, //add by cs                                    // 100
332     MM_SET_COEX_REQ, //add by cs
333     MM_SET_COEX_CFM, //add by cs
334     MM_SET_RF_CONFIG_REQ, //add by cs
335     MM_SET_RF_CONFIG_CFM, //add by cs
336     MM_SET_RF_CALIB_REQ, //add by cs
337     MM_SET_RF_CALIB_CFM, //add by cs
338 
339     /// MU EDCA PARAMETERS Configuration Request.
340     MM_SET_MU_EDCA_REQ,
341     /// MU EDCA PARAMETERS Configuration Confirmation.
342     MM_SET_MU_EDCA_CFM,
343     /// UORA PARAMETERS Configuration Request.
344     MM_SET_UORA_REQ,
345     /// UORA PARAMETERS Configuration Confirmation.
346     MM_SET_UORA_CFM,
347     /// TXOP RTS THRESHOLD Configuration Request.
348     MM_SET_TXOP_RTS_THRES_REQ,
349     /// TXOP RTS THRESHOLD Configuration Confirmation.
350     MM_SET_TXOP_RTS_THRES_CFM,
351     /// HE BSS Color Configuration Request.
352     MM_SET_BSS_COLOR_REQ,
353     /// HE BSS Color Configuration Confirmation.
354     MM_SET_BSS_COLOR_CFM,                                                   // 110
355 
356     MM_GET_MAC_ADDR_REQ,
357     MM_GET_MAC_ADDR_CFM,
358     MM_GET_STA_TXINFO_REQ,
359     MM_GET_STA_TXINFO_CFM,
360 
361     /// MAX number of messages
362     MM_MAX,
363 };
364 
365 /// Interface types
366 enum
367 {
368     /// ESS STA interface
369     MM_STA,
370     /// IBSS STA interface
371     MM_IBSS,
372     /// AP interface
373     MM_AP,
374     // Mesh Point interface
375     MM_MESH_POINT,
376     // Monitor interface
377     MM_MONITOR,
378 };
379 
380 ///BA agreement types
381 enum
382 {
383     ///BlockAck agreement for TX
384     BA_AGMT_TX,
385     ///BlockAck agreement for RX
386     BA_AGMT_RX,
387 };
388 
389 ///BA agreement related status
390 enum
391 {
392     ///Correct BA agreement establishment
393     BA_AGMT_ESTABLISHED,
394     ///BA agreement already exists for STA+TID requested, cannot override it (should have been deleted first)
395     BA_AGMT_ALREADY_EXISTS,
396     ///Correct BA agreement deletion
397     BA_AGMT_DELETED,
398     ///BA agreement for the (STA, TID) doesn't exist so nothing to delete
399     BA_AGMT_DOESNT_EXIST,
400 };
401 
402 /// Features supported by LMAC - Positions
403 enum mm_features
404 {
405     /// Beaconing
406     MM_FEAT_BCN_BIT         = 0,
407     /// Autonomous Beacon Transmission
408     MM_FEAT_AUTOBCN_BIT,
409     /// Scan in LMAC
410     MM_FEAT_HWSCAN_BIT,
411     /// Connection Monitoring
412     MM_FEAT_CMON_BIT,
413     /// Multi Role
414     MM_FEAT_MROLE_BIT,
415     /// Radar Detection
416     MM_FEAT_RADAR_BIT,
417     /// Power Save
418     MM_FEAT_PS_BIT,
419     /// UAPSD
420     MM_FEAT_UAPSD_BIT,
421     /// DPSM
422     MM_FEAT_DPSM_BIT,
423     /// A-MPDU
424     MM_FEAT_AMPDU_BIT,
425     /// A-MSDU
426     MM_FEAT_AMSDU_BIT,
427     /// Channel Context
428     MM_FEAT_CHNL_CTXT_BIT,
429     /// Packet reordering
430     MM_FEAT_REORD_BIT,
431     /// P2P
432     MM_FEAT_P2P_BIT,
433     /// P2P Go
434     MM_FEAT_P2P_GO_BIT,
435     /// UMAC Present
436     MM_FEAT_UMAC_BIT,
437     /// VHT support
438     MM_FEAT_VHT_BIT,
439     /// Beamformee
440     MM_FEAT_BFMEE_BIT,
441     /// Beamformer
442     MM_FEAT_BFMER_BIT,
443     /// WAPI
444     MM_FEAT_WAPI_BIT,
445     /// MFP
446     MM_FEAT_MFP_BIT,
447     /// Mu-MIMO RX support
448     MM_FEAT_MU_MIMO_RX_BIT,
449     /// Mu-MIMO TX support
450     MM_FEAT_MU_MIMO_TX_BIT,
451     /// Wireless Mesh Networking
452     MM_FEAT_MESH_BIT,
453     /// TDLS support
454     MM_FEAT_TDLS_BIT,
455     /// Antenna Diversity support
456     MM_FEAT_ANT_DIV_BIT,
457     /// UF support
458     MM_FEAT_UF_BIT,
459     /// A-MSDU maximum size (bit0)
460     MM_AMSDU_MAX_SIZE_BIT0,
461     /// A-MSDU maximum size (bit1)
462     MM_AMSDU_MAX_SIZE_BIT1,
463     /// MON_DATA support
464     MM_FEAT_MON_DATA_BIT,
465     /// HE (802.11ax) support
466     MM_FEAT_HE_BIT,
467 };
468 
469 /// Maximum number of words in the configuration buffer
470 #define PHY_CFG_BUF_SIZE     16
471 
472 /// Structure containing the parameters of the PHY configuration
473 struct phy_cfg_tag
474 {
475     /// Buffer containing the parameters specific for the PHY used
476     uint32_t parameters[PHY_CFG_BUF_SIZE];
477 };
478 
479 /// Structure containing the parameters of the Trident PHY configuration
480 struct phy_trd_cfg_tag
481 {
482     /// MDM type(nxm)(upper nibble) and MDM2RF path mapping(lower nibble)
483     u8_l path_mapping;
484     /// TX DC offset compensation
485     uint32_t tx_dc_off_comp;
486 };
487 
488 /// Structure containing the parameters of the Karst PHY configuration
489 struct phy_karst_cfg_tag
490 {
491     /// TX IQ mismatch compensation in 2.4GHz
492     uint32_t tx_iq_comp_2_4G[2];
493     /// RX IQ mismatch compensation in 2.4GHz
494     uint32_t rx_iq_comp_2_4G[2];
495     /// TX IQ mismatch compensation in 5GHz
496     uint32_t tx_iq_comp_5G[2];
497     /// RX IQ mismatch compensation in 5GHz
498     uint32_t rx_iq_comp_5G[2];
499     /// RF path used by default (0 or 1)
500     u8_l path_used;
501 };
502 
503 /// Structure containing the parameters of the @ref MM_START_REQ message
504 struct mm_start_req
505 {
506     /// PHY configuration
507     struct phy_cfg_tag phy_cfg;
508     /// UAPSD timeout
509     uint32_t uapsd_timeout;
510     /// Local LP clock accuracy (in ppm)
511     u16_l lp_clk_accuracy;
512 };
513 
514 /// Structure containing the parameters of the @ref MM_SET_CHANNEL_REQ message
515 struct mm_set_channel_req
516 {
517     /// Channel information
518     struct mac_chan_op chan;
519     /// Index of the RF for which the channel has to be set (0: operating (primary), 1: secondary
520     /// RF (used for additional radar detection). This parameter is reserved if no secondary RF
521     /// is available in the system
522     u8_l index;
523 };
524 
525 /// Structure containing the parameters of the @ref MM_SET_CHANNEL_CFM message
526 struct mm_set_channel_cfm
527 {
528     /// Radio index to be used in policy table
529     u8_l radio_idx;
530     /// TX power configured (in dBm)
531     s8_l power;
532 };
533 
534 /// Structure containing the parameters of the @ref MM_SET_DTIM_REQ message
535 struct mm_set_dtim_req
536 {
537     /// DTIM period
538     u8_l dtim_period;
539 };
540 
541 /// Structure containing the parameters of the @ref MM_SET_POWER_REQ message
542 struct mm_set_power_req
543 {
544     /// Index of the interface for which the parameter is configured
545     u8_l inst_nbr;
546     /// TX power (in dBm)
547     s8_l power;
548 };
549 
550 /// Structure containing the parameters of the @ref MM_SET_POWER_CFM message
551 struct mm_set_power_cfm
552 {
553     /// Radio index to be used in policy table
554     u8_l radio_idx;
555     /// TX power configured (in dBm)
556     s8_l power;
557 };
558 
559 /// Structure containing the parameters of the @ref MM_SET_BEACON_INT_REQ message
560 struct mm_set_beacon_int_req
561 {
562     /// Beacon interval
563     u16_l beacon_int;
564     /// Index of the interface for which the parameter is configured
565     u8_l inst_nbr;
566 };
567 
568 /// Structure containing the parameters of the @ref MM_SET_BASIC_RATES_REQ message
569 struct mm_set_basic_rates_req
570 {
571     /// Basic rate set (as expected by bssBasicRateSet field of Rates MAC HW register)
572     uint32_t rates;
573     /// Index of the interface for which the parameter is configured
574     u8_l inst_nbr;
575     /// Band on which the interface will operate
576     u8_l band;
577 };
578 
579 /// Structure containing the parameters of the @ref MM_SET_BSSID_REQ message
580 struct mm_set_bssid_req
581 {
582     /// BSSID to be configured in HW
583     struct mac_addr bssid;
584     /// Index of the interface for which the parameter is configured
585     u8_l inst_nbr;
586 };
587 
588 /// Structure containing the parameters of the @ref MM_SET_FILTER_REQ message
589 struct mm_set_filter_req
590 {
591     /// RX filter to be put into rxCntrlReg HW register
592     uint32_t filter;
593 };
594 
595 /// Structure containing the parameters of the @ref MM_ADD_IF_REQ message.
596 struct mm_add_if_req
597 {
598     /// Type of the interface (AP, STA, ADHOC, ...)
599     u8_l type;
600     /// MAC ADDR of the interface to start
601     struct mac_addr addr;
602     /// P2P Interface
603     bool_l p2p;
604 };
605 
606 /// Structure containing the parameters of the @ref MM_SET_EDCA_REQ message
607 struct mm_set_edca_req
608 {
609     /// EDCA parameters of the queue (as expected by edcaACxReg HW register)
610     uint32_t ac_param;
611     /// Flag indicating if UAPSD can be used on this queue
612     bool_l uapsd;
613     /// HW queue for which the parameters are configured
614     u8_l hw_queue;
615     /// Index of the interface for which the parameters are configured
616     u8_l inst_nbr;
617 };
618 
619 /// Structure containing the parameters of the @ref MM_SET_MU_EDCA_REQ message
620 struct mm_set_mu_edca_req
621 {
622     /// MU EDCA parameters of the different HE queues
623     u32_l param[AC_MAX];
624 };
625 
626 /// Structure containing the parameters of the @ref MM_SET_UORA_REQ message
627 struct mm_set_uora_req
628 {
629     /// Minimum exponent of OFDMA Contention Window.
630     u8_l eocw_min;
631     /// Maximum exponent of OFDMA Contention Window.
632     u8_l eocw_max;
633 };
634 
635 /// Structure containing the parameters of the @ref MM_SET_TXOP_RTS_THRES_REQ message
636 struct mm_set_txop_rts_thres_req
637 {
638     /// TXOP RTS threshold
639     u16_l txop_dur_rts_thres;
640     /// Index of the interface for which the parameter is configured
641     u8_l inst_nbr;
642 };
643 
644 /// Structure containing the parameters of the @ref MM_SET_BSS_COLOR_REQ message
645 struct mm_set_bss_color_req
646 {
647     /// HE BSS color, formatted as per BSS_COLOR MAC HW register
648     u32_l bss_color;
649 };
650 
651 struct mm_set_idle_req
652 {
653     u8_l hw_idle;
654 };
655 
656 /// Structure containing the parameters of the @ref MM_SET_SLOTTIME_REQ message
657 struct mm_set_slottime_req
658 {
659     /// Slot time expressed in us
660     u8_l slottime;
661 };
662 
663 /// Structure containing the parameters of the @ref MM_SET_MODE_REQ message
664 struct mm_set_mode_req
665 {
666     /// abgnMode field of macCntrl1Reg register
667     u8_l abgnmode;
668 };
669 
670 /// Structure containing the parameters of the @ref MM_SET_VIF_STATE_REQ message
671 struct mm_set_vif_state_req
672 {
673     /// Association Id received from the AP (valid only if the VIF is of STA type)
674     u16_l aid;
675     /// Flag indicating if the VIF is active or not
676     bool_l active;
677     /// Interface index
678     u8_l inst_nbr;
679 };
680 
681 /// Structure containing the parameters of the @ref MM_ADD_IF_CFM message.
682 struct mm_add_if_cfm
683 {
684     /// Status of operation (different from 0 if unsuccessful)
685     u8_l status;
686     /// Interface index assigned by the LMAC
687     u8_l inst_nbr;
688 };
689 
690 /// Structure containing the parameters of the @ref MM_REMOVE_IF_REQ message.
691 struct mm_remove_if_req
692 {
693     /// Interface index assigned by the LMAC
694     u8_l inst_nbr;
695 };
696 
697 /// Structure containing the parameters of the @ref MM_VERSION_CFM message.
698 struct mm_version_cfm
699 {
700     /// Version of the LMAC FW
701     uint32_t version_lmac;
702     /// Version1 of the MAC HW (as encoded in version1Reg MAC HW register)
703     uint32_t version_machw_1;
704     /// Version2 of the MAC HW (as encoded in version2Reg MAC HW register)
705     uint32_t version_machw_2;
706     /// Version1 of the PHY (depends on actual PHY)
707     uint32_t version_phy_1;
708     /// Version2 of the PHY (depends on actual PHY)
709     uint32_t version_phy_2;
710     /// Supported Features
711     uint32_t features;
712     /// Maximum number of supported stations
713     u16_l max_sta_nb;
714     /// Maximum number of supported virtual interfaces
715     u8_l max_vif_nb;
716 };
717 
718 /// Structure containing the parameters of the @ref MM_STA_ADD_REQ message.
719 struct mm_sta_add_req
720 {
721     /// Maximum A-MPDU size, in bytes, for HE frames
722     uint32_t ampdu_size_max_he;
723     /// Maximum A-MPDU size, in bytes, for VHT frames
724     uint32_t ampdu_size_max_vht;
725     /// PAID/GID
726     uint32_t paid_gid;
727     /// Maximum A-MPDU size, in bytes, for HT frames
728     u16_l ampdu_size_max_ht;
729     /// MAC address of the station to be added
730     struct mac_addr mac_addr;
731     /// A-MPDU spacing, in us
732     u8_l ampdu_spacing_min;
733     /// Interface index
734     u8_l inst_nbr;
735     /// TDLS station
736     bool_l tdls_sta;
737     /// Indicate if the station is TDLS link initiator station
738     bool_l tdls_sta_initiator;
739     /// Indicate if the TDLS Channel Switch is allowed
740     bool_l tdls_chsw_allowed;
741 };
742 
743 /// Structure containing the parameters of the @ref MM_STA_ADD_CFM message.
744 struct mm_sta_add_cfm
745 {
746     /// Status of the operation (different from 0 if unsuccessful)
747     u8_l status;
748     /// Index assigned by the LMAC to the newly added station
749     u8_l sta_idx;
750     /// MAC HW index of the newly added station
751     u8_l hw_sta_idx;
752 };
753 
754 /// Structure containing the parameters of the @ref MM_STA_DEL_REQ message.
755 struct mm_sta_del_req
756 {
757     /// Index of the station to be deleted
758     u8_l sta_idx;
759 };
760 
761 /// Structure containing the parameters of the @ref MM_STA_DEL_CFM message.
762 struct mm_sta_del_cfm
763 {
764     /// Status of the operation (different from 0 if unsuccessful)
765     u8_l     status;
766 };
767 
768 /// Structure containing the parameters of the SET_POWER_MODE REQ message.
769 struct mm_setpowermode_req
770 {
771     u8_l mode;
772     u8_l sta_idx;
773 };
774 
775 /// Structure containing the parameters of the SET_POWER_MODE CFM message.
776 struct mm_setpowermode_cfm
777 {
778     u8_l     status;
779 };
780 
781 /// Structure containing the parameters of the @ref MM_KEY_ADD REQ message.
782 struct mm_key_add_req
783 {
784     /// Key index (valid only for default keys)
785     u8_l key_idx;
786     /// STA index (valid only for pairwise or mesh group keys)
787     u8_l sta_idx;
788     /// Key material
789     struct mac_sec_key key;
790     /// Cipher suite (WEP64, WEP128, TKIP, CCMP)
791     u8_l cipher_suite;
792     /// Index of the interface for which the key is set (valid only for default keys or mesh group keys)
793     u8_l inst_nbr;
794     /// A-MSDU SPP parameter
795     u8_l spp;
796     /// Indicate if provided key is a pairwise key or not
797     bool_l pairwise;
798 };
799 
800 /// Structure containing the parameters of the @ref MM_KEY_ADD_CFM message.
801 struct mm_key_add_cfm
802 {
803     /// Status of the operation (different from 0 if unsuccessful)
804     u8_l status;
805     /// HW index of the key just added
806     u8_l hw_key_idx;
807 };
808 
809 /// Structure containing the parameters of the @ref MM_KEY_DEL_REQ message.
810 struct mm_key_del_req
811 {
812     /// HW index of the key to be deleted
813     u8_l hw_key_idx;
814 };
815 
816 /// Structure containing the parameters of the @ref MM_BA_ADD_REQ message.
817 struct mm_ba_add_req
818 {
819     ///Type of agreement (0: TX, 1: RX)
820     u8_l  type;
821     ///Index of peer station with which the agreement is made
822     u8_l  sta_idx;
823     ///TID for which the agreement is made with peer station
824     u8_l  tid;
825     ///Buffer size - number of MPDUs that can be held in its buffer per TID
826     u8_l  bufsz;
827     /// Start sequence number negotiated during BA setup - the one in first aggregated MPDU counts more
828     u16_l ssn;
829 };
830 
831 /// Structure containing the parameters of the @ref MM_BA_ADD_CFM message.
832 struct mm_ba_add_cfm
833 {
834     ///Index of peer station for which the agreement is being confirmed
835     u8_l sta_idx;
836     ///TID for which the agreement is being confirmed
837     u8_l tid;
838     /// Status of ba establishment
839     u8_l status;
840 };
841 
842 /// Structure containing the parameters of the @ref MM_BA_DEL_REQ message.
843 struct mm_ba_del_req
844 {
845     ///Type of agreement (0: TX, 1: RX)
846     u8_l type;
847     ///Index of peer station for which the agreement is being deleted
848     u8_l sta_idx;
849     ///TID for which the agreement is being deleted
850     u8_l tid;
851 };
852 
853 /// Structure containing the parameters of the @ref MM_BA_DEL_CFM message.
854 struct mm_ba_del_cfm
855 {
856     ///Index of peer station for which the agreement deletion is being confirmed
857     u8_l sta_idx;
858     ///TID for which the agreement deletion is being confirmed
859     u8_l tid;
860     /// Status of ba deletion
861     u8_l status;
862 };
863 
864 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_ADD_REQ message
865 struct mm_chan_ctxt_add_req
866 {
867     /// Operating channel
868     struct mac_chan_op chan;
869 };
870 
871 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_ADD_REQ message
872 struct mm_chan_ctxt_add_cfm
873 {
874     /// Status of the addition
875     u8_l status;
876     /// Index of the new channel context
877     u8_l index;
878 };
879 
880 
881 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_DEL_REQ message
882 struct mm_chan_ctxt_del_req
883 {
884     /// Index of the new channel context to be deleted
885     u8_l index;
886 };
887 
888 
889 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_LINK_REQ message
890 struct mm_chan_ctxt_link_req
891 {
892     /// VIF index
893     u8_l vif_index;
894     /// Channel context index
895     u8_l chan_index;
896     /// Indicate if this is a channel switch (unlink current ctx first if true)
897     u8_l chan_switch;
898 };
899 
900 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_UNLINK_REQ message
901 struct mm_chan_ctxt_unlink_req
902 {
903     /// VIF index
904     u8_l vif_index;
905 };
906 
907 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_UPDATE_REQ message
908 struct mm_chan_ctxt_update_req
909 {
910     /// Channel context index
911     u8_l chan_index;
912     /// New channel information
913     struct mac_chan_op chan;
914 };
915 
916 /// Structure containing the parameters of the @ref MM_CHAN_CTXT_SCHED_REQ message
917 struct mm_chan_ctxt_sched_req
918 {
919     /// VIF index
920     u8_l vif_index;
921     /// Channel context index
922     u8_l chan_index;
923     /// Type of the scheduling request (0: normal scheduling, 1: derogatory
924     /// scheduling)
925     u8_l type;
926 };
927 
928 /// Structure containing the parameters of the @ref MM_CHANNEL_SWITCH_IND message
929 struct mm_channel_switch_ind
930 {
931     /// Index of the channel context we will switch to
932     u8_l chan_index;
933     /// Indicate if the switch has been triggered by a Remain on channel request
934     bool_l roc;
935     /// VIF on which remain on channel operation has been started (if roc == 1)
936     u8_l vif_index;
937     /// Indicate if the switch has been triggered by a TDLS Remain on channel request
938     bool_l roc_tdls;
939 };
940 
941 /// Structure containing the parameters of the @ref MM_CHANNEL_PRE_SWITCH_IND message
942 struct mm_channel_pre_switch_ind
943 {
944     /// Index of the channel context we will switch to
945     u8_l chan_index;
946 };
947 
948 /// Structure containing the parameters of the @ref MM_CONNECTION_LOSS_IND message.
949 struct mm_connection_loss_ind
950 {
951     /// VIF instance number
952     u8_l inst_nbr;
953 };
954 
955 
956 /// Structure containing the parameters of the @ref MM_DBG_TRIGGER_REQ message.
957 struct mm_dbg_trigger_req
958 {
959     /// Error trace to be reported by the LMAC
960     char error[64];
961 };
962 
963 /// Structure containing the parameters of the @ref MM_SET_PS_MODE_REQ message.
964 struct mm_set_ps_mode_req
965 {
966     /// Power Save is activated or deactivated
967     u8_l  new_state;
968 };
969 
970 /// Structure containing the parameters of the @ref MM_BCN_CHANGE_REQ message.
971 #define BCN_MAX_CSA_CPT 2
972 struct mm_bcn_change_req
973 {
974     /// Pointer, in host memory, to the new beacon template
975     uint32_t bcn_ptr;
976     /// Length of the beacon template
977     u16_l bcn_len;
978     /// Offset of the TIM IE in the beacon
979     u16_l tim_oft;
980     /// Length of the TIM IE
981     u8_l tim_len;
982     /// Index of the VIF for which the beacon is updated
983     u8_l inst_nbr;
984     /// Offset of CSA (channel switch announcement) counters (0 means no counter)
985     u8_l csa_oft[BCN_MAX_CSA_CPT];
986 };
987 
988 
989 /// Structure containing the parameters of the @ref MM_TIM_UPDATE_REQ message.
990 struct mm_tim_update_req
991 {
992     /// Association ID of the STA the bit of which has to be updated (0 for BC/MC traffic)
993     u16_l aid;
994     /// Flag indicating the availability of data packets for the given STA
995     u8_l tx_avail;
996     /// Index of the VIF for which the TIM is updated
997     u8_l inst_nbr;
998 };
999 
1000 /// Structure containing the parameters of the @ref MM_REMAIN_ON_CHANNEL_REQ message.
1001 struct mm_remain_on_channel_req
1002 {
1003     /// Operation Code
1004     u8_l op_code;
1005     /// VIF Index
1006     u8_l vif_index;
1007     /// Band (2.4GHz or 5GHz)
1008     u8_l band;
1009     /// Channel type: 20,40,80,160 or 80+80 MHz
1010     u8_l type;
1011     /// Frequency for Primary 20MHz channel (in MHz)
1012     u16_l prim20_freq;
1013     /// Frequency for Center of the contiguous channel or center of Primary 80+80
1014     u16_l center1_freq;
1015     /// Frequency for Center of the non-contiguous secondary 80+80
1016     u16_l center2_freq;
1017     /// Duration (in ms)
1018     uint32_t duration_ms;
1019     /// TX power (in dBm)
1020     s8_l tx_power;
1021 };
1022 
1023 /// Structure containing the parameters of the @ref MM_REMAIN_ON_CHANNEL_CFM message
1024 struct mm_remain_on_channel_cfm
1025 {
1026     /// Operation Code
1027     u8_l op_code;
1028     /// Status of the operation
1029     u8_l status;
1030     /// Channel Context index
1031     u8_l chan_ctxt_index;
1032 };
1033 
1034 /// Structure containing the parameters of the @ref MM_REMAIN_ON_CHANNEL_EXP_IND message
1035 struct mm_remain_on_channel_exp_ind
1036 {
1037     /// VIF Index
1038     u8_l vif_index;
1039     /// Channel Context index
1040     u8_l chan_ctxt_index;
1041 };
1042 
1043 /// Structure containing the parameters of the @ref MM_SET_UAPSD_TMR_REQ message.
1044 struct mm_set_uapsd_tmr_req
1045 {
1046     /// action: Start or Stop the timer
1047     u8_l  action;
1048     /// timeout value, in milliseconds
1049     uint32_t  timeout;
1050 };
1051 
1052 /// Structure containing the parameters of the @ref MM_SET_UAPSD_TMR_CFM message.
1053 struct mm_set_uapsd_tmr_cfm
1054 {
1055     /// Status of the operation (different from 0 if unsuccessful)
1056     u8_l     status;
1057 };
1058 
1059 
1060 /// Structure containing the parameters of the @ref MM_PS_CHANGE_IND message
1061 struct mm_ps_change_ind
1062 {
1063     /// Index of the peer device that is switching its PS state
1064     u8_l sta_idx;
1065     /// New PS state of the peer device (0: active, 1: sleeping)
1066     u8_l ps_state;
1067 };
1068 
1069 /// Structure containing the parameters of the @ref MM_P2P_VIF_PS_CHANGE_IND message
1070 struct mm_p2p_vif_ps_change_ind
1071 {
1072     /// Index of the P2P VIF that is switching its PS state
1073     u8_l vif_index;
1074     /// New PS state of the P2P VIF interface (0: active, 1: sleeping)
1075     u8_l ps_state;
1076 };
1077 
1078 /// Structure containing the parameters of the @ref MM_TRAFFIC_REQ_IND message
1079 struct mm_traffic_req_ind
1080 {
1081     /// Index of the peer device that needs traffic
1082     u8_l sta_idx;
1083     /// Number of packets that need to be sent (if 0, all buffered traffic shall be sent and
1084     /// if set to @ref PS_SP_INTERRUPTED, it means that current service period has been interrupted)
1085     u8_l pkt_cnt;
1086     /// Flag indicating if the traffic request concerns U-APSD queues or not
1087     bool_l uapsd;
1088 };
1089 
1090 /// Structure containing the parameters of the @ref MM_SET_PS_OPTIONS_REQ message.
1091 struct mm_set_ps_options_req
1092 {
1093     /// VIF Index
1094     u8_l vif_index;
1095     /// Listen interval (0 if wake up shall be based on DTIM period)
1096     u16_l listen_interval;
1097     /// Flag indicating if we shall listen the BC/MC traffic or not
1098     bool_l dont_listen_bc_mc;
1099 };
1100 
1101 /// Structure containing the parameters of the @ref MM_CSA_COUNTER_IND message
1102 struct mm_csa_counter_ind
1103 {
1104     /// Index of the VIF
1105     u8_l vif_index;
1106     /// Updated CSA counter value
1107     u8_l csa_count;
1108 };
1109 
1110 /// Structure containing the parameters of the @ref MM_CHANNEL_SURVEY_IND message
1111 struct mm_channel_survey_ind
1112 {
1113     /// Frequency of the channel
1114     u16_l freq;
1115     /// Noise in dbm
1116     s8_l noise_dbm;
1117     /// Amount of time spent of the channel (in ms)
1118     uint32_t chan_time_ms;
1119     /// Amount of time the primary channel was sensed busy
1120     uint32_t chan_time_busy_ms;
1121 };
1122 
1123 /// Structure containing the parameters of the @ref MM_BFMER_ENABLE_REQ message.
1124 struct mm_bfmer_enable_req
1125 {
1126     /**
1127      * Address of the beamforming report space allocated in host memory
1128      * (Valid only if vht_su_bfmee is true)
1129      */
1130     uint32_t host_bfr_addr;
1131     /**
1132      * Size of the beamforming report space allocated in host memory. This space should
1133      * be twice the maximum size of the expected beamforming reports as the FW will
1134      * divide it in two in order to be able to upload a new report while another one is
1135      * used in transmission
1136      */
1137     u16_l host_bfr_size;
1138     /// AID
1139     u16_l aid;
1140     /// Station Index
1141     u8_l sta_idx;
1142     /// Maximum number of spatial streams the station can receive
1143     u8_l rx_nss;
1144     /**
1145      * Indicate if peer STA is MU Beamformee (VHT) capable
1146      * (Valid only if vht_su_bfmee is true)
1147      */
1148     bool_l vht_mu_bfmee;
1149 };
1150 
1151 /// Structure containing the parameters of the @ref MM_SET_P2P_NOA_REQ message.
1152 struct mm_set_p2p_noa_req
1153 {
1154     /// VIF Index
1155     u8_l vif_index;
1156     /// Allocated NOA Instance Number - Valid only if count = 0
1157     u8_l noa_inst_nb;
1158     /// Count
1159     u8_l count;
1160     /// Indicate if NoA can be paused for traffic reason
1161     bool_l dyn_noa;
1162     /// Duration (in us)
1163     uint32_t duration_us;
1164     /// Interval (in us)
1165     uint32_t interval_us;
1166     /// Start Time offset from next TBTT (in us)
1167     uint32_t start_offset;
1168 };
1169 
1170 /// Structure containing the parameters of the @ref MM_SET_P2P_OPPPS_REQ message.
1171 struct mm_set_p2p_oppps_req
1172 {
1173     /// VIF Index
1174     u8_l vif_index;
1175     /// CTWindow
1176     u8_l ctwindow;
1177 };
1178 
1179 /// Structure containing the parameters of the @ref MM_SET_P2P_NOA_CFM message.
1180 struct mm_set_p2p_noa_cfm
1181 {
1182     /// Request status
1183     u8_l status;
1184 };
1185 
1186 /// Structure containing the parameters of the @ref MM_SET_P2P_OPPPS_CFM message.
1187 struct mm_set_p2p_oppps_cfm
1188 {
1189     /// Request status
1190     u8_l status;
1191 };
1192 
1193 /// Structure containing the parameters of the @ref MM_P2P_NOA_UPD_IND message.
1194 struct mm_p2p_noa_upd_ind
1195 {
1196     /// VIF Index
1197     u8_l vif_index;
1198     /// NOA Instance Number
1199     u8_l noa_inst_nb;
1200     /// NoA Type
1201     u8_l noa_type;
1202     /// Count
1203     u8_l count;
1204     /// Duration (in us)
1205     uint32_t duration_us;
1206     /// Interval (in us)
1207     uint32_t interval_us;
1208     /// Start Time
1209     uint32_t start_time;
1210 };
1211 
1212 /// Structure containing the parameters of the @ref MM_CFG_RSSI_REQ message
1213 struct mm_cfg_rssi_req
1214 {
1215     /// Index of the VIF
1216     u8_l vif_index;
1217     /// RSSI threshold
1218     s8_l rssi_thold;
1219     /// RSSI hysteresis
1220     u8_l rssi_hyst;
1221 };
1222 
1223 /// Structure containing the parameters of the @ref MM_RSSI_STATUS_IND message
1224 struct mm_rssi_status_ind
1225 {
1226     /// Index of the VIF
1227     u8_l vif_index;
1228     /// Status of the RSSI
1229     bool_l rssi_status;
1230     /// Current RSSI
1231     s8_l rssi;
1232 };
1233 
1234 /// Structure containing the parameters of the @ref MM_PKTLOSS_IND message
1235 struct mm_pktloss_ind
1236 {
1237     /// Index of the VIF
1238     u8_l vif_index;
1239     /// Address of the STA for which there is a packet loss
1240     struct mac_addr mac_addr;
1241     /// Number of packets lost
1242     uint32_t num_packets;
1243 };
1244 
1245 /// Structure containing the parameters of the @ref MM_CSA_FINISH_IND message
1246 struct mm_csa_finish_ind
1247 {
1248     /// Index of the VIF
1249     u8_l vif_index;
1250     /// Status of the operation
1251     u8_l status;
1252     /// New channel ctx index
1253     u8_l chan_idx;
1254 };
1255 
1256 /// Structure containing the parameters of the @ref MM_CSA_TRAFFIC_IND message
1257 struct mm_csa_traffic_ind
1258 {
1259     /// Index of the VIF
1260     u8_l vif_index;
1261     /// Is tx traffic enable or disable
1262     bool_l enable;
1263 };
1264 
1265 /// Structure containing the parameters of the @ref MM_MU_GROUP_UPDATE_REQ message.
1266 /// Size allocated for the structure depends of the number of group
1267 struct mm_mu_group_update_req
1268 {
1269     /// Station index
1270     u8_l sta_idx;
1271     /// Number of groups the STA belongs to
1272     u8_l group_cnt;
1273     /// Group information
1274     struct
1275     {
1276         /// Group Id
1277         u8_l group_id;
1278         /// User position
1279         u8_l user_pos;
1280     } groups[0];
1281 };
1282 
1283 ///////////////////////////////////////////////////////////////////////////////
1284 /////////// For Scan messages
1285 ///////////////////////////////////////////////////////////////////////////////
1286 enum scan_msg_tag
1287 {
1288     /// Scanning start Request.
1289     SCAN_START_REQ = LMAC_FIRST_MSG(TASK_SCAN),
1290     /// Scanning start Confirmation.
1291     SCAN_START_CFM,     // 0x801
1292     /// End of scanning indication.
1293     SCAN_DONE_IND,      // 0x802
1294     /// Cancel scan request
1295     SCAN_CANCEL_REQ,    // 0x803
1296     /// Cancel scan confirmation
1297     SCAN_CANCEL_CFM,    // 0x804
1298 
1299     /// MAX number of messages
1300     SCAN_MAX,
1301 };
1302 
1303 /// Maximum number of SSIDs in a scan request
1304 #define SCAN_SSID_MAX   2
1305 
1306 /// Maximum number of 2.4GHz channels
1307 #define SCAN_CHANNEL_2G4 14
1308 
1309 /// Maximum number of 5GHz channels
1310 #define SCAN_CHANNEL_5G  28
1311 
1312 /// Maximum number of channels in a scan request
1313 #define SCAN_CHANNEL_MAX (SCAN_CHANNEL_2G4 + SCAN_CHANNEL_5G)
1314 
1315 /// Maximum length of the ProbeReq IEs (SoftMAC mode)
1316 #define SCAN_MAX_IE_LEN 300
1317 
1318 /// Maximum number of PHY bands supported
1319 #define SCAN_BAND_MAX 2
1320 
1321 
1322 /// Structure containing the parameters of the @ref SCAN_START_REQ message
1323 struct scan_start_req
1324 {
1325     /// List of channel to be scanned
1326     struct mac_chan_def chan[SCAN_CHANNEL_MAX];
1327     /// List of SSIDs to be scanned
1328     struct mac_ssid ssid[SCAN_SSID_MAX];
1329     /// BSSID to be scanned
1330     struct mac_addr bssid;
1331     /// Pointer (in host memory) to the additional IEs that need to be added to the ProbeReq
1332     /// (following the SSID element)
1333     uint32_t add_ies;
1334     /// Length of the additional IEs
1335     u16_l add_ie_len;
1336     /// Index of the VIF that is scanning
1337     u8_l vif_idx;
1338     /// Number of channels to scan
1339     u8_l chan_cnt;
1340     /// Number of SSIDs to scan for
1341     u8_l ssid_cnt;
1342     /// no CCK - For P2P frames not being sent at CCK rate in 2GHz band.
1343     u8_l no_cck;
1344 };
1345 
1346 /// Structure containing the parameters of the @ref SCAN_START_CFM message
1347 struct scan_start_cfm
1348 {
1349     /// Status of the request
1350     u8_l status;
1351 };
1352 
1353 /// Structure containing the parameters of the @ref SCAN_START_CFM message
1354 struct scan_cancel_cfm
1355 {
1356     /// Status of the request
1357     u8_l status;
1358 };
1359 
1360 ///////////////////////////////////////////////////////////////////////////////
1361 /////////// For Scanu messages
1362 ///////////////////////////////////////////////////////////////////////////////
1363 /// Messages that are logically related to the task.
1364 enum
1365 {
1366     /// Scan request from host.
1367     SCANU_START_REQ = LMAC_FIRST_MSG(TASK_SCANU),
1368     /// Scanning start Confirmation.
1369     SCANU_START_CFM,            // 0x1001
1370     /// Join request
1371     SCANU_JOIN_REQ,             // 0x1002
1372     /// Join confirmation.
1373     SCANU_JOIN_CFM,             // 0x1003
1374     /// Scan result indication.
1375     SCANU_RESULT_IND,           // 0x1004
1376     /// Get Scan result request.
1377     SCANU_GET_SCAN_RESULT_REQ,  // 0x1005
1378     /// Scan result confirmation.
1379     SCANU_GET_SCAN_RESULT_CFM,  // 0x1006
1380 
1381     //add by cs
1382     SCANU_VENDOR_IE_REQ,        // 0x1007
1383     SCANU_VENDOR_IE_CFM,        // 0x1008
1384     SCANU_START_CFM_ADDTIONAL,  // 0x1009
1385     SCANU_CANCEL_REQ,           // 0x100A
1386     SCANU_CANCEL_CFM,           // 0x100B
1387 
1388     /// MAX number of messages
1389     SCANU_MAX,
1390 };
1391 
1392 /// Maximum length of the additional ProbeReq IEs (FullMAC mode)
1393 #define SCANU_MAX_IE_LEN  200
1394 
1395 /// Structure containing the parameters of the @ref SCANU_START_REQ message
1396 struct scanu_start_req
1397 {
1398     /// List of channel to be scanned
1399     struct mac_chan_def chan[SCAN_CHANNEL_MAX];
1400     /// List of SSIDs to be scanned
1401     struct mac_ssid ssid[SCAN_SSID_MAX];
1402     /// BSSID to be scanned (or WILDCARD BSSID if no BSSID is searched in particular)
1403     struct mac_addr bssid;
1404     /// Address (in host memory) of the additional IEs that need to be added to the ProbeReq
1405     /// (following the SSID element)
1406     uint32_t add_ies;
1407     /// Length of the additional IEs
1408     u16_l add_ie_len;
1409     /// Index of the VIF that is scanning
1410     u8_l vif_idx;
1411     /// Number of channels to scan
1412     u8_l chan_cnt;
1413     /// Number of SSIDs to scan for
1414     u8_l ssid_cnt;
1415     /// no CCK - For P2P frames not being sent at CCK rate in 2GHz band.
1416     bool no_cck;
1417 };
1418 
1419 struct scanu_scan_cancel_req
1420 {
1421     uint8_t status;
1422 };
1423 
1424 /// Structure containing the parameters of the @ref SCANU_START_CFM message
1425 struct scanu_start_cfm
1426 {
1427     /// Index of the VIF that was scanning
1428     u8_l vif_idx;
1429     /// Status of the request
1430     u8_l status;
1431     /// Number of scan results available
1432     u8_l result_cnt;
1433 };
1434 
1435 struct scanu_start_cfm_add
1436 {
1437     /// Index of the VIF that was scanning
1438     uint8_t vif_idx;
1439     /// Status of the request
1440     uint8_t status;
1441 };
1442 
1443 /// Structure containing the parameters of the @ref SCANU_GET_SCAN_RESULT_REQ message
1444 struct scanu_get_scan_result_req
1445 {
1446     /// index of the scan element
1447     uint8_t idx;
1448 };
1449 
1450 /// Structure containing the parameters of the @ref SCANU_GET_SCAN_RESULT_CFM message
1451 struct scanu_get_scan_result_cfm
1452 {
1453     /// Structure for scan result element
1454     struct mac_scan_result scan_result;
1455 };
1456 
1457 /// Parameters of the @SCANU_RESULT_IND message
1458 struct scanu_result_ind
1459 {
1460     /// Length of the frame
1461     u16_l length;
1462     /// Frame control field of the frame.
1463     u16_l framectrl;
1464     /// Center frequency on which we received the packet
1465     u16_l center_freq;
1466     /// PHY band
1467     u8_l band;
1468     /// Index of the station that sent the frame. 0xFF if unknown.
1469     u8_l sta_idx;
1470     /// Index of the VIF that received the frame. 0xFF if unknown.
1471     u8_l inst_nbr;
1472     /// RSSI of the received frame.
1473     s8_l rssi;
1474     /// Frame payload.
1475     uint32_t payload[];
1476 };
1477 
1478 /// Structure containing the parameters of the message.
1479 struct scanu_fast_req
1480 {
1481     /// The SSID to scan in the channel.
1482     struct mac_ssid ssid;
1483     /// BSSID.
1484     struct mac_addr bssid;
1485     /// Probe delay.
1486     u16_l probe_delay;
1487     /// Minimum channel time.
1488     u16_l minch_time;
1489     /// Maximum channel time.
1490     u16_l maxch_time;
1491     /// The channel number to scan.
1492     u16_l ch_nbr;
1493 };
1494 
1495 ///////////////////////////////////////////////////////////////////////////////
1496 /////////// For ME messages
1497 ///////////////////////////////////////////////////////////////////////////////
1498 /// Messages that are logically related to the task.
1499 enum
1500 {
1501     /// Configuration request from host.
1502     ME_CONFIG_REQ = LMAC_FIRST_MSG(TASK_ME),
1503     /// Configuration confirmation.
1504     ME_CONFIG_CFM,              // 0x1401
1505     /// Configuration request from host.
1506     ME_CHAN_CONFIG_REQ,         // 0x1402
1507     /// Configuration confirmation.
1508     ME_CHAN_CONFIG_CFM,         // 0x1403
1509     /// Set control port state for a station.
1510     ME_SET_CONTROL_PORT_REQ,    // 0x1404
1511     /// Control port setting confirmation.
1512     ME_SET_CONTROL_PORT_CFM,    // 0x1405
1513     /// TKIP MIC failure indication.
1514     ME_TKIP_MIC_FAILURE_IND,    // 0x1406
1515     /// Add a station to the FW (AP mode)
1516     ME_STA_ADD_REQ,             // 0x1407
1517     /// Confirmation of the STA addition
1518     ME_STA_ADD_CFM,             // 0x1408
1519     /// Delete a station from the FW (AP mode)
1520     ME_STA_DEL_REQ,             // 0x1409
1521     /// Confirmation of the STA deletion
1522     ME_STA_DEL_CFM,             // 0x140A
1523     /// Indication of a TX RA/TID queue credit update
1524     ME_TX_CREDITS_UPDATE_IND,   // 0x140B
1525     /// Request indicating to the FW that there is traffic buffered on host
1526     ME_TRAFFIC_IND_REQ,         // 0x140C
1527     /// Confirmation that the @ref ME_TRAFFIC_IND_REQ has been executed
1528     ME_TRAFFIC_IND_CFM,         // 0x140D
1529     /// Request of RC statistics to a station
1530     ME_RC_STATS_REQ,            // 0x140E
1531     /// RC statistics confirmation
1532     ME_RC_STATS_CFM,            // 0x140F
1533     /// RC fixed rate request
1534     ME_RC_SET_RATE_REQ,         // 0x1410
1535     /// Configure monitor interface
1536     ME_CONFIG_MONITOR_REQ,      // 0x1411
1537     /// Configure monitor interface response
1538     ME_CONFIG_MONITOR_CFM,      // 0x1412
1539     /// Setting power Save mode request from host
1540     ME_SET_PS_MODE_REQ,         // 0x1413
1541     /// Set power Save mode confirmation
1542     ME_SET_PS_MODE_CFM,         // 0x1414
1543     /// Setting Low Power level request from host
1544     ME_SET_LP_LEVEL_REQ,        // 0x1415
1545     /// Set Low Power level confirmation
1546     ME_SET_LP_LEVEL_CFM,        // 0x1416
1547     /// MAX number of messages
1548     ME_MAX,
1549 };
1550 
1551 /// Structure containing the parameters of the @ref ME_START_REQ message
1552 struct me_config_req
1553 {
1554     /// HT Capabilities
1555     struct mac_htcapability ht_cap;
1556     /// VHT Capabilities
1557     struct mac_vhtcapability vht_cap;
1558     /// HE capabilities
1559     struct mac_hecapability he_cap;
1560     /// Lifetime of packets sent under a BlockAck agreement (expressed in TUs)
1561     u16_l tx_lft;
1562     /// Maximum supported BW
1563     uint8_t phy_bw_max;
1564     /// Boolean indicating if HT is supported or not
1565     bool_l ht_supp;
1566     /// Boolean indicating if VHT is supported or not
1567     bool_l vht_supp;
1568     /// Boolean indicating if HE is supported or not
1569     bool_l he_supp;
1570     /// Boolean indicating if HE OFDMA UL is enabled or not
1571     bool_l he_ul_on;
1572     /// Boolean indicating if PS mode shall be enabled or not
1573     bool_l ps_on;
1574     /// Boolean indicating if Antenna Diversity shall be enabled or not
1575     bool_l ant_div_on;
1576     /// Boolean indicating if Dynamic PS mode shall be used or not
1577     bool_l dpsm;
1578 };
1579 
1580 /// Structure containing the parameters of the @ref ME_CHAN_CONFIG_REQ message
1581 struct me_chan_config_req
1582 {
1583     /// List of 2.4GHz supported channels
1584     struct mac_chan_def chan2G4[MAC_DOMAINCHANNEL_24G_MAX];
1585     /// List of 5GHz supported channels
1586     struct mac_chan_def chan5G[MAC_DOMAINCHANNEL_5G_MAX];
1587     /// Number of 2.4GHz channels in the list
1588     u8_l chan2G4_cnt;
1589     /// Number of 5GHz channels in the list
1590     u8_l chan5G_cnt;
1591 };
1592 
1593 /// Structure containing the parameters of the @ref ME_SET_CONTROL_PORT_REQ message
1594 struct me_set_control_port_req
1595 {
1596     /// Index of the station for which the control port is opened
1597     u8_l sta_idx;
1598     /// Control port state
1599     bool_l control_port_open;
1600 };
1601 
1602 /// Structure containing the parameters of the @ref ME_TKIP_MIC_FAILURE_IND message
1603 struct me_tkip_mic_failure_ind
1604 {
1605     /// Address of the sending STA
1606     struct mac_addr addr;
1607     /// TSC value
1608     u64_l tsc;
1609     /// Boolean indicating if the packet was a group or unicast one (true if group)
1610     bool_l ga;
1611     /// Key Id
1612     u8_l keyid;
1613     /// VIF index
1614     u8_l vif_idx;
1615 };
1616 
1617 /// Structure containing the parameters of the @ref ME_STA_ADD_REQ message
1618 struct me_sta_add_req
1619 {
1620     /// MAC address of the station to be added
1621     struct mac_addr mac_addr;
1622     /// Supported legacy rates
1623     struct mac_rateset rate_set;
1624     /// HT Capabilities
1625     struct mac_htcapability ht_cap;
1626     /// VHT Capabilities
1627     struct mac_vhtcapability vht_cap;
1628     /// HE capabilities
1629     struct mac_hecapability he_cap;
1630     /// Flags giving additional information about the station (@ref mac_sta_flags)
1631     uint32_t flags;
1632     /// Association ID of the station
1633     u16_l aid;
1634     /// Bit field indicating which queues have U-APSD enabled
1635     u8_l uapsd_queues;
1636     /// Maximum size, in frames, of a APSD service period
1637     u8_l max_sp_len;
1638     /// Operation mode information (valid if bit @ref STA_OPMOD_NOTIF is
1639     /// set in the flags)
1640     u8_l opmode;
1641     /// Index of the VIF the station is attached to
1642     u8_l vif_idx;
1643     /// Whether the the station is TDLS station
1644     bool_l tdls_sta;
1645     /// Indicate if the station is TDLS link initiator station
1646     bool_l tdls_sta_initiator;
1647     /// Indicate if the TDLS Channel Switch is allowed
1648     bool_l tdls_chsw_allowed;
1649 };
1650 
1651 /// Structure containing the parameters of the @ref ME_STA_ADD_CFM message
1652 struct me_sta_add_cfm
1653 {
1654     /// Station index
1655     u8_l sta_idx;
1656     /// Status of the station addition
1657     u8_l status;
1658     /// PM state of the station
1659     u8_l pm_state;
1660 };
1661 
1662 /// Structure containing the parameters of the @ref ME_STA_DEL_REQ message.
1663 struct me_sta_del_req
1664 {
1665     /// Index of the station to be deleted
1666     u8_l sta_idx;
1667     /// Whether the the station is TDLS station
1668     bool_l tdls_sta;
1669 };
1670 
1671 /// Structure containing the parameters of the @ref ME_TX_CREDITS_UPDATE_IND message.
1672 struct me_tx_credits_update_ind
1673 {
1674     /// Index of the station for which the credits are updated
1675     u8_l sta_idx;
1676     /// TID for which the credits are updated
1677     u8_l tid;
1678     /// Offset to be applied on the credit count
1679     s8_l credits;
1680 };
1681 
1682 /// Structure containing the parameters of the @ref ME_TRAFFIC_IND_REQ message.
1683 struct me_traffic_ind_req
1684 {
1685     /// Index of the station for which UAPSD traffic is available on host
1686     u8_l sta_idx;
1687     /// Flag indicating the availability of UAPSD packets for the given STA
1688     u8_l tx_avail;
1689     /// Indicate if traffic is on uapsd-enabled queues
1690     bool_l uapsd;
1691 };
1692 
1693 /// Structure containing the parameters of the @ref ME_RC_STATS_REQ message.
1694 struct me_rc_stats_req
1695 {
1696     /// Index of the station for which the RC statistics are requested
1697     u8_l sta_idx;
1698 };
1699 
1700 /// Structure containing the rate control statistics
1701 struct rc_rate_stats
1702 {
1703     /// Number of attempts (per sampling interval)
1704     u16_l attempts;
1705     /// Number of success (per sampling interval)
1706     u16_l success;
1707     /// Estimated probability of success (EWMA)
1708     u16_l probability;
1709     /// Rate configuration of the sample
1710     u16_l rate_config;
1711     union
1712     {
1713         struct {
1714             /// Number of times the sample has been skipped (per sampling interval)
1715             u8_l  sample_skipped;
1716             /// Whether the old probability is available
1717             bool_l  old_prob_available;
1718             /// Whether the rate can be used in the retry chain
1719             bool_l rate_allowed;
1720         };
1721         struct {
1722             /// RU size and UL length received in the latest HE trigger frame
1723             u16_l ru_and_length;
1724         };
1725     };
1726 };
1727 
1728 /// Number of RC samples
1729 #define RC_MAX_N_SAMPLE 10
1730 /// Index of the HE statistics element in the table
1731 #define RC_HE_STATS_IDX RC_MAX_N_SAMPLE
1732 
1733 /// Structure containing the parameters of the @ref ME_RC_STATS_CFM message.
1734 struct me_rc_stats_cfm
1735 {
1736     /// Index of the station for which the RC statistics are provided
1737     u8_l sta_idx;
1738     /// Number of samples used in the RC algorithm
1739     u16_l no_samples;
1740     /// Number of MPDUs transmitted (per sampling interval)
1741     u16_l ampdu_len;
1742     /// Number of AMPDUs transmitted (per sampling interval)
1743     u16_l ampdu_packets;
1744     /// Average number of MPDUs in each AMPDU frame (EWMA)
1745     uint32_t avg_ampdu_len;
1746     // Current step 0 of the retry chain
1747     u8_l sw_retry_step;
1748     /// Trial transmission period
1749     u8_l sample_wait;
1750     /// Retry chain steps
1751     u16_l retry_step_idx[4];
1752     /// RC statistics - Max number of RC samples, plus one for the HE TB statistics
1753     struct rc_rate_stats rate_stats[RC_MAX_N_SAMPLE + 1];
1754     /// Throughput - Max number of RC samples, plus one for the HE TB statistics
1755     u32_l tp[RC_MAX_N_SAMPLE + 1];
1756 };
1757 
1758 /// Structure containing the parameters of the @ref ME_RC_SET_RATE_REQ message.
1759 struct me_rc_set_rate_req
1760 {
1761     /// Index of the station for which the fixed rate is set
1762     u8_l sta_idx;
1763     /// Rate configuration to be set
1764     u16_l fixed_rate_cfg;
1765 };
1766 
1767 /// Structure containing the parameters of the @ref ME_CONFIG_MONITOR_REQ message.
1768 struct me_config_monitor_req
1769 {
1770     /// Channel to configure
1771     struct mac_chan_op chan;
1772     /// Is channel data valid
1773     bool_l chan_set;
1774     /// Enable report of unsupported HT frames
1775     bool_l uf;
1776 };
1777 
1778 /// Structure containing the parameters of the @ref ME_CONFIG_MONITOR_CFM message.
1779 struct me_config_monitor_cfm
1780 {
1781     /// Channel context index
1782     u8_l chan_index;
1783     /// Channel parameters
1784     struct mac_chan_op chan;
1785 };
1786 
1787 /// Structure containing the parameters of the @ref ME_SET_PS_MODE_REQ message.
1788 struct me_set_ps_mode_req
1789 {
1790     /// Power Save is activated or deactivated
1791     u8_l  ps_state;
1792 };
1793 
1794 /// Structure containing the parameters of the @ref ME_SET_LP_LEVEL_REQ message.
1795 struct me_set_lp_level_req
1796 {
1797     /// Low Power level
1798     u8_l lp_level;
1799 };
1800 
1801 
1802 ///////////////////////////////////////////////////////////////////////////////
1803 /////////// For SM messages
1804 ///////////////////////////////////////////////////////////////////////////////
1805 /// Message API of the SM task
1806 enum sm_msg_tag
1807 {
1808     /// Request to connect to an AP
1809     SM_CONNECT_REQ = LMAC_FIRST_MSG(TASK_SM),
1810     /// Confirmation of connection
1811     SM_CONNECT_CFM,                 // 0x1801
1812     /// Indicates that the SM associated to the AP
1813     SM_CONNECT_IND,                 // 0x1802
1814     /// Request to disconnect
1815     SM_DISCONNECT_REQ,              // 0x1803
1816     /// Confirmation of disconnection
1817     SM_DISCONNECT_CFM,              // 0x1804
1818     /// Indicates that the SM disassociated the AP
1819     SM_DISCONNECT_IND,              // 0x1805
1820     /// Request to start external authentication
1821     SM_EXTERNAL_AUTH_REQUIRED_IND,  // 0x1806
1822     /// Response to external authentication request
1823     SM_EXTERNAL_AUTH_REQUIRED_RSP,  // 0x1807
1824 
1825     /// MAX number of messages
1826     SM_MAX,
1827 };
1828 
1829 /// Structure containing the parameters of @ref SM_CONNECT_REQ message.
1830 struct sm_connect_req
1831 {
1832     /// SSID to connect to
1833     struct mac_ssid ssid;
1834     /// BSSID to connect to (if not specified, set this field to WILDCARD BSSID)
1835     struct mac_addr bssid;
1836     /// Channel on which we have to connect (if not specified, set -1 in the chan.freq field)
1837     struct mac_chan_def chan;
1838     /// Connection flags (see @ref mac_connection_flags)
1839     u32_l flags;
1840     /// Control port Ethertype (in network endianness)
1841     u16_l ctrl_port_ethertype;
1842     /// Length of the association request IEs
1843     u16_l ie_len;
1844     /// Listen interval to be used for this connection
1845     u16_l listen_interval;
1846     /// Flag indicating if the we have to wait for the BC/MC traffic after beacon or not
1847     bool_l dont_wait_bcmc;
1848     /// Authentication type
1849     u8_l auth_type;
1850     /// UAPSD queues (bit0: VO, bit1: VI, bit2: BE, bit3: BK)
1851     u8_l uapsd_queues;
1852     /// VIF index
1853     u8_l vif_idx;
1854     /// Buffer containing the additional information elements to be put in the
1855     /// association request
1856     uint32_t ie_buf[64];
1857 };
1858 
1859 /// Structure containing the parameters of the @ref SM_CONNECT_CFM message.
1860 struct sm_connect_cfm
1861 {
1862     /// Status. If 0, it means that the connection procedure will be performed and that
1863     /// a subsequent @ref SM_CONNECT_IND message will be forwarded once the procedure is
1864     /// completed
1865     u8_l status;
1866 };
1867 
1868 #define SM_ASSOC_IE_LEN   800
1869 /// Structure containing the parameters of the @ref SM_CONNECT_IND message.
1870 struct sm_connect_ind
1871 {
1872     /// Status code of the connection procedure
1873     u16_l status_code;
1874     /// BSSID
1875     struct mac_addr bssid;
1876     /// Flag indicating if the indication refers to an internal roaming or from a host request
1877     bool_l roamed;
1878     /// Index of the VIF for which the association process is complete
1879     u8_l vif_idx;
1880     /// Index of the STA entry allocated for the AP
1881     u8_l ap_idx;
1882     /// Index of the LMAC channel context the connection is attached to
1883     u8_l ch_idx;
1884     /// Flag indicating if the AP is supporting QoS
1885     bool_l qos;
1886     /// ACM bits set in the AP WMM parameter element
1887     u8_l acm;
1888     /// Length of the AssocReq IEs
1889     u16_l assoc_req_ie_len;
1890     /// Length of the AssocRsp IEs
1891     u16_l assoc_rsp_ie_len;
1892     /// IE buffer
1893     uint32_t assoc_ie_buf[SM_ASSOC_IE_LEN/4];
1894 
1895     u16_l aid;
1896     u8_l band;
1897     u16_l center_freq;
1898     u8_l width;
1899     uint32_t center_freq1;
1900     uint32_t center_freq2;
1901 
1902     /// EDCA parameters
1903     uint32_t ac_param[AC_MAX];
1904 };
1905 
1906 /// Structure containing the parameters of the @ref SM_DISCONNECT_REQ message.
1907 struct sm_disconnect_req
1908 {
1909     /// Reason of the deauthentication.
1910     u16_l reason_code;
1911     /// Index of the VIF.
1912     u8_l vif_idx;
1913 };
1914 
1915 /// Structure containing the parameters of SM_ASSOCIATION_IND the message
1916 struct sm_association_ind
1917 {
1918     // MAC ADDR of the STA
1919     struct mac_addr     me_mac_addr;
1920 };
1921 
1922 
1923 /// Structure containing the parameters of the @ref SM_DISCONNECT_IND message.
1924 struct sm_disconnect_ind
1925 {
1926     /// Reason of the disconnection.
1927     u16_l reason_code;
1928     /// Index of the VIF.
1929     u8_l vif_idx;
1930     /// FT over DS is ongoing
1931     bool_l ft_over_ds;
1932     // add for reassoc
1933     uint8_t reassoc;
1934 };
1935 
1936 /// Structure containing the parameters of the @ref SM_EXTERNAL_AUTH_REQUIRED_IND
1937 struct sm_external_auth_required_ind
1938 {
1939     /// Index of the VIF.
1940     u8_l vif_idx;
1941     /// SSID to authenticate to
1942     struct mac_ssid ssid;
1943     /// BSSID to authenticate to
1944     struct mac_addr bssid;
1945     /// AKM suite of the respective authentication
1946     uint32_t akm;
1947 };
1948 
1949 /// Structure containing the parameters of the @ref SM_EXTERNAL_AUTH_REQUIRED_RSP
1950 struct sm_external_auth_required_rsp
1951 {
1952     /// Index of the VIF.
1953     u8_l vif_idx;
1954     /// Authentication status
1955     u16_l status;
1956 };
1957 
1958 ///////////////////////////////////////////////////////////////////////////////
1959 /////////// For APM messages
1960 ///////////////////////////////////////////////////////////////////////////////
1961 /// Message API of the APM task
1962 enum apm_msg_tag
1963 {
1964     /// Request to start the AP.
1965     APM_START_REQ = LMAC_FIRST_MSG(TASK_APM),
1966     /// Confirmation of the AP start.
1967     APM_START_CFM,
1968     /// Request to stop the AP.
1969     APM_STOP_REQ,
1970     /// Confirmation of the AP stop.
1971     APM_STOP_CFM,
1972     /// Request to start CAC
1973     APM_START_CAC_REQ,
1974     /// Confirmation of the CAC start
1975     APM_START_CAC_CFM,
1976     /// Request to stop CAC
1977     APM_STOP_CAC_REQ,
1978     /// Confirmation of the CAC stop
1979     APM_STOP_CAC_CFM,
1980 
1981     APM_SET_BEACON_IE_REQ,
1982     APM_SET_BEACON_IE_CFM,
1983 
1984     /// MAX number of messages
1985     APM_MAX,
1986 };
1987 
1988 struct apm_set_bcn_ie_req
1989 {
1990     uint8_t  vif_idx;
1991     uint16_t bcn_ie_len;
1992     uint8_t  bcn_ie[400];
1993 };
1994 struct apm_set_bcn_ie_cfm
1995 {
1996     uint8_t status;
1997     uint8_t vif_idx;
1998 };
1999 
2000 /// Structure containing the parameters of the @ref APM_START_REQ message.
2001 struct apm_start_req
2002 {
2003     /// Basic rate set
2004     struct mac_rateset basic_rates;
2005     /// Control channel on which we have to enable the AP
2006     struct mac_chan_def chan;
2007     /// Center frequency of the first segment
2008     uint32_t center_freq1;
2009     /// Center frequency of the second segment (only in 80+80 configuration)
2010     uint32_t center_freq2;
2011     /// Width of channel
2012     u8_l ch_width;
2013     /// Address, in host memory, to the beacon template
2014     uint32_t bcn_addr;
2015     /// Length of the beacon template
2016     u16_l bcn_len;
2017     /// Offset of the TIM IE in the beacon
2018     u16_l tim_oft;
2019     /// Beacon interval
2020     u16_l bcn_int;
2021     /// Flags (@ref mac_connection_flags)
2022     uint32_t flags;
2023     /// Control port Ethertype
2024     u16_l ctrl_port_ethertype;
2025     /// Length of the TIM IE
2026     u8_l tim_len;
2027     /// Index of the VIF for which the AP is started
2028     u8_l vif_idx;
2029 };
2030 
2031 /// Structure containing the parameters of the @ref APM_START_CFM message.
2032 struct apm_start_cfm
2033 {
2034     /// Status of the AP starting procedure
2035     u8_l status;
2036     /// Index of the VIF for which the AP is started
2037     u8_l vif_idx;
2038     /// Index of the channel context attached to the VIF
2039     u8_l ch_idx;
2040     /// Index of the STA used for BC/MC traffic
2041     u8_l bcmc_idx;
2042 };
2043 
2044 /// Structure containing the parameters of the @ref APM_STOP_REQ message.
2045 struct apm_stop_req
2046 {
2047     /// Index of the VIF for which the AP has to be stopped
2048     u8_l vif_idx;
2049 };
2050 
2051 /// Structure containing the parameters of the @ref APM_START_CAC_REQ message.
2052 struct apm_start_cac_req
2053 {
2054     /// Control channel on which we have to start the CAC
2055     struct mac_chan_def chan;
2056     /// Center frequency of the first segment
2057     uint32_t center_freq1;
2058     /// Center frequency of the second segment (only in 80+80 configuration)
2059     uint32_t center_freq2;
2060     /// Width of channel
2061     u8_l ch_width;
2062     /// Index of the VIF for which the CAC is started
2063     u8_l vif_idx;
2064 };
2065 
2066 /// Structure containing the parameters of the @ref APM_START_CAC_CFM message.
2067 struct apm_start_cac_cfm
2068 {
2069     /// Status of the CAC starting procedure
2070     u8_l status;
2071     /// Index of the channel context attached to the VIF for CAC
2072     u8_l ch_idx;
2073 };
2074 
2075 /// Structure containing the parameters of the @ref APM_STOP_CAC_REQ message.
2076 struct apm_stop_cac_req
2077 {
2078     /// Index of the VIF for which the CAC has to be stopped
2079     u8_l vif_idx;
2080 };
2081 
2082 ///////////////////////////////////////////////////////////////////////////////
2083 /////////// For MESH messages
2084 ///////////////////////////////////////////////////////////////////////////////
2085 
2086 /// Maximum length of the Mesh ID
2087 #define MESH_MESHID_MAX_LEN     (32)
2088 
2089 /// Message API of the MESH task
2090 enum mesh_msg_tag
2091 {
2092     /// Request to start the MP
2093     MESH_START_REQ = LMAC_FIRST_MSG(TASK_MESH),
2094     /// Confirmation of the MP start.
2095     MESH_START_CFM,
2096 
2097     /// Request to stop the MP.
2098     MESH_STOP_REQ,
2099     /// Confirmation of the MP stop.
2100     MESH_STOP_CFM,
2101 
2102     // Request to update the MP
2103     MESH_UPDATE_REQ,
2104     /// Confirmation of the MP update
2105     MESH_UPDATE_CFM,
2106 
2107     /// Request information about a given link
2108     MESH_PEER_INFO_REQ,
2109     /// Response to the MESH_PEER_INFO_REQ message
2110     MESH_PEER_INFO_CFM,
2111 
2112     /// Request automatic establishment of a path with a given mesh STA
2113     MESH_PATH_CREATE_REQ,
2114     /// Confirmation to the MESH_PATH_CREATE_REQ message
2115     MESH_PATH_CREATE_CFM,
2116 
2117     /// Request a path update (delete path, modify next hop mesh STA)
2118     MESH_PATH_UPDATE_REQ,
2119     /// Confirmation to the MESH_PATH_UPDATE_REQ message
2120     MESH_PATH_UPDATE_CFM,
2121 
2122     /// Indication from Host that the indicated Mesh Interface is a proxy for an external STA
2123     MESH_PROXY_ADD_REQ,
2124 
2125     /// Indicate that a connection has been established or lost
2126     MESH_PEER_UPDATE_IND,
2127     /// Notification that a connection has been established or lost (when MPM handled by userspace)
2128     MESH_PEER_UPDATE_NTF = MESH_PEER_UPDATE_IND,
2129 
2130     /// Indicate that a path is now active or inactive
2131     MESH_PATH_UPDATE_IND,
2132     /// Indicate that proxy information have been updated
2133     MESH_PROXY_UPDATE_IND,
2134 
2135     /// MAX number of messages
2136     MESH_MAX,
2137 };
2138 
2139 /// Structure containing the parameters of the @ref MESH_START_REQ message.
2140 struct mesh_start_req
2141 {
2142     /// Basic rate set
2143     struct mac_rateset basic_rates;
2144     /// Control channel on which we have to enable the AP
2145     struct mac_chan_def chan;
2146     /// Center frequency of the first segment
2147     uint32_t center_freq1;
2148     /// Center frequency of the second segment (only in 80+80 configuration)
2149     uint32_t center_freq2;
2150     /// Width of channel
2151     u8_l ch_width;
2152     /// DTIM Period
2153     u8_l dtim_period;
2154     /// Beacon Interval
2155     u16_l bcn_int;
2156     /// Index of the VIF for which the MP is started
2157     u8_l vif_index;
2158     /// Length of the Mesh ID
2159     u8_l mesh_id_len;
2160     /// Mesh ID
2161     u8_l mesh_id[MESH_MESHID_MAX_LEN];
2162     /// Address of the IEs to download
2163     uint32_t ie_addr;
2164     /// Length of the provided IEs
2165     u8_l ie_len;
2166     /// Indicate if Mesh Peering Management (MPM) protocol is handled in userspace
2167     bool_l user_mpm;
2168     /// Indicate if Mesh Point is using authentication
2169     bool_l is_auth;
2170     /// Indicate which authentication method is used
2171     u8_l auth_id;
2172 };
2173 
2174 /// Structure containing the parameters of the @ref MESH_START_CFM message.
2175 struct mesh_start_cfm
2176 {
2177     /// Status of the MP starting procedure
2178     u8_l status;
2179     /// Index of the VIF for which the MP is started
2180     u8_l vif_idx;
2181     /// Index of the channel context attached to the VIF
2182     u8_l ch_idx;
2183     /// Index of the STA used for BC/MC traffic
2184     u8_l bcmc_idx;
2185 };
2186 
2187 /// Structure containing the parameters of the @ref MESH_STOP_REQ message.
2188 struct mesh_stop_req
2189 {
2190     /// Index of the VIF for which the MP has to be stopped
2191     u8_l vif_idx;
2192 };
2193 
2194 /// Structure containing the parameters of the @ref MESH_STOP_CFM message.
2195 struct mesh_stop_cfm
2196 {
2197     /// Index of the VIF for which the MP has to be stopped
2198     u8_l vif_idx;
2199    /// Status
2200     u8_l status;
2201 };
2202 
2203 /// Bit fields for mesh_update_req message's flags value
2204 enum mesh_update_flags_bit
2205 {
2206     /// Root Mode
2207     MESH_UPDATE_FLAGS_ROOT_MODE_BIT = 0,
2208     /// Gate Mode
2209     MESH_UPDATE_FLAGS_GATE_MODE_BIT,
2210     /// Mesh Forwarding
2211     MESH_UPDATE_FLAGS_MESH_FWD_BIT,
2212     /// Local Power Save Mode
2213     MESH_UPDATE_FLAGS_LOCAL_PSM_BIT,
2214 };
2215 
2216 /// Structure containing the parameters of the @ref MESH_UPDATE_REQ message.
2217 struct mesh_update_req
2218 {
2219     /// Flags, indicate fields which have been updated
2220     u8_l flags;
2221     /// VIF Index
2222     u8_l vif_idx;
2223     /// Root Mode
2224     u8_l root_mode;
2225     /// Gate Announcement
2226     bool_l gate_announ;
2227     /// Mesh Forwarding
2228     bool_l mesh_forward;
2229     /// Local PS Mode
2230     u8_l local_ps_mode;
2231 };
2232 
2233 /// Structure containing the parameters of the @ref MESH_UPDATE_CFM message.
2234 struct mesh_update_cfm
2235 {
2236     /// Status
2237     u8_l status;
2238 };
2239 
2240 /// Structure containing the parameters of the @ref MESH_PEER_INFO_REQ message.
2241 struct mesh_peer_info_req
2242 {
2243     ///Index of the station allocated for the peer
2244     u8_l sta_idx;
2245 };
2246 
2247 /// Structure containing the parameters of the @ref MESH_PEER_INFO_CFM message.
2248 struct mesh_peer_info_cfm
2249 {
2250     /// Response status
2251     u8_l status;
2252     /// Index of the station allocated for the peer
2253     u8_l sta_idx;
2254     /// Local Link ID
2255     u16_l local_link_id;
2256     /// Peer Link ID
2257     u16_l peer_link_id;
2258     /// Local PS Mode
2259     u8_l local_ps_mode;
2260     /// Peer PS Mode
2261     u8_l peer_ps_mode;
2262     /// Non-peer PS Mode
2263     u8_l non_peer_ps_mode;
2264     /// Link State
2265     u8_l link_state;
2266 };
2267 
2268 /// Structure containing the parameters of the @ref MESH_PATH_CREATE_REQ message.
2269 struct mesh_path_create_req
2270 {
2271     /// Index of the interface on which path has to be created
2272     u8_l vif_idx;
2273     /// Indicate if originator MAC Address is provided
2274     bool_l has_orig_addr;
2275     /// Path Target MAC Address
2276     struct mac_addr tgt_mac_addr;
2277     /// Originator MAC Address
2278     struct mac_addr orig_mac_addr;
2279 };
2280 
2281 /// Structure containing the parameters of the @ref MESH_PATH_CREATE_CFM message.
2282 struct mesh_path_create_cfm
2283 {
2284     /// Confirmation status
2285     u8_l status;
2286     /// VIF Index
2287     u8_l vif_idx;
2288 };
2289 
2290 /// Structure containing the parameters of the @ref MESH_PATH_UPDATE_REQ message.
2291 struct mesh_path_update_req
2292 {
2293     /// Indicate if path must be deleted
2294     bool_l delete;
2295     /// Index of the interface on which path has to be created
2296     u8_l vif_idx;
2297     /// Path Target MAC Address
2298     struct mac_addr tgt_mac_addr;
2299     /// Next Hop MAC Address
2300     struct mac_addr nhop_mac_addr;
2301 };
2302 
2303 /// Structure containing the parameters of the @ref MESH_PATH_UPDATE_CFM message.
2304 struct mesh_path_update_cfm
2305 {
2306     /// Confirmation status
2307     u8_l status;
2308     /// VIF Index
2309     u8_l vif_idx;
2310 };
2311 
2312 /// Structure containing the parameters of the @ref MESH_PROXY_ADD_REQ message.
2313 struct mesh_proxy_add_req
2314 {
2315     /// VIF Index
2316     u8_l vif_idx;
2317     /// MAC Address of the External STA
2318     struct mac_addr ext_sta_addr;
2319 };
2320 
2321 /// Structure containing the parameters of the @ref MESH_PROXY_UPDATE_IND
2322 struct mesh_proxy_update_ind
2323 {
2324     /// Indicate if proxy information has been added or deleted
2325     bool_l delete;
2326     /// Indicate if we are a proxy for the external STA
2327     bool_l local;
2328     /// VIF Index
2329     u8_l vif_idx;
2330     /// MAC Address of the External STA
2331     struct mac_addr ext_sta_addr;
2332     /// MAC Address of the proxy (only valid if local is false)
2333     struct mac_addr proxy_mac_addr;
2334 };
2335 
2336 /// Structure containing the parameters of the @ref MESH_PEER_UPDATE_IND message.
2337 struct mesh_peer_update_ind
2338 {
2339     /// Indicate if connection has been established or lost
2340     bool_l estab;
2341     /// VIF Index
2342     u8_l vif_idx;
2343     /// STA Index
2344     u8_l sta_idx;
2345     /// Peer MAC Address
2346     struct mac_addr peer_addr;
2347 };
2348 
2349 /// Structure containing the parameters of the @ref MESH_PEER_UPDATE_NTF message.
2350 struct mesh_peer_update_ntf
2351 {
2352     /// VIF Index
2353     u8_l vif_idx;
2354     /// STA Index
2355     u8_l sta_idx;
2356     /// Mesh Link State
2357     u8_l state;
2358 };
2359 
2360 /// Structure containing the parameters of the @ref MESH_PATH_UPDATE_IND message.
2361 struct mesh_path_update_ind
2362 {
2363     /// Indicate if path is deleted or not
2364     bool_l delete;
2365     /// Indicate if path is towards an external STA (not part of MBSS)
2366     bool_l ext_sta;
2367     /// VIF Index
2368     u8_l vif_idx;
2369     /// Path Index
2370     u8_l path_idx;
2371     /// Target MAC Address
2372     struct mac_addr tgt_mac_addr;
2373     /// External STA MAC Address (only if ext_sta is true)
2374     struct mac_addr ext_sta_mac_addr;
2375     /// Next Hop STA Index
2376     u8_l nhop_sta_idx;
2377 };
2378 
2379 ///////////////////////////////////////////////////////////////////////////////
2380 /////////// For Debug messages
2381 ///////////////////////////////////////////////////////////////////////////////
2382 
2383 /// Messages related to Debug Task
2384 enum dbg_msg_tag
2385 {
2386     /// Memory read request
2387     DBG_MEM_READ_REQ = LMAC_FIRST_MSG(TASK_DBG),
2388     /// Memory read confirm
2389     DBG_MEM_READ_CFM,
2390     /// Memory write request
2391     DBG_MEM_WRITE_REQ,
2392     /// Memory write confirm
2393     DBG_MEM_WRITE_CFM,
2394     /// Module filter request
2395     DBG_SET_MOD_FILTER_REQ,
2396     /// Module filter confirm
2397     DBG_SET_MOD_FILTER_CFM,
2398     /// Severity filter request
2399     DBG_SET_SEV_FILTER_REQ,
2400     /// Severity filter confirm
2401     DBG_SET_SEV_FILTER_CFM,
2402     /// LMAC/MAC HW fatal error indication
2403     DBG_ERROR_IND,
2404     /// Request to get system statistics
2405     DBG_GET_SYS_STAT_REQ,
2406     /// COnfirmation of system statistics
2407     DBG_GET_SYS_STAT_CFM,
2408     /// Max number of Debug messages
2409     DBG_MAX,
2410 };
2411 
2412 /// Structure containing the parameters of the @ref DBG_MEM_READ_REQ message.
2413 struct dbg_mem_read_req
2414 {
2415     uint32_t memaddr;
2416 };
2417 
2418 /// Structure containing the parameters of the @ref DBG_MEM_READ_CFM message.
2419 struct dbg_mem_read_cfm
2420 {
2421     uint32_t memaddr;
2422     uint32_t memdata;
2423 };
2424 
2425 /// Structure containing the parameters of the @ref DBG_MEM_WRITE_REQ message.
2426 struct dbg_mem_write_req
2427 {
2428     uint32_t memaddr;
2429     uint32_t memdata;
2430 };
2431 
2432 /// Structure containing the parameters of the @ref DBG_MEM_WRITE_CFM message.
2433 struct dbg_mem_write_cfm
2434 {
2435     uint32_t memaddr;
2436     uint32_t memdata;
2437 };
2438 
2439 /// Structure containing the parameters of the @ref DBG_SET_MOD_FILTER_REQ message.
2440 struct dbg_set_mod_filter_req
2441 {
2442     /// Bit field indicating for each module if the traces are enabled or not
2443     uint32_t mod_filter;
2444 };
2445 
2446 /// Structure containing the parameters of the @ref DBG_SEV_MOD_FILTER_REQ message.
2447 struct dbg_set_sev_filter_req
2448 {
2449     /// Bit field indicating the severity threshold for the traces
2450     uint32_t sev_filter;
2451 };
2452 
2453 /// Structure containing the parameters of the @ref DBG_GET_SYS_STAT_CFM message.
2454 struct dbg_get_sys_stat_cfm
2455 {
2456     /// Time spent in CPU sleep since last reset of the system statistics
2457     uint32_t cpu_sleep_time;
2458     /// Time spent in DOZE since last reset of the system statistics
2459     uint32_t doze_time;
2460     /// Total time spent since last reset of the system statistics
2461     uint32_t stats_time;
2462 };
2463 
2464 ///////////////////////////////////////////////////////////////////////////////
2465 /////////// For TDLS messages
2466 ///////////////////////////////////////////////////////////////////////////////
2467 
2468 /// List of messages related to the task.
2469 enum tdls_msg_tag
2470 {
2471     /// TDLS channel Switch Request.
2472     TDLS_CHAN_SWITCH_REQ = LMAC_FIRST_MSG(TASK_TDLS),
2473     /// TDLS channel switch confirmation.
2474     TDLS_CHAN_SWITCH_CFM,
2475     /// TDLS channel switch indication.
2476     TDLS_CHAN_SWITCH_IND,
2477     /// TDLS channel switch to base channel indication.
2478     TDLS_CHAN_SWITCH_BASE_IND,
2479     /// TDLS cancel channel switch request.
2480     TDLS_CANCEL_CHAN_SWITCH_REQ,
2481     /// TDLS cancel channel switch confirmation.
2482     TDLS_CANCEL_CHAN_SWITCH_CFM,
2483     /// TDLS peer power save indication.
2484     TDLS_PEER_PS_IND,
2485     /// TDLS peer traffic indication request.
2486     TDLS_PEER_TRAFFIC_IND_REQ,
2487     /// TDLS peer traffic indication confirmation.
2488     TDLS_PEER_TRAFFIC_IND_CFM,
2489     /// MAX number of messages
2490     TDLS_MAX
2491 };
2492 
2493 /// Structure containing the parameters of the @ref TDLS_CHAN_SWITCH_REQ message
2494 struct tdls_chan_switch_req
2495 {
2496     /// Index of the VIF
2497     u8_l vif_index;
2498     /// STA Index
2499     u8_l sta_idx;
2500     /// MAC address of the TDLS station
2501     struct mac_addr peer_mac_addr;
2502     bool_l initiator;
2503     /// Band (2.4GHz or 5GHz)
2504     u8_l band;
2505     /// Channel type: 20,40,80,160 or 80+80 MHz
2506     u8_l type;
2507     /// Frequency for Primary 20MHz channel (in MHz)
2508     u16_l prim20_freq;
2509     /// Frequency for Center of the contiguous channel or center of Primary 80+80
2510     u16_l center1_freq;
2511     /// Frequency for Center of the non-contiguous secondary 80+80
2512     u16_l center2_freq;
2513     /// TX power (in dBm)
2514     s8_l tx_power;
2515     /// Operating class
2516     u8_l op_class;
2517 };
2518 
2519 /// Structure containing the parameters of the @ref TDLS_CANCEL_CHAN_SWITCH_REQ message
2520 struct tdls_cancel_chan_switch_req
2521 {
2522     /// Index of the VIF
2523     u8_l vif_index;
2524     /// STA Index
2525     u8_l sta_idx;
2526     /// MAC address of the TDLS station
2527     struct mac_addr peer_mac_addr;
2528 };
2529 
2530 
2531 /// Structure containing the parameters of the @ref TDLS_CHAN_SWITCH_CFM message
2532 struct tdls_chan_switch_cfm
2533 {
2534     /// Status of the operation
2535     u8_l status;
2536 };
2537 
2538 /// Structure containing the parameters of the @ref TDLS_CANCEL_CHAN_SWITCH_CFM message
2539 struct tdls_cancel_chan_switch_cfm
2540 {
2541     /// Status of the operation
2542     u8_l status;
2543 };
2544 
2545 /// Structure containing the parameters of the @ref TDLS_CHAN_SWITCH_IND message
2546 struct tdls_chan_switch_ind
2547 {
2548     /// VIF Index
2549     u8_l vif_index;
2550     /// Channel Context Index
2551     u8_l chan_ctxt_index;
2552     /// Status of the operation
2553     u8_l status;
2554 };
2555 
2556 /// Structure containing the parameters of the @ref TDLS_CHAN_SWITCH_BASE_IND message
2557 struct tdls_chan_switch_base_ind
2558 {
2559     /// VIF Index
2560     u8_l vif_index;
2561     /// Channel Context index
2562     u8_l chan_ctxt_index;
2563 };
2564 
2565 /// Structure containing the parameters of the @ref TDLS_PEER_PS_IND message
2566 struct tdls_peer_ps_ind
2567 {
2568     /// VIF Index
2569     u8_l vif_index;
2570     /// STA Index
2571     u8_l sta_idx;
2572     /// MAC ADDR of the TDLS STA
2573     struct mac_addr peer_mac_addr;
2574     /// Flag to indicate if the TDLS peer is going to sleep
2575     bool ps_on;
2576 };
2577 
2578 /// Structure containing the parameters of the @ref TDLS_PEER_TRAFFIC_IND_REQ message
2579 struct tdls_peer_traffic_ind_req
2580 {
2581     /// VIF Index
2582     u8_l vif_index;
2583     /// STA Index
2584     u8_l sta_idx;
2585     // MAC ADDR of the TDLS STA
2586     struct mac_addr peer_mac_addr;
2587     /// Dialog token
2588     u8_l dialog_token;
2589     /// TID of the latest MPDU transmitted over the TDLS direct link to the TDLS STA
2590     u8_l last_tid;
2591     /// Sequence number of the latest MPDU transmitted over the TDLS direct link
2592     /// to the TDLS STA
2593     u16_l last_sn;
2594 };
2595 
2596 /// Structure containing the parameters of the @ref TDLS_PEER_TRAFFIC_IND_CFM message
2597 struct tdls_peer_traffic_ind_cfm
2598 {
2599     /// Status of the operation
2600     u8_l status;
2601 };
2602 
2603 
2604 struct mm_set_agg_disable_req
2605 {
2606     uint8_t disable;
2607     uint8_t sta_idx;
2608 };
2609 
2610 struct mm_set_coex_req
2611 {
2612     uint8_t bt_on;
2613     uint8_t disable_coexnull;
2614     uint8_t enable_periodic_timer;
2615     uint8_t enable_nullcts;
2616     uint8_t coex_timeslot_set;
2617     uint32_t coex_timeslot[2];
2618 };
2619 
2620 
2621 struct mm_set_rf_config_req
2622 {
2623     uint8_t def_band;
2624     uint8_t config_type;
2625     uint16_t offset;
2626     uint16_t len;
2627     uint16_t set;
2628     uint32_t data[32];
2629 };
2630 
2631 struct mm_set_rf_calib_req
2632 {
2633     uint32_t cal_cfg_24g; //cal2.4g + 5g
2634     uint32_t cal_cfg_5g;
2635     uint32_t param_alpha;
2636     uint32_t bt_calib_en;
2637     uint32_t bt_calib_param;
2638 };
2639 
2640 struct mm_set_rf_calib_cfm
2641 {
2642     uint32_t rxgain_24g_addr;
2643     uint32_t rxgain_5g_addr;
2644     uint32_t txgain_24g_addr;
2645     uint32_t txgain_5g_addr;
2646 };
2647 
2648 #endif // _WIFI_LMAC_MSG_H
2649