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