From 6ca6f835565d23c120d739bfc2e609624756541a Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Tue, 17 Jul 2018 06:43:15 -0400 Subject: [PATCH] qcacmn: Fix 11d non offload issue If target only support regdb offload but not support 11d scan offload, the set country code wmi command needs to be sent to firmware. Change-Id: Ide69c3f08a14560789f6e53a6013861843b5e974 CRs-Fixed: 2280170 --- umac/regulatory/core/src/reg_services.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 145338b84083..c1f8c3b5f48f 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -1485,6 +1485,7 @@ QDF_STATUS reg_set_11d_country(struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_psoc *psoc; struct cc_regdmn_s rd; QDF_STATUS status; + struct wlan_lmac_if_reg_tx_ops *tx_ops; if (!country) { reg_err("country code is NULL"); @@ -1514,8 +1515,15 @@ QDF_STATUS reg_set_11d_country(struct wlan_objmgr_pdev *pdev, psoc_reg->new_11d_ctry_pending = true; if (psoc_reg->offload_enabled) { - reg_err("reg offload, 11d offload too!"); - status = QDF_STATUS_E_FAULT; + 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_11d_ctry_pending = false; + return QDF_STATUS_E_FAULT; + } + status = QDF_STATUS_SUCCESS; } else { qdf_mem_copy(rd.cc.alpha, country, REG_ALPHA2_LEN + 1); rd.flags = ALPHA_IS_SET;