|
@@ -899,6 +899,77 @@ reg_populate_6g_band_channels(struct cur_reg_rule *reg_rule_5g,
|
|
}
|
|
}
|
|
#endif /* CONFIG_BAND_6GHZ */
|
|
#endif /* CONFIG_BAND_6GHZ */
|
|
|
|
|
|
|
|
+#ifdef CONFIG_REG_CLIENT
|
|
|
|
+/**
|
|
|
|
+ * reg_send_ctl_info() - Send CTL info to firmware when regdb is not offloaded
|
|
|
|
+ * @soc_reg: soc private object for regulatory
|
|
|
|
+ * @regulatory_info: regulatory info
|
|
|
|
+ * @tx_ops: send operations for regulatory component
|
|
|
|
+ *
|
|
|
|
+ * Return: QDF_STATUS
|
|
|
|
+ */
|
|
|
|
+static QDF_STATUS
|
|
|
|
+reg_send_ctl_info(struct wlan_regulatory_psoc_priv_obj *soc_reg,
|
|
|
|
+ struct cur_regulatory_info *regulatory_info,
|
|
|
|
+ struct wlan_lmac_if_reg_tx_ops *tx_ops)
|
|
|
|
+{
|
|
|
|
+ struct wlan_objmgr_psoc *psoc = regulatory_info->psoc;
|
|
|
|
+ struct reg_ctl_params params = {0};
|
|
|
|
+ QDF_STATUS status;
|
|
|
|
+ uint16_t regd_index;
|
|
|
|
+ uint32_t index_2g, index_5g;
|
|
|
|
+
|
|
|
|
+ if (soc_reg->offload_enabled)
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+
|
|
|
|
+ if (!tx_ops || !tx_ops->send_ctl_info) {
|
|
|
|
+ reg_err("No regulatory tx_ops for send_ctl_info");
|
|
|
|
+ return QDF_STATUS_E_FAULT;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ status = reg_get_rdpair_from_regdmn_id(regulatory_info->reg_dmn_pair,
|
|
|
|
+ ®d_index);
|
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
|
+ reg_err("Failed to get regdomain index for regdomain pair: %x",
|
|
|
|
+ regulatory_info->reg_dmn_pair);
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ index_2g = g_reg_dmn_pairs[regd_index].dmn_id_2g;
|
|
|
|
+ index_5g = g_reg_dmn_pairs[regd_index].dmn_id_5g;
|
|
|
|
+ params.ctl_2g = regdomains_2g[index_2g].ctl_val;
|
|
|
|
+ params.ctl_5g = regdomains_5g[index_5g].ctl_val;
|
|
|
|
+ params.regd_2g = reg_2g_sub_dmn_code[index_2g];
|
|
|
|
+ params.regd_5g = reg_5g_sub_dmn_code[index_5g];
|
|
|
|
+
|
|
|
|
+ if (reg_is_world_ctry_code(regulatory_info->reg_dmn_pair))
|
|
|
|
+ params.regd = regulatory_info->reg_dmn_pair;
|
|
|
|
+ else
|
|
|
|
+ params.regd = regulatory_info->ctry_code | COUNTRY_ERD_FLAG;
|
|
|
|
+
|
|
|
|
+ reg_debug("regdomain pair = %u, regdomain index = %u",
|
|
|
|
+ regulatory_info->reg_dmn_pair, regd_index);
|
|
|
|
+ reg_debug("index_2g = %u, index_5g = %u, ctl_2g = %x, ctl_5g = %x",
|
|
|
|
+ index_2g, index_5g, params.ctl_2g, params.ctl_5g);
|
|
|
|
+ reg_debug("regd_2g = %x, regd_5g = %x, regd = %x",
|
|
|
|
+ params.regd_2g, params.regd_5g, params.regd);
|
|
|
|
+
|
|
|
|
+ status = tx_ops->send_ctl_info(psoc, ¶ms);
|
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
|
+ reg_err("Failed to send CTL info to firmware");
|
|
|
|
+
|
|
|
|
+ return status;
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static QDF_STATUS
|
|
|
|
+reg_send_ctl_info(struct wlan_regulatory_psoc_priv_obj *soc_reg,
|
|
|
|
+ struct cur_regulatory_info *regulatory_info,
|
|
|
|
+ struct wlan_lmac_if_reg_tx_ops *tx_ops)
|
|
|
|
+{
|
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
QDF_STATUS reg_process_master_chan_list(
|
|
QDF_STATUS reg_process_master_chan_list(
|
|
struct cur_regulatory_info *regulat_info)
|
|
struct cur_regulatory_info *regulat_info)
|
|
{
|
|
{
|
|
@@ -1063,6 +1134,12 @@ QDF_STATUS reg_process_master_chan_list(
|
|
}
|
|
}
|
|
|
|
|
|
soc_reg->chan_list_recvd[phy_id] = true;
|
|
soc_reg->chan_list_recvd[phy_id] = true;
|
|
|
|
+ status = reg_send_ctl_info(soc_reg, regulat_info, tx_ops);
|
|
|
|
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
|
+ reg_err("Failed to send ctl info to fw");
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (soc_reg->new_user_ctry_pending[phy_id]) {
|
|
if (soc_reg->new_user_ctry_pending[phy_id]) {
|
|
soc_reg->new_user_ctry_pending[phy_id] = false;
|
|
soc_reg->new_user_ctry_pending[phy_id] = false;
|
|
soc_reg->cc_src = SOURCE_USERSPACE;
|
|
soc_reg->cc_src = SOURCE_USERSPACE;
|