瀏覽代碼

qcacld-3.0: Allow to vote link for STA mode

On MDM platforms, STA only IPA offload is supported.
Therefore there'll be scenarios when STA is connected
and APPS is suspended, IPA offload traffic will still
flow through WLAN HW.

Thus define a feature flag FEATURE_STA_MODE_VOTE_LINK
and allow to vote link for STA mode on MDM platforms.

Change-Id: I5c7aa3b35e3cd56249a5b34996fcea538b0da69d
CRs-Fixed: 2803802
Jia Ding 4 年之前
父節點
當前提交
e6afd40dd6
共有 3 個文件被更改,包括 28 次插入0 次删除
  1. 2 0
      Kbuild
  2. 1 0
      configs/default_defconfig
  3. 25 0
      core/wma/src/wma_dev_if.c

+ 2 - 0
Kbuild

@@ -3714,6 +3714,8 @@ ifeq ($(CONFIG_FEATURE_IPA_PIPE_CHANGE_WDI1), y)
 cppflags-y += -DFEATURE_IPA_PIPE_CHANGE_WDI1
 endif
 
+cppflags-$(CONFIG_FEATURE_STA_MODE_VOTE_LINK) += -DFEATURE_STA_MODE_VOTE_LINK
+
 KBUILD_CPPFLAGS += $(cppflags-y)
 
 # Currently, for versions of gcc which support it, the kernel Makefile

+ 1 - 0
configs/default_defconfig

@@ -673,6 +673,7 @@ ifneq ($(CONFIG_ARCH_SDXPRAIRIE), y)
 CONFIG_FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE := y
 endif
 CONFIG_FEATURE_AP_MCC_CH_AVOIDANCE := y
+CONFIG_FEATURE_STA_MODE_VOTE_LINK := y
 else
 CONFIG_QCOM_ESE := y
 CONFIG_WLAN_OPEN_P2P_INTERFACE := y

+ 25 - 0
core/wma/src/wma_dev_if.c

@@ -93,6 +93,10 @@
 #include <wlan_dcs_ucfg_api.h>
 #endif
 
+#ifdef FEATURE_STA_MODE_VOTE_LINK
+#include "wlan_ipa_ucfg_api.h"
+#endif
+
 QDF_STATUS wma_find_vdev_id_by_addr(tp_wma_handle wma, uint8_t *addr,
 				    uint8_t *vdev_id)
 {
@@ -4504,6 +4508,21 @@ static void wma_sap_allow_runtime_pm(tp_wma_handle wma)
 	qdf_runtime_pm_allow_suspend(&wma->sap_prevent_runtime_pm_lock);
 }
 
+#ifdef FEATURE_STA_MODE_VOTE_LINK
+static bool wma_add_sta_allow_sta_mode_vote_link(uint8_t oper_mode)
+{
+	if (oper_mode == BSS_OPERATIONAL_MODE_STA && ucfg_ipa_is_enabled())
+		return true;
+
+	return false;
+}
+#else /* !FEATURE_STA_MODE_VOTE_LINK */
+static bool wma_add_sta_allow_sta_mode_vote_link(uint8_t oper_mode)
+{
+	return false;
+}
+#endif /* FEATURE_STA_MODE_VOTE_LINK */
+
 void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 {
 	uint8_t oper_mode = BSS_OPERATIONAL_MODE_STA;
@@ -4542,6 +4561,9 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 		wma_debug("disable runtime pm and vote for link up");
 		htc_vote_link_up(htc_handle);
 		wma_sap_prevent_runtime_pm(wma);
+	} else if (wma_add_sta_allow_sta_mode_vote_link(oper_mode)) {
+		wma_debug("vote for link up");
+		htc_vote_link_up(htc_handle);
 	}
 }
 
@@ -4603,6 +4625,9 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
 		wma_debug("allow runtime pm and vote for link down");
 		htc_vote_link_down(htc_handle);
 		wma_sap_allow_runtime_pm(wma);
+	} else if (wma_add_sta_allow_sta_mode_vote_link(oper_mode)) {
+		wma_debug("vote for link down");
+		htc_vote_link_down(htc_handle);
 	}
 }