qcacld-3.0: Update nan policy to allow SAP+NDP

Allow NDP if there is SAP, and remove duplicate codes.

Change-Id: Ibb59ad8bc9a2eb8638a0f11e78e8f0994422dfb7
CRs-Fixed: 2508265
This commit is contained in:
Wu Gao 2019-08-13 17:33:14 +08:00 • committed by nshrivas
commit 18596aeaea
3 changed files with 33 additions and 8 deletions

1
Kbuild
View file

@ -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

View file

@ -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)

View file

@ -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);
}