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) 106 /** 107 * target_if_reg_set_lower_6g_edge_ch_info() - populate lower 6ghz edge channel 108 * enablement info 109 * @psoc: psoc pointer 110 * Return: Success or Failure 111 */ 112 QDF_STATUS 113 target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc); 114 115 /** 116 * target_if_reg_set_disable_upper_6g_edge_ch_info() - populate upper 6ghz 117 * edge channel disablement info 118 * @psoc: psoc pointer 119 * Return: Success or Failure 120 */ 121 QDF_STATUS 122 target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc); 123 #else 124 static inline QDF_STATUS 125 target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc) 126 { 127 return QDF_STATUS_E_FAILURE; 128 } 129 130 static inline QDF_STATUS 131 target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc) 132 { 133 return QDF_STATUS_E_FAILURE; 134 } 135 #endif 136 137 #if defined(CONFIG_AFC_SUPPORT) 138 /** 139 * target_if_reg_set_afc_dev_type() - set afc device deployment type 140 * @psoc: psoc pointer 141 * @tgt_hdl: target handle 142 * 143 * Return: Success or Failure 144 */ 145 QDF_STATUS 146 target_if_reg_set_afc_dev_type(struct wlan_objmgr_psoc *psoc, 147 struct target_psoc_info *tgt_hdl); 148 149 /** 150 * target_if_reg_get_afc_device_type() - get afc device deployment type 151 * @psoc: psoc pointer 152 * @reg_afc_dev_type: 153 * Return: Success or Failure 154 */ 155 QDF_STATUS 156 target_if_reg_get_afc_dev_type(struct wlan_objmgr_psoc *psoc, 157 enum reg_afc_dev_deploy_type *reg_afc_dev_type); 158 159 /** 160 * target_if_set_regulatory_eirp_preferred_support() - Set EIRP as the preferred 161 * support 162 * @psoc: psoc pointer 163 * Return: Success or Failure 164 */ 165 QDF_STATUS 166 target_if_set_regulatory_eirp_preferred_support(struct wlan_objmgr_psoc *psoc); 167 #else 168 static inline QDF_STATUS 169 target_if_reg_set_afc_dev_type(struct wlan_objmgr_psoc *psoc, 170 struct target_psoc_info *tgt_hdl) 171 { 172 return QDF_STATUS_E_FAILURE; 173 } 174 175 static inline QDF_STATUS 176 target_if_set_regulatory_eirp_preferred_support(struct wlan_objmgr_psoc *psoc) 177 { 178 return QDF_STATUS_E_FAILURE; 179 } 180 #endif 181 #endif /* __TARGET_IF_REG_H__ */ 182