1 /*
2  * Copyright (c) 2012-2015,2020-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: wlan_cm_public_struct.h
20  *
21  * This header file maintain public structures required for connection mgr
22  */
23 
24 #ifndef __WLAN_CM_PUBLIC_STRUCT_H__
25 #define __WLAN_CM_PUBLIC_STRUCT_H__
26 
27 #include <wlan_scan_public_structs.h>
28 #include "wlan_crypto_global_def.h"
29 #include "qdf_status.h"
30 #ifdef WLAN_FEATURE_11BE_MLO
31 #include <wlan_mlo_mgr_public_structs.h>
32 #endif
33 
34 #define CM_ID_INVALID 0xFFFFFFFF
35 #define CM_ID_LSWITCH_BIT 0x10000000
36 
37 typedef uint32_t wlan_cm_id;
38 
39 /* Diconnect active timeout */
40 #define DISCONNECT_TIMEOUT \
41 	((STOP_RESPONSE_TIMER) + (DELETE_RESPONSE_TIMER) +\
42 	 (RSO_STOP_RESPONSE_TIMER) + (1000))
43 
44 #define CM_DISCONNECT_ASSOC_VDEV_EXTRA_TIMEOUT \
45 		(STOP_RESPONSE_TIMER + DELETE_RESPONSE_TIMER)
46 
47 /*
48  * Disconnect command wait timeout VDEV timeouts + 5 sec buff for current active
49  * command to complete
50  */
51 #define CM_DISCONNECT_CMD_TIMEOUT DISCONNECT_TIMEOUT + 5000
52 
53 /**
54  * struct wlan_cm_wep_key_params - store wep key info
55  * @key: key info
56  * @seq: seq info
57  * @key_len: key length
58  * @seq_len: seq len
59  * @key_idx: key index
60  */
61 struct wlan_cm_wep_key_params {
62 	uint8_t *key;
63 	uint8_t *seq;
64 	uint8_t key_len;
65 	uint8_t seq_len;
66 	uint8_t key_idx;
67 };
68 
69 /**
70  * struct wlan_cm_connect_crypto_info - Crypto settings
71  * @wpa_versions: indicates which, if any, WPA versions are enabled
72  *	(from enum nl80211_wpa_versions)
73  * @auth_type: Auth mode type bitmask
74  * @group_cipher: group key cipher suite bitmask
75  * @ciphers_pairwise: unicast key cipher suites bitmask
76  * @akm_suites: AKM suites bitmask
77  * @wep_keys: static WEP keys, if not NULL points to an array of
78  *	MAX_WEP_KEYS WEP keys
79  * @rsn_caps: rsn caps
80  * @mgmt_ciphers: mgmt cipher bitmask
81  * @user_mfp: Management frame protection state configured by user
82  * @user_auth_type: user provided auth type
83  * @user_grp_cipher: user provided  group cipher
84  * @user_akm_suite: user provided AKM suite. First akm suite value
85  * is populated from akm suites array received from userspace
86  * @user_cipher_pairwise: user provided pairwise cipher. First pairwise
87  * cipher values populated from pairwise cipher array received from userspace
88  */
89 struct wlan_cm_connect_crypto_info {
90 	uint32_t wpa_versions;
91 	uint32_t auth_type;
92 	uint32_t group_cipher;
93 	uint32_t ciphers_pairwise;
94 	uint32_t akm_suites;
95 	struct wlan_cm_wep_key_params wep_keys;
96 	uint16_t rsn_caps;
97 	uint32_t mgmt_ciphers;
98 	uint8_t user_mfp;
99 #ifdef CONNECTIVITY_DIAG_EVENT
100 	uint32_t user_auth_type;
101 	uint32_t user_grp_cipher;
102 	uint32_t user_akm_suite;
103 	uint32_t user_cipher_pairwise;
104 #endif
105 };
106 
107 #ifdef WLAN_FEATURE_FILS_SK
108 #define WLAN_CM_FILS_MAX_KEYNAME_NAI_LENGTH 253
109 #define WLAN_CM_FILS_MAX_REALM_LEN 255
110 #define WLAN_CM_FILS_MAX_RRK_LENGTH 64
111 
112 /**
113  * enum wlan_fils_auth_type - fils auth type info
114  * @FILS_SK_WITHOUT_PFS: without pfs
115  * @FILS_SK_WITH_PFS: with pfs
116  * @FILS_PK_AUTH: fils auth
117  * @FILS_PK_MAX: max value
118  */
119 enum wlan_fils_auth_type {
120 	FILS_SK_WITHOUT_PFS,
121 	FILS_SK_WITH_PFS,
122 	FILS_PK_AUTH,
123 	FILS_PK_MAX,
124 };
125 
126 /**
127  * struct wlan_fils_con_info - fils connect req info
128  * @is_fils_connection: is fils connection
129  * @username_len: username length
130  * @username: username
131  * @realm_len: realm length
132  * @realm: realm
133  * @next_seq_num: next seq number
134  * @rrk_len: rrk length
135  * @rrk: rrk
136  * @auth_type: FILS authentication type
137  */
138 struct wlan_fils_con_info {
139 	bool is_fils_connection;
140 	uint32_t username_len;
141 	uint8_t username[WLAN_CM_FILS_MAX_KEYNAME_NAI_LENGTH];
142 	uint32_t realm_len;
143 	uint8_t realm[WLAN_CM_FILS_MAX_REALM_LEN];
144 	uint16_t next_seq_num;
145 	uint32_t rrk_len;
146 	uint8_t rrk[WLAN_CM_FILS_MAX_RRK_LENGTH];
147 	enum wlan_fils_auth_type auth_type;
148 };
149 #endif
150 
151 /**
152  * enum wlan_cm_source - connection manager req source
153  * @CM_OSIF_CONNECT: Connect req initiated by OSIF or north bound
154  * @CM_ROAMING_HOST: Roaming request initiated by host
155  * @CM_ROAMING_NUD_FAILURE: Roaming request initiated by NUD failure
156  * @CM_ROAMING_FW: Roam req initiated by FW
157  * @CM_ROAMING_LINK_REMOVAL: Roaming request initiate by link removal
158  * @CM_OSIF_DISCONNECT: Disconnect req initiated by OSIF or north bound
159  * @CM_PEER_DISCONNECT: Disconnect req initiated by peer sending deauth/disassoc
160  * only for this localy generated will be false while indicating to kernel
161  * @CM_SB_DISCONNECT: Disconnect initiated from firmware. eg HB failure,
162  * sta kickout etc
163  * @CM_MLME_DISCONNECT: Disconnect req initiated by mlme. eg VDEV mgr or any
164  * other mlme component.
165  * @CM_INTERNAL_DISCONNECT: Internal disconnect initiated by Connection manager
166  * on receiving the back to back commands
167  * @CM_ROAM_DISCONNECT: Disconnect req due to HO failure
168  * @CM_OSIF_CFG_CONNECT: Connect request initiated due to config change
169  * @CM_OSIF_CFG_DISCONNECT: Disconnect request initiated due to config change
170  * @CM_MLO_LINK_VDEV_DISCONNECT: Disconnect req for ML link
171  * @CM_MLO_LINK_VDEV_CONNECT: Connect req for ML link
172  * @CM_MLO_ROAM_INTERNAL_DISCONNECT: Disconnect req triggered for mlo roaming
173  * @CM_MLO_LINK_SWITCH_CONNECT: Connect req triggered for mlo link switch
174  * @CM_MLO_LINK_SWITCH_DISCONNECT: Disconnect req triggered for mlo link switch
175  * @CM_ROAMING_USER: Roaming request initiated by user
176  * @CM_SOURCE_MAX: max value of connection manager source
177  * @CM_SOURCE_INVALID: Invalid connection manager req source
178  */
179 enum wlan_cm_source {
180 	CM_OSIF_CONNECT,
181 	CM_ROAMING_HOST,
182 	CM_ROAMING_NUD_FAILURE,
183 	CM_ROAMING_FW,
184 	CM_ROAMING_LINK_REMOVAL,
185 	CM_OSIF_DISCONNECT,
186 	CM_PEER_DISCONNECT,
187 	CM_SB_DISCONNECT,
188 	CM_MLME_DISCONNECT,
189 	CM_INTERNAL_DISCONNECT,
190 	CM_ROAM_DISCONNECT,
191 	CM_OSIF_CFG_CONNECT,
192 	CM_OSIF_CFG_DISCONNECT,
193 	CM_MLO_LINK_VDEV_DISCONNECT,
194 	CM_MLO_LINK_VDEV_CONNECT,
195 	CM_MLO_ROAM_INTERNAL_DISCONNECT,
196 	CM_MLO_LINK_SWITCH_CONNECT,
197 	CM_MLO_LINK_SWITCH_DISCONNECT,
198 	CM_ROAMING_USER,
199 	CM_SOURCE_MAX,
200 	CM_SOURCE_INVALID = CM_SOURCE_MAX,
201 };
202 
203 /**
204  * struct wlan_cm_connect_req - connect req from requester
205  * @vdev_id: vdev id
206  * @source: source of the req
207  * @bssid: bssid given
208  * @prev_bssid: prev AP bssid, given in case supplican want to roam to new BSSID
209  * @ssid: profile SSID
210  * @bssid_hint: bssid hint to connect
211  * @chan_freq: channel of the AP
212  * @chan_freq_hint: channel hint
213  * @crypto: crypto related info
214  * @assoc_ie:Additional assoc IE to be appended in assoc req
215  *           (Include RSN/WPA/WAPI/WPS ies)
216  * @scan_ie: Default scan ie to be used in the uncast probe req and connect scan
217  * @force_rsne_override: force the arbitrary rsne received in connect req to be
218  * used with out validation, used for the scenarios where the device is used
219  * as a testbed device with special functionality and not recommended
220  * for production.
221  * @is_wps_connection: if its wps connection
222  * @is_osen_connection: if its osen connection
223  * @reassoc_in_non_init: if reassoc received in non init state
224  * @dot11mode_filter: dot11mode filter used to restrict connection to
225  * 11n/11ac/11ax.
226  * @sae_pwe: SAE mechanism for PWE derivation
227  *           0 = hunting-and-pecking loop only
228  *           1 = hash-to-element only
229  *           2 = both hunting-and-pecking loop and hash-to-element enabled
230  * @ht_caps: ht capability information bit mask
231  * @ht_caps_mask: mask of valid ht caps
232  * @vht_caps: vht capability information bit mask
233  * @vht_caps_mask: mask of valid vht caps
234  * @fils_info: Fills related connect info
235  * @is_non_assoc_link: non assoc link
236  * @mld_addr: MLD address of candidate
237  *              -mandatory and only used for link VDEV connect
238  * @ml_parnter_info: ml partner link info
239  */
240 struct wlan_cm_connect_req {
241 	uint8_t vdev_id;
242 	enum wlan_cm_source source;
243 	struct qdf_mac_addr bssid;
244 	struct qdf_mac_addr prev_bssid;
245 	struct wlan_ssid ssid;
246 	struct qdf_mac_addr bssid_hint;
247 	qdf_freq_t chan_freq;
248 	qdf_freq_t chan_freq_hint;
249 	struct wlan_cm_connect_crypto_info crypto;
250 	struct element_info assoc_ie;
251 	struct element_info scan_ie;
252 	uint8_t force_rsne_override:1,
253 		is_wps_connection:1,
254 		is_osen_connection:1,
255 		reassoc_in_non_init:1;
256 	enum dot11_mode_filter dot11mode_filter;
257 	uint8_t sae_pwe;
258 	uint16_t ht_caps;
259 	uint16_t ht_caps_mask;
260 	uint32_t vht_caps;
261 	uint32_t vht_caps_mask;
262 #ifdef WLAN_FEATURE_FILS_SK
263 	struct wlan_fils_con_info fils_info;
264 #endif
265 	bool is_non_assoc_link;
266 #ifdef WLAN_FEATURE_11BE_MLO
267 	struct qdf_mac_addr mld_addr;
268 	struct mlo_partner_info ml_parnter_info;
269 #endif
270 };
271 
272 /**
273  * struct wlan_cm_vdev_connect_req - connect req from connection manager to
274  * vdev mgr
275  * @vdev_id: vdev id
276  * @cm_id: Connect manager id
277  * @force_rsne_override: force the arbitrary rsne received in connect req to be
278  * used with out validation, used for the scenarios where the device is used
279  * as a testbed device with special functionality and not recommended
280  * for production.
281  * @is_wps_connection: if its wps connection
282  * @is_osen_connection: if its osen connection
283  * @ht_caps: ht capability
284  * @ht_caps_mask: mask of valid ht caps
285  * @vht_caps: vht capability
286  * @vht_caps_mask: mask of valid vht caps
287  * @assoc_ie: assoc ie to be used in assoc req
288  * @scan_ie: Default scan ie to be used in the uncast probe req
289  * @bss: scan entry for the candidate
290  * @fils_info: Fills related connect info
291  * @is_non_assoc_link: non assoc link
292  * @ml_parnter_info: ml partner link info
293  * @owe_trans_ssid: owe trans ssid to be used when scan entry ssid is wildcard
294  */
295 struct wlan_cm_vdev_connect_req {
296 	uint8_t vdev_id;
297 	wlan_cm_id cm_id;
298 	uint8_t force_rsne_override:1,
299 		is_wps_connection:1,
300 		is_osen_connection:1;
301 	uint16_t ht_caps;
302 	uint16_t ht_caps_mask;
303 	uint32_t vht_caps;
304 	uint32_t vht_caps_mask;
305 	struct element_info assoc_ie;
306 	struct element_info scan_ie;
307 	struct scan_cache_node *bss;
308 #ifdef WLAN_FEATURE_FILS_SK
309 	struct wlan_fils_con_info *fils_info;
310 #endif
311 	bool is_non_assoc_link;
312 #ifdef WLAN_FEATURE_11BE_MLO
313 	struct mlo_partner_info ml_parnter_info;
314 #endif
315 	struct wlan_ssid owe_trans_ssid;
316 };
317 
318 /**
319  * struct wlan_cm_roam_req - roam req from requester
320  * @forced_roaming: Roaming to be done without giving bssid, and channel.
321  * @vdev_id: vdev id
322  * @source: source of the req
323  * @bssid: bssid given
324  * @prev_bssid: prev AP bssid, given in case supplican want to roam to new BSSID
325  * @chan_freq: channel of the AP
326  */
327 struct wlan_cm_roam_req {
328 	uint8_t forced_roaming:1;
329 	uint8_t vdev_id;
330 	enum wlan_cm_source source;
331 	struct qdf_mac_addr bssid;
332 	struct qdf_mac_addr prev_bssid;
333 	uint32_t chan_freq;
334 };
335 
336 /**
337  * struct wlan_cm_vdev_reassoc_req - Reassoc req from connection manager to
338  * vdev mgr
339  * @vdev_id: vdev id
340  * @cm_id: Connect manager id
341  * @prev_bssid: previous BSSID
342  * @bss: scan entry for the candidate
343  */
344 struct wlan_cm_vdev_reassoc_req {
345 	uint8_t vdev_id;
346 	wlan_cm_id cm_id;
347 	struct qdf_mac_addr prev_bssid;
348 	struct scan_cache_node *bss;
349 };
350 
351 /**
352  * struct wlan_cm_disconnect_req - disconnect req from requester
353  * @vdev_id: vdev id
354  * @source: source of disconnect
355  * @reason_code: protocol/propitiatory reason code of the disconnect.
356  * propitiatory will be used to send in
357  * QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_DRIVER_DISCONNECT_REASON
358  * @bssid: bssid of AP
359  * @is_no_disassoc_disconnect: Is disassoc required
360  */
361 struct wlan_cm_disconnect_req {
362 	uint8_t vdev_id;
363 	enum wlan_cm_source source;
364 	enum wlan_reason_code reason_code;
365 	struct qdf_mac_addr bssid;
366 	bool is_no_disassoc_disconnect;
367 };
368 
369 /**
370  * struct wlan_cm_vdev_discon_req - disconnect req from connection manager to
371  * vdev mgr
372  * @cm_id: connection manager ID
373  * @req: disconnect req
374  */
375 struct wlan_cm_vdev_discon_req {
376 	wlan_cm_id cm_id;
377 	struct wlan_cm_disconnect_req req;
378 };
379 
380 /*
381  * enum wlan_cm_connect_fail_reason: connection manager connect fail reason
382  * @CM_NO_CANDIDATE_FOUND: No candidate found
383  * @CM_ABORT_DUE_TO_NEW_REQ_RECVD: Aborted as new command is received and
384  * @CM_BSS_SELECT_IND_FAILED: Failed BSS select indication
385  * State machine is not able to handle as state has changed due to new command.
386  * @CM_PEER_CREATE_FAILED: peer create failed
387  * @CM_JOIN_FAILED: Failed in joining state
388  * (BSS peer creation or other handling)
389  * @CM_JOIN_TIMEOUT: Did not receive beacon or probe response after unicast
390  * probe request
391  * @CM_AUTH_FAILED: Auth rejected by AP
392  * @CM_AUTH_TIMEOUT: No Auth resp from AP
393  * @CM_ASSOC_FAILED: Assoc rejected by AP
394  * @CM_ASSOC_TIMEOUT: No Assoc resp from AP
395  * @CM_HW_MODE_FAILURE: failed to change HW mode
396  * @CM_SER_FAILURE: Failed to serialize command
397  * @CM_SER_TIMEOUT: Serialization cmd timeout
398  * @CM_GENERIC_FAILURE: Generic failure apart from above
399  * @CM_VALID_CANDIDATE_CHECK_FAIL: Valid Candidate Check fail
400  */
401 enum wlan_cm_connect_fail_reason {
402 	CM_NO_CANDIDATE_FOUND = 1,
403 	CM_ABORT_DUE_TO_NEW_REQ_RECVD,
404 	CM_BSS_SELECT_IND_FAILED,
405 	CM_PEER_CREATE_FAILED,
406 	CM_JOIN_FAILED,
407 	CM_JOIN_TIMEOUT,
408 	CM_AUTH_FAILED,
409 	CM_AUTH_TIMEOUT,
410 	CM_ASSOC_FAILED,
411 	CM_ASSOC_TIMEOUT,
412 	CM_HW_MODE_FAILURE,
413 	CM_SER_FAILURE,
414 	CM_SER_TIMEOUT,
415 	CM_GENERIC_FAILURE,
416 	CM_VALID_CANDIDATE_CHECK_FAIL,
417 };
418 
419 #ifdef WLAN_FEATURE_FILS_SK
420 #define CM_FILS_MAX_HLP_DATA_LEN 2048
421 #define MAX_TK_LENGTH 32
422 #define MAX_GTK_LENGTH 255
423 
424 /**
425  * struct fils_connect_rsp_params - fils related connect rsp params
426  * @fils_pmk: fils pmk
427  * @fils_pmk_len: fils pmk length
428  * @fils_pmkid: fils pmkid
429  * @kek: kek
430  * @kek_len: kek length
431  * @tk: tk
432  * @tk_len: tk length
433  * @gtk: gtk
434  * @gtk_len: gtk length
435  * @dst_mac: dst mac
436  * @src_mac: src mac
437  * @hlp_data: hlp data
438  * @hlp_data_len: hlp data length
439  * @fils_seq_num: FILS sequence number
440  */
441 struct fils_connect_rsp_params {
442 	uint8_t *fils_pmk;
443 	uint8_t fils_pmk_len;
444 	uint8_t fils_pmkid[PMKID_LEN];
445 	uint8_t kek[MAX_KEK_LENGTH];
446 	uint8_t kek_len;
447 	uint8_t tk[MAX_TK_LENGTH];
448 	uint8_t tk_len;
449 	uint8_t gtk[MAX_GTK_LENGTH];
450 	uint8_t gtk_len;
451 	struct qdf_mac_addr dst_mac;
452 	struct qdf_mac_addr src_mac;
453 	uint8_t hlp_data[CM_FILS_MAX_HLP_DATA_LEN];
454 	uint16_t hlp_data_len;
455 	uint16_t fils_seq_num;
456 };
457 #endif
458 
459 /**
460  * struct wlan_connect_rsp_ies - connect rsp ies stored in vdev filled during
461  *                               connect
462  * @bcn_probe_rsp: Raw beacon or probe rsp of connected AP
463  * @link_bcn_probe_rsp: Raw beacon or probe rsp of connected non-assoc link
464  * @assoc_req: assoc req IE pointer send during connect
465  * @assoc_rsp: assoc rsp IE received during connection
466  * @fils_ie: fills connection ie received during connection
467  */
468 struct wlan_connect_rsp_ies {
469 	struct element_info bcn_probe_rsp;
470 	struct element_info link_bcn_probe_rsp;
471 	struct element_info assoc_req;
472 	struct element_info assoc_rsp;
473 #ifdef WLAN_FEATURE_FILS_SK
474 	struct fils_connect_rsp_params *fils_ie;
475 #endif
476 };
477 
478 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
479 /**
480  * struct wlan_roam_sync_info - roam sync information populated
481  * from roam sync indication struct
482  * @auth_status: roam auth status (authenticated or connected)
483  * @num_setup_links: Number of links from FW roam sync event
484  * @kck_len: kck length
485  * @kck: kck info in roam sync
486  * @kek_len: kek length
487  * @kek: kek info in roam sync
488  * @replay_ctr: replay counter
489  * @subnet_change_status: if subnet has changed.
490  *                        0 = unchanged
491  *                        1 = changed
492  *                        2 = unknown
493  * @roam_reason: reason of roaming
494  * @pmk_len: fils pmk length
495  * @pmk: fils pmk info
496  * @pmkid: fils pmkid
497  * @update_erp_next_seq_num: if seq update required
498  * @next_erp_seq_num: next seq number
499  */
500 struct wlan_roam_sync_info {
501 	uint8_t auth_status;
502 #ifdef WLAN_FEATURE_11BE
503 	uint8_t num_setup_links;
504 #endif
505 	uint8_t kck_len;
506 	uint8_t kck[MAX_KCK_LEN];
507 	uint8_t kek_len;
508 	uint8_t kek[MAX_KEK_LENGTH];
509 	uint8_t replay_ctr[REPLAY_CTR_LEN];
510 	uint8_t subnet_change_status;
511 	uint16_t roam_reason;
512 	uint32_t pmk_len;
513 	uint8_t pmk[MAX_PMK_LEN];
514 	uint8_t pmkid[PMKID_LEN];
515 	bool update_erp_next_seq_num;
516 	uint16_t next_erp_seq_num;
517 };
518 #endif
519 
520 /**
521  * struct wlan_cm_connect_resp - connect resp from VDEV mgr and will be sent to
522  * OSIF
523  * @vdev_id: vdev id
524  * @is_wps_connection: if its wps connection
525  * @is_osen_connection: if its osen connection
526  * @is_reassoc: if response is for reassoc/roam
527  * @is_ft: is FT reassoc
528  * @is_assoc: if response is for assoc
529  * @send_disconnect: if disconnect needed to sent to kernel, for reassoc
530  * received in non connected state, this is to cleanup kernel
531  * @cm_id: Connect manager id
532  * @bssid: BSSID of the ap
533  * @ssid: SSID of the connection
534  * @freq: Channel frequency
535  * @connect_status: connect status success or failure
536  * @reason: connect fail reason, valid only in case of failure
537  * @status_code: protocol status code received in auth/assoc resp
538  * @aid: aid
539  * @connect_ies: connect related IE required by osif to send to kernel
540  * @roaming_info: roam sync info received
541  * @is_fils_connection: is fils connection
542  * @mld_addr: MLD address of the ML AP
543  * @ml_parnter_info: ml partner link info
544  */
545 struct wlan_cm_connect_resp {
546 	uint8_t vdev_id;
547 	uint8_t is_wps_connection:1,
548 		is_osen_connection:1,
549 		is_reassoc:1,
550 		is_ft:1,
551 		is_assoc:1,
552 		send_disconnect:1;
553 	wlan_cm_id cm_id;
554 	struct qdf_mac_addr bssid;
555 	struct wlan_ssid ssid;
556 	qdf_freq_t freq;
557 	QDF_STATUS connect_status;
558 	enum wlan_cm_connect_fail_reason reason;
559 	enum wlan_status_code status_code;
560 	uint8_t aid;
561 	struct wlan_connect_rsp_ies connect_ies;
562 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
563 	struct wlan_roam_sync_info *roaming_info;
564 #endif
565 #ifdef WLAN_FEATURE_FILS_SK
566 	bool is_fils_connection;
567 #endif
568 #ifdef WLAN_FEATURE_11BE_MLO
569 	struct qdf_mac_addr mld_addr;
570 	struct mlo_partner_info ml_parnter_info;
571 #endif
572 };
573 
574 #ifdef WLAN_VENDOR_HANDOFF_CONTROL
575 /* As per enum vendor_control_roam_param */
576 #define MAX_VENDOR_CONTROL_PARAMS 8
577 
578 /**
579  * enum vendor_control_roam_param - vendor control roam parameters
580  * @VENDOR_CONTROL_PARAM_ROAM_TRIGGER: roam trigger
581  * @VENDOR_CONTROL_PARAM_ROAM_DELTA: roam delta
582  * @VENDOR_CONTROL_PARAM_ROAM_FULL_SCANPERIOD: full scan period
583  * @VENDOR_CONTROL_PARAM_ROAM_PARTIAL_SCANPERIOD: partial scan period
584  * @VENDOR_CONTROL_PARAM_ROAM_ACTIVE_CH_DWELLTIME: active ch dwell time
585  * @VENDOR_CONTROL_PARAM_ROAM_PASSIVE_CH_DWELLTIME: passive ch dwell time
586  * @VENDOR_CONTROL_PARAM_ROAM_HOME_CH_TIME: home ch dwell time
587  * @VENDOR_CONTROL_PARAM_ROAM_AWAY_TIME: away time
588  * @VENDOR_CONTROL_PARAM_ROAM_ALL: Sending query for all params of
589  * enum vendor_control_roam_param
590  */
591 enum vendor_control_roam_param {
592 	VENDOR_CONTROL_PARAM_ROAM_TRIGGER = 1,
593 	VENDOR_CONTROL_PARAM_ROAM_DELTA,
594 	VENDOR_CONTROL_PARAM_ROAM_FULL_SCANPERIOD,
595 	VENDOR_CONTROL_PARAM_ROAM_PARTIAL_SCANPERIOD,
596 	VENDOR_CONTROL_PARAM_ROAM_ACTIVE_CH_DWELLTIME,
597 	VENDOR_CONTROL_PARAM_ROAM_PASSIVE_CH_DWELLTIME,
598 	VENDOR_CONTROL_PARAM_ROAM_HOME_CH_TIME,
599 	VENDOR_CONTROL_PARAM_ROAM_AWAY_TIME,
600 	VENDOR_CONTROL_PARAM_ROAM_ALL = 0xFFFFFFFF,
601 };
602 
603 /*
604  * struct roam_param_info: vendor handoff related parameters
605  * @param_id: vendor control Param ID from enum
606  * vendor_control_roam_param
607  * @param_value: vendor control param value
608  */
609 struct roam_param_info {
610 	enum vendor_control_roam_param param_id;
611 	uint32_t param_value;
612 };
613 
614 /*
615  * struct roam_vendor_handoff_params: vendor handoff parameters
616  * @vdev_id : vdev id
617  * @num_entries: num of tlv present in vendor handoff event
618  * @param_info: vendor handoff related parameters
619  */
620 struct roam_vendor_handoff_params {
621 	uint32_t vdev_id;
622 	uint32_t num_entries;
623 	struct roam_param_info param_info[MAX_VENDOR_CONTROL_PARAMS];
624 };
625 
626 #endif
627 
628 #ifdef WLAN_FEATURE_PREAUTH_ENABLE
629 /**
630  * struct wlan_preauth_req - preauth request
631  * @vdev_id: vdev id
632  * @entry: scan entry for the candidate
633  */
634 struct wlan_preauth_req {
635 	uint8_t vdev_id;
636 	struct scan_cache_entry *entry;
637 };
638 
639 /**
640  * struct wlan_cm_preauth_fail - connection manager preauth fail
641  * @cm_id: connection id
642  * @reason: connect fail reason
643  */
644 struct wlan_cm_preauth_fail {
645 	wlan_cm_id cm_id;
646 	enum wlan_cm_connect_fail_reason reason;
647 };
648 
649 #define CM_MAX_FTIE_SIZE 384
650 
651 /**
652  * struct wlan_preauth_rsp - preauth response
653  * @psoc: psoc object
654  * @vdev_id: vdev id
655  * @cm_id: connection manager ID
656  * @pre_auth_bssid: bssid to preauth to
657  * @status: QDF_STATUS
658  * @ft_ie_length: ft ie length
659  * @ft_ie: ft ie
660  * @ric_ies_length: ric ies length
661  * @ric_ies: ric ies
662  * @timestamp: time stamp
663  */
664 struct wlan_preauth_rsp {
665 	struct wlan_objmgr_psoc *psoc;
666 	uint8_t vdev_id;
667 	wlan_cm_id cm_id;
668 	struct qdf_mac_addr pre_auth_bssid;
669 	QDF_STATUS status;
670 	uint16_t ft_ie_length;
671 	uint8_t ft_ie[CM_MAX_FTIE_SIZE];
672 	uint16_t ric_ies_length;
673 	uint8_t ric_ies[CM_MAX_FTIE_SIZE];
674 #ifdef FEATURE_WLAN_ESE
675 	uint32_t timestamp[2];
676 #endif
677 };
678 #endif
679 
680 /**
681  * struct wlan_cm_discon_rsp - disconnect resp from VDEV mgr and will be sent to
682  * OSIF
683  * @req: disconnect req sent to vdev mgr
684  * @ap_discon_ie: disconnect IE sent by AP
685  */
686 struct wlan_cm_discon_rsp {
687 	struct wlan_cm_vdev_discon_req req;
688 	struct element_info ap_discon_ie;
689 };
690 
691 /*
692  * enum wlan_cm_active_request_type: CM active req type
693  * @CM_NONE: No active serialisation command
694  * @CM_CONNECT_ACTIVE: Connect active in serialisation
695  * @CM_DISCONNECT_ACTIVE: DicConnect active in serialisation
696  * @CM_ROAM_ACTIVE: Roam active in serialisation
697  */
698 enum wlan_cm_active_request_type {
699 	CM_NONE,
700 	CM_CONNECT_ACTIVE,
701 	CM_DISCONNECT_ACTIVE,
702 	CM_ROAM_ACTIVE,
703 };
704 
705 /*
706  * enum MLO_TYPE: ML type of bss
707  * @SLO: Non-ML or Single link ML
708  * @MLSR: Multi link Single Radio, indicates that both links
709  *        have to be on one mac
710  * @MLMR: Multi link Multi Radio, indicates that both links
711  *        can be on different macs
712  */
713 enum MLO_TYPE {
714 	SLO,
715 	MLSR,
716 	MLMR,
717 	MLO_TYPE_MAX
718 };
719 #endif /* __WLAN_CM_PUBLIC_STRUCT_H__ */
720