From 36b80ed9bf625e82bf44be03dc44fe81add2e644 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Wed, 17 Jan 2018 17:58:17 +0800 Subject: [PATCH] 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 --- umac/regulatory/core/src/reg_db_parser.c | 4 ++-- umac/regulatory/core/src/reg_services.c | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/umac/regulatory/core/src/reg_db_parser.c b/umac/regulatory/core/src/reg_db_parser.c index 4a1d5255f557..c9e7375f3437 100644 --- a/umac/regulatory/core/src/reg_db_parser.c +++ b/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++; } diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index e2f11f4447cd..8f3fa7eac065 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/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;