diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index cf67ee2f81d3..72bc8e6dd42d 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -69,6 +69,8 @@ struct hdd_context; #define MAX_PRB_REQ_VENDOR_OUI_INI_LEN 160 #define VENDOR_SPECIFIC_IE_BITMAP 0x20000000 +#define CFG_CONCURRENT_IFACE_MAX_LEN 16 + /* Defines for all of the things we read from the configuration (registry). */ /* * @@ -5570,6 +5572,24 @@ enum hdd_link_speed_rpt_type { #define CFG_ENABLE_FW_MODULE_LOG_LEVEL "gFwDebugModuleLoglevel" #define CFG_ENABLE_FW_MODULE_LOG_DEFAULT "2,1,3,1,5,1,9,1,13,1,14,1,18,1,19,1,26,1,28,1,29,1,31,1,36,1,38,1,46,1,47,1,50,1,52,1,53,1,56,1,60,1,61,1,4,1" +/* + * + * gEnableConcurrentSTA - This will control the creation of concurrent STA + * interface + * @Default: NULL + * + * This ini is used for providing control to create a concurrent STA session + * along with the creation of wlan0 and p2p0. The name of the interface is + * specified as the parameter + * + * Usage: Internal/External + * + * + */ + +#define CFG_ENABLE_CONCURRENT_STA "gEnableConcurrentSTA" +#define CFG_ENABLE_CONCURRENT_STA_DEFAULT "" + /* * * gEnableRTSProfiles - It will use configuring different RTS profiles @@ -13710,6 +13730,8 @@ struct hdd_config { uint32_t DelayedTriggerFrmInt; + char enableConcurrentSTA[CFG_CONCURRENT_IFACE_MAX_LEN]; + /* Wowl pattern */ char wowlPattern[1024]; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b6838767bae6..7779027a9166 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3272,6 +3272,11 @@ struct reg_table_entry g_registry_table[] = { VAR_FLAGS_OPTIONAL, (void *)CFG_ENABLE_FW_MODULE_LOG_DEFAULT), + REG_VARIABLE_STRING(CFG_ENABLE_CONCURRENT_STA, WLAN_PARAM_String, + struct hdd_config, enableConcurrentSTA, + VAR_FLAGS_NONE, + (void *)CFG_ENABLE_CONCURRENT_STA_DEFAULT), + #ifdef WLAN_FEATURE_11W REG_VARIABLE(CFG_PMF_SA_QUERY_MAX_RETRIES_NAME, WLAN_PARAM_Integer, struct hdd_config, pmfSaQueryMaxRetries, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 710b94fa8d61..fa44b76f8497 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8103,6 +8103,22 @@ int hdd_start_ftm_adapter(struct hdd_adapter *adapter) EXIT(); } +static int hdd_open_concurrent_interface(struct hdd_context *hdd_ctx, + bool rtnl_held) +{ + struct hdd_adapter *adapter; + + adapter = hdd_open_adapter(hdd_ctx, QDF_STA_MODE, + hdd_ctx->config->enableConcurrentSTA, + wlan_hdd_get_intf_addr(hdd_ctx), + NET_NAME_UNKNOWN, rtnl_held); + + if (!adapter) + return -ENOSPC; + + return 0; +} + /** * hdd_open_interfaces - Open all required interfaces * hdd_ctx: HDD context @@ -8143,6 +8159,12 @@ static int hdd_open_interfaces(struct hdd_context *hdd_ctx, bool rtnl_held) /* fast roaming is allowed only on first STA, i.e. wlan adapter */ adapter->fast_roaming_allowed = true; + if (strlen(hdd_ctx->config->enableConcurrentSTA) != 0) { + ret = hdd_open_concurrent_interface(hdd_ctx, rtnl_held); + if (ret) + hdd_err("Cannot create concurrent STA interface"); + } + ret = hdd_open_p2p_interface(hdd_ctx, rtnl_held); if (ret) goto err_close_adapters;