xref: /wlan-driver/qca-wifi-host-cmn/target_if/regulatory/inc/target_if_reg.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: target_if_reg.h
22  * This file contains regulatory target interfaces.
23  */
24 #ifndef __TARGET_IF_REG_H__
25 #define __TARGET_IF_REG_H__
26 
27 /**
28  * tgt_if_regulatory_modify_freq_range() - Modify low and high freq ranges based
29  * on wireless mode.
30  * @psoc: psoc pointer
31  *
32  * Return: Success or Failure
33  */
34 QDF_STATUS tgt_if_regulatory_modify_freq_range(struct wlan_objmgr_psoc *psoc);
35 
36 /**
37  * target_if_register_regulatory_tx_ops() - register regulatory tx ops
38  * @tx_ops: tx_ops pointer
39  *
40  * Return: Success or Failure
41  */
42 QDF_STATUS target_if_register_regulatory_tx_ops(
43 		struct wlan_lmac_if_tx_ops *tx_ops);
44 
45 /**
46  * target_if_reg_set_offloaded_info() - populate regulatory offloaded info
47  * @psoc: psoc pointer
48  *
49  * Return: Success or Failure
50  */
51 QDF_STATUS target_if_reg_set_offloaded_info(struct wlan_objmgr_psoc *psoc);
52 
53 /**
54  * target_if_reg_set_6ghz_info() - populate 6ghz enablement info
55  * @psoc: psoc pointer
56  *
57  * Return: Success or Failure
58  */
59 QDF_STATUS target_if_reg_set_6ghz_info(struct wlan_objmgr_psoc *psoc);
60 
61 /**
62  * target_if_reg_set_5dot9_ghz_info() - populate 5.9ghz enablement info
63  * @psoc: psoc pointer
64  *
65  * Return: Success or Failure
66  */
67 QDF_STATUS target_if_reg_set_5dot9_ghz_info(struct wlan_objmgr_psoc *psoc);
68 
69 /**
70  * target_if_reg_is_reg_cc_ext_event_host_supported() - Populate if reg_cc_ext
71  * event is supported by host.
72  * @psoc: psoc pointer
73  *
74  * Return: True if host supports, false otherwise.
75  */
76 bool
77 target_if_reg_is_reg_cc_ext_event_host_supported(struct wlan_objmgr_psoc *psoc);
78 
79 /**
80  * target_if_regulatory_get_rx_ops() - Get regdb rx ops
81  * @psoc: pointer to psoc object
82  *
83  * Return: Reg rx_ops
84  */
85 struct wlan_lmac_if_reg_rx_ops *
86 target_if_regulatory_get_rx_ops(struct wlan_objmgr_psoc *psoc);
87 
88 /**
89  * target_if_regulatory_set_ext_tpc() - populate FW support of new WMI command
90  * for TPC
91  * @psoc: psoc pointer
92  *
93  * Return: Success or Failure
94  */
95 QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc);
96 
97 /**
98  * target_if_regulatory_get_tx_ops() - Get regdb tx ops
99  * @psoc: pointer to psoc object
100  *
101  * Return: Reg tx_ops
102  */
103 struct wlan_lmac_if_reg_tx_ops *
104 target_if_regulatory_get_tx_ops(struct wlan_objmgr_psoc *psoc);
105 
106 #if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
107 /**
108  * tgt_if_set_reg_afc_configure() - Configure target AFC feature
109  * @tgt_hdl: target psoc info handler
110  * @psoc: pointer to psoc
111  *
112  * Return: None
113  */
114 void tgt_if_set_reg_afc_configure(struct target_psoc_info *tgt_hdl,
115 				  struct wlan_objmgr_psoc *psoc);
116 #else
117 static inline
tgt_if_set_reg_afc_configure(struct target_psoc_info * tgt_hdl,struct wlan_objmgr_psoc * psoc)118 void tgt_if_set_reg_afc_configure(struct target_psoc_info *tgt_hdl,
119 				  struct wlan_objmgr_psoc *psoc)
120 {
121 }
122 #endif
123 
124 #if defined(CONFIG_BAND_6GHZ)
125 /**
126  * target_if_reg_set_lower_6g_edge_ch_info() - populate lower 6 GHz edge channel
127  * enablement info
128  * @psoc: psoc pointer
129  *
130  * Return: Success or Failure
131  */
132 QDF_STATUS
133 target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc);
134 
135 /**
136  * target_if_reg_set_disable_upper_6g_edge_ch_info() - populate upper 6 GHz
137  * edge channel disablement info
138  * @psoc: psoc pointer
139  *
140  * Return: Success or Failure
141  */
142 QDF_STATUS
143 target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc);
144 #else
145 static inline QDF_STATUS
target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc * psoc)146 target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc)
147 {
148 	return QDF_STATUS_E_FAILURE;
149 }
150 
151 static inline QDF_STATUS
target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc * psoc)152 target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc)
153 {
154 	return QDF_STATUS_E_FAILURE;
155 }
156 #endif
157 
158 #if defined(CONFIG_AFC_SUPPORT)
159 /**
160  * target_if_reg_set_afc_dev_type() - set afc device deployment type
161  * @psoc: psoc pointer
162  * @tgt_hdl: target handle
163  *
164  * Return: Success or Failure
165  */
166 QDF_STATUS
167 target_if_reg_set_afc_dev_type(struct wlan_objmgr_psoc *psoc,
168 			       struct target_psoc_info *tgt_hdl);
169 
170 /**
171  * target_if_reg_get_afc_dev_type() - get afc device deployment type
172  * @psoc: psoc pointer
173  * @reg_afc_dev_type: device deployment type
174  *
175  * Return: Success or Failure
176  */
177 QDF_STATUS
178 target_if_reg_get_afc_dev_type(struct wlan_objmgr_psoc *psoc,
179 			       enum reg_afc_dev_deploy_type *reg_afc_dev_type);
180 
181 /**
182  * target_if_set_regulatory_eirp_preferred_support() - Set EIRP as the preferred
183  * support
184  * @psoc: psoc pointer
185  *
186  * Return: Success or Failure
187  */
188 QDF_STATUS
189 target_if_set_regulatory_eirp_preferred_support(struct wlan_objmgr_psoc *psoc);
190 #else
191 static inline QDF_STATUS
target_if_reg_set_afc_dev_type(struct wlan_objmgr_psoc * psoc,struct target_psoc_info * tgt_hdl)192 target_if_reg_set_afc_dev_type(struct wlan_objmgr_psoc *psoc,
193 			       struct target_psoc_info *tgt_hdl)
194 {
195 	return QDF_STATUS_E_FAILURE;
196 }
197 
198 static inline QDF_STATUS
target_if_set_regulatory_eirp_preferred_support(struct wlan_objmgr_psoc * psoc)199 target_if_set_regulatory_eirp_preferred_support(struct wlan_objmgr_psoc *psoc)
200 {
201 	return QDF_STATUS_E_FAILURE;
202 }
203 #endif
204 #endif /* __TARGET_IF_REG_H__ */
205