1 /*
2  * Copyright (c) 2022, 2024, Qualcomm Innovation Center, Inc. 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: Public API implementation of pre cac called by north bound iface.
19  */
20 
21 #include "../../core/src/wlan_pre_cac_main.h"
22 #include "wlan_pre_cac_ucfg_api.h"
23 
ucfg_pre_cac_complete_set(struct wlan_objmgr_vdev * vdev,bool status)24 void ucfg_pre_cac_complete_set(struct wlan_objmgr_vdev *vdev,
25 			       bool status)
26 {
27 	pre_cac_complete_set(vdev, status);
28 }
29 
ucfg_pre_cac_clean_up(struct wlan_objmgr_psoc * psoc)30 void ucfg_pre_cac_clean_up(struct wlan_objmgr_psoc *psoc)
31 {
32 	pre_cac_clean_up(psoc);
33 }
34 
ucfg_pre_cac_stop(struct wlan_objmgr_psoc * psoc)35 void ucfg_pre_cac_stop(struct wlan_objmgr_psoc *psoc)
36 {
37 	pre_cac_stop(psoc);
38 }
39 
ucfg_pre_cac_set_freq(struct wlan_objmgr_vdev * vdev,qdf_freq_t freq)40 void ucfg_pre_cac_set_freq(struct wlan_objmgr_vdev *vdev,
41 			   qdf_freq_t freq)
42 {
43 	pre_cac_set_freq(vdev, freq);
44 }
45 
ucfg_pre_cac_get_freq(struct wlan_objmgr_vdev * vdev)46 qdf_freq_t ucfg_pre_cac_get_freq(struct wlan_objmgr_vdev *vdev)
47 {
48 	return pre_cac_get_freq(vdev);
49 }
50 
ucfg_pre_cac_set_freq_before_pre_cac(struct wlan_objmgr_vdev * vdev,qdf_freq_t freq)51 void ucfg_pre_cac_set_freq_before_pre_cac(struct wlan_objmgr_vdev *vdev,
52 					  qdf_freq_t freq)
53 {
54 	return pre_cac_set_freq_before_pre_cac(vdev, freq);
55 }
56 
ucfg_pre_cac_adapter_set(struct wlan_objmgr_vdev * vdev,bool status)57 void ucfg_pre_cac_adapter_set(struct wlan_objmgr_vdev *vdev,
58 			      bool status)
59 {
60 	pre_cac_adapter_set(vdev, status);
61 }
62 
ucfg_pre_cac_adapter_is_active(struct wlan_objmgr_vdev * vdev)63 bool ucfg_pre_cac_adapter_is_active(struct wlan_objmgr_vdev *vdev)
64 {
65 	return pre_cac_adapter_is_active(vdev);
66 }
67 
ucfg_pre_cac_get_vdev_id(struct wlan_objmgr_psoc * psoc,uint8_t * vdev_id)68 void ucfg_pre_cac_get_vdev_id(struct wlan_objmgr_psoc *psoc,
69 			      uint8_t *vdev_id)
70 {
71 	pre_cac_get_vdev_id(psoc, vdev_id);
72 }
73 
ucfg_pre_cac_validate_and_get_freq(struct wlan_objmgr_pdev * pdev,uint32_t chan_freq,uint32_t * pre_cac_chan_freq,enum phy_ch_width cac_ch_width)74 int ucfg_pre_cac_validate_and_get_freq(struct wlan_objmgr_pdev *pdev,
75 				       uint32_t chan_freq,
76 				       uint32_t *pre_cac_chan_freq,
77 				       enum phy_ch_width cac_ch_width)
78 {
79 	return pre_cac_validate_and_get_freq(pdev, chan_freq,
80 					     pre_cac_chan_freq,
81 					     cac_ch_width);
82 }
83 
84 #if defined(FEATURE_SAP_COND_CHAN_SWITCH)
ucfg_pre_cac_set_status(struct wlan_objmgr_vdev * vdev,bool status)85 QDF_STATUS ucfg_pre_cac_set_status(struct wlan_objmgr_vdev *vdev, bool status)
86 {
87 	return pre_cac_set_status(vdev, status);
88 }
89 #endif
90 
ucfg_pre_cac_is_active(struct wlan_objmgr_psoc * psoc)91 bool ucfg_pre_cac_is_active(struct wlan_objmgr_psoc *psoc)
92 {
93 	return pre_cac_is_active(psoc);
94 }
95 
ucfg_pre_cac_set_osif_cb(struct pre_cac_ops * osif_pre_cac_ops)96 void ucfg_pre_cac_set_osif_cb(struct pre_cac_ops *osif_pre_cac_ops)
97 {
98 	pre_cac_set_osif_cb(osif_pre_cac_ops);
99 }
100 
ucfg_pre_cac_clear_work(struct wlan_objmgr_psoc * psoc)101 void ucfg_pre_cac_clear_work(struct wlan_objmgr_psoc *psoc)
102 {
103 	return pre_cac_clear_work(psoc);
104 }
105 
ucfg_pre_cac_init(void)106 QDF_STATUS ucfg_pre_cac_init(void)
107 {
108 	return pre_cac_init();
109 }
110 
ucfg_pre_cac_deinit(void)111 void ucfg_pre_cac_deinit(void)
112 {
113 	pre_cac_deinit();
114 }
115