diff --git a/Kbuild b/Kbuild index d9bcd08796da..03b4ac2f5b8f 100644 --- a/Kbuild +++ b/Kbuild @@ -2271,6 +2271,7 @@ cppflags-$(CONFIG_WLAN_LOG_EXIT) += -DWLAN_LOG_EXIT cppflags-$(WLAN_OPEN_SOURCE) += -DWLAN_OPEN_SOURCE cppflags-$(CONFIG_FEATURE_STATS_EXT) += -DWLAN_FEATURE_STATS_EXT cppflags-$(CONFIG_QCACLD_FEATURE_NAN) += -DWLAN_FEATURE_NAN +cppflags-$(CONFIG_NDP_SAP_CONCURRENCY_ENABLE) += -DNDP_SAP_CONCURRENCY_ENABLE cppflags-$(CONFIG_QCA_IBSS_SUPPORT) += -DQCA_IBSS_SUPPORT cppflags-$(CONFIG_WLAN_SYSFS) += -DWLAN_SYSFS cppflags-$(CONFIG_FEATURE_WLAN_RMC) += -DFEATURE_WLAN_RMC diff --git a/configs/qca6390_defconfig b/configs/qca6390_defconfig index 5fe7ac5fe532..808e920be959 100644 --- a/configs/qca6390_defconfig +++ b/configs/qca6390_defconfig @@ -178,6 +178,7 @@ endif ifneq ($(CONFIG_MOBILE_ROUTER), y) #Flag to enable NAN CONFIG_QCACLD_FEATURE_NAN := y + CONFIG_NDP_SAP_CONCURRENCY_ENABLE := y endif ifneq ($(CONFIG_MOBILE_ROUTER), y) diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index bed712318154..3878a6b00a1b 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -119,6 +119,34 @@ static int hdd_close_ndi(struct hdd_adapter *adapter) * * Return: true if allowed, false otherwise */ +#ifdef NDP_SAP_CONCURRENCY_ENABLE +static bool hdd_is_ndp_allowed(struct hdd_context *hdd_ctx) +{ + struct hdd_adapter *adapter; + struct hdd_station_ctx *sta_ctx; + + hdd_for_each_adapter(hdd_ctx, adapter) { + switch (adapter->device_mode) { + case QDF_P2P_GO_MODE: + if (test_bit(SOFTAP_BSS_STARTED, + &adapter->event_flags)) + return false; + break; + case QDF_P2P_CLIENT_MODE: + case QDF_IBSS_MODE: + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + if (hdd_conn_is_connected(sta_ctx) || + hdd_is_connecting(sta_ctx)) + return false; + break; + default: + break; + } + } + + return true; +} +#else static bool hdd_is_ndp_allowed(struct hdd_context *hdd_ctx) { struct hdd_adapter *adapter; @@ -129,14 +157,14 @@ static bool hdd_is_ndp_allowed(struct hdd_context *hdd_ctx) case QDF_P2P_GO_MODE: case QDF_SAP_MODE: if (test_bit(SOFTAP_BSS_STARTED, - &adapter->event_flags)) + &adapter->event_flags)) return false; break; case QDF_P2P_CLIENT_MODE: case QDF_IBSS_MODE: sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); if (hdd_conn_is_connected(sta_ctx) || - hdd_is_connecting(sta_ctx)) + hdd_is_connecting(sta_ctx)) return false; break; default: @@ -146,6 +174,7 @@ static bool hdd_is_ndp_allowed(struct hdd_context *hdd_ctx) return true; } +#endif /* NDP_SAP_CONCURRENCY_ENABLE */ /** * hdd_ndi_start_bss() - Start BSS on NAN data interface @@ -388,12 +417,6 @@ static int __wlan_hdd_cfg80211_process_ndp_cmd(struct wiphy *wiphy, return -EPERM; } - /* NAN data path coexists only with STA interface */ - if (false == hdd_is_ndp_allowed(hdd_ctx)) { - hdd_err_rl("Unsupported concurrency for NAN datapath"); - return -EPERM; - } - return os_if_nan_process_ndp_cmd(hdd_ctx->psoc, data, data_len); }