qcacld-3.0: Handle SAP+NAN concurrency when NAN_DBS isn't supported
When nan_sap and nan_disable are supported but nan_dbs is not supported, 1. Allow SAP+NAN concurrency if force SCC is supported 2. Disable NAN if SAP comes up on a different band and force SCC is not supported 3. Reject NAN enable if SAP is already on a different band and force SCC is not supported Change-Id: Ic53eedcda2e5b314f9be2a4bd913d5e63f6613a2 CRs-Fixed: 2729986
This commit is contained in:

committed by
nshrivas

parent
63028f5fd7
commit
8e493f081d
@@ -1605,16 +1605,22 @@ policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc,
|
|||||||
|
|
||||||
if (!wlan_nan_get_sap_conc_support(pm_ctx->psoc)) {
|
if (!wlan_nan_get_sap_conc_support(pm_ctx->psoc)) {
|
||||||
policy_mgr_debug("NAN+SAP not supported in fw");
|
policy_mgr_debug("NAN+SAP not supported in fw");
|
||||||
|
/* Reject NAN as SAP is of high priority */
|
||||||
if (mode == PM_NAN_DISC_MODE)
|
if (mode == PM_NAN_DISC_MODE)
|
||||||
return false;
|
return false;
|
||||||
/* Before SAP start disable NAN */
|
/* Before SAP start disable NAN */
|
||||||
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == PM_NAN_DISC_MODE) {
|
if (mode == PM_NAN_DISC_MODE) {
|
||||||
sap_freq = policy_mgr_mode_specific_get_channel(pm_ctx->psoc,
|
sap_freq = policy_mgr_mode_specific_get_channel(pm_ctx->psoc,
|
||||||
PM_SAP_MODE);
|
PM_SAP_MODE);
|
||||||
policy_mgr_debug("FREQ SAP: %d NAN: %d", sap_freq, ch_freq);
|
policy_mgr_debug("FREQ SAP: %d NAN: %d", sap_freq, ch_freq);
|
||||||
if (WLAN_REG_IS_SAME_BAND_FREQS(sap_freq, ch_freq)) {
|
if (ucfg_is_nan_dbs_supported(pm_ctx->psoc) &&
|
||||||
|
!WLAN_REG_IS_SAME_BAND_FREQS(sap_freq, ch_freq))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (sap_freq == ch_freq) {
|
if (sap_freq == ch_freq) {
|
||||||
policy_mgr_debug("NAN+SAP SCC");
|
policy_mgr_debug("NAN+SAP SCC");
|
||||||
return true;
|
return true;
|
||||||
@@ -1629,7 +1635,6 @@ policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc,
|
|||||||
policy_mgr_debug("NAN+SAP unsafe ch SCC disabled");
|
policy_mgr_debug("NAN+SAP unsafe ch SCC disabled");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (mode == PM_SAP_MODE) {
|
} else if (mode == PM_SAP_MODE) {
|
||||||
nan_2g_freq =
|
nan_2g_freq =
|
||||||
policy_mgr_mode_specific_get_channel(pm_ctx->psoc,
|
policy_mgr_mode_specific_get_channel(pm_ctx->psoc,
|
||||||
@@ -1637,7 +1642,15 @@ policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc,
|
|||||||
nan_5g_freq = wlan_nan_get_disc_5g_ch_freq(pm_ctx->psoc);
|
nan_5g_freq = wlan_nan_get_disc_5g_ch_freq(pm_ctx->psoc);
|
||||||
policy_mgr_debug("SAP CH: %d NAN Ch: %d %d", ch_freq,
|
policy_mgr_debug("SAP CH: %d NAN Ch: %d %d", ch_freq,
|
||||||
nan_2g_freq, nan_5g_freq);
|
nan_2g_freq, nan_5g_freq);
|
||||||
if (WLAN_REG_IS_SAME_BAND_FREQS(nan_2g_freq, ch_freq) ||
|
if (ucfg_is_nan_conc_control_supported(pm_ctx->psoc) &&
|
||||||
|
!ucfg_is_nan_dbs_supported(pm_ctx->psoc) &&
|
||||||
|
!WLAN_REG_IS_SAME_BAND_FREQS(nan_2g_freq, ch_freq)) {
|
||||||
|
if (!policy_mgr_is_force_scc(pm_ctx->psoc)) {
|
||||||
|
policy_mgr_debug("NAN and SAP are in different bands but SAP force SCC disabled");
|
||||||
|
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (WLAN_REG_IS_SAME_BAND_FREQS(nan_2g_freq, ch_freq) ||
|
||||||
WLAN_REG_IS_SAME_BAND_FREQS(nan_5g_freq, ch_freq)) {
|
WLAN_REG_IS_SAME_BAND_FREQS(nan_5g_freq, ch_freq)) {
|
||||||
if (ch_freq == nan_2g_freq || ch_freq == nan_5g_freq) {
|
if (ch_freq == nan_2g_freq || ch_freq == nan_5g_freq) {
|
||||||
policy_mgr_debug("NAN+SAP SCC");
|
policy_mgr_debug("NAN+SAP SCC");
|
||||||
@@ -1646,7 +1659,7 @@ policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc,
|
|||||||
if (!policy_mgr_is_force_scc(pm_ctx->psoc)) {
|
if (!policy_mgr_is_force_scc(pm_ctx->psoc)) {
|
||||||
policy_mgr_debug("SAP force SCC disabled");
|
policy_mgr_debug("SAP force SCC disabled");
|
||||||
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
|
if ((WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
|
||||||
!policy_mgr_is_nan_sap_unsafe_ch_scc_allowed(
|
!policy_mgr_is_nan_sap_unsafe_ch_scc_allowed(
|
||||||
@@ -1656,7 +1669,7 @@ policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc,
|
|||||||
pm_ctx, nan_2g_freq))) {
|
pm_ctx, nan_2g_freq))) {
|
||||||
policy_mgr_debug("NAN+SAP unsafe ch SCC disabled");
|
policy_mgr_debug("NAN+SAP unsafe ch SCC disabled");
|
||||||
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
ucfg_nan_disable_concurrency(pm_ctx->psoc);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1146,7 +1146,9 @@ QDF_STATUS nan_discovery_pre_enable(struct wlan_objmgr_psoc *psoc,
|
|||||||
goto pre_enable_failure;
|
goto pre_enable_failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!policy_mgr_nan_sap_pre_enable_conc_check(psoc, PM_NAN_DISC_MODE,
|
if (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE,
|
||||||
|
NULL) &&
|
||||||
|
!policy_mgr_nan_sap_pre_enable_conc_check(psoc, PM_NAN_DISC_MODE,
|
||||||
nan_ch_freq)) {
|
nan_ch_freq)) {
|
||||||
nan_debug("NAN not enabled due to concurrency constraints");
|
nan_debug("NAN not enabled due to concurrency constraints");
|
||||||
status = QDF_STATUS_E_INVAL;
|
status = QDF_STATUS_E_INVAL;
|
||||||
@@ -1386,6 +1388,5 @@ bool wlan_nan_get_sap_conc_support(struct wlan_objmgr_psoc *psoc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (psoc_nan_obj->nan_caps.nan_sap_supported &&
|
return (psoc_nan_obj->nan_caps.nan_sap_supported &&
|
||||||
psoc_nan_obj->nan_caps.nan_dbs_supported &&
|
ucfg_is_nan_conc_control_supported(psoc));
|
||||||
psoc_nan_obj->nan_caps.nan_conc_control);
|
|
||||||
}
|
}
|
||||||
|
@@ -546,5 +546,11 @@ bool ucfg_is_nan_vdev(struct wlan_objmgr_vdev *vdev)
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
bool ucfg_is_nan_dbs_supported(struct wlan_objmgr_psoc *psoc)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif /* WLAN_FEATURE_NAN */
|
#endif /* WLAN_FEATURE_NAN */
|
||||||
#endif /* _NAN_UCFG_API_H_ */
|
#endif /* _NAN_UCFG_API_H_ */
|
||||||
|
@@ -6482,8 +6482,11 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|||||||
|
|
||||||
/* NDI + SAP conditional supported */
|
/* NDI + SAP conditional supported */
|
||||||
hdd_sap_nan_check_and_disable_unsupported_ndi(hdd_ctx->psoc, true);
|
hdd_sap_nan_check_and_disable_unsupported_ndi(hdd_ctx->psoc, true);
|
||||||
if (!policy_mgr_nan_sap_pre_enable_conc_check(
|
|
||||||
hdd_ctx->psoc, PM_SAP_MODE, wlan_chan_to_freq(channel)))
|
if (policy_mgr_mode_specific_connection_count(hdd_ctx->psoc,
|
||||||
|
PM_NAN_DISC_MODE, NULL) &&
|
||||||
|
!policy_mgr_nan_sap_pre_enable_conc_check(hdd_ctx->psoc,
|
||||||
|
PM_SAP_MODE, wlan_chan_to_freq(channel)))
|
||||||
hdd_debug("NAN disabled due to concurrency constraints");
|
hdd_debug("NAN disabled due to concurrency constraints");
|
||||||
|
|
||||||
/* check if concurrency is allowed */
|
/* check if concurrency is allowed */
|
||||||
|
Reference in New Issue
Block a user