summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiangwei Dong <liangwei@codeaurora.org>2017-07-19 02:45:00 -0400
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-17 19:35:31 -0700
commitf1e0ee047e0c1e17ce3d853b54257d1807f68272 (patch)
tree9970b1d1fcbcd92e2ace9d879c2b3ffe8c6f12e6
parent5dd17329e58153d7562c40c3857952e6ceb0a36f (diff)
qcacld-3.0: Fix edca parameter issue
qcacld-2.0 to qcacld-3.0 propagation Update EDCA parameter if the country is in European Union based on new ETSI RED channel access parameters. Change-Id: I08b1a0d7cd0ee1f6985cd0810c5c4c1108e582b4 CRs-Fixed: 2078985
-rw-r--r--core/cds/inc/cds_regdomain.h10
-rw-r--r--core/cds/src/cds_regdomain.c59
-rw-r--r--core/mac/inc/wni_cfg.h19
-rw-r--r--core/mac/src/cfg/cfg_param_name.c10
-rw-r--r--core/mac/src/cfg/cfg_proc_msg.c73
-rw-r--r--core/mac/src/pe/include/sch_api.h3
-rw-r--r--core/mac/src/pe/sch/sch_message.c48
-rw-r--r--core/sme/src/csr/csr_api_scan.c3
8 files changed, 212 insertions, 13 deletions
diff --git a/core/cds/inc/cds_regdomain.h b/core/cds/inc/cds_regdomain.h
index d97c734506a4..2d49c4d1efdd 100644
--- a/core/cds/inc/cds_regdomain.h
+++ b/core/cds/inc/cds_regdomain.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2014-2018 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
@@ -563,5 +563,11 @@ uint16_t cds_reg_dmn_get_chanwidth_from_opclass(uint8_t *country,
uint8_t opclass);
uint16_t cds_reg_dmn_set_curr_opclasses(uint8_t num_classes, uint8_t *class);
uint16_t cds_reg_dmn_get_curr_opclasses(uint8_t *num_classes, uint8_t *class);
-
+/**
+ * cds_is_etsi_europe_country - check ETSI Europe country or not
+ * @country: country string with two Characters
+ *
+ * Return: true if country in ETSI Europe country list
+ */
+bool cds_is_etsi_europe_country(uint8_t *country);
#endif /* __CDS_REGDOMAIN_H */
diff --git a/core/cds/src/cds_regdomain.c b/core/cds/src/cds_regdomain.c
index 9fa18ced76d6..c388b948ce24 100644
--- a/core/cds/src/cds_regdomain.c
+++ b/core/cds/src/cds_regdomain.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011,2013-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011,2013-2018 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
@@ -465,6 +465,63 @@ struct reg_dmn_tables g_reg_dmn_tbl = {
QDF_ARRAY_SIZE(g_reg_dmns),
};
+/*
+ * ETSI is updating EN 301 893, which specifies 5 GHz channel access
+ * in Europe
+ */
+static const char etsi_europe_country[][2] = {
+ {'A', 'T'},
+ {'B', 'E'},
+ {'B', 'G'},
+ {'C', 'Z'},
+ {'D', 'K'},
+ {'E', 'E'},
+ {'F', 'R'},
+
+ {'D', 'E'},
+ {'I', 'S'},
+ {'I', 'E'},
+ {'I', 'T'},
+ {'E', 'L'},
+ {'E', 'S'},
+ {'C', 'Y'},
+
+ {'L', 'V'},
+ {'L', 'I'},
+ {'L', 'T'},
+ {'L', 'U'},
+ {'H', 'U'},
+ {'M', 'T'},
+ {'N', 'L'},
+
+ {'N', 'O'},
+ {'P', 'L'},
+ {'P', 'T'},
+ {'R', 'O'},
+ {'S', 'I'},
+ {'S', 'K'},
+ {'T', 'R'},
+
+ {'F', 'I'},
+ {'S', 'E'},
+ {'C', 'H'},
+ {'U', 'K'},
+ {'H', 'R'},
+};
+
+bool cds_is_etsi_europe_country(uint8_t *country)
+{
+ int32_t i;
+
+ for (i = 0; i < QDF_ARRAY_SIZE(etsi_europe_country); i++) {
+ if (country[0] == etsi_europe_country[i][0] &&
+ country[1] == etsi_europe_country[i][1])
+ return true;
+ }
+
+ return false;
+}
+
/**
* get_bdf_reg_dmn() - get regulatory domain from BDF
* @reg_dmn: BDF regulatory domain
diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h
index 348995cdae84..6a436fc3c708 100644
--- a/core/mac/inc/wni_cfg.h
+++ b/core/mac/inc/wni_cfg.h
@@ -247,6 +247,14 @@ enum {
WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT,
WNI_CFG_RATE_FOR_TX_MGMT_2G,
WNI_CFG_RATE_FOR_TX_MGMT_5G,
+ WNI_CFG_EDCA_ETSI_ACBK_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACBE_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACVI_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACVO_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACBK,
+ WNI_CFG_EDCA_ETSI_ACBE,
+ WNI_CFG_EDCA_ETSI_ACVI,
+ WNI_CFG_EDCA_ETSI_ACVO,
/* Any new items to be added should be above this strictly */
CFG_PARAM_MAX_NUM
};
@@ -290,6 +298,14 @@ enum {
#define WNI_CFG_EDCA_WME_ACBE_LEN 20
#define WNI_CFG_EDCA_WME_ACVI_LEN 20
#define WNI_CFG_EDCA_WME_ACVO_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACBK_LOCAL_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACBE_LOCAL_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACVI_LOCAL_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACVO_LOCAL_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACBK_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACBE_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACVI_LEN 20
+#define WNI_CFG_EDCA_ETSI_ACVO_LEN 20
#define WNI_CFG_SCAN_CONTROL_LIST_LEN 128
#define WNI_CFG_SUPPORTED_MCS_SET_LEN 16
#define WNI_CFG_BASIC_MCS_SET_LEN 16
@@ -673,7 +689,8 @@ enum {
#define WNI_CFG_EDCA_PROFILE_ANI 0
#define WNI_CFG_EDCA_PROFILE_WMM 1
#define WNI_CFG_EDCA_PROFILE_TIT_DEMO 2
-#define WNI_CFG_EDCA_PROFILE_MAX 3
+#define WNI_CFG_EDCA_PROFILE_ETSI_EUROPE 3
+#define WNI_CFG_EDCA_PROFILE_MAX 4
#define WNI_CFG_EDCA_PROFILE_ACM_IDX 0
#define WNI_CFG_EDCA_PROFILE_AIFSN_IDX 1
#define WNI_CFG_EDCA_PROFILE_CWMINA_IDX 2
diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c
index be0063d7c847..d960a6219657 100644
--- a/core/mac/src/cfg/cfg_param_name.c
+++ b/core/mac/src/cfg/cfg_param_name.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018 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
@@ -329,4 +329,12 @@ unsigned char *g_cfg_param_name[] = {
(unsigned char *)"SAP_MAX_MCS_DATA",
(unsigned char *)"RATE_FOR_TX_MGMT_2G",
(unsigned char *)"RATE_FOR_TX_MGMT_5G",
+ (unsigned char *)"EDCA_ETSI_ACBK_LOCAL",
+ (unsigned char *)"EDCA_ETSI_ACBE_LOCAL",
+ (unsigned char *)"EDCA_ETSI_ACVI_LOCAL",
+ (unsigned char *)"EDCA_ETSI_ACVO_LOCAL",
+ (unsigned char *)"EDCA_ETSI_ACBK",
+ (unsigned char *)"EDCA_ETSI_ACBE",
+ (unsigned char *)"EDCA_ETSI_ACVI",
+ (unsigned char *)"EDCA_ETSI_ACVO",
};
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c
index 33a92dd45862..14c64325eb38 100644
--- a/core/mac/src/cfg/cfg_proc_msg.c
+++ b/core/mac/src/cfg/cfg_proc_msg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2018 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
@@ -1164,6 +1164,30 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
WNI_CFG_RATE_FOR_TX_MGMT_5G_STAMIN,
WNI_CFG_RATE_FOR_TX_MGMT_5G_STAMAX,
WNI_CFG_RATE_FOR_TX_MGMT_5G_STADEF},
+ {WNI_CFG_EDCA_ETSI_ACBK_LOCAL,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACBE_LOCAL,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACVI_LOCAL,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACVO_LOCAL,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACBK,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACBE,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACVI,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+ 0, 0, 0},
+ {WNI_CFG_EDCA_ETSI_ACVO,
+ CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_RESTART,
+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CA_ETSI_ACBE,
+ WNI_CFG_EDCA_ETSI_ACBE_LEN,
+ 17,
+ {0x0, 0x3, 0x0, 0xf, 0x3, 0xff, 0xbb, 0x0, 0xf, 0x3, 0xff, 0x0, 0x0,
+ 0xf, 0x3, 0xff, 0x0} },
+ {WNI_CFG_EDCA_ETSI_ACVI,
+ WNI_CFG_EDCA_ETSI_ACVI_LEN,
+ 17,
+ {0x0, 0x2, 0x0, 0x7, 0x0, 0xf, 0x7d, 0x0, 0x7, 0x0, 0xf, 0xbc, 0x0,
+ 0x7, 0x0, 0xf, 0x5e} },
+ {WNI_CFG_EDCA_ETSI_ACVO,
+ WNI_CFG_EDCA_ETSI_ACVO_LEN,
+ 17,
+ {0x0, 0x2, 0x0, 0x3, 0x0, 0x7, 0x3e, 0x0, 0x3, 0x0, 0x7, 0x66, 0x0,
+ 0x3, 0x0, 0x7, 0x2f} },
};
/*--------------------------------------------------------------------*/
@@ -1861,8 +1925,11 @@ process_cfg_download_req(tpAniSirGlobal pMac)
if ((pMac->cfg.gCfgEntry[i].control & CFG_CTL_VALID) == 0)
continue;
- if (index >= pMac->cfg.gCfgMaxSBufSize)
+ if (index >= pMac->cfg.gCfgMaxSBufSize) {
+ pe_debug("No space id:%d BufSize:%d index:%d",
+ i, pMac->cfg.gCfgMaxSBufSize, index);
continue;
+ }
pDstTest = &pMac->cfg.gCfgSBuf[index];
pStrCfg = (cfgstatic_string*)cfg_static[i].pStrData;
diff --git a/core/mac/src/pe/include/sch_api.h b/core/mac/src/pe/include/sch_api.h
index 15451bcd54c4..e23b49c91a3b 100644
--- a/core/mac/src/pe/include/sch_api.h
+++ b/core/mac/src/pe/include/sch_api.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2015,2018 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
@@ -51,6 +51,7 @@ extern void sch_qos_update_local(tpAniSirGlobal pMac, tpPESession psessionEntry)
extern void sch_edca_profile_update(tpAniSirGlobal pMac,
tpPESession psessionEntry);
+void sch_edca_profile_update_all(tpAniSirGlobal pmac);
/* / Set the fixed fields in a beacon frame */
extern tSirRetStatus sch_set_fixed_beacon_fields(tpAniSirGlobal pMac,
tpPESession psessionEntry);
diff --git a/core/mac/src/pe/sch/sch_message.c b/core/mac/src/pe/sch/sch_message.c
index 944bb1ba534f..51569c03848f 100644
--- a/core/mac/src/pe/sch/sch_message.c
+++ b/core/mac/src/pe/sch/sch_message.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 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
@@ -76,6 +76,26 @@ void sch_set_beacon_interval(tpAniSirGlobal pMac, tpPESession psessionEntry)
pMac->sch.schObject.gSchBeaconInterval = (uint16_t) bi;
}
+/**
+ * sch_edca_profile_update_all() - update EDCA profile
+ * @pmac: tpAniSirGlobal
+ *
+ * update EDCA parameter for APs when country code changed.
+ *
+ * return None
+ */
+void sch_edca_profile_update_all(tpAniSirGlobal pmac)
+{
+ uint32_t i;
+ tpPESession psession_entry;
+
+ for (i = 0; i < pmac->lim.maxBssId; i++) {
+ psession_entry = &pmac->lim.gpSession[i];
+ if (psession_entry->valid)
+ sch_edca_profile_update(pmac, psession_entry);
+ }
+}
+
/* -------------------------------------------------------------------- */
/**
* sch_process_message
@@ -197,19 +217,33 @@ sch_get_params(tpAniSirGlobal pMac,
uint32_t val;
uint32_t i, idx;
uint32_t *prf;
-
+ uint8_t country_code_str[WNI_CFG_COUNTRY_CODE_LEN];
+ uint32_t country_code_len = WNI_CFG_COUNTRY_CODE_LEN;
uint32_t ani_l[] = {
WNI_CFG_EDCA_ANI_ACBE_LOCAL, WNI_CFG_EDCA_ANI_ACBK_LOCAL,
WNI_CFG_EDCA_ANI_ACVI_LOCAL, WNI_CFG_EDCA_ANI_ACVO_LOCAL};
uint32_t wme_l[] = {
WNI_CFG_EDCA_WME_ACBE_LOCAL, WNI_CFG_EDCA_WME_ACBK_LOCAL,
WNI_CFG_EDCA_WME_ACVI_LOCAL, WNI_CFG_EDCA_WME_ACVO_LOCAL};
+ uint32_t etsi_l[] = {WNI_CFG_EDCA_ETSI_ACBE_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACBK_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACVI_LOCAL,
+ WNI_CFG_EDCA_ETSI_ACVO_LOCAL};
uint32_t ani_b[] = { WNI_CFG_EDCA_ANI_ACBE, WNI_CFG_EDCA_ANI_ACBK,
WNI_CFG_EDCA_ANI_ACVI, WNI_CFG_EDCA_ANI_ACVO};
uint32_t wme_b[] = { WNI_CFG_EDCA_WME_ACBE, WNI_CFG_EDCA_WME_ACBK,
WNI_CFG_EDCA_WME_ACVI, WNI_CFG_EDCA_WME_ACVO};
-
- if (wlan_cfg_get_int(pMac, WNI_CFG_EDCA_PROFILE, &val) != eSIR_SUCCESS) {
+ uint32_t etsi_b[] = {WNI_CFG_EDCA_ETSI_ACBE, WNI_CFG_EDCA_ETSI_ACBK,
+ WNI_CFG_EDCA_ETSI_ACVI, WNI_CFG_EDCA_ETSI_ACVO};
+
+ if (wlan_cfg_get_str(pMac, WNI_CFG_COUNTRY_CODE, country_code_str,
+ &country_code_len) == eSIR_SUCCESS &&
+ cds_is_etsi_europe_country(country_code_str)) {
+ val = WNI_CFG_EDCA_PROFILE_ETSI_EUROPE;
+ pe_debug("switch to ETSI EUROPE profile country code %c%c",
+ country_code_str[0], country_code_str[1]);
+ } else if (wlan_cfg_get_int(pMac, WNI_CFG_EDCA_PROFILE, &val) !=
+ eSIR_SUCCESS) {
pe_err("failed to cfg get EDCA_PROFILE id %d",
WNI_CFG_EDCA_PROFILE);
return eSIR_FAILURE;
@@ -229,6 +263,9 @@ sch_get_params(tpAniSirGlobal pMac,
case WNI_CFG_EDCA_PROFILE_WMM:
prf = &wme_l[0];
break;
+ case WNI_CFG_EDCA_PROFILE_ETSI_EUROPE:
+ prf = &etsi_l[0];
+ break;
case WNI_CFG_EDCA_PROFILE_ANI:
default:
prf = &ani_l[0];
@@ -239,6 +276,9 @@ sch_get_params(tpAniSirGlobal pMac,
case WNI_CFG_EDCA_PROFILE_WMM:
prf = &wme_b[0];
break;
+ case WNI_CFG_EDCA_PROFILE_ETSI_EUROPE:
+ prf = &etsi_b[0];
+ break;
case WNI_CFG_EDCA_PROFILE_ANI:
default:
prf = &ani_b[0];
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index 36462c4d4583..490f245d7bfc 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -43,6 +43,7 @@
#include "wlan_hdd_main.h"
#include "pld_common.h"
#include "csr_internal.h"
+#include "sch_api.h"
#define MIN_CHN_TIME_TO_FIND_GO 100
#define MAX_CHN_TIME_TO_FIND_GO 100
@@ -4064,6 +4065,7 @@ void csr_apply_channel_power_info_to_fw(tpAniSirGlobal mac_ctx,
sme_err("11D channel list is empty");
}
csr_set_cfg_country_code(mac_ctx, countryCode);
+ sch_edca_profile_update_all(mac_ctx);
}
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
@@ -4252,6 +4254,7 @@ QDF_STATUS csr_set_country_code(tpAniSirGlobal pMac, uint8_t *pCountry)
pCountry,
WNI_CFG_COUNTRY_CODE_LEN);
csr_set_cfg_country_code(pMac, pCountry);
+ sch_edca_profile_update_all(pMac);
}
}
return status;