From c5a417e285f58102d27dd5bd106b6d40a8fe4ac0 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Mon, 13 Jan 2020 15:50:54 +0800 Subject: [PATCH] qcacmn: Set the right cc_src for reg country Currently, if the country code which is going to be set is the same as the country currently being used, it will be ignored. It does not consider its country code source. This causes the working of 11d logic unexpected. To fix this issue, check the country source when trying to set the same country code. CRs-Fixed: 2583172 Change-Id: I9c574a62d11676bc0305510f1da9848cc044f874 --- umac/regulatory/core/src/reg_offload_11d_scan.c | 8 +++++--- umac/regulatory/core/src/reg_utils.c | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/umac/regulatory/core/src/reg_offload_11d_scan.c b/umac/regulatory/core/src/reg_offload_11d_scan.c index 5f25a97c6369..5f39b500419f 100644 --- a/umac/regulatory/core/src/reg_offload_11d_scan.c +++ b/umac/regulatory/core/src/reg_offload_11d_scan.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -59,8 +59,10 @@ QDF_STATUS reg_set_11d_country(struct wlan_objmgr_pdev *pdev, } if (!qdf_mem_cmp(psoc_priv_obj->cur_country, country, REG_ALPHA2_LEN)) { - reg_debug("country is not different"); - return QDF_STATUS_SUCCESS; + if (psoc_priv_obj->cc_src == SOURCE_11D) { + reg_debug("country is not different"); + return QDF_STATUS_SUCCESS; + } } reg_info("programming new 11d country:%c%c to firmware", diff --git a/umac/regulatory/core/src/reg_utils.c b/umac/regulatory/core/src/reg_utils.c index c36b8fa9fbc1..9addeca0e9b4 100644 --- a/umac/regulatory/core/src/reg_utils.c +++ b/umac/regulatory/core/src/reg_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -201,8 +201,11 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev, } if (!qdf_mem_cmp(psoc_reg->cur_country, country, REG_ALPHA2_LEN)) { - reg_err("country is not different"); - return QDF_STATUS_SUCCESS; + if (psoc_reg->cc_src == SOURCE_USERSPACE || + psoc_reg->cc_src == SOURCE_CORE) { + reg_debug("country is not different"); + return QDF_STATUS_SUCCESS; + } } reg_debug("programming new country: %s to firmware", country);