Browse Source

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
Paul Zhang 5 years ago
parent
commit
c5a417e285

+ 5 - 3
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",

+ 6 - 3
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);