xref: /wlan-driver/qca-wifi-host-cmn/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /**
19  * DOC: contains mlo manager structure definitions
20  */
21 #ifndef __MLO_MGR_PUBLIC_STRUCTS_H
22 #define __MLO_MGR_PUBLIC_STRUCTS_H
23 
24 #include <wlan_objmgr_cmn.h>
25 #include <qdf_list.h>
26 #include <qdf_atomic.h>
27 #include <qdf_nbuf.h>
28 #include <wlan_cmn_ieee80211.h>
29 #include <wlan_cmn.h>
30 #include <wlan_objmgr_global_obj.h>
31 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
32 #include <qdf_event.h>
33 #endif
34 #include <wlan_mlo_t2lm.h>
35 
36 /* MAX MLO dev support */
37 #ifndef WLAN_UMAC_MLO_MAX_VDEVS
38 #define WLAN_UMAC_MLO_MAX_VDEVS 2
39 #endif
40 
41 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
42 /* Max bridge vdevs supported */
43 #define WLAN_UMAC_MLO_MAX_BRIDGE_VDEVS 2
44 /* Max number of PSOC taking part in topology decision at a time*/
45 #define WLAN_UMAC_MLO_MAX_PSOC_TOPOLOGY 3
46 #endif
47 
48 #include <wlan_mlo_epcs.h>
49 
50 /* MAX instances of ML devices */
51 #ifndef WLAN_UMAC_MLO_MAX_DEV
52 #define WLAN_UMAC_MLO_MAX_DEV 2
53 #endif
54 
55 /* MAX MLO Assoc Links per MLD */
56 #ifndef WLAN_UMAC_MLO_ASSOC_MAX_SUPPORTED_LINKS
57 #ifdef SAP_MULTI_LINK_EMULATION
58 #define WLAN_UMAC_MLO_ASSOC_MAX_SUPPORTED_LINKS 2
59 #else
60 #define WLAN_UMAC_MLO_ASSOC_MAX_SUPPORTED_LINKS 1
61 #endif
62 #endif
63 
64 
65 /* Default Initialization value for Max Recommended Simultaneous Links */
66 #ifndef WLAN_UMAC_MLO_RECOM_MAX_SIMULT_LINKS_DEFAULT
67 #define WLAN_UMAC_MLO_RECOM_MAX_SIMULT_LINKS_DEFAULT 2
68 #endif
69 
70 /* Max PEER support */
71 #define MAX_MLO_PEER 512
72 
73 struct mlo_mlme_ext_ops;
74 struct mlo_osif_ext_ops;
75 struct vdev_mlme_obj;
76 struct wlan_t2lm_context;
77 struct mlo_link_switch_context;
78 struct wlan_mlo_link_switch_req;
79 
80 /* Max LINK PEER support */
81 #define MAX_MLO_LINK_PEERS WLAN_UMAC_MLO_MAX_VDEVS
82 
83 /* MAX MLO peer_id supported by FW is 128 */
84 #define MAX_MLO_PEER_ID 128
85 #define MLO_INVALID_PEER_ID 0xFFFF
86 
87 /* IE nomenclature */
88 #define ID_POS 0
89 #define TAG_LEN_POS 1
90 #define IDEXT_POS 2
91 #define MIN_IE_LEN 2
92 #define MULTI_LINK_CTRL_1 3
93 #define MULTI_LINK_CTRL_2 4
94 #define STA_CTRL_1 2
95 #define STA_CTRL_2 3
96 #define STA_PROFILE_SUB_ELEM_ID 0
97 #define PER_STA_PROF_MAC_ADDR_START 4
98 
99 /* MLO link id max value */
100 #define MAX_MLO_LINK_ID 15
101 
102 #ifdef WLAN_MLO_MULTI_CHIP
103 
104 #ifndef WLAN_MAX_MLO_GROUPS
105 #define WLAN_MAX_MLO_GROUPS 2
106 #endif
107 
108 /**
109  * enum MLO_LINK_STATE - MLO link state enums
110  * @MLO_LINK_SETUP_INIT: MLO link SETUP exchange not yet done
111  * @MLO_LINK_SETUP_DONE: MLO link SETUP exchange started
112  * @MLO_LINK_READY: MLO link SETUP done and READY sent
113  * @MLO_LINK_TEARDOWN: MLO teardown done.
114  * @MLO_LINK_UNINITIALIZED: MLO link in blank state
115  */
116 enum MLO_LINK_STATE {
117 	MLO_LINK_SETUP_INIT,
118 	MLO_LINK_SETUP_DONE,
119 	MLO_LINK_READY,
120 	MLO_LINK_TEARDOWN,
121 	MLO_LINK_UNINITIALIZED,
122 };
123 
124 /**
125  * enum MLO_SOC_LIST - MLO SOC LIST
126  * @WLAN_MLO_GROUP_DEFAULT_SOC_LIST:  All MLO SoCs that are part of this MLO
127  *                                    group, (inclusive of both setup sequence
128  *                                    completed, not yet completed)
129  * @WLAN_MLO_GROUP_CURRENT_SOC_LIST:  Current MLO SoCs that are probed for which
130  *                                    the setup sequence has been completed
131  */
132 enum MLO_SOC_LIST {
133 	WLAN_MLO_GROUP_DEFAULT_SOC_LIST,
134 	WLAN_MLO_GROUP_CURRENT_SOC_LIST,
135 };
136 
137 /*
138  * Maximum number of MLO LINKS across the system,
139  * this is not the MLO links within and AP-MLD.
140  */
141 
142 #define MAX_MLO_LINKS 6
143 #define MAX_MLO_CHIPS 5
144 #define MAX_ADJ_CHIPS 2
145 
146 /* MLO Bridge link */
147 #define MLO_NUM_CHIPS_FOR_BRIDGE_LINK 4
148 #define MLO_MAX_BRIDGE_LINKS_PER_MLD 2
149 #define MLO_MAX_BRIDGE_LINKS_PER_RADIO 8
150 
151 /**
152  * struct mlo_chip_info: MLO chip info per link
153  * @info_valid: If the info here is valid or not
154  * @chip_id: Chip ID as assigned by platform
155  * @adj_chip_ids: Chip IDs of Adjacent chips
156  */
157 struct mlo_chip_info {
158 	uint8_t info_valid;
159 	uint8_t chip_id[MAX_MLO_CHIPS];
160 	uint8_t adj_chip_ids[MAX_MLO_CHIPS][MAX_ADJ_CHIPS];
161 };
162 
163 #define START_STOP_INPROGRESS_BIT 0
164 
165 /**
166  * struct mlo_setup_info: MLO setup status per link
167  * @ml_grp_id: Unique id for ML grouping of Pdevs/links
168  * @tot_socs: Total number of soc participating in ML group
169  * @num_soc: Number of soc ready or probed
170  * @tot_links: Total links in ML group
171  * @num_links: Number of links probed in ML group
172  * @pdev_list: current pdev pointers belonging to this group
173  * @curr_soc_list: current psoc pointers belonging to this group
174  * @soc_list: Actual psoc pointers part of this group
175  * @soc_id_list: list of soc ids part of this mlo group
176  * @state: MLO link state
177  * @valid_link_bitmap: valid MLO link bitmap
178  * @trigger_umac_reset: teardown require umac reset, for mode1 SSR
179  * @state_lock: lock to protect access to link state
180  * @event: event for teardown completion
181  * @start_stop_inprogress: MLO group start/stop in progress
182  * @dp_handle: pointer to DP ML context
183  * @chip_info: chip specific info of the soc
184  * @tsf_sync_enabled: MLO TSF sync is enabled at FW or not
185  * @wsi_stats_info_support: WSI stats support at FW or not
186  */
187 struct mlo_setup_info {
188 	uint8_t ml_grp_id;
189 	uint8_t tot_socs;
190 	uint8_t num_soc;
191 	uint8_t tot_links;
192 	uint8_t num_links;
193 	struct wlan_objmgr_pdev *pdev_list[MAX_MLO_LINKS];
194 	struct wlan_objmgr_psoc *curr_soc_list[MAX_MLO_CHIPS];
195 	struct wlan_objmgr_psoc *soc_list[MAX_MLO_CHIPS];
196 	uint8_t soc_id_list[MAX_MLO_CHIPS];
197 	enum MLO_LINK_STATE state[MAX_MLO_LINKS];
198 	uint16_t valid_link_bitmap;
199 	bool trigger_umac_reset;
200 	qdf_spinlock_t state_lock;
201 	qdf_event_t event;
202 	unsigned long start_stop_inprogress;
203 	struct cdp_mlo_ctxt *dp_handle;
204 	struct mlo_chip_info chip_info;
205 	bool tsf_sync_enabled;
206 	uint8_t wsi_stats_info_support;
207 };
208 
209 /**
210  * struct mlo_state_params: MLO state params for pdev iteration
211  * @link_state_fail: Flag to check when pdev not in expected state
212  * @check_state: State on against which pdev is to be expected
213  * @grp_id: Id of the required MLO Group
214  */
215 struct mlo_state_params {
216 	bool link_state_fail;
217 	enum MLO_LINK_STATE check_state;
218 	uint8_t grp_id;
219 };
220 
221 #endif
222 
223 /**
224  * enum wlan_mlo_link_switch_notify_reason - Enum for link switch notifier
225  *                                           callback trigger reason.
226  * @MLO_LINK_SWITCH_NOTIFY_REASON_PRE_START_PRE_SER: Prior to start of
227  *                                                   link switch and prior to
228  *                                                   serializing link switch.
229  * @MLO_LINK_SWITCH_NOTIFY_REASON_PRE_START_POST_SER: Prior to link switch start
230  *                                                    but link switch is
231  *                                                    serialized
232  * @MLO_LINK_SWITCH_NOTIFY_REASON_STOP_FAILURE: Link switch failure notify
233  * @MLO_LINK_SWITCH_NOTIFY_REASON_STOP_SUCCESS: Link switch success notify
234  */
235 enum wlan_mlo_link_switch_notify_reason {
236 	MLO_LINK_SWITCH_NOTIFY_REASON_PRE_START_PRE_SER,
237 	MLO_LINK_SWITCH_NOTIFY_REASON_PRE_START_POST_SER,
238 	MLO_LINK_SWITCH_NOTIFY_REASON_STOP_FAILURE,
239 	MLO_LINK_SWITCH_NOTIFY_REASON_STOP_SUCCESS,
240 };
241 
242 typedef QDF_STATUS
243 (*mlo_mgr_link_switch_notifier_cb)(struct wlan_objmgr_vdev *vdev,
244 				   struct wlan_mlo_link_switch_req *lswitch_req,
245 				   enum wlan_mlo_link_switch_notify_reason notify_reason);
246 
247 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
248 /*
249  * struct wlan_mlo_link_switch_notifier - Link switch notifier callbacks
250  * @in_use: Set to true on successful notifier callback registration
251  * @cb: Callback to notify link switch start
252  */
253 struct wlan_mlo_link_switch_notifier {
254 	bool in_use;
255 	mlo_mgr_link_switch_notifier_cb cb;
256 };
257 
258 /**
259  * mlo_mgr_register_link_switch_notifier() - API to register link switch
260  * start notifier callback
261  * @comp_id: Component requesting notification on link switch start
262  * @cb: Callback to register.
263  *
264  * The @cb will be triggered on start of link switch with params of the
265  * link switch.
266  *
267  * Return: QDF_STATUS
268  */
269 QDF_STATUS
270 mlo_mgr_register_link_switch_notifier(enum wlan_umac_comp_id comp_id,
271 				      mlo_mgr_link_switch_notifier_cb cb);
272 
273 /**
274  * mlo_mgr_unregister_link_switch_notifier() - API to unregister link switch
275  * notifier callback.
276  * @comp_id: Component to deregister.
277  *
278  * The API will cleanup the notification callback registered for link switch.
279  *
280  * Return: QDF_STATUS
281  */
282 QDF_STATUS
283 mlo_mgr_unregister_link_switch_notifier(enum wlan_umac_comp_id comp_id);
284 #else
285 static inline QDF_STATUS
mlo_mgr_register_link_switch_notifier(enum wlan_umac_comp_id comp_id,mlo_mgr_link_switch_notifier_cb cb)286 mlo_mgr_register_link_switch_notifier(enum wlan_umac_comp_id comp_id,
287 				      mlo_mgr_link_switch_notifier_cb cb)
288 {
289 	return QDF_STATUS_E_NOSUPPORT;
290 }
291 
292 static inline QDF_STATUS
mlo_mgr_unregister_link_switch_notifier(enum wlan_umac_comp_id comp_id)293 mlo_mgr_unregister_link_switch_notifier(enum wlan_umac_comp_id comp_id)
294 {
295 	return QDF_STATUS_E_NOSUPPORT;
296 }
297 #endif /* WLAN_FEATURE_11BE_MLO_ADV_FEATURE */
298 
299 /*
300  * struct mlo_wsi_link_stats - MLO ingress/egress counters of PSOC
301  * @ingress_cnt:  Ingress counter
302  * @egress_cnt:  Egress counter
303  * @send_wmi_cmd: To indicate whether WMI command to be sent or not
304  */
305 struct mlo_wsi_link_stats {
306 	uint32_t ingress_cnt;
307 	uint32_t egress_cnt;
308 	bool  send_wmi_cmd;
309 };
310 
311 /*
312  * struct mlo_wsi_psoc_grp - MLO WSI PSOC group
313  * @psoc_order:  PSOC list in WSI loop order
314  * @num_psoc: num psoc in the group
315  */
316 struct mlo_wsi_psoc_grp {
317 	uint32_t psoc_order[WLAN_OBJMGR_MAX_DEVICES];
318 	uint32_t num_psoc;
319 };
320 
321 #define MLO_WSI_MAX_MLO_GRPS 2
322 #define MLO_WSI_PSOC_ID_MAX 0xFF
323 
324 /*
325  * struct mlo_wsi_info - MLO ingress/egress link context per-PSOC
326  * @mlo_psoc_grp: PSOC IDs for different MLO groups
327  * @num_psoc: Total num psoc
328  * @link_stats: Ingress and Egress counts for PSOCs
329  * @block_wmi_cmd: Blocks WMI command
330  */
331 struct mlo_wsi_info {
332 	struct mlo_wsi_psoc_grp mlo_psoc_grp[MLO_WSI_MAX_MLO_GRPS];
333 	uint32_t num_psoc;
334 	struct mlo_wsi_link_stats link_stats[WLAN_OBJMGR_MAX_DEVICES];
335 	uint8_t block_wmi_cmd;
336 };
337 
338 /**
339  * struct mlo_mgr_context - MLO manager context
340  * @ml_dev_list_lock: ML DEV list lock
341  * @aid_lock: AID global lock
342  * @ml_peerid_lock: ML peer ID global lock
343  * @ml_dev_list: Array of MLO device context
344  * @mlo_peer_id_bmap: bitmap to allocate MLO Peer ID
345  * @max_mlo_peer_id: Max MLO Peer ID
346  * @last_mlo_peer_id: Previously allocated ML peer ID
347  * @setup_info: Pointer to MLO setup_info of all groups
348  * @total_grp: Total number of MLO groups
349  * @mlme_ops: MLO MLME callback function pointers
350  * @osif_ops: MLO to OSIF callback function pointers
351  * @msgq_ctx: Context switch mgr
352  * @mlo_is_force_primary_umac: Force Primary UMAC enable
353  * @mlo_forced_primary_umac_id: Force Primary UMAC ID
354  * @force_non_assoc_prim_umac: Force non-assoc link to be primary umac
355  * @lswitch_notifier: Link switch notifier callbacks
356  * @wsi_info: WSI stats info
357  * @disable_eml: Disable Enhanced Multi Link features(eMLSR and eMLMR).
358  */
359 struct mlo_mgr_context {
360 #ifdef WLAN_MLO_USE_SPINLOCK
361 	qdf_spinlock_t ml_dev_list_lock;
362 	qdf_spinlock_t aid_lock;
363 	qdf_spinlock_t ml_peerid_lock;
364 #else
365 	qdf_mutex_t ml_dev_list_lock;
366 	qdf_mutex_t aid_lock;
367 	qdf_mutex_t ml_peerid_lock;
368 #endif
369 	qdf_list_t ml_dev_list;
370 	qdf_bitmap(mlo_peer_id_bmap, MAX_MLO_PEER_ID);
371 	uint16_t max_mlo_peer_id;
372 	uint16_t last_mlo_peer_id;
373 #ifdef WLAN_MLO_MULTI_CHIP
374 	struct mlo_setup_info *setup_info;
375 	uint8_t total_grp;
376 #endif
377 	struct mlo_mlme_ext_ops *mlme_ops;
378 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
379 	struct mlo_osif_ext_ops *osif_ops;
380 #endif
381 	struct ctxt_switch_mgr *msgq_ctx;
382 	bool mlo_is_force_primary_umac;
383 	uint8_t mlo_forced_primary_umac_id;
384 	bool force_non_assoc_prim_umac;
385 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
386 	struct wlan_mlo_link_switch_notifier lswitch_notifier[WLAN_UMAC_COMP_ID_MAX];
387 #endif /* WLAN_FEATURE_11BE_MLO_ADV_FEATURE */
388 	struct mlo_wsi_info *wsi_info;
389 	bool disable_eml;
390 };
391 
392 /**
393  * struct wlan_ml_vdev_aid_mgr - ML AID manager
394  * @aid_bitmap: AID bitmap array
395  * @start_aid: start of AID index
396  * @max_aid: Max allowed AID
397  * @aid_mgr:  Array of link vdev aid mgr
398  */
399 struct wlan_ml_vdev_aid_mgr {
400 	qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID);
401 	uint16_t start_aid;
402 	uint16_t max_aid;
403 	struct wlan_vdev_aid_mgr *aid_mgr[WLAN_UMAC_MLO_MAX_VDEVS];
404 };
405 
406 /**
407  * struct wlan_mlo_key_mgmt - MLO key management
408  * @keys_saved: keys saved bool
409  * @link_id: link id
410  */
411 struct wlan_mlo_key_mgmt {
412 	bool keys_saved;
413 	uint8_t link_id;
414 };
415 
416 /**
417  * struct mlo_link_bss_params - link bss param
418  * @link_id: link id
419  * @ap_mld_mac: mld mac address
420  * @chan: channel
421  */
422 struct mlo_link_bss_params {
423 	int8_t link_id;
424 	int8_t ap_mld_mac[QDF_MAC_ADDR_SIZE];
425 	struct wlan_channel *chan;
426 };
427 
428 #ifdef WLAN_FEATURE_11BE_MLO
429 
430 /**
431  * enum mlo_link_info_event_status - link info event status
432  * @WLAN_LINK_INFO_EVENT_SUCCESS: success
433  * @WLAN_LINK_INFO_EVENT_REJECT_FAILURE: reject due to common failure reason
434  * @WLAN_LINK_INFO_EVENT_REJECT_VDEV_NOT_UP: reject as vdev is not up
435  * @WLAN_LINK_INFO_EVENT_REJECT_ROAMING_IN_PROGRESS: reject as roaming
436  *						     is in progress
437  * @WLAN_LINK_INFO_EVENT_REJECT_NON_MLO_CONNECTION: reject as it's not
438  *						    MLO connection
439  */
440 enum mlo_link_info_event_status {
441 	WLAN_LINK_INFO_EVENT_SUCCESS,
442 	WLAN_LINK_INFO_EVENT_REJECT_FAILURE,
443 	WLAN_LINK_INFO_EVENT_REJECT_VDEV_NOT_UP,
444 	WLAN_LINK_INFO_EVENT_REJECT_ROAMING_IN_PROGRESS,
445 	WLAN_LINK_INFO_EVENT_REJECT_NON_MLO_CONNECTION,
446 };
447 
448 /**
449  * struct mlo_link_state_cmd_params - MLO link state params
450  * @vdev_id: Vdev id
451  * @mld_mac: mld mac address
452  */
453 struct mlo_link_state_cmd_params {
454 	uint8_t vdev_id;
455 	uint8_t mld_mac[QDF_MAC_ADDR_SIZE];
456 };
457 
458 /**
459  * struct ml_link_info - ml link information
460  * @vdev_id: vdev id for this link
461  * @link_id: link id defined as in 802.11 BE spec.
462  * @link_status: inactive 0, active 1
463  * @reserved: reserved bits
464  * @chan_freq: Channel frequency in MHz
465  */
466 struct ml_link_info {
467 	uint32_t vdev_id:8,
468 		 link_id:8,
469 		 link_status:2,
470 		 reserved:14;
471 	uint32_t chan_freq;
472 };
473 
474 /**
475  * struct ml_link_state_info_event - ML link state info response
476  * @status: to indicate the status for ml link info
477  * @hw_mode_index: current hardware mode index
478  * @link_info: link information
479  * @num_mlo_vdev_link_info: number of mlo vdev link info
480  * @vdev_id: vdev_id
481  * @mldaddr: mld addr
482  */
483 struct ml_link_state_info_event {
484 	uint32_t status;
485 	uint32_t hw_mode_index;
486 	struct ml_link_info link_info[WLAN_MAX_ML_BSS_LINKS];
487 	uint16_t num_mlo_vdev_link_info;
488 	uint8_t vdev_id;
489 	struct qdf_mac_addr mldaddr;
490 };
491 
492 /**
493  * struct ml_link_state_cmd_info - ml link state command info
494  * @request_cookie: request cookie
495  * @ml_link_state_resp_cb: callback function to handle response
496  * @ml_link_state_req_context: request context
497  */
498 struct ml_link_state_cmd_info {
499 	void *request_cookie;
500 	void (*ml_link_state_resp_cb)(struct ml_link_state_info_event *ev,
501 				      void *cookie);
502 	void *ml_link_state_req_context;
503 };
504 #endif
505 /**
506  * struct mlo_sta_csa_params - CSA request parameters in mlo mgr
507  * @csa_param: csa parameters
508  * @link_id: the link index of AP which triggers CSA
509  * @mlo_csa_synced: Before vdev is up, csa information is only saved but not
510  *                  handled, and this value is false. Once vdev is up, the saved
511  *                  csa information is handled, and this value is changed to
512  *                  true. Note this value will be true if the vdev is doing
513  *                  restart.
514  * @csa_offload_event_recvd: True if WMI_CSA_HANDLING_EVENTID is already
515  *                           received. False if this is the first
516  *                           WMI_CSA_HANDLING_EVENTID.
517  * @valid_csa_param: True once csa_param is filled.
518  */
519 struct mlo_sta_csa_params {
520 	struct csa_offload_params csa_param;
521 	uint8_t link_id;
522 	bool mlo_csa_synced;
523 	bool csa_offload_event_recvd;
524 	bool valid_csa_param;
525 };
526 
527 /**
528  * struct mlo_sta_cu_params - critical update parameters in mlo mgr
529  * @vdev_id: vdev id
530  * @bpcc: bss parameter change count
531  * @initialized: flag about the parameter is valid or not
532  */
533 struct mlo_sta_cu_params {
534 	uint8_t vdev_id;
535 	uint8_t bpcc;
536 	bool initialized;
537 };
538 
539 /**
540  * struct mlo_sta_quiet_status - MLO sta quiet status
541  * @link_id: link id
542  * @quiet_status: true if corresponding ap in quiet status
543  * @valid_status: true if mlo_sta_quiet_status is filled
544  */
545 struct mlo_sta_quiet_status {
546 	uint8_t link_id;
547 	bool quiet_status;
548 	bool valid_status;
549 };
550 
551 /**
552  * enum mlo_link_force_mode: MLO link force modes
553  * @MLO_LINK_FORCE_MODE_ACTIVE:
554  *  Force specific links active
555  * @MLO_LINK_FORCE_MODE_INACTIVE:
556  *  Force specific links inactive
557  * @MLO_LINK_FORCE_MODE_ACTIVE_NUM:
558  *  Force active a number of links, firmware to decide which links to inactive
559  * @MLO_LINK_FORCE_MODE_INACTIVE_NUM:
560  *  Force inactive a number of links, firmware to decide which links to inactive
561  * @MLO_LINK_FORCE_MODE_NO_FORCE:
562  *  Cancel the force operation of specific links, allow firmware to decide
563  * @MLO_LINK_FORCE_MODE_ACTIVE_INACTIVE: Force specific links active and
564  *  force specific links inactive
565  */
566 enum mlo_link_force_mode {
567 	MLO_LINK_FORCE_MODE_ACTIVE       = 1,
568 	MLO_LINK_FORCE_MODE_INACTIVE     = 2,
569 	MLO_LINK_FORCE_MODE_ACTIVE_NUM   = 3,
570 	MLO_LINK_FORCE_MODE_INACTIVE_NUM = 4,
571 	MLO_LINK_FORCE_MODE_NO_FORCE     = 5,
572 	MLO_LINK_FORCE_MODE_ACTIVE_INACTIVE = 6,
573 };
574 
575 /**
576  * enum mlo_link_force_reason: MLO link force reasons
577  * @MLO_LINK_FORCE_REASON_CONNECT:
578  *  Set force specific links because of new connection
579  * @MLO_LINK_FORCE_REASON_DISCONNECT:
580  *  Set force specific links because of new dis-connection
581  * @MLO_LINK_FORCE_REASON_LINK_REMOVAL:
582  *  Set force specific links because of AP side link removal
583  * @MLO_LINK_FORCE_REASON_TDLS:
584  *  Set force specific links because of TDLS operation
585  */
586 enum mlo_link_force_reason {
587 	MLO_LINK_FORCE_REASON_CONNECT    = 1,
588 	MLO_LINK_FORCE_REASON_DISCONNECT = 2,
589 	MLO_LINK_FORCE_REASON_LINK_REMOVAL = 3,
590 	MLO_LINK_FORCE_REASON_TDLS = 4,
591 };
592 
593 /**
594  * enum set_link_source - set link source
595  * @SET_LINK_FROM_CONCURRENCY: concurrent connection request
596  * @SET_LINK_FROM_VENDOR_CMD: vendor command request
597  * @SET_LINK_FROM_TDLS: tdls command request
598  * @SET_LINK_SOURCE_MAX: max num of source
599  */
600 enum set_link_source {
601 	SET_LINK_FROM_CONCURRENCY = 0,
602 	SET_LINK_FROM_VENDOR_CMD = 1,
603 	SET_LINK_FROM_TDLS = 2,
604 	SET_LINK_SOURCE_MAX,
605 };
606 
607 /**
608  * struct set_link_req - set link request
609  * @mode: set link mode
610  * @reason: reason of set link
611  * @force_active_bitmap: force active link bitmap
612  * @force_inactive_bitmap: force inactive link bitmap
613  * @force_active_num: force active link num
614  * @force_active_num_bitmap: force active num link bitmap
615  * @force_inactive_num: force inactive link num
616  * @force_inactive_num_bitmap: force inactive num link bitmap
617  */
618 struct set_link_req {
619 	enum mlo_link_force_mode mode;
620 	enum mlo_link_force_reason reason;
621 	uint16_t force_active_bitmap;
622 	uint16_t force_inactive_bitmap;
623 	uint8_t force_active_num;
624 	uint16_t force_active_num_bitmap;
625 	uint8_t force_inactive_num;
626 	uint16_t force_inactive_num_bitmap;
627 };
628 
629 /**
630  * struct ml_link_force_state - link force state.
631  * @force_active_bitmap: force active link bitmap
632  * @force_inactive_bitmap: force inactive link bitmap
633  * @force_active_num: force active link num
634  * @force_active_num_bitmap: force active num link bitmap
635  * @force_inactive_num: force inactive link num
636  * @force_inactive_num_bitmap: force inactive num link bitmap
637  * @curr_dynamic_inactive_bitmap: dynamic inactive link bitmap
638  * @curr_active_bitmap: current active link bitmap
639  * @curr_inactive_bitmap: current inactive link bitmap
640  */
641 struct ml_link_force_state {
642 	uint16_t force_active_bitmap;
643 	uint16_t force_inactive_bitmap;
644 	uint8_t force_active_num;
645 	uint16_t force_active_num_bitmap;
646 	uint8_t force_inactive_num;
647 	uint16_t force_inactive_num_bitmap;
648 	uint16_t curr_dynamic_inactive_bitmap;
649 	uint16_t curr_active_bitmap;
650 	uint16_t curr_inactive_bitmap;
651 };
652 
653 /**
654  * struct wlan_link_force_context - link force ctx.
655  * @force_state: current force active/inactive states which
656  * have been sent to target
657  * @reqs: request of set link
658  */
659 struct wlan_link_force_context {
660 	struct ml_link_force_state force_state;
661 	struct set_link_req reqs[SET_LINK_SOURCE_MAX];
662 };
663 
664 #if defined(UMAC_SUPPORT_MLNAWDS) || defined(MESH_MODE_SUPPORT)
665 /**
666  * struct mlnawds_config - MLO NAWDS configuration
667  * @caps: Bandwidth & NSS capabilities to be configured on NAWDS peer
668  * @puncture_bitmap: puncture bitmap to be configured on NAWDS peer
669  * @mac: MAC address of the NAWDS peer to which the caps & puncture bitmap is
670  * to be configured.
671  */
672 struct mlnawds_config {
673 	uint64_t caps;
674 	uint16_t puncture_bitmap;
675 	uint8_t  mac[QDF_MAC_ADDR_SIZE];
676 };
677 #endif
678 
679 /* AP removed link flag bit position for link_status_flags in
680  * struct mlo_link_info
681  */
682 #define LS_F_AP_REMOVAL_BIT 0
683 
684 /**
685  * struct mlo_link_info - ML link info
686  * @link_addr: link mac address
687  * @link_id: link index
688  * @is_bridge : Bridge peer or not
689  * @chan_freq: Operating channel frequency
690  * @nawds_config: peer's NAWDS configurarion
691  * @vdev_id: VDEV ID
692  * @mesh_config: peer's MESH configurarion
693  * @link_status_flags: Current status of link
694  * @ap_link_addr: Associated link BSSID
695  * @link_chan_info: Associated link channel info
696  * @is_link_active: link state
697  */
698 struct mlo_link_info {
699 	struct qdf_mac_addr link_addr;
700 	uint8_t link_id;
701 	bool is_bridge;
702 	uint16_t chan_freq;
703 #ifdef UMAC_SUPPORT_MLNAWDS
704 	struct mlnawds_config nawds_config;
705 #endif
706 	uint8_t vdev_id;
707 #ifdef MESH_MODE_SUPPORT
708 	struct mlnawds_config mesh_config;
709 #endif
710 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
711 	unsigned long link_status_flags;
712 	struct qdf_mac_addr ap_link_addr;
713 	struct wlan_channel *link_chan_info;
714 #endif
715 	bool is_link_active;
716 };
717 
718 /**
719  * struct mlo_nstr_info - MLO NSTR capability info
720  * @link_id: Lind Id
721  * @nstr_lp_present: Flag for NSTR link pair presence
722  * @nstr_bmp_size: NSTR Bitmap Size
723  * @nstr_lp_bitmap: NSTR link pair bitmap of link_id
724  */
725 struct mlo_nstr_info {
726 	uint8_t link_id;
727 	bool nstr_lp_present;
728 	uint8_t nstr_bmp_size;
729 	uint16_t nstr_lp_bitmap;
730 };
731 
732 #ifndef WLAN_MAX_ML_BSS_LINKS
733 #define WLAN_MAX_ML_BSS_LINKS WLAN_UMAC_MLO_MAX_VDEVS
734 #endif
735 
736 /**
737  * struct mlo_partner_info - mlo partner link info
738  * @num_partner_links: no. of partner links
739  * @partner_link_info: per partner link info
740  * @t2lm_enable_val: enum wlan_t2lm_enable
741  * @nstr_info: NSTR Capability info
742  * @num_nstr_info_links: No. of links for which NSTR info is present
743  */
744 struct mlo_partner_info {
745 	uint8_t num_partner_links;
746 	struct mlo_link_info partner_link_info[WLAN_MAX_ML_BSS_LINKS];
747 #ifdef WLAN_FEATURE_11BE
748 	enum wlan_t2lm_enable t2lm_enable_val;
749 	struct mlo_nstr_info nstr_info[WLAN_UMAC_MLO_MAX_VDEVS];
750 	uint8_t num_nstr_info_links;
751 #endif
752 };
753 
754 #ifdef WLAN_FEATURE_11BE_MLO
755 /**
756  * struct emlsr_capability - EMLSR capabilities info
757  * @emlsr_supp: EMLSR support is present or not.
758  * @trans_timeout: transition timeout
759  */
760 struct emlsr_capability {
761 	bool emlsr_supp;
762 	uint8_t trans_timeout;
763 };
764 #endif
765 
766 /**
767  * struct wlan_mlo_sta_assoc_pending_list - MLO sta assoc pending list entry
768  * @peer_list: MLO peer list
769  * @list_lock: lock to access members of structure
770  */
771 struct wlan_mlo_sta_assoc_pending_list {
772 	qdf_list_t peer_list;
773 	qdf_spinlock_t list_lock;
774 };
775 
776 /**
777  * struct wlan_mlo_sta - MLO sta additional info
778  * @wlan_connect_req_links: list of vdevs selected for connection with the MLAP
779  * @wlan_connected_links: list of vdevs associated with this MLO connection
780  * @key_mgmt:
781  * @connect_req: connect params
782  * @copied_conn_req: original connect req
783  * @copied_conn_req_lock: lock for the original connect request
784  * @assoc_rsp: Raw assoc response frame
785  * @mlo_quiet_status:
786  * @mlo_csa_param: CSA request parameters for mlo sta
787  * @mlo_cu_param: critical update parameters for mlo sta
788  * @disconn_req: disconnect req params
789  * @copied_reassoc_rsp: Reassoc response copied from assoc link roam handling
790  *                      to re-use while link connect in case of deferred/need
791  *                      basis link connect (e.g. MLO OWE roaming).
792  * @ml_link_state: ml link state command info param
793  * @copied_t2lm_ie_assoc_rsp: copy of t2lm ie received in assoc response
794  * @ml_partner_info: mlo partner link info
795  * @emlsr_cap: EMLSR capabilities info
796  * @link_force_ctx: set link force mode context
797  * @ml_link_control_mode: link control mode configured via user space
798  * @ml_chan_switch_in_progress: Flag to track CSA at MLD level
799  */
800 struct wlan_mlo_sta {
801 	qdf_bitmap(wlan_connect_req_links, WLAN_UMAC_MLO_MAX_VDEVS);
802 	qdf_bitmap(wlan_connected_links, WLAN_UMAC_MLO_MAX_VDEVS);
803 	struct wlan_mlo_key_mgmt key_mgmt[WLAN_MAX_ML_BSS_LINKS];
804 	struct wlan_cm_connect_req *connect_req;
805 	struct wlan_cm_connect_req *copied_conn_req;
806 #ifdef WLAN_MLO_USE_SPINLOCK
807 	qdf_spinlock_t copied_conn_req_lock;
808 #else
809 	qdf_mutex_t copied_conn_req_lock;
810 #endif
811 	struct element_info assoc_rsp;
812 	struct mlo_sta_quiet_status mlo_quiet_status[WLAN_UMAC_MLO_MAX_VDEVS];
813 	struct mlo_sta_csa_params mlo_csa_param[WLAN_UMAC_MLO_MAX_VDEVS];
814 	struct mlo_sta_cu_params mlo_cu_param[WLAN_UMAC_MLO_MAX_VDEVS];
815 	struct wlan_cm_disconnect_req *disconn_req;
816 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
817 	struct wlan_cm_connect_resp *copied_reassoc_rsp;
818 #endif
819 #ifdef WLAN_FEATURE_11BE_MLO
820 	struct ml_link_state_cmd_info ml_link_state;
821 	struct wlan_t2lm_context copied_t2lm_ie_assoc_rsp;
822 	struct mlo_partner_info ml_partner_info;
823 	struct emlsr_capability emlsr_cap;
824 #endif
825 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
826 	struct wlan_link_force_context link_force_ctx;
827 #endif
828 	uint8_t ml_link_control_mode;
829 	bool ml_chan_switch_in_progress;
830 };
831 
832 /**
833  * struct wlan_mlo_ap - MLO AP related info
834  * @num_ml_vdevs: number of vdevs to form MLD
835  * @ml_aid_mgr: ML AID mgr
836  * @mlo_ap_lock: lock to sync VDEV SM event
837  * @mlo_vdev_quiet_bmap: Bitmap of vdevs for which quiet ie needs to enabled
838  * @mlo_vdev_up_bmap: Bitmap of vdevs for which sync complete can be dispatched
839  * @assoc_list: MLO sta assoc pending list entry (for FT-over-DS)
840  */
841 struct wlan_mlo_ap {
842 	uint8_t num_ml_vdevs;
843 	struct wlan_ml_vdev_aid_mgr *ml_aid_mgr;
844 #ifdef WLAN_MLO_USE_SPINLOCK
845 	qdf_spinlock_t mlo_ap_lock;
846 #else
847 	qdf_mutex_t mlo_ap_lock;
848 #endif
849 	qdf_bitmap(mlo_vdev_quiet_bmap, WLAN_UMAC_MLO_MAX_VDEVS);
850 	qdf_bitmap(mlo_vdev_up_bmap, WLAN_UMAC_MLO_MAX_VDEVS);
851 	struct wlan_mlo_sta_assoc_pending_list assoc_list;
852 };
853 
854 /**
855  * struct wlan_mlo_peer_list - MLO peer list entry
856  * @peer_hash: MLO peer hash code
857  * @peer_list_lock: lock to access members of structure
858  */
859 struct wlan_mlo_peer_list {
860 	qdf_list_t peer_hash[WLAN_PEER_HASHSIZE];
861 #ifdef WLAN_MLO_USE_SPINLOCK
862 	qdf_spinlock_t peer_list_lock;
863 #else
864 	qdf_mutex_t peer_list_lock;
865 #endif
866 };
867 
868 /**
869  * struct mlo_vdev_link_mac_info - VDEV to link address map
870  * @vdev_id: Vdev Id with which this link mac address is associated:
871  * @link_mac_addr: link specific mac address
872  */
873 struct mlo_vdev_link_mac_info {
874 	uint8_t vdev_id;
875 	struct qdf_mac_addr link_mac_addr;
876 };
877 
878 /**
879  * struct wlan_mlo_link_mac_update: VDEV to link MAC address list
880  * @num_mac_update: Number of mac address
881  * @link_mac_info: Each VDEV to link mac address mapping
882  */
883 struct wlan_mlo_link_mac_update {
884 	int num_mac_update;
885 	struct mlo_vdev_link_mac_info link_mac_info[3];
886 };
887 
888 /**
889  * struct wlan_mlo_dev_context - MLO device context
890  * @node: QDF list node member
891  * @mld_id: MLD id
892  * @mld_addr: MLO device MAC address
893  * @wlan_vdev_list: list of vdevs associated with this MLO connection
894  * @wlan_bridge_vdev_list: list of bridge vdevs associated with this MLO
895  * @wlan_bridge_vdev_count: number of elements in the bridge vdev list
896  * @bridge_sta_ctx: bridge sta context
897  * @wlan_vdev_count: number of elements in the vdev list
898  * @mlo_peer_list: list peers in this MLO connection
899  * @wlan_max_mlo_peer_count: peer count across the links of specific MLO
900  * @mlo_dev_lock: lock to access struct
901  * @tsf_recalculation_lock: Lock to protect TSF (re)calculation
902  * @ref_cnt: reference count
903  * @ref_id_dbg: Reference count debug information
904  * @sta_ctx: MLO STA related information
905  * @ap_ctx: AP related information
906  * @t2lm_ctx: T2LM related information
907  * @epcs_ctx: EPCS related information
908  * @ptqm_migrate_timer: timer for ptqm migration
909  * @mlo_peer_id_bmap: mlo_peer_id bitmap for ptqm migration
910  * @link_ctx: link related information
911  * @mlo_max_recom_simult_links: Max Recommended Simultaneous Links
912  */
913 struct wlan_mlo_dev_context {
914 	qdf_list_node_t node;
915 	uint8_t mld_id;
916 	struct qdf_mac_addr mld_addr;
917 	struct wlan_objmgr_vdev *wlan_vdev_list[WLAN_UMAC_MLO_MAX_VDEVS];
918 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
919 	struct wlan_objmgr_vdev *wlan_bridge_vdev_list[WLAN_UMAC_MLO_MAX_BRIDGE_VDEVS];
920 	struct wlan_mlo_bridge_sta *bridge_sta_ctx;
921 #endif
922 	uint16_t wlan_vdev_count;
923 	uint16_t wlan_bridge_vdev_count;
924 	struct wlan_mlo_peer_list mlo_peer_list;
925 	uint16_t wlan_max_mlo_peer_count;
926 #ifdef WLAN_MLO_USE_SPINLOCK
927 	qdf_spinlock_t mlo_dev_lock;
928 	qdf_spinlock_t tsf_recalculation_lock;
929 #else
930 	qdf_mutex_t mlo_dev_lock;
931 	qdf_mutex_t tsf_recalculation_lock;
932 #endif
933 	qdf_atomic_t ref_cnt;
934 	qdf_atomic_t ref_id_dbg[WLAN_REF_ID_MAX];
935 	struct wlan_mlo_sta *sta_ctx;
936 	struct wlan_mlo_ap *ap_ctx;
937 	struct wlan_t2lm_context t2lm_ctx;
938 	struct wlan_epcs_context epcs_ctx;
939 #ifdef QCA_SUPPORT_PRIMARY_LINK_MIGRATE
940 	qdf_timer_t ptqm_migrate_timer;
941 	qdf_bitmap(mlo_peer_id_bmap, MAX_MLO_PEER_ID);
942 #endif
943 	struct mlo_link_switch_context *link_ctx;
944 	uint8_t mlo_max_recom_simult_links;
945 };
946 
947 /**
948  * struct wlan_mlo_link_peer_entry - Link peer entry
949  * @link_peer: Object manager peer
950  * @link_addr: MAC address of link peer
951  * @link_ix: Link index
952  * @is_primary: sets true if the peer is primary UMAC’s peer
953  * @hw_link_id: HW Link id of peer
954  * @assoc_rsp_buf: Assoc resp buffer
955  * @peer_assoc_sent: flag to indicate peer assoc sent to FW
956  */
957 struct wlan_mlo_link_peer_entry {
958 	struct wlan_objmgr_peer *link_peer;
959 	struct qdf_mac_addr link_addr;
960 	uint8_t link_ix;
961 	bool is_primary;
962 	uint8_t hw_link_id;
963 	qdf_nbuf_t assoc_rsp_buf;
964 	bool peer_assoc_sent;
965 };
966 
967 /**
968  * enum mlo_peer_state - MLO peer state
969  * @ML_PEER_CREATED:     Initial state
970  * @ML_PEER_ASSOC_DONE:  ASSOC sent on assoc link
971  * @ML_PEER_DISCONN_INITIATED: Disconnect initiated on one of the links
972  */
973 enum mlo_peer_state {
974 	ML_PEER_CREATED,
975 	ML_PEER_ASSOC_DONE,
976 	ML_PEER_DISCONN_INITIATED,
977 };
978 
979 /**
980  * struct mlpeer_auth_params - Deferred Auth params
981  * @vdev_id:  VDEV ID
982  * @psoc_id:  PSOC ID
983  * @link_addr: MAC address
984  * @mldaddr: MLD MAC address
985  * @algo:  Auth algorithm
986  * @seq: Auth sequence number
987  * @status_code: Auth status
988  * @challenge: Auth Challenge
989  * @challenge_length: Auth Challenge length
990  * @wbuf:  Auth wbuf
991  * @rs: Rx stats
992  */
993 struct mlpeer_auth_params {
994 	uint8_t vdev_id;
995 	uint8_t psoc_id;
996 	struct qdf_mac_addr link_addr;
997 	struct qdf_mac_addr mldaddr;
998 	uint16_t algo;
999 	uint16_t seq;
1000 	uint16_t status_code;
1001 	uint8_t *challenge;
1002 	uint8_t challenge_length;
1003 	qdf_nbuf_t wbuf;
1004 	void *rs;
1005 };
1006 
1007 /**
1008  * struct wlan_mlo_eml_cap - EML capabilities of MLD
1009  * @emlsr_supp: eMLSR Support
1010  * @emlsr_pad_delay: eMLSR Padding Delay
1011  * @emlsr_trans_delay: eMLSR transition delay
1012  * @emlmr_supp: eMLMR Support
1013  * @emlmr_delay: eMLMR Delay
1014  * @trans_timeout: Transition Timeout
1015  * @reserved: Reserved
1016  */
1017 struct wlan_mlo_eml_cap {
1018 	uint16_t emlsr_supp:1,
1019 		 emlsr_pad_delay:3,
1020 		 emlsr_trans_delay:3,
1021 		 emlmr_supp:1,
1022 		 emlmr_delay:3,
1023 		 trans_timeout:4,
1024 		 reserved:1;
1025 };
1026 
1027 /**
1028  * struct wlan_mlo_msd_cap - MSD capabilities of MLD
1029  * @medium_sync_duration: Medium Sync Duration
1030  * @medium_sync_ofdm_ed_thresh: MSD threshold value
1031  * @medium_sync_max_txop_num: Max number of TXOP
1032  */
1033 struct wlan_mlo_msd_cap {
1034 	uint16_t medium_sync_duration:8,
1035 		 medium_sync_ofdm_ed_thresh:4,
1036 		 medium_sync_max_txop_num:4;
1037 };
1038 
1039 /**
1040  * struct wlan_mlo_mld_cap - MLD capabilities of MLD
1041  * @max_simult_link: Maximum number of simultaneous links
1042  * @srs_support: SRS support
1043  * @tid2link_neg_support: TID to Link Negotiation Support
1044  * @str_freq_sep: Frequency separation suggested by STR non-AP MLD
1045  *                OR Type of AP-MLD
1046  * @aar_support: AAR Support
1047  * @reserved: Reserved
1048  */
1049 struct wlan_mlo_mld_cap {
1050 	uint16_t max_simult_link:4,
1051 		 srs_support:1,
1052 		 tid2link_neg_support:2,
1053 		 str_freq_sep:5,
1054 		 aar_support:1,
1055 		 reserved:3;
1056 };
1057 
1058 /**
1059  * struct wlan_mlo_peer_context - MLO peer context
1060  *
1061  * @peer_node:     peer list node for ml_dev qdf list
1062  * @peer_list: list of peers on the MLO link
1063  * @link_peer_cnt: Number of link peers attached
1064  * @max_links: Max links for this ML peer
1065  * @link_asresp_cnt: Number of reassoc resp generated
1066  * @mlo_peer_id: unique ID for the peer
1067  * @peer_mld_addr: MAC address of MLD link
1068  * @mlo_ie: MLO IE struct
1069  * @mlo_peer_lock: lock to access peer structure
1070  * @assoc_id: Assoc ID derived by MLO manager
1071  * @primary_umac_psoc_id:
1072  * @ref_cnt: Reference counter to avoid use after free
1073  * @ml_dev: MLO dev context
1074  * @mlpeer_state: MLO peer state
1075  * @avg_link_rssi: avg RSSI of ML peer
1076  * @is_nawds_ml_peer: flag to indicate if ml_peer is NAWDS configured
1077  * @nawds_config: eack link peer's NAWDS configuration
1078  * @pending_auth: Holds pending auth request
1079  * @t2lm_policy: TID-to-link mapping information
1080  * @epcs_info: EPCS information
1081  * @msd_cap_present: Medium Sync Capability present bit
1082  * @mlpeer_emlcap: EML capability information for ML peer
1083  * @mlpeer_msdcap: Medium Sync Delay capability information for ML peer
1084  * @is_mesh_ml_peer: flag to indicate if ml_peer is MESH configured
1085  * @mesh_config: eack link peer's MESH configuration
1086  * @mlpeer_mldcap: MLD Capability information for ML peer
1087  * @mlpeer_nstrinfo: NSTR Capability info
1088  * @migrate_primary_umac_psoc_id: primary umac psoc id selected for umac
1089  * migration
1090  * @primary_umac_migration_in_progress: flag to indicate primary umac migration
1091  * in progress
1092  */
1093 struct wlan_mlo_peer_context {
1094 	qdf_list_node_t peer_node;
1095 	struct wlan_mlo_link_peer_entry peer_list[MAX_MLO_LINK_PEERS];
1096 	uint8_t link_peer_cnt;
1097 	uint8_t max_links;
1098 	uint8_t link_asresp_cnt;
1099 	uint32_t mlo_peer_id;
1100 	struct qdf_mac_addr peer_mld_addr;
1101 	uint8_t *mlo_ie;
1102 #ifdef WLAN_MLO_USE_SPINLOCK
1103 	qdf_spinlock_t mlo_peer_lock;
1104 #else
1105 	qdf_mutex_t mlo_peer_lock;
1106 #endif
1107 	uint16_t assoc_id;
1108 	uint8_t primary_umac_psoc_id;
1109 	qdf_atomic_t ref_cnt;
1110 	struct wlan_mlo_dev_context *ml_dev;
1111 	enum mlo_peer_state mlpeer_state;
1112 	int8_t avg_link_rssi;
1113 #ifdef UMAC_SUPPORT_MLNAWDS
1114 	bool is_nawds_ml_peer;
1115 	struct mlnawds_config nawds_config[MAX_MLO_LINK_PEERS];
1116 #endif
1117 #ifdef UMAC_MLO_AUTH_DEFER
1118 	struct mlpeer_auth_params *pending_auth[MAX_MLO_LINK_PEERS];
1119 #endif
1120 #ifdef WLAN_FEATURE_11BE
1121 	struct wlan_mlo_peer_t2lm_policy t2lm_policy;
1122 	struct wlan_mlo_peer_epcs_info epcs_info;
1123 #endif
1124 	bool msd_cap_present;
1125 	struct wlan_mlo_eml_cap mlpeer_emlcap;
1126 	struct wlan_mlo_msd_cap mlpeer_msdcap;
1127 #ifdef MESH_MODE_SUPPORT
1128 	bool is_mesh_ml_peer;
1129 	struct mlnawds_config mesh_config[MAX_MLO_LINK_PEERS];
1130 #endif
1131 	struct wlan_mlo_mld_cap mlpeer_mldcap;
1132 	struct mlo_nstr_info mlpeer_nstrinfo[WLAN_UMAC_MLO_MAX_VDEVS];
1133 	uint8_t migrate_primary_umac_psoc_id;
1134 	bool primary_umac_migration_in_progress;
1135 };
1136 
1137 /**
1138  * struct mlo_probereq_info - mlo probe req link info
1139  * @mlid: MLID requested in the probe req
1140  * @num_links: no. of link info in probe req
1141  * @link_id: target link id of APs
1142  * @is_mld_id_valid: Indicates if mld_id is valid for a given request
1143  * @skip_mbssid: Skip mbssid IE
1144  */
1145 struct mlo_probereq_info {
1146 	uint8_t mlid;
1147 	uint8_t num_links;
1148 	uint8_t link_id[WLAN_UMAC_MLO_MAX_VDEVS];
1149 	bool is_mld_id_valid;
1150 	bool skip_mbssid;
1151 };
1152 
1153 /**
1154  * struct ml_rv_partner_link_info: Partner link information of an ML reconfig IE
1155  * @link_id: Link id advertised by the AP
1156  * @link_mac_addr: Link mac address
1157  * @is_ap_removal_timer_p: AP removal timer is present or not
1158  * @ap_removal_timer: number of TBTTs of the AP removal timer
1159  */
1160 struct ml_rv_partner_link_info {
1161 	uint8_t link_id;
1162 	struct qdf_mac_addr link_mac_addr;
1163 	uint8_t is_ap_removal_timer_p;
1164 	uint16_t ap_removal_timer;
1165 };
1166 
1167 /**
1168  * struct ml_rv_info: Reconfig Multi link information of a 11be beacon
1169  * @mld_mac_addr: MLD mac address
1170  * @num_links: Number of links supported by ML AP
1171  * @link_info: Array containing partner links information
1172  */
1173 struct ml_rv_info {
1174 	struct qdf_mac_addr mld_mac_addr;
1175 	uint8_t num_links;
1176 	struct ml_rv_partner_link_info link_info[WLAN_UMAC_MLO_MAX_VDEVS];
1177 };
1178 
1179 /**
1180  * struct mlo_tgt_link_info - ML target link info
1181  * @vdev_id: link peer vdev id
1182  * @hw_mld_link_id: HW link id
1183  * @mlo_enabled: indicate is MLO enabled
1184  * @mlo_assoc_link: indicate is the link used to initialize the association
1185  *                  of mlo connection
1186  * @mlo_primary_umac: indicate is the link on primary UMAC, WIN only flag
1187  * @mlo_logical_link_index_valid: indicate if the logial link index in is valid
1188  * @mlo_peer_id_valid: indicate if the mlo peer id is valid
1189  * @mlo_force_link_inactive: force the peer inactive
1190  * @emlsr_support: indicate if eMLSR supported
1191  * @emlmr_support: indicate if eMLMR supported
1192  * @msd_cap_support: indicate if MSD supported
1193  * @mlo_bridge_peer: indicate if it is bridge peer
1194  * @unused: spare bits
1195  * @logical_link_index: Unique index for links of the mlo. Starts with Zero
1196  */
1197 struct mlo_tgt_link_info {
1198 	uint8_t vdev_id;
1199 	uint8_t hw_mld_link_id;
1200 	uint32_t mlo_enabled:1,
1201 		 mlo_assoc_link:1,
1202 		 mlo_primary_umac:1,
1203 		 mlo_logical_link_index_valid:1,
1204 		 mlo_peer_id_valid:1,
1205 		 mlo_force_link_inactive:1,
1206 		 emlsr_support:1,
1207 		 emlmr_support:1,
1208 		 msd_cap_support:1,
1209 		 mlo_bridge_peer:1,
1210 		 unused:22;
1211 	uint32_t logical_link_index;
1212 
1213 };
1214 
1215 /**
1216  * struct mlo_tgt_partner_info - mlo target partner link info
1217  * @num_partner_links: no. of partner links
1218  * @link_info: per partner link info
1219  */
1220 struct mlo_tgt_partner_info {
1221 	uint8_t num_partner_links;
1222 	struct mlo_tgt_link_info link_info[WLAN_UMAC_MLO_MAX_VDEVS];
1223 };
1224 
1225 /**
1226  * struct wlan_mlo_bridge_sta - MLO bridge sta context
1227  * @bridge_partners: mlo_partner_info of partners of a bridge
1228  * @bridge_ml_links: mlo_tgt_partner_info of partners of bridge
1229  * @bridge_umac_id: umac id for bridge
1230  * @bridge_link_id: link id used by bridge vdev
1231  * @is_force_central_primary: Flag to tell if bridge should be primary umac
1232  * @bridge_vap_exists: If there is bridge vap
1233  * @bridge_node_auth: Is bridge node auth done
1234  * @bss_mld_addr: MLD address of the BSS
1235  */
1236 struct wlan_mlo_bridge_sta {
1237 	struct mlo_partner_info bridge_partners;
1238 	struct mlo_tgt_partner_info bridge_ml_links;
1239 	uint8_t bridge_umac_id;
1240 	uint8_t bridge_link_id;
1241 	bool is_force_central_primary;
1242 	bool bridge_vap_exists;
1243 	bool bridge_node_auth;
1244 	struct qdf_mac_addr bss_mld_addr;
1245 };
1246 
1247 /**
1248  * struct mlo_mlme_ext_ops - MLME callback functions
1249  * @mlo_mlme_ext_validate_conn_req: Callback to validate connect request
1250  * @mlo_mlme_ext_create_link_vdev: Callback to create link vdev for ML STA
1251  * @mlo_mlme_ext_peer_create: Callback to create link peer
1252  * @mlo_mlme_ext_bridge_peer_create: Callback to create bridge peer
1253  * @mlo_mlme_ext_peer_assoc: Callback to initiate peer assoc
1254  * @mlo_mlme_ext_peer_assoc_fail: Callback to notify peer assoc failure
1255  * @mlo_mlme_ext_peer_delete: Callback to initiate link peer delete
1256  * @mlo_mlme_ext_assoc_resp: Callback to initiate assoc resp
1257  * @mlo_mlme_get_link_assoc_req: Callback to get link assoc req buffer
1258  * @mlo_mlme_ext_deauth: Callback to initiate deauth
1259  * @mlo_mlme_ext_clone_security_param: Callback to clone mlo security params
1260  * @mlo_mlme_ext_peer_process_auth: Callback to process pending auth
1261  * @mlo_mlme_ext_handle_sta_csa_param: Callback to handle sta csa param
1262  * @mlo_mlme_ext_sta_op_class:
1263  * @mlo_mlme_ext_peer_reassoc: Callback to process reassoc
1264  */
1265 struct mlo_mlme_ext_ops {
1266 	QDF_STATUS (*mlo_mlme_ext_validate_conn_req)(
1267 		    struct vdev_mlme_obj *vdev_mlme, void *ext_data);
1268 	QDF_STATUS (*mlo_mlme_ext_create_link_vdev)(
1269 		    struct vdev_mlme_obj *vdev_mlme, void *ext_data);
1270 	QDF_STATUS (*mlo_mlme_ext_peer_create)(struct wlan_objmgr_vdev *vdev,
1271 					struct wlan_mlo_peer_context *ml_peer,
1272 					struct qdf_mac_addr *addr,
1273 					qdf_nbuf_t frm_buf);
1274 	QDF_STATUS (*mlo_mlme_ext_bridge_peer_create)(struct wlan_objmgr_vdev *vdev,
1275 					struct wlan_mlo_peer_context *ml_peer,
1276 					struct qdf_mac_addr *addr,
1277 					qdf_nbuf_t frm_buf);
1278 	void (*mlo_mlme_ext_peer_assoc)(struct wlan_objmgr_peer *peer);
1279 	void (*mlo_mlme_ext_peer_assoc_fail)(struct wlan_objmgr_peer *peer);
1280 	void (*mlo_mlme_ext_peer_delete)(struct wlan_objmgr_peer *peer);
1281 	void (*mlo_mlme_ext_assoc_resp)(struct wlan_objmgr_peer *peer);
1282 	qdf_nbuf_t (*mlo_mlme_get_link_assoc_req)(struct wlan_objmgr_peer *peer,
1283 						  uint8_t link_ix);
1284 	void (*mlo_mlme_ext_deauth)(struct wlan_objmgr_peer *peer,
1285 				    uint8_t is_disassoc);
1286 	QDF_STATUS (*mlo_mlme_ext_clone_security_param)(
1287 		    struct vdev_mlme_obj *vdev_mlme,
1288 		    struct wlan_cm_connect_req *req);
1289 #ifdef UMAC_MLO_AUTH_DEFER
1290 	void (*mlo_mlme_ext_peer_process_auth)(
1291 	      struct mlpeer_auth_params *auth_param);
1292 #endif
1293 	void (*mlo_mlme_ext_handle_sta_csa_param)(
1294 				struct wlan_objmgr_vdev *vdev,
1295 				struct csa_offload_params *csa_param);
1296 	QDF_STATUS (*mlo_mlme_ext_sta_op_class)(
1297 			struct vdev_mlme_obj *vdev_mlme,
1298 			uint8_t *ml_ie);
1299 	QDF_STATUS (*mlo_mlme_ext_peer_reassoc)(struct wlan_objmgr_vdev *vdev,
1300 					struct wlan_mlo_peer_context *ml_peer,
1301 					struct qdf_mac_addr *addr,
1302 					qdf_nbuf_t frm_buf);
1303 };
1304 
1305 /*
1306  * struct mlo_osif_ext_ops - MLO manager to OSIF callback functions
1307  * @mlo_mgr_osif_update_bss_info: Callback to update each link connection info.
1308  * @mlo_mgr_osif_update_mac_addr: Callback to notify MAC addr update complete
1309  *                                from old link id to new link id for the vdev.
1310  * @mlo_mgr_osif_link_switch_notification: Notify OSIF on start of link switch
1311  */
1312 struct mlo_osif_ext_ops {
1313 	QDF_STATUS
1314 	(*mlo_mgr_osif_update_bss_info)(struct qdf_mac_addr *self_mac,
1315 					struct qdf_mac_addr *bssid,
1316 					int32_t link_id);
1317 
1318 	QDF_STATUS (*mlo_mgr_osif_update_mac_addr)(int32_t ieee_old_link_id,
1319 						   int32_t ieee_new_link_id,
1320 						   uint8_t vdev_id);
1321 
1322 	QDF_STATUS
1323 	(*mlo_mgr_osif_link_switch_notification)(struct wlan_objmgr_vdev *vdev,
1324 						 uint8_t non_trans_vdev_id);
1325 };
1326 
1327 /* maximum size of vdev bitmap array for MLO link set active command */
1328 #define MLO_VDEV_BITMAP_SZ 2
1329 
1330 /* maximum size of link number param array for MLO link set active command */
1331 #define MLO_LINK_NUM_SZ 2
1332 
1333 /**
1334  * struct mlo_link_set_active_resp: MLO link set active response structure
1335  * @status: Return status, 0 for success, non-zero otherwise
1336  * @evt_handled: response event is handled
1337  * @active_sz: size of current active vdev bitmap array
1338  * @active: current active vdev bitmap array
1339  * @inactive_sz: size of current inactive vdev bitmap array
1340  * @inactive: current inactive vdev bitmap array
1341  * @use_ieee_link_id: link id is valid in active_linkid_bitmap or
1342  *	inactive_linkid_bitmap
1343  * @ap_mld_mac_addr: AP MLD mac address
1344  * @active_linkid_bitmap: current forced active link id bitmap
1345  * @inactive_linkid_bitmap: current forced inactive link id bitmap
1346  * @curr_inactive_linkid_bitmap: current inactive link id bitmap
1347  * @curr_active_linkid_bitmap: current active link id bitmap
1348  */
1349 struct mlo_link_set_active_resp {
1350 	uint32_t status;
1351 	bool evt_handled;
1352 	uint32_t active_sz;
1353 	uint32_t active[MLO_VDEV_BITMAP_SZ];
1354 	uint32_t inactive_sz;
1355 	uint32_t inactive[MLO_VDEV_BITMAP_SZ];
1356 	bool use_ieee_link_id;
1357 	struct qdf_mac_addr  ap_mld_mac_addr;
1358 	uint32_t active_linkid_bitmap;
1359 	uint32_t inactive_linkid_bitmap;
1360 	uint32_t curr_inactive_linkid_bitmap;
1361 	uint32_t curr_active_linkid_bitmap;
1362 };
1363 
1364 /**
1365  * struct mlo_link_num_param: MLO link set active number params
1366  * @num_of_link: number of links to active/inactive
1367  * @vdev_type: type of vdev
1368  * @vdev_subtype: subtype of vdev
1369  * @home_freq: home frequency of the link
1370  */
1371 struct mlo_link_num_param {
1372 	uint32_t num_of_link;
1373 	uint32_t vdev_type;
1374 	uint32_t vdev_subtype;
1375 	uint32_t home_freq;
1376 };
1377 
1378 /*
1379  * struct mlo_control_flags: This structure is used for setting
1380  * wmi_mlo_control_flags.
1381  * @overwrite_force_active_bitmap: indicate overwrite all earlier force_active
1382  * bitmaps
1383  * @overwrite_force_inactive_bitmap: indicate overwrite all earlier
1384  * force_inactive bitmaps
1385  * @dynamic_force_link_num: indicate fw to use force link number instead of
1386  * force link bitmaps
1387  * @post_re_evaluate: run link state check again after command response event
1388  * handled
1389  */
1390 struct mlo_control_flags {
1391 	bool overwrite_force_active_bitmap;
1392 	bool overwrite_force_inactive_bitmap;
1393 	bool dynamic_force_link_num;
1394 	bool post_re_evaluate;
1395 };
1396 
1397 /* struct ml_link_force_cmd - force command for links
1398  * @ap_mld_mac_addr: AP mld mac address
1399  * @ieee_link_id_bitmap: link id bitmap
1400  * valid for WMI_MLO_LINK_FORCE_ACTIVE, WMI_MLO_LINK_FORCE_INACTIVE,
1401  * WMI_MLO_LINK_NO_FORCE, WMI_MLO_LINK_FORCE_ACTIVE_LINK_NUM,
1402  * WMI_MLO_LINK_FORCE_INACTIVE_LINK_NUM.
1403  * @ieee_link_id_bitmap2: link id bitmap, only valid for
1404  * WMI_MLO_LINK_FORCE_ACTIVE_INACTIVE carry the inactive linkid bitmap
1405  * @link_num: link num
1406  * only valid on WMI_MLO_LINK_FORCE_ACTIVE_LINK_NUM or
1407  * WMI_MLO_LINK_FORCE_INACTIVE_LINK_NUM
1408  */
1409 struct ml_link_force_cmd {
1410 	struct qdf_mac_addr ap_mld_mac_addr;
1411 	uint16_t ieee_link_id_bitmap;
1412 	uint16_t ieee_link_id_bitmap2;
1413 	uint8_t link_num;
1414 };
1415 
1416 /**
1417  * struct mlo_link_set_active_param: MLO link set active params
1418  * @force_mode: operation to take (enum mlo_link_force_mode)
1419  * @reason: reason for the operation (enum mlo_link_force_reason)
1420  * @num_link_entry: number of the valid entries for link_num
1421  * @num_vdev_bitmap: number of the valid entries for vdev_bitmap
1422  * @num_inactive_vdev_bitmap: number of the valid entries for
1423  *  inactive_vdev_bitmap
1424  * @link_num: link number param array
1425  *  It's present only when force_mode is MLO_LINK_FORCE_MODE_ACTIVE_NUM or
1426  *  MLO_LINK_FORCE_MODE_INACTIVE_NUM
1427  * @vdev_bitmap: active/inactive vdev bitmap array
1428  *  It will be present when force_mode is MLO_LINK_FORCE_MODE_ACTIVE,
1429  *  MLO_LINK_FORCE_MODE_INACTIVE, MLO_LINK_FORCE_MODE_NO_FORCE,
1430  *  MLO_LINK_FORCE_MODE_ACTIVE_NUM or MLO_LINK_FORCE_MODE_INACTIVE_NUM,
1431  *  and MLO_LINK_FORCE_MODE_ACTIVE_INACTIVE.
1432  *  For MLO_LINK_FORCE_MODE_ACTIVE_INACTIVE, it includes the active vdev
1433  *  bitmaps
1434  * @inactive_vdev_bitmap: inactive vdev bitmap array
1435  *  It will be present when force_mode is MLO_LINK_FORCE_MODE_ACTIVE_INACTIVE,
1436  *  it includes the inactive vdev bitmaps
1437  * @control_flags: This structure is used for setting wmi_mlo_control_flags.
1438  * @use_ieee_link_id: send link id bitmap to target.
1439  *  If this value is true, the "force_cmd" field should be provided and
1440  *  that will be sent to target
1441  * @force_cmd: force command which includes link id bitmap
1442  */
1443 struct mlo_link_set_active_param {
1444 	uint32_t force_mode;
1445 	uint32_t reason;
1446 	uint32_t num_link_entry;
1447 	uint32_t num_vdev_bitmap;
1448 	uint32_t num_inactive_vdev_bitmap;
1449 	struct mlo_link_num_param link_num[MLO_LINK_NUM_SZ];
1450 	uint32_t vdev_bitmap[MLO_VDEV_BITMAP_SZ];
1451 	uint32_t inactive_vdev_bitmap[MLO_VDEV_BITMAP_SZ];
1452 	struct mlo_control_flags control_flags;
1453 	bool use_ieee_link_id;
1454 	struct ml_link_force_cmd force_cmd;
1455 };
1456 
1457 /**
1458  * struct mlo_link_set_active_ctx - Context for MLO link set active request
1459  * @vdev: pointer to vdev on which the request issued
1460  * @set_mlo_link_cb: callback function for MLO link set active request
1461  * @validate_set_mlo_link_cb: callback to validate set link request
1462  * @cb_arg: callback context
1463  */
1464 struct mlo_link_set_active_ctx {
1465 	struct wlan_objmgr_vdev *vdev;
1466 	void (*set_mlo_link_cb)(struct wlan_objmgr_vdev *vdev, void *arg,
1467 				struct mlo_link_set_active_resp *evt);
1468 	QDF_STATUS (*validate_set_mlo_link_cb)(
1469 			struct wlan_objmgr_psoc *psoc,
1470 			struct mlo_link_set_active_param *param);
1471 	void *cb_arg;
1472 };
1473 
1474 /**
1475  * struct mlo_link_set_active_req - MLO link set active request
1476  * @ctx: context for MLO link set active request
1477  * @param: MLO link set active params
1478  */
1479 struct mlo_link_set_active_req {
1480 	struct mlo_link_set_active_ctx ctx;
1481 	struct mlo_link_set_active_param param;
1482 };
1483 
1484 /**
1485  * enum mlo_chip_recovery_type - MLO chip recovery types
1486  * @MLO_RECOVERY_MODE_0: CRASH_PARTNER_CHIPS & recover all chips
1487  * @MLO_RECOVERY_MODE_1: Crash & recover asserted chip alone
1488  * @MLO_RECOVERY_MODE_MAX: Max limit for recovery types
1489  */
1490 enum mlo_chip_recovery_type {
1491 	MLO_RECOVERY_MODE_0 = 1,
1492 	MLO_RECOVERY_MODE_1 = 2,
1493 
1494 	/* Add new types above */
1495 	MLO_RECOVERY_MODE_MAX = 0xf
1496 };
1497 
1498 /**
1499  * enum wlan_t2lm_status - Target status codes in event of t2lm
1500  * @WLAN_MAP_SWITCH_TIMER_TSF: Mapping switch time value in TSF to be included
1501  * in probe response frames
1502  * @WLAN_MAP_SWITCH_TIMER_EXPIRED: Indication that the new proposed T2LM has
1503  * been applied, Update the required data structures and other modules.
1504  * @WLAN_EXPECTED_DUR_EXPIRED: Indication that the proposed T2LM ineffective
1505  * after this duration and all TIDs fall back to default mode.
1506  */
1507 enum wlan_t2lm_status {
1508 	WLAN_MAP_SWITCH_TIMER_TSF,
1509 	WLAN_MAP_SWITCH_TIMER_EXPIRED,
1510 	WLAN_EXPECTED_DUR_EXPIRED,
1511 };
1512 
1513 /**
1514  * struct mlo_vdev_host_tid_to_link_map_resp - TID-to-link mapping response
1515  * @vdev_id: Vdev id
1516  * @status: Target status for t2lm ie info
1517  * @mapping_switch_tsf: Mapping switch time in tsf for probe response frames
1518  */
1519 struct mlo_vdev_host_tid_to_link_map_resp {
1520 	uint8_t vdev_id;
1521 	enum wlan_t2lm_status status;
1522 	uint32_t mapping_switch_tsf;
1523 };
1524 
1525 /**
1526  * struct mlo_link_removal_cmd_params - MLO link removal command parameters
1527  * @vdev_id: vdev ID of the link to be removed
1528  * @reconfig_ml_ie: Entire ML reconfiguration element
1529  * @reconfig_ml_ie_size: size of the field @reconfig_ml_ie
1530  */
1531 struct mlo_link_removal_cmd_params {
1532 	uint8_t vdev_id;
1533 	uint8_t *reconfig_ml_ie;
1534 	uint32_t reconfig_ml_ie_size;
1535 };
1536 
1537 /**
1538  * struct mlo_link_removal_tbtt_info - MLO link removal TBTT info. This
1539  * information will be in correspondence with an outgoing beacon instance.
1540  * @tbtt_count: AP removal timer TBTT count in the reported beacon
1541  * @qtimer_reading: Q-timer reading when the reported beacon is sent out
1542  * @tsf: TSF of the reported beacon
1543  */
1544 struct mlo_link_removal_tbtt_info {
1545 	uint32_t tbtt_count;
1546 	uint64_t qtimer_reading;
1547 	uint64_t tsf;
1548 };
1549 
1550 /**
1551  * struct mlo_link_removal_evt_params - MLO link removal event parameters
1552  * @vdev_id: vdev ID of the link undergoing removal
1553  * @tbtt_info: TBTT information of the link undergoing removal
1554  */
1555 struct mlo_link_removal_evt_params {
1556 	uint8_t vdev_id;
1557 	struct mlo_link_removal_tbtt_info tbtt_info;
1558 };
1559 
1560 /**
1561  * struct mgmt_rx_mlo_link_removal_info - Information, sent in MGMT Rx event, of
1562  * a link undergoing removal from its MLD
1563  * @vdev_id: Vdev ID of the link undergoing removal
1564  * @hw_link_id: HW link ID of the link undergoing removal
1565  * @tbtt_count: AP removal timer TBTT count of the link undergoing removal
1566  */
1567 struct mgmt_rx_mlo_link_removal_info {
1568 	uint8_t vdev_id;
1569 	uint8_t hw_link_id;
1570 	uint16_t tbtt_count;
1571 };
1572 
1573 /**
1574  * struct mlo_link_disable_request_evt_params - MLO link disable
1575  * request params
1576  * @mld_addr: disable mld address
1577  * @link_id_bitmap: Disable Link id bitmap
1578  */
1579 struct mlo_link_disable_request_evt_params {
1580 	struct qdf_mac_addr mld_addr;
1581 	uint32_t link_id_bitmap;
1582 };
1583 
1584 #define MAX_LINK_SWITCH_TLV 5
1585 /**
1586  * struct mlo_link_switch_params - Structure to hold link State switch
1587  * related parameters
1588  * @mld_addr: MLD address
1589  * @active_link_bitmap: Bitmap of ieee link id for active links
1590  * @prev_link_bitmap: Bitmap of ieee link id for previous active links
1591  * @fw_timestamp: Firmware timestamp in milliseconds
1592  * @reason_code: Reason code for the switch
1593  */
1594 struct mlo_link_switch_params {
1595 	struct qdf_mac_addr mld_addr;
1596 	uint32_t active_link_bitmap;
1597 	uint32_t prev_link_bitmap;
1598 	uint32_t fw_timestamp;
1599 	uint32_t reason_code;
1600 };
1601 
1602 /**
1603  * struct mlo_link_switch_state_info  - Structure to hold the link switch
1604  * related parameters corresponding to all the TLV received in link state switch
1605  * event.
1606  * @num_params: Number of the link switch parameters
1607  * @link_switch_param: Link switch parameters
1608  */
1609 struct mlo_link_switch_state_info {
1610 	uint8_t num_params;
1611 	struct mlo_link_switch_params link_switch_param[MAX_LINK_SWITCH_TLV];
1612 };
1613 
1614 #ifdef QCA_SUPPORT_PRIMARY_LINK_MIGRATE
1615 /**
1616  * struct peer_ptqm_migrate_entry - peer ptqm migrate entry
1617  * @ml_peer_id: ML peer id
1618  * @hw_link_id: HW link id
1619  */
1620 struct peer_ptqm_migrate_entry {
1621 	uint16_t ml_peer_id;
1622 	uint16_t hw_link_id;
1623 };
1624 
1625 /**
1626  * struct peer_ptqm_migrate_params - peer ptqm migrate request parameter
1627  * @vdev_id: vdev id
1628  * @num_peers: peer count
1629  * @num_peers_failed: number of peers for which wmi cmd is failed.
1630  * This value is expected to be used only in case failure is returned by WMI
1631  * @peer_list: list of peers to be migrated
1632  */
1633 struct peer_ptqm_migrate_params {
1634 	uint8_t vdev_id;
1635 	uint16_t num_peers;
1636 	uint16_t num_peers_failed;
1637 	struct peer_ptqm_migrate_entry *peer_list;
1638 };
1639 
1640 /**
1641  * struct peer_ptqm_migrate_list_entry - peer ptqm migrate list
1642  * @node: QDF list node member
1643  * @peer: objmgr peer object
1644  * @mlo_peer_id: mlo peer id
1645  * @new_hw_link_id: hw link id of new primary
1646  */
1647 struct peer_ptqm_migrate_list_entry {
1648 	qdf_list_node_t node;
1649 	struct wlan_objmgr_peer *peer;
1650 	uint32_t mlo_peer_id;
1651 	uint8_t new_hw_link_id;
1652 };
1653 
1654 /**
1655  * struct peer_migrate_ptqm_multi_entries - multi ptqm migrate peer entry params
1656  * @num_entries: Number of entries in the peer_list list
1657  * @peer_list: List to hold the peer entries to be migrated
1658  *
1659  */
1660 struct peer_migrate_ptqm_multi_entries {
1661 	uint16_t num_entries;
1662 	qdf_list_t peer_list;
1663 };
1664 
1665 enum primary_link_peer_migration_evenr_status {
1666 	PRIMARY_LINK_PEER_MIGRATION_SUCCESS,
1667 	PRIMARY_LINK_PEER_MIGRATION_IN_PROGRESS,
1668 	PRIMARY_LINK_PEER_MIGRATION_DELETE_IN_PROGRESS,
1669 	PRIMARY_LINK_PEER_MIGRATION_DELETED,
1670 	PRIMARY_LINK_PEER_MIGRATION_TX_PIPES_FAILED,
1671 	PRIMARY_LINK_PEER_MIGRATION_RX_PIPES_FAILED,
1672 
1673 	/* Add any new status above this line */
1674 	PRIMARY_LINK_PEER_MIGRATION_FAIL = 255,
1675 };
1676 
1677 /**
1678  * struct peer_ptqm_migrate_event_params - peer ptqm migrate event parameter
1679  * @vdev_id: vdev id
1680  * @num_peers: peer count
1681  */
1682 struct peer_ptqm_migrate_event_params {
1683 	uint8_t vdev_id;
1684 	uint16_t num_peers;
1685 };
1686 
1687 /**
1688  * struct peer_entry_ptqm_migrate_event_params - peer entry ptqm migrate
1689  * event parameter
1690  * @ml_peer_id: ML peer id
1691  * @status: migration status
1692  */
1693 struct peer_entry_ptqm_migrate_event_params {
1694 	uint16_t ml_peer_id;
1695 	enum primary_link_peer_migration_evenr_status status;
1696 };
1697 #endif /* QCA_SUPPORT_PRIMARY_LINK_MIGRATE */
1698 
1699 /**
1700  * struct wlan_mlo_sta_entry - MLO sta entry
1701  * @mac_node: QDF list mac_node member
1702  * @peer_mld_addr: MLO peer MAC address
1703  */
1704 
1705 struct wlan_mlo_sta_entry {
1706 	qdf_list_node_t mac_node;
1707 	struct qdf_mac_addr peer_mld_addr;
1708 };
1709 
1710 #endif
1711