summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeshwanth Sriram Guntuka <ysriramg@codeaurora.org>2018-01-22 16:46:59 +0530
committersnandini <snandini@codeaurora.org>2018-02-09 06:59:00 -0800
commitae6ac295b00f9aaa88c8607e7e8044a77eae72d2 (patch)
tree391414c9dc81d4ffce66ed892ef67ec3edab8584
parent92fd8cc610557d21ee5d5d93c2078d26d27547a6 (diff)
qcacld-3.0: Add ini support for channel selection logic
Add ini to select DBS or inter-band MCC channel selection logic for STA+STA and STA+P2P connections. Change-Id: I7cfde9592ec210b0a8c812171d2bc6f005e17fb2 CRs-Fixed: 2185552
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h28
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c10
-rw-r--r--core/hdd/src/wlan_hdd_main.c86
-rw-r--r--core/wma/inc/wma.h15
-rw-r--r--core/wma/inc/wma_api.h3
-rw-r--r--core/wma/src/wma_utils.c8
6 files changed, 81 insertions, 69 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 4a40a28e355b..be04074dcf6a 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -14190,6 +14190,33 @@ enum hw_filter_mode {
#define CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_MAX (300)
#define CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_DEFAULT (3)
+/*
+ * <ini>
+ * channel_select_logic_conc - Set channel selection logic
+ * for different concurrency combinations to DBS or inter band
+ * MCC. Default is DBS for STA+STA and STA+P2P.
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * 0 - inter-band MCC
+ * 1 - DBS
+ *
+ * BIT 0: STA+STA
+ * BIT 1: STA+P2P
+ * BIT 2-31: Reserved
+ *
+ * Supported Feature: STA+STA, STA+P2P
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_CHANNEL_SELECT_LOGIC_CONC_NAME "channel_select_logic_conc"
+#define CFG_CHANNEL_SELECT_LOGIC_CONC_MIN (0x00000000)
+#define CFG_CHANNEL_SELECT_LOGIC_CONC_MAX (0xFFFFFFFF)
+#define CFG_CHANNEL_SELECT_LOGIC_CONC_DEFAULT (0x00000003)
+
/*---------------------------------------------------------------------------
Type declarations
-------------------------------------------------------------------------*/
@@ -15091,6 +15118,7 @@ struct hdd_config {
uint32_t neighbor_report_offload_per_threshold_offset;
uint32_t neighbor_report_offload_cache_timeout;
uint32_t neighbor_report_offload_max_req_cap;
+ uint32_t channel_select_logic_conc;
};
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index bcf0240a2719..b7dcd6860f49 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -5508,6 +5508,13 @@ struct reg_table_entry g_registry_table[] = {
CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_DEFAULT,
CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_MIN,
CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_MAX),
+
+ REG_VARIABLE(CFG_CHANNEL_SELECT_LOGIC_CONC_NAME, WLAN_PARAM_HexInteger,
+ struct hdd_config, channel_select_logic_conc,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_CHANNEL_SELECT_LOGIC_CONC_DEFAULT,
+ CFG_CHANNEL_SELECT_LOGIC_CONC_MIN,
+ CFG_CHANNEL_SELECT_LOGIC_CONC_MAX),
};
/**
@@ -7371,6 +7378,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
pHddCtx->config->gcmp_enabled);
hdd_cfg_print_11k_offload_params(pHddCtx);
+ hdd_debug("Name = [%s] value = [0x%x]",
+ CFG_CHANNEL_SELECT_LOGIC_CONC_NAME,
+ pHddCtx->config->channel_select_logic_conc);
}
/**
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index c5d820276a75..19d3a82cc481 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -8103,44 +8103,12 @@ void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
frame_ind->rxRssi);
}
-/**
- * wlan_hdd_disable_all_dual_mac_features() - Disable dual mac features
- * @hdd_ctx: HDD context
- *
- * Disables all the dual mac features like DBS, Agile DFS etc.
- *
- * Return: QDF_STATUS_SUCCESS on success
- */
-static QDF_STATUS wlan_hdd_disable_all_dual_mac_features(hdd_context_t *hdd_ctx)
-{
- struct sir_dual_mac_config cfg;
- QDF_STATUS status;
-
- if (!hdd_ctx) {
- hdd_err("HDD context is NULL");
- return QDF_STATUS_E_FAILURE;
- }
-
- cfg.scan_config = 0;
- cfg.fw_mode_config = 0;
- cfg.set_dual_mac_cb = cds_soc_set_dual_mac_cfg_cb;
-
- hdd_debug("Disabling all dual mac features...");
-
- status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
- if (status != QDF_STATUS_SUCCESS) {
- hdd_err("sme_soc_set_dual_mac_config failed %d", status);
- return status;
- }
-
- return QDF_STATUS_SUCCESS;
-}
-
static QDF_STATUS
wlan_hdd_update_dbs_scan_and_fw_mode_config(hdd_context_t *hdd_ctx)
{
struct sir_dual_mac_config cfg = {0};
QDF_STATUS status;
+ uint32_t channel_select_logic_conc;
if (!hdd_ctx) {
hdd_err("HDD context is NULL");
@@ -8150,14 +8118,25 @@ wlan_hdd_update_dbs_scan_and_fw_mode_config(hdd_context_t *hdd_ctx)
cfg.scan_config = 0;
cfg.fw_mode_config = 0;
cfg.set_dual_mac_cb = cds_soc_set_dual_mac_cfg_cb;
- status = wma_get_updated_scan_and_fw_mode_config(&cfg.scan_config,
- &cfg.fw_mode_config,
- hdd_ctx->config->dual_mac_feature_disable);
- if (status != QDF_STATUS_SUCCESS) {
- hdd_err("wma_get_updated_scan_and_fw_mode_config failed %d",
- status);
- return status;
+ if (!wma_is_dbs_enable())
+ channel_select_logic_conc = 0;
+ else
+ channel_select_logic_conc = hdd_ctx->config->
+ channel_select_logic_conc;
+
+ if (hdd_ctx->config->dual_mac_feature_disable !=
+ DISABLE_DBS_CXN_AND_SCAN) {
+ status = wma_get_updated_scan_and_fw_mode_config(
+ &cfg.scan_config, &cfg.fw_mode_config,
+ hdd_ctx->config->dual_mac_feature_disable,
+ channel_select_logic_conc);
+
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("wma_get_updated_scan_and_fw_mode_config failed %d",
+ status);
+ return status;
+ }
}
hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw",
@@ -9880,31 +9859,6 @@ static int hdd_set_auto_shutdown_cb(hdd_context_t *hdd_ctx)
}
#endif
-static QDF_STATUS hdd_set_dbs_scan_and_fw_mode_cfg(hdd_context_t *hdd_ctx)
-{
-
- QDF_STATUS status = QDF_STATUS_SUCCESS;
-
- switch (hdd_ctx->config->dual_mac_feature_disable) {
- case DISABLE_DBS_CXN_AND_SCAN:
- status = wlan_hdd_disable_all_dual_mac_features(hdd_ctx);
- if (status != QDF_STATUS_SUCCESS)
- hdd_err("Failed to disable dual mac features");
- break;
- case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN:
- case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF:
- case ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF:
- status = wlan_hdd_update_dbs_scan_and_fw_mode_config(hdd_ctx);
- if (status != QDF_STATUS_SUCCESS)
- hdd_err("Failed to set dbs scan and fw mode config");
- break;
- default:
- break;
- }
-
- return status;
-
-}
/**
* hdd_features_init() - Init features
* @hdd_ctx: HDD context
@@ -10045,7 +9999,7 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
hdd_err("Failed to register HDD callbacks!");
goto deregister_frames;
}
- status = hdd_set_dbs_scan_and_fw_mode_cfg(hdd_ctx);
+ status = wlan_hdd_update_dbs_scan_and_fw_mode_config(hdd_ctx);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Failed to set dbs scan and fw mode cfg");
goto deregister_cb;
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index ec1ae165bf5b..4131ee0cc25c 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -207,6 +207,19 @@
#define WMA_BEACON_TX_RATE_48_M 480
#define WMA_BEACON_TX_RATE_54_M 540
+#define WMA_FW_MODE_STA_STA_BIT_POS 0
+#define WMA_FW_MODE_STA_P2P_BIT_POS 1
+
+#define WMA_FW_MODE_STA_STA_BIT_MASK (0x1 << WMA_FW_MODE_STA_STA_BIT_POS)
+#define WMA_FW_MODE_STA_P2P_BIT_MASK (0x1 << WMA_FW_MODE_STA_P2P_BIT_POS)
+
+#define WMA_CHANNEL_SELECT_LOGIC_STA_STA_GET(channel_select_logic_conc) \
+ ((channel_select_logic_conc & WMA_FW_MODE_STA_STA_BIT_MASK) >> \
+ WMA_FW_MODE_STA_STA_BIT_POS)
+#define WMA_CHANNEL_SELECT_LOGIC_STA_P2P_GET(channel_select_logic_conc) \
+ ((channel_select_logic_conc & WMA_FW_MODE_STA_P2P_BIT_MASK) >> \
+ WMA_FW_MODE_STA_P2P_BIT_POS)
+
/**
* ds_mode: distribution system mode
* @IEEE80211_NO_DS: NO DS at either side
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index f00378ca0fa2..e50bb6486820 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -252,7 +252,8 @@ QDF_STATUS wma_get_updated_fw_mode_config(uint32_t *fw_mode_config,
bool dbs,
bool agile_dfs);
QDF_STATUS wma_get_updated_scan_and_fw_mode_config(uint32_t *scan_config,
- uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini);
+ uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini,
+ uint32_t channel_select_logic_conc);
bool wma_get_dbs_scan_config(void);
bool wma_get_dbs_plus_agile_scan_config(void);
bool wma_get_single_mac_scan_with_dfs_config(void);
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index d8fd8a203ad7..decc08b22761 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -5082,7 +5082,8 @@ QDF_STATUS wma_get_updated_scan_config(uint32_t *scan_config,
}
QDF_STATUS wma_get_updated_scan_and_fw_mode_config(uint32_t *scan_config,
- uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini)
+ uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini,
+ uint32_t channel_select_logic_conc)
{
tp_wma_handle wma;
@@ -5121,6 +5122,11 @@ QDF_STATUS wma_get_updated_scan_and_fw_mode_config(uint32_t *scan_config,
default:
break;
}
+
+ WMI_DBS_FW_MODE_CFG_DBS_FOR_STA_PLUS_STA_SET(*fw_mode_config,
+ WMA_CHANNEL_SELECT_LOGIC_STA_STA_GET(channel_select_logic_conc));
+ WMI_DBS_FW_MODE_CFG_DBS_FOR_STA_PLUS_P2P_SET(*fw_mode_config,
+ WMA_CHANNEL_SELECT_LOGIC_STA_P2P_GET(channel_select_logic_conc));
WMA_LOGD("%s: *scan_config:%x ", __func__, *scan_config);
WMA_LOGD("%s: *fw_mode_config:%x ", __func__, *fw_mode_config);