xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_dcs.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 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_hdd_dcs.h
20  *
21  * WLAN Host Device Driver dcs related implementation
22  *
23  */
24 
25 #if !defined(WLAN_HDD_DCS_H)
26 #define WLAN_HDD_DCS_H
27 
28 #include <wlan_hdd_main.h>
29 
30 #ifdef DCS_INTERFERENCE_DETECTION
31 /**
32  * hdd_dcs_register_cb() - register dcs callback
33  * @hdd_ctx: hdd ctx
34  *
35  * This function is used to register the HDD callbacks with dcs component
36  *
37  * Return: None
38  */
39 void hdd_dcs_register_cb(struct hdd_context *hdd_ctx);
40 
41 /**
42  * hdd_dcs_hostapd_set_chan() - switch sap channel to dcs channel
43  * @hdd_ctx: hdd ctx
44  * @vdev_id: vdev id
45  * @dcs_ch_freq: dcs channel freq
46  *
47  * This function is used to switch sap channel to dcs channel using (E)CSA
48  *
49  * Return: None
50  */
51 QDF_STATUS hdd_dcs_hostapd_set_chan(struct hdd_context *hdd_ctx,
52 				    uint8_t vdev_id,
53 				    qdf_freq_t dcs_ch_freq);
54 
55 /**
56  * hdd_dcs_chan_select_complete() - dcs triggered channel select
57  * complete handling
58  * @adapter: hdd adapter pointer
59  *
60  * When dcs triggered channel select complete, this function is used to do
61  * switch sap to new dcs channel or just to enable interference mitigation
62  *
63  * Return: None
64  */
65 void hdd_dcs_chan_select_complete(struct hdd_adapter *adapter);
66 
67 /**
68  * hdd_dcs_clear() - clear dcs information
69  * @adapter: hdd adapter pointer
70  *
71  * This function is used to clear sap dcs related information such as
72  * im stats and freq ctrl params
73  *
74  * Return: None
75  */
76 void hdd_dcs_clear(struct hdd_adapter *adapter);
77 #else
hdd_dcs_register_cb(struct hdd_context * hdd_ctx)78 static inline void hdd_dcs_register_cb(struct hdd_context *hdd_ctx)
79 {
80 }
81 
hdd_dcs_hostapd_set_chan(struct hdd_context * hdd_ctx,uint8_t vdev_id,qdf_freq_t dcs_ch_freq)82 static inline QDF_STATUS hdd_dcs_hostapd_set_chan(struct hdd_context *hdd_ctx,
83 						  uint8_t vdev_id,
84 						  qdf_freq_t dcs_ch_freq)
85 {
86 	return QDF_STATUS_SUCCESS;
87 }
88 
hdd_dcs_chan_select_complete(struct hdd_adapter * adapter)89 static inline void hdd_dcs_chan_select_complete(struct hdd_adapter *adapter)
90 {
91 }
92 
hdd_dcs_clear(struct hdd_adapter * adapter)93 static inline void hdd_dcs_clear(struct hdd_adapter *adapter)
94 {
95 }
96 #endif
97 
98 #endif /* end #if !defined(WLAN_HDD_DCS_H) */
99