Browse Source

qcacmn: use driver database for reg no-offload

For reg no-offload case, it needs to call the
reg_program_chan_list() function directory to apply
the right channel info.

Change-Id: Ieb7acf9f96973a6e56146e2763f455ef92838c4a
CRs-Fixed: 2174286
Paul Zhang 7 years ago
parent
commit
36b80ed9bf
2 changed files with 15 additions and 8 deletions
  1. 2 2
      umac/regulatory/core/src/reg_db_parser.c
  2. 13 6
      umac/regulatory/core/src/reg_services.c

+ 2 - 2
umac/regulatory/core/src/reg_db_parser.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -77,7 +77,7 @@ QDF_STATUS reg_regrules_assign(uint8_t dmn_id_2g,
 		r_r_5g->max_bw = reg_rules_5g[rule_index].max_bw;
 		r_r_5g->reg_power = reg_rules_5g[rule_index].reg_power;
 		r_r_5g->flags = reg_rules_5g[rule_index].flags;
-		r_r_2g->ant_gain = ant_gain_5g;
+		r_r_5g->ant_gain = ant_gain_5g;
 		r_r_5g++;
 	}
 

+ 13 - 6
umac/regulatory/core/src/reg_services.c

@@ -1383,6 +1383,7 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev,
 	struct wlan_lmac_if_reg_tx_ops *tx_ops;
 	struct set_country country_code;
 	struct wlan_objmgr_psoc *psoc;
+	struct cc_regdmn_s rd;
 
 	if (!country) {
 		reg_err("country code is NULL");
@@ -1411,13 +1412,19 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev,
 
 	psoc_reg->new_user_ctry_pending = true;
 
-	tx_ops = reg_get_psoc_tx_ops(psoc);
-
-	if (tx_ops->set_country_code) {
-		tx_ops->set_country_code(psoc, &country_code);
+	if (psoc_reg->offload_enabled) {
+		tx_ops = reg_get_psoc_tx_ops(psoc);
+		if (tx_ops->set_country_code) {
+			tx_ops->set_country_code(psoc, &country_code);
+		} else {
+			reg_err("country set fw handler not present");
+			psoc_reg->new_user_ctry_pending = false;
+			return QDF_STATUS_E_FAULT;
+		}
 	} else {
-		reg_err("country set fw handler not present");
-		return QDF_STATUS_E_FAULT;
+		qdf_mem_copy(rd.cc.alpha, country, REG_ALPHA2_LEN + 1);
+		rd.flags = ALPHA_IS_SET;
+		reg_program_chan_list(pdev, &rd);
 	}
 
 	return QDF_STATUS_SUCCESS;