1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /*
18  * DOC: Implements CM UTF
19  */
20 
21 #ifdef FEATURE_CM_UTF_ENABLE
22 #include <cm_utf.h>
23 #include <wlan_cm_utf.h>
24 #include <include/wlan_mlme_cmn.h>
25 
cm_utf_set_mlme_ops(struct mlme_ext_ops * ext_ops)26 void cm_utf_set_mlme_ops(struct mlme_ext_ops *ext_ops)
27 {
28 	ext_ops->mlme_cm_ext_connect_start_ind_cb = NULL;
29 	ext_ops->mlme_cm_ext_bss_select_ind_cb = NULL;
30 	ext_ops->mlme_cm_ext_bss_peer_create_req_cb =
31 					wlan_cm_utf_bss_peer_create_req;
32 	ext_ops->mlme_cm_ext_connect_req_cb = wlan_cm_utf_connect_req;
33 	ext_ops->mlme_cm_ext_connect_complete_ind_cb = NULL;
34 	ext_ops->mlme_cm_ext_disconnect_start_ind_cb = NULL;
35 	ext_ops->mlme_cm_ext_disconnect_req_cb = wlan_cm_utf_disconnect_req;
36 	ext_ops->mlme_cm_ext_bss_peer_delete_req_cb =
37 					wlan_cm_utf_bss_peer_delete_req;
38 	ext_ops->mlme_cm_ext_disconnect_complete_ind_cb = NULL;
39 	ext_ops->mlme_cm_ext_vdev_down_req_cb = wlan_cm_utf_vdev_down;
40 }
41 
cm_utf_register_os_if_cb(void)42 QDF_STATUS cm_utf_register_os_if_cb(void)
43 {
44 	return osif_cm_utf_register_cb();
45 }
46 
cm_utf_attach(struct wlan_objmgr_vdev * vdev)47 void cm_utf_attach(struct wlan_objmgr_vdev *vdev)
48 {
49 	if (QDF_IS_STATUS_ERROR(wlan_cm_utf_attach(vdev)))
50 		mlme_err("utf attach failed");
51 	else
52 		mlme_debug("utf attach success");
53 }
54 
cm_utf_detach(struct wlan_objmgr_vdev * vdev)55 void cm_utf_detach(struct wlan_objmgr_vdev *vdev)
56 {
57 	wlan_cm_utf_detach(vdev);
58 }
59 #endif
60