فهرست منبع

qcacld-3.0: Consolidate and rename regulatory macros

Consolidate regulatory macros in cds file and rename for
homogeneity.

Change-Id: I572eda616b985a39655dca3944e26fb1e0b5efb4
CRs-Fixed: 1058399
Amar Singhal 8 سال پیش
والد
کامیت
5f9978661c

+ 6 - 3
core/cds/inc/cds_regdomain.h

@@ -73,12 +73,15 @@
 
 #define MAX_CHANNELS_PER_OPERATING_CLASS  25
 #define CDS_MAX_SUPP_OPER_CLASSES 32
-#define	CTRY_DEFAULT            0
-#define COUNTRY_ERD_FLAG        0x8000
-#define WORLDWIDE_ROAMING_FLAG  0x4000
 #define MIN_TX_PWR_CAP    8
 #define MAX_TX_PWR_CAP    30
 
+#define CTRY_DEFAULT          0
+#define CTRY_FLAG             0x8000
+#define WORLD_ROAMING_FLAG    0x4000
+#define WORLD_ROAMING_MASK    0x00F0
+#define WORLD_ROAMING_PREFIX  0x0060
+
 enum country_code {
 	CTRY_AFGHANISTAN = 4,
 	CTRY_ALBANIA = 8,

+ 1 - 3
core/cds/src/cds_reg_service.c

@@ -33,13 +33,11 @@
 
 #include <net/cfg80211.h>
 #include "qdf_types.h"
-#include "cds_reg_service.h"
 #include "qdf_trace.h"
-#include "sme_api.h"
 #include "cds_api.h"
 #include "cds_reg_service.h"
 #include "cds_regdomain.h"
-
+#include "sme_api.h"
 
 const struct chan_map chan_mapping[NUM_CHANNELS] = {
 	[CHAN_ENUM_1] = {2412, 1},

+ 6 - 6
core/cds/src/cds_regdomain.c

@@ -466,7 +466,7 @@ struct reg_dmn_tables g_reg_dmn_tbl = {
  */
 static uint16_t get_bdf_reg_dmn(uint16_t reg_dmn)
 {
-	return reg_dmn & ~WORLDWIDE_ROAMING_FLAG;
+	return reg_dmn & ~WORLD_ROAMING_FLAG;
 }
 
 /**
@@ -479,8 +479,8 @@ static bool is_reg_dmn_valid(uint16_t reg_dmn)
 {
 	int32_t i;
 
-	if (reg_dmn & COUNTRY_ERD_FLAG) {
-		uint16_t cc = reg_dmn & ~COUNTRY_ERD_FLAG;
+	if (reg_dmn & CTRY_FLAG) {
+		uint16_t cc = reg_dmn & ~CTRY_FLAG;
 		for (i = 0; i < g_reg_dmn_tbl.all_countries_cnt; i++)
 			if (g_reg_dmn_tbl.all_countries[i].country_code == cc)
 				return true;
@@ -544,9 +544,9 @@ static uint16_t reg_dmn_get_default_country(uint16_t reg_dmn)
 {
 	int32_t i;
 	const struct country_code_to_reg_dmn *country = NULL;
-	uint16_t cc = reg_dmn & ~COUNTRY_ERD_FLAG;
+	uint16_t cc = reg_dmn & ~CTRY_FLAG;
 
-	if (reg_dmn & COUNTRY_ERD_FLAG) {
+	if (reg_dmn & CTRY_FLAG) {
 		country = find_country(cc);
 		if (country)
 			return cc;
@@ -627,7 +627,7 @@ static const struct country_code_to_reg_dmn *get_country_from_rd(
  */
 static void reg_dmn_sanitize(struct regulatory *reg)
 {
-	if (reg->reg_domain != COUNTRY_ERD_FLAG)
+	if (reg->reg_domain != CTRY_FLAG)
 		return;
 
 	reg->reg_domain = WOR0_WORLD;

+ 6 - 9
core/hdd/src/wlan_hdd_regulatory.c

@@ -32,16 +32,13 @@
  */
 
 #include "qdf_types.h"
+#include "qdf_trace.h"
 #include "cds_reg_service.h"
 #include "cds_regdomain.h"
-#include "qdf_trace.h"
 #include "sme_api.h"
 #include "wlan_hdd_main.h"
 #include "wlan_hdd_regulatory.h"
 
-#define WORLD_SKU_MASK      0x00F0
-#define WORLD_SKU_PREFIX    0x0060
-
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
 #define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR
 #define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR
@@ -174,11 +171,11 @@ struct regulatory *reg)
  */
 static bool hdd_is_world_regdomain(uint32_t reg_domain)
 {
-	uint32_t temp_regd = reg_domain & ~WORLDWIDE_ROAMING_FLAG;
+	uint32_t temp_regd = reg_domain & ~WORLD_ROAMING_FLAG;
 
-	return ((temp_regd & COUNTRY_ERD_FLAG) != COUNTRY_ERD_FLAG) &&
-		(((temp_regd & WORLD_SKU_MASK) == WORLD_SKU_PREFIX) ||
-		 (temp_regd == WORLD));
+	return ((temp_regd & CTRY_FLAG) != CTRY_FLAG) &&
+		((temp_regd & WORLD_ROAMING_MASK) ==
+		 WORLD_ROAMING_PREFIX);
 }
 
 
@@ -194,7 +191,7 @@ static void hdd_update_regulatory_info(hdd_context_t *hdd_ctx)
 
 	country_code = cds_get_country_from_alpha2(hdd_ctx->reg.alpha2);
 
-	hdd_ctx->reg.reg_domain = COUNTRY_ERD_FLAG;
+	hdd_ctx->reg.reg_domain = CTRY_FLAG;
 	hdd_ctx->reg.reg_domain |= country_code;
 
 	cds_fill_some_regulatory_info(&hdd_ctx->reg);

+ 2 - 2
core/wma/src/wma_features.c

@@ -6315,8 +6315,8 @@ void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
 	if (status == QDF_STATUS_E_NOMEM)
 		return;
 
-	if ((((reg_dmn & ~COUNTRY_ERD_FLAG) == CTRY_JAPAN14) ||
-	     ((reg_dmn & ~COUNTRY_ERD_FLAG) == CTRY_KOREA_ROC)) &&
+	if ((((reg_dmn & ~CTRY_FLAG) == CTRY_JAPAN14) ||
+	     ((reg_dmn & ~CTRY_FLAG) == CTRY_KOREA_ROC)) &&
 	    (true == wma->tx_chain_mask_cck))
 		cck_mask_val = 1;