xref: /wlan-driver/qcacld-3.0/components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2015, 2020-2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-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_vdev_api.h
20  *
21  * This header file maintain legacy connect, disconnect APIs of connection
22  * manager to initiate vdev manager operations
23  */
24 
25 #ifndef __WLAN_CM_VDEV_API_H__
26 #define __WLAN_CM_VDEV_API_H__
27 
28 #include <wlan_cm_public_struct.h>
29 #include "scheduler_api.h"
30 #include "connection_mgr/core/src/wlan_cm_main.h"
31 #include "connection_mgr/core/src/wlan_cm_main_api.h"
32 #include <wlan_cm_roam_api.h>
33 #ifdef WLAN_FEATURE_11BE_MLO
34 #include "wlan_mlo_mgr_public_structs.h"
35 #endif
36 
37 #define HS20_OUI_TYPE   "\x50\x6f\x9a\x10"
38 #define HS20_OUI_TYPE_SIZE  4
39 
40 /**
41  * struct cm_vdev_join_req - connect req from legacy CM to vdev manager
42  * @vdev_id: vdev id
43  * @cm_id: Connect manager id
44  * @force_rsne_override: force the arbitrary rsne received in connect req to be
45  * used with out validation, used for the scenarios where the device is used
46  * as a testbed device with special functionality and not recommended
47  * for production.
48  * @is_wps_connection: is wps connection
49  * @is_osen_connection: is osen connection
50  * @is_ssid_hidden: AP SSID is hidden
51  * @assoc_ie: assoc ie to be used in assoc req
52  * @scan_ie: Default scan ie to be used in the uncast probe req
53  * @entry: scan entry for the candidate
54  * @partner_info: Partner link information for an ML connection
55  * @assoc_link_id: Assoc link ID of an ML connection
56  * @owe_trans_ssid: owe trans ssid to be used when scan entry ssid is wildcard
57  */
58 struct cm_vdev_join_req {
59 	uint8_t vdev_id;
60 	wlan_cm_id cm_id;
61 	uint8_t force_rsne_override:1,
62 		is_wps_connection:1,
63 		is_osen_connection:1,
64 		is_ssid_hidden:1;
65 	struct element_info assoc_ie;
66 	struct element_info scan_ie;
67 	struct scan_cache_entry *entry;
68 #ifdef WLAN_FEATURE_11BE_MLO
69 	struct mlo_partner_info partner_info;
70 	uint8_t assoc_link_id;
71 #endif
72 	struct wlan_ssid owe_trans_ssid;
73 };
74 
75 /**
76  * struct wlan_cm_discon_ind - disconnect ind from VDEV mgr and will be sent to
77  * SME
78  * @vdev_id: vdev id
79  * @source: source of disconnection
80  * @reason_code: reason of disconnection
81  * @bssid: BSSID of AP
82  */
83 struct wlan_cm_discon_ind {
84 	uint8_t vdev_id;
85 	enum wlan_cm_source source;
86 	enum wlan_reason_code reason_code;
87 	struct qdf_mac_addr bssid;
88 };
89 
90 /**
91  * struct cm_vdev_discon_ind - disconnect ind from vdev mgr to connection mgr
92  * @psoc: psoc object
93  * @disconnect_param: DisConnect indication to be sent to CM
94  */
95 struct cm_vdev_discon_ind {
96 	struct wlan_objmgr_psoc *psoc;
97 	struct wlan_cm_discon_ind disconnect_param;
98 };
99 
100 /**
101  * struct cm_vdev_disconnect_rsp - disconnect rsp from vdev mgr to CM
102  * @vdev_id: vdev id
103  * @psoc: psoc object
104  */
105 struct cm_vdev_disconnect_rsp {
106 	uint8_t vdev_id;
107 	struct wlan_objmgr_psoc *psoc;
108 };
109 
110 /*
111  * struct cm_vdev_hw_mode_rsp - hw mode change from vdev mgr to CM
112  * @pdev: pdev pointer
113  * @vdev_id: vdev id
114  * @cm_id: connection ID which gave the hw mode change request
115  * @status: status of the HW mode change.
116  */
117 struct cm_vdev_hw_mode_rsp {
118 	struct wlan_objmgr_pdev *pdev;
119 	uint8_t vdev_id;
120 	wlan_cm_id cm_id;
121 	QDF_STATUS status;
122 };
123 
124 /**
125  * struct cm_vdev_join_rsp - connect rsp from vdev mgr to connection mgr
126  * @psoc: psoc object
127  * @connect_rsp: Connect response to be sent to CM
128  * @ric_resp_ie: ric ie data
129  * @tspec_ie: tspec ie
130  * @nss: used nss
131  * @uapsd_mask: uapsd mask
132  */
133 struct cm_vdev_join_rsp {
134 	struct wlan_objmgr_psoc *psoc;
135 	struct wlan_cm_connect_resp connect_rsp;
136 	struct element_info ric_resp_ie;
137 #ifdef FEATURE_WLAN_ESE
138 	struct element_info tspec_ie;
139 #endif
140 	uint8_t nss;
141 	uint8_t uapsd_mask;
142 };
143 
144 /**
145  * struct cm_peer_create_req - bss peer create req
146  * @vdev_id: vdev_id
147  * @peer_mac: peer mac to create
148  * @mld_mac: peer mld mac
149  * @is_assoc_peer: is assoc peer or not
150  */
151 struct cm_peer_create_req {
152 	uint8_t vdev_id;
153 	struct qdf_mac_addr peer_mac;
154 #ifdef WLAN_FEATURE_11BE_MLO
155 	struct qdf_mac_addr mld_mac;
156 	bool is_assoc_peer;
157 #endif
158 };
159 
160 /**
161  * struct cm_host_roam_start_ind - roam start ind for host roam from FW
162  * @vdev_id: vdev id
163  * @pdev: pdev object
164  */
165 struct cm_host_roam_start_ind {
166 	uint8_t vdev_id;
167 	struct wlan_objmgr_pdev *pdev;
168 };
169 
170 /**
171  * struct cm_ext_obj - Connection manager legacy object
172  * @rso_cfg: connect info to be used in RSO.
173  * @rso_usr_cfg: roam related userspace RSO configs.
174  */
175 struct cm_ext_obj {
176 	struct rso_config rso_cfg;
177 	struct rso_user_config rso_usr_cfg;
178 };
179 
180 #ifdef WLAN_FEATURE_FILS_SK
181 /**
182  * cm_update_hlp_info - API to save HLP IE
183  * @vdev: vdev ptr
184  * @gen_ie: IE buffer to store
185  * @len: length of the IE buffer @gen_ie
186  * @flush: Flush the older saved HLP if any
187  *
188  * Return: None
189  */
190 void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
191 			const uint8_t *gen_ie, uint16_t len,
192 			bool flush);
193 #else
cm_update_hlp_info(struct wlan_objmgr_vdev * vdev,const uint8_t * gen_ie,uint16_t len,bool flush)194 static inline void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
195 				      const uint8_t *gen_ie, uint16_t len,
196 				      bool flush)
197 {}
198 #endif
199 
200 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
201 /**
202  * cm_connect_info - send connect info to diag
203  * @vdev: vdev ptr
204  * @connect_success: if connect was success
205  * @bssid: bssid
206  * @ssid: ssid
207  * @freq: freq
208  *
209  * Return: none
210  */
211 void cm_connect_info(struct wlan_objmgr_vdev *vdev, bool connect_success,
212 		     struct qdf_mac_addr *bssid, struct wlan_ssid *ssid,
213 		     qdf_freq_t freq);
214 
215 void cm_diag_get_auth_enc_type_vdev_id(struct wlan_objmgr_psoc *psoc,
216 				       uint8_t *auth_type,
217 				       uint8_t *ucast_cipher,
218 				       uint8_t *mcast_cipher,
219 				       uint8_t vdev_id);
220 
221 #ifdef WLAN_UNIT_TEST
222 /**
223  * cm_get_sta_cxn_info - fill sta context info in buffer
224  * @vdev: Pointer to vdev
225  * @buf: buffer to fill
226  * @buf_sz: buf size
227  *
228  * Return: none
229  */
230 void cm_get_sta_cxn_info(struct wlan_objmgr_vdev *vdev,
231 			 char *buf, uint32_t buf_sz);
232 #endif
233 #else
234 static inline void
cm_connect_info(struct wlan_objmgr_vdev * vdev,bool connect_success,struct qdf_mac_addr * bssid,struct wlan_ssid * ssid,qdf_freq_t freq)235 cm_connect_info(struct wlan_objmgr_vdev *vdev, bool connect_success,
236 		struct qdf_mac_addr *bssid, struct wlan_ssid *ssid,
237 		qdf_freq_t freq)
238 {}
239 #endif
240 
241 /**
242  * cm_wait_for_key_time_out_handler() - Wait key time out handler API
243  * @data: Pointer to wait key timer data
244  *
245  * Return: none
246  */
247 void cm_wait_for_key_time_out_handler(void *data);
248 
249 /**
250  * cm_start_wait_for_key_timer() - Wait for key start API
251  * @vdev: Pointer to vdev
252  * @interval: timer trigger interval
253  *
254  * Return: QDF_STATUS
255  */
256 
257 QDF_STATUS cm_start_wait_for_key_timer(struct wlan_objmgr_vdev *vdev,
258 				       uint32_t interval);
259 
260 /**
261  * cm_stop_wait_for_key_timer() - Wait key stop API
262  * @psoc: Pointer to psoc
263  * @vdev_id: vdev id
264  *
265  * Return: none
266  */
267 void cm_stop_wait_for_key_timer(struct wlan_objmgr_psoc *psoc,
268 				uint8_t vdev_id);
269 
270 void cm_update_wait_for_key_timer(struct wlan_objmgr_vdev *vdev,
271 				  uint8_t vdev_id, uint32_t interval);
272 
273 void cm_update_prev_ap_ie(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
274 			  uint32_t len, uint8_t *bcn_ptr);
275 bool cm_csr_is_ss_wait_for_key(uint8_t vdev_id);
276 void cm_csr_set_ss_wait_for_key(uint8_t vdev_id);
277 void cm_csr_set_ss_none(uint8_t vdev_id);
278 void cm_csr_set_joining(uint8_t vdev_id);
279 void cm_csr_set_joined(uint8_t vdev_id);
280 void cm_csr_set_idle(uint8_t vdev_id);
281 
282 /**
283  * cm_get_rssi_snr_by_bssid() - get rssi and snr by bssid
284  * @pdev: Pointer to pdev
285  * @bssid: bssid to get rssi and snr
286  * @rssi: pointer to fill rssi
287  * @snr: pointer to fill snr
288  *
289  * Return: none
290  */
291 QDF_STATUS cm_get_rssi_snr_by_bssid(struct wlan_objmgr_pdev *pdev,
292 				    struct qdf_mac_addr *bssid,
293 				    int8_t *rssi, int8_t *snr);
294 
295 /**
296  * cm_csr_send_set_ie()  - CM wrapper to send the set IE request
297  * @vdev: Object manager VDEV
298  *
299  * Return: None
300  */
301 void cm_csr_send_set_ie(struct wlan_objmgr_vdev *vdev);
302 
303 /**
304  * cm_csr_get_vdev_dot11_mode() - Wrapper for CM to get the dot11mode for
305  * the vdev id
306  * @vdev_id: vdev id
307  *
308  * Return: dot11 mode
309  */
310 uint16_t cm_csr_get_vdev_dot11_mode(uint8_t vdev_id);
311 
312 static inline QDF_STATUS
cm_ext_hdl_create(struct wlan_objmgr_vdev * vdev,cm_ext_t ** ext_cm_ptr)313 cm_ext_hdl_create(struct wlan_objmgr_vdev *vdev, cm_ext_t **ext_cm_ptr)
314 {
315 	struct cm_ext_obj *cm_obj;
316 
317 	*ext_cm_ptr = qdf_mem_malloc(sizeof(struct cm_ext_obj));
318 	if (!*ext_cm_ptr)
319 		return QDF_STATUS_E_NOMEM;
320 
321 	cm_obj = *ext_cm_ptr;
322 	wlan_cm_rso_config_init(vdev, &cm_obj->rso_cfg);
323 
324 	return QDF_STATUS_SUCCESS;
325 }
326 
327 static inline QDF_STATUS
cm_ext_hdl_destroy(struct wlan_objmgr_vdev * vdev,cm_ext_t * ext_cm_ptr)328 cm_ext_hdl_destroy(struct wlan_objmgr_vdev *vdev, cm_ext_t *ext_cm_ptr)
329 {
330 	wlan_cm_rso_config_deinit(vdev, &ext_cm_ptr->rso_cfg);
331 	qdf_mem_free(ext_cm_ptr);
332 
333 	return QDF_STATUS_SUCCESS;
334 }
335 
336 /**
337  * cm_connect_start_ind() - Connection manager ext connect start indication
338  * vdev and peer assoc state machine
339  * @vdev: VDEV object
340  * @req: connect request
341  *
342  * Return: QDF_STATUS
343  */
344 QDF_STATUS cm_connect_start_ind(struct wlan_objmgr_vdev *vdev,
345 				struct wlan_cm_connect_req *req);
346 
347 /**
348  * cm_csr_handle_join_req() - Connection manager cb to csr to fill csr
349  * session and update join req from legacy structures
350  * @vdev: VDEV object
351  * @req: Vdev connect request
352  * @join_req: join req to be sent to LIM
353  * @reassoc: if reassoc
354  *
355  * This API is to update legacy struct and should be removed once
356  * CSR is cleaned up fully. No new params should be added to CSR, use
357  * vdev/pdev/psoc instead.
358  *
359  * Return: QDF_STATUS
360  */
361 QDF_STATUS cm_csr_handle_join_req(struct wlan_objmgr_vdev *vdev,
362 				  struct wlan_cm_vdev_connect_req *req,
363 				  struct cm_vdev_join_req *join_req,
364 				  bool reassoc);
365 
366 /**
367  * cm_handle_connect_req() - Connection manager ext connect request to
368  * start vdev and peer assoc state machine
369  * @vdev: VDEV object
370  * @req: Vdev connect request
371  *
372  * Return: QDF_STATUS
373  */
374 QDF_STATUS
375 cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
376 			    struct wlan_cm_vdev_connect_req *req);
377 
378 /**
379  * cm_send_bss_peer_create_req() - Connection manager ext bss peer create
380  * request
381  * @vdev: VDEV object
382  * @peer_mac: Peer mac address
383  * @mld_mac: peer mld mac address
384  * @is_assoc_peer: is assoc peer or not
385  *
386  * Return: QDF_STATUS
387  */
388 QDF_STATUS
389 cm_send_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
390 			    struct qdf_mac_addr *peer_mac,
391 			    struct qdf_mac_addr *mld_mac,
392 			    bool is_assoc_peer);
393 
394 /**
395  * cm_csr_connect_rsp() - Connection manager ext connect resp indication
396  * @vdev: VDEV object
397  * @rsp: Connection vdev response
398  *
399  * This API is to update legacy struct and should be removed once
400  * CSR is cleaned up fully. No new params should be added to CSR, use
401  * vdev/pdev/psoc instead.
402  *
403  * Return: QDF_STATUS
404  */
405 QDF_STATUS cm_csr_connect_rsp(struct wlan_objmgr_vdev *vdev,
406 			      struct cm_vdev_join_rsp *rsp);
407 
408 /**
409  * cm_connect_complete_ind() - Connection manager ext connect complete
410  * indication
411  * @vdev: VDEV object
412  * @rsp: Connection manager connect response
413  *
414  * Return: QDF_STATUS
415  */
416 QDF_STATUS
417 cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
418 			struct wlan_cm_connect_resp *rsp);
419 
420 /**
421  * cm_csr_connect_done_ind() - Connection manager call to csr to update
422  * legacy structures on connect complete
423  * @vdev: VDEV object
424  * @rsp: Connection manager connect response
425  *
426  * This API is to update legacy struct and should be removed once
427  * CSR is cleaned up fully. No new params should be added to CSR, use
428  * vdev/pdev/psoc instead.
429  *
430  * Return: QDF_STATUS
431  */
432 QDF_STATUS
433 cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
434 			struct wlan_cm_connect_resp *rsp);
435 
436 /**
437  * cm_is_vdevid_connected() - check if vdev_id is in conneted state
438  * @pdev: pdev pointer
439  * @vdev_id: vdev ID
440  *
441  * Return: bool
442  */
443 bool cm_is_vdevid_connected(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
444 
445 /**
446  * cm_is_vdevid_active() - check if vdev_id is in conneted/roaming state
447  * @pdev: pdev pointer
448  * @vdev_id: vdev ID
449  *
450  * Return: bool
451  */
452 bool cm_is_vdevid_active(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
453 
454 /**
455  * cm_disconnect_start_ind() - Connection manager ext disconnect start
456  * indication
457  * vdev and peer assoc state machine
458  * @vdev: VDEV object
459  * @req: disconnect request
460  *
461  * Return: QDF_STATUS
462  */
463 QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
464 				   struct wlan_cm_disconnect_req *req);
465 
466 /**
467  * cm_handle_disconnect_req() - Connection manager ext disconnect
468  * req to vdev and peer sm
469  * @vdev: VDEV object
470  * @req: vdev disconnect request
471  *
472  * Return: QDF_STATUS
473  */
474 QDF_STATUS
475 cm_handle_disconnect_req(struct wlan_objmgr_vdev *vdev,
476 			 struct wlan_cm_vdev_discon_req *req);
477 
478 /**
479  * cm_csr_handle_diconnect_req() - Connection manager cb to csr to update legacy
480  * structures on disconnect
481  * @vdev: VDEV object
482  * @req: vdev disconnect request
483  *
484  * This API is to update legacy struct and should be removed once
485  * CSR is cleaned up fully. No new params should be added to CSR, use
486  * vdev/pdev/psoc instead.
487  *
488  * Return: QDF_STATUS
489  */
490 QDF_STATUS
491 cm_csr_handle_diconnect_req(struct wlan_objmgr_vdev *vdev,
492 			    struct wlan_cm_vdev_discon_req *req);
493 
494 /**
495  * cm_send_bss_peer_delete_req() - Connection manager ext bss peer delete
496  * request
497  * @vdev: VDEV object
498  *
499  * Return: QDF_STATUS
500  */
501 QDF_STATUS
502 cm_send_bss_peer_delete_req(struct wlan_objmgr_vdev *vdev);
503 
504 /**
505  * cm_disconnect_complete_ind() - Connection manager ext disconnect
506  * complete indication
507  * @vdev: VDEV object
508  * @rsp: Connection manager disconnect response
509  *
510  * Return: QDF_STATUS
511  */
512 QDF_STATUS
513 cm_disconnect_complete_ind(struct wlan_objmgr_vdev *vdev,
514 			   struct wlan_cm_discon_rsp *rsp);
515 
516 /**
517  * cm_csr_disconnect_done_ind() - Connection manager call to csr to update
518  * legacy structures on disconnect complete
519  * @vdev: VDEV object
520  * @rsp: Connection manager disconnect response
521  *
522  * This API is to update legacy struct and should be removed once
523  * CSR is cleaned up fully. No new params should be added to CSR, use
524  * vdev/pdev/psoc instead.
525  *
526  * Return: QDF_STATUS
527  */
528 QDF_STATUS
529 cm_csr_disconnect_done_ind(struct wlan_objmgr_vdev *vdev,
530 			   struct wlan_cm_discon_rsp *rsp);
531 
532 /**
533  * cm_send_vdev_down_req() - Connection manager ext req to send vdev down
534  * to FW
535  * @vdev: VDEV object
536  *
537  * Return: QDF_STATUS
538  */
539 QDF_STATUS cm_send_vdev_down_req(struct wlan_objmgr_vdev *vdev);
540 
541 /**
542  * cm_free_join_req() - Free cm vdev connect req params
543  * @join_req: join request
544  *
545  * Return: void
546  */
547 void cm_free_join_req(struct cm_vdev_join_req *join_req);
548 
549 /**
550  * cm_flush_join_req() - Process join req flush
551  * @msg: scheduler message
552  *
553  * Return: QDF_STATUS
554  */
555 QDF_STATUS cm_flush_join_req(struct scheduler_msg *msg);
556 
557 /**
558  * cm_process_join_req() - Process vdev join req
559  * @msg: scheduler message
560  *
561  * Process connect request in LIM and copy all join req params.
562  *
563  * Return: QDF_STATUS
564  */
565 QDF_STATUS cm_process_join_req(struct scheduler_msg *msg);
566 
567 #ifdef WLAN_FEATURE_HOST_ROAM
568 /**
569  * cm_process_preauth_req() - Process preauth request
570  * @msg: scheduler message
571  *
572  * Process preauth request in LIM.
573  *
574  * Return: QDF_STATUS
575  */
576 QDF_STATUS cm_process_preauth_req(struct scheduler_msg *msg);
577 
578 /**
579  * cm_process_reassoc_req() - Process vdev reassoc req
580  * @msg: scheduler message
581  *
582  * Process reassoc request in LIM and copy all reassoc req params.
583  *
584  * Return: QDF_STATUS
585  */
586 QDF_STATUS cm_process_reassoc_req(struct scheduler_msg *msg);
587 
588 /**
589  * cm_handle_reassoc_req() - Connection manager ext reassoc request to start
590  * vdev and peer assoc state machine
591  * @vdev: VDEV object
592  * @req: Vdev reassoc request
593  *
594  * Return: QDF_STATUS
595  */
596 QDF_STATUS
597 cm_handle_reassoc_req(struct wlan_objmgr_vdev *vdev,
598 		      struct wlan_cm_vdev_reassoc_req *req);
599 
600 /**
601  * cm_handle_roam_start() - roam start indication
602  * @vdev: VDEV object
603  * @req: Connection manager roam request
604  *
605  * Return: QDF_STATUS
606  */
607 QDF_STATUS
608 cm_handle_roam_start(struct wlan_objmgr_vdev *vdev,
609 		     struct wlan_cm_roam_req *req);
610 
611 /**
612  * cm_csr_preauth_done() - Process preauth done from csr part
613  * @vdev: vdev object pointer
614  *
615  * Return: void
616  */
617 void cm_csr_preauth_done(struct wlan_objmgr_vdev *vdev);
618 #else
cm_process_preauth_req(struct scheduler_msg * msg)619 static inline QDF_STATUS cm_process_preauth_req(struct scheduler_msg *msg)
620 {
621 	return QDF_STATUS_SUCCESS;
622 }
623 
cm_process_reassoc_req(struct scheduler_msg * msg)624 static inline QDF_STATUS cm_process_reassoc_req(struct scheduler_msg *msg)
625 {
626 	return QDF_STATUS_SUCCESS;
627 }
628 
629 static inline QDF_STATUS
cm_handle_reassoc_req(struct wlan_objmgr_vdev * vdev,struct wlan_cm_vdev_reassoc_req * req)630 cm_handle_reassoc_req(struct wlan_objmgr_vdev *vdev,
631 		      struct wlan_cm_vdev_reassoc_req *req)
632 {
633 	return QDF_STATUS_SUCCESS;
634 }
635 static inline QDF_STATUS
cm_handle_roam_start(struct wlan_objmgr_vdev * vdev,struct wlan_cm_roam_req * req)636 cm_handle_roam_start(struct wlan_objmgr_vdev *vdev,
637 		     struct wlan_cm_roam_req *req)
638 {
639 	return QDF_STATUS_SUCCESS;
640 }
641 #endif
642 
643 /**
644  * cm_process_peer_create() - Process bss peer create req
645  * @msg: scheduler message
646  *
647  * Return: QDF_STATUS
648  */
649 QDF_STATUS cm_process_peer_create(struct scheduler_msg *msg);
650 
651 /**
652  * cm_process_disconnect_req() - Process vdev disconnect request
653  * @msg: scheduler message
654  *
655  * Process disconnect request in LIM.
656  *
657  * Return: QDF_STATUS
658  */
659 QDF_STATUS cm_process_disconnect_req(struct scheduler_msg *msg);
660 
661 /**
662  * cm_disconnect() - disconnect start request
663  * @psoc: psoc pointer
664  * @vdev_id: vdev id
665  * @source: disconnect source
666  * @reason_code: disconnect reason
667  * @bssid: bssid of AP to disconnect, can be null if not known
668  *
669  * Context: can be called from any context, should not hold sme global lock
670  * while calling as can lead to deadlock (disconnect access sme lock holding CM
671  * lock and thus calling cm api (which will hold CM lock) while holding sme lock
672  * can lead to deadlock)
673  *
674  * Return: QDF_STATUS
675  */
676 QDF_STATUS cm_disconnect(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
677 			 enum wlan_cm_source source,
678 			 enum wlan_reason_code reason_code,
679 			 struct qdf_mac_addr *bssid);
680 
681 /**
682  * cm_send_sb_disconnect_req() - Process vdev discon ind from sb and send to CM
683  * @msg: scheduler message
684  *
685  * Process disconnect indication and send it to CM SM.
686  *
687  * Return: QDF_STATUS
688  */
689 QDF_STATUS cm_send_sb_disconnect_req(struct scheduler_msg *msg);
690 
691 /**
692  * cm_handle_disconnect_resp() - Process vdev discon rsp and send to CM
693  * @msg: scheduler message
694  *
695  * Process disconnect rsp and send it to CM SM.
696  *
697  * Return: QDF_STATUS
698  */
699 QDF_STATUS cm_handle_disconnect_resp(struct scheduler_msg *msg);
700 
701 /**
702  * wlan_cm_send_connect_rsp() - Process vdev join rsp and send to CM
703  * @msg: scheduler message
704  *
705  * Process connect response and send it to CM SM.
706  *
707  * Return: QDF_STATUS
708  */
709 QDF_STATUS wlan_cm_send_connect_rsp(struct scheduler_msg *msg);
710 
711 /**
712  * wlan_cm_free_connect_rsp() - Function to free all params in join rsp
713  * @rsp: CM join response
714  *
715  * Function to free up all the memory in join rsp.
716  *
717  * Return: void
718  */
719 void wlan_cm_free_connect_rsp(struct cm_vdev_join_rsp *rsp);
720 
721 /**
722  * wlan_cm_handle_hw_mode_change_resp() - Process hw_mode_change_resp
723  * @pdev: pdev pointer
724  * @vdev_id: vdev_id
725  * @cm_id: connection manager id
726  * @status: status
727  *
728  * This API is to break the context and avoid calling CM API to take CM lock
729  * while holding SME lock.
730  *
731  * Return: QDF_STATUS
732  */
733 QDF_STATUS
734 wlan_cm_handle_hw_mode_change_resp(struct wlan_objmgr_pdev *pdev,
735 				   uint8_t vdev_id,
736 				   wlan_cm_id cm_id, QDF_STATUS status);
737 /**
738  * wlan_cm_rso_stop_continue_disconnect() - Continue disconnect after RSO stop
739  * @psoc: psoc object
740  * @vdev_id: vdev id
741  * @is_ho_fail: Carries true if HO_FAIL happened
742  *
743  * Return: QDF_STATUS
744  */
745 QDF_STATUS
746 wlan_cm_rso_stop_continue_disconnect(struct wlan_objmgr_psoc *psoc,
747 				     uint8_t vdev_id, bool is_ho_fail);
748 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
749 /**
750  * cm_send_rso_stop() - Send RSP stop req to firmware
751  * @vdev: VDEV object
752  *
753  * Return: QDF_STATUS
754  */
755 QDF_STATUS
756 cm_send_rso_stop(struct wlan_objmgr_vdev *vdev);
757 #else
758 static inline QDF_STATUS
cm_send_rso_stop(struct wlan_objmgr_vdev * vdev)759 cm_send_rso_stop(struct wlan_objmgr_vdev *vdev)
760 {
761 	return QDF_STATUS_E_NOSUPPORT;
762 }
763 #endif
764 
765 #ifdef WLAN_FEATURE_11BE_MLO
766 /**
767  * cm_get_ml_partner_info() - Fill ML partner info from scan entry
768  * @pdev: PDEV object
769  * @conn_req: Connect request pointer
770  *
771  * Return: QDF_STATUS
772  */
773 QDF_STATUS
774 cm_get_ml_partner_info(struct wlan_objmgr_pdev *pdev,
775 		       struct cm_connect_req *conn_req);
776 #endif
777 #endif /* __WLAN_CM_VDEV_API_H__ */
778