1 /* 2 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 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: wlan_reg_tgt_api.h 22 * This file provides prototypes of the regulatory component target 23 * interface routines 24 */ 25 26 #ifndef __WLAN_REG_TGT_API_H 27 #define __WLAN_REG_TGT_API_H 28 29 /** 30 * tgt_process_master_chan_list() - process master channel list 31 * @reg_info: regulatory info 32 * 33 * Return: QDF_STATUS 34 */ 35 QDF_STATUS tgt_reg_process_master_chan_list(struct cur_regulatory_info 36 *reg_info); 37 38 #ifdef CONFIG_BAND_6GHZ 39 /** 40 * tgt_reg_process_master_chan_list_ext() - process master ext channel list 41 * @reg_info: regulatory info 42 * 43 * Return: QDF_STATUS 44 */ 45 QDF_STATUS tgt_reg_process_master_chan_list_ext(struct cur_regulatory_info 46 *reg_info); 47 48 #ifdef CONFIG_AFC_SUPPORT 49 /** 50 * tgt_reg_process_afc_event() - process the AFC event 51 * @afc_info: AFC regulatory info 52 * 53 * Return: QDF_STATUS 54 */ 55 QDF_STATUS 56 tgt_reg_process_afc_event(struct afc_regulatory_info *afc_info); 57 #endif 58 #endif 59 60 /** 61 * tgt_reg_process_11d_new_country() - process new 11d country event 62 * @psoc: pointer to psoc 63 * @reg_11d_new_cc: new 11d country pointer 64 * 65 * Return: QDF_STATUS 66 */ 67 QDF_STATUS tgt_reg_process_11d_new_country(struct wlan_objmgr_psoc *psoc, 68 struct reg_11d_new_country *reg_11d_new_cc); 69 70 /** 71 * tgt_reg_set_regdb_offloaded() - set/clear regulatory offloaded flag 72 * 73 * @psoc: psoc pointer 74 * Return: Success or Failure 75 */ 76 QDF_STATUS tgt_reg_set_regdb_offloaded(struct wlan_objmgr_psoc *psoc, 77 bool val); 78 79 /** 80 * tgt_reg_set_11d_offloaded() - set/clear 11d offloaded flag 81 * 82 * @psoc: psoc pointer 83 * Return: Success or Failure 84 */ 85 QDF_STATUS tgt_reg_set_11d_offloaded(struct wlan_objmgr_psoc *psoc, 86 bool val); 87 /** 88 * tgt_reg_process_ch_avoid_event() - process new ch avoid event 89 * @psoc: pointer to psoc 90 * @ch_avoid_evnt: channel avoid event 91 * 92 * Return: QDF_STATUS 93 */ 94 QDF_STATUS tgt_reg_process_ch_avoid_event(struct wlan_objmgr_psoc *psoc, 95 struct ch_avoid_ind_type *ch_avoid_evnt); 96 97 /** 98 * tgt_reg_ignore_fw_reg_offload_ind() - Check whether regdb offload indication 99 * from FW needs to be ignored. 100 * @psoc: Pointer to psoc 101 */ 102 bool tgt_reg_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc); 103 104 /** 105 * tgt_reg_set_6ghz_supported() - Whether 6ghz is supported by the chip 106 * @psoc: Pointer to psoc 107 * @val: value 108 */ 109 QDF_STATUS tgt_reg_set_6ghz_supported(struct wlan_objmgr_psoc *psoc, 110 bool val); 111 112 /** 113 * tgt_reg_set_5dot9_ghz_supported() - Whether 5.9ghz is supported by the chip 114 * @psoc: Pointer to psoc 115 * @val: value 116 */ 117 QDF_STATUS tgt_reg_set_5dot9_ghz_supported(struct wlan_objmgr_psoc *psoc, 118 bool val); 119 120 /** 121 * tgt_reg_set_ext_tpc_supported() - Whether FW supports new WMI cmd for TPC 122 * @psoc: Pointer to psoc 123 * @val: value 124 * 125 * Return: QDF_STATUS 126 */ 127 QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc, 128 bool val); 129 130 #if defined(CONFIG_BAND_6GHZ) 131 /** 132 * tgt_reg_set_lower_6g_edge_ch_supp() - Assign the value set by FW for lower 133 * 6ghz edge channel (5935 MHz) support 134 * @psoc: Pointer to psoc 135 * @val: value 136 */ 137 QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, 138 bool val); 139 140 /** 141 * tgt_reg_set_disable_upper_6g_edge_ch_supp() - Assign the value set by FW 142 * for upper 6G edge channel {7115MHz) disablement 143 * @psoc: Pointer to psoc 144 * @val: value 145 */ 146 QDF_STATUS 147 tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, 148 bool val); 149 #else 150 static inline 151 QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, 152 bool val) 153 { 154 return QDF_STATUS_E_FAILURE; 155 } 156 157 static inline QDF_STATUS 158 tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, 159 bool val) 160 161 { 162 return QDF_STATUS_E_FAILURE; 163 } 164 #endif 165 166 #ifdef CONFIG_AFC_SUPPORT 167 /** 168 * tgt_reg_set_afc_dev_type() - set target afc device type 169 * @psoc: Pointer to psoc 170 * @reg_afc_dev_type: afc device deployment type 171 * 172 * Return: QDF_STATUS 173 */ 174 QDF_STATUS 175 tgt_reg_set_afc_dev_type(struct wlan_objmgr_psoc *psoc, 176 enum reg_afc_dev_deploy_type reg_afc_dev_type); 177 178 /** 179 * tgt_reg_get_afc_dev_type() - get target afc device type 180 * @psoc: Pointer to psoc 181 * @reg_afc_dev_type: Pointer to afc device deploymenttype 182 * 183 * Return: QDF_STATUS 184 */ 185 QDF_STATUS 186 tgt_reg_get_afc_dev_type(struct wlan_objmgr_psoc *psoc, 187 enum reg_afc_dev_deploy_type *reg_afc_dev_type); 188 #endif 189 #endif 190