Эх сурвалжийг харах

qcacld-3.0: Add API to set/reset CPU frequency

Add API to set/reset CPU frequency, which is used to
enable the tx queues faster during roam.

Change-Id: I8594dacc9b3e8bc3fcdce575102cecef573cbf06
CRs-Fixed: 3487568
Krupali Dhanvijay 1 жил өмнө
parent
commit
d8a6ea4e49

+ 2 - 0
Kbuild

@@ -4107,6 +4107,8 @@ ccflags-$(CONFIG_WLAN_FEATURE_PKT_CAPTURE_V2) += -DWLAN_FEATURE_PKT_CAPTURE_V2
 
 ccflags-$(CONFIG_DP_RX_UDP_OVER_PEER_ROAM) += -DDP_RX_UDP_OVER_PEER_ROAM
 
+cppflags-$(CONFIG_WLAN_BOOST_CPU_FREQ_IN_ROAM) += -DWLAN_BOOST_CPU_FREQ_IN_ROAM
+
 ccflags-$(CONFIG_QCA_WIFI_EMULATION) += -DQCA_WIFI_EMULATION
 ccflags-$(CONFIG_SHADOW_V2) += -DCONFIG_SHADOW_V2
 ccflags-$(CONFIG_SHADOW_V3) += -DCONFIG_SHADOW_V3

+ 1 - 0
configs/default_defconfig

@@ -1533,6 +1533,7 @@ ifneq (, $(filter y, $(CONFIG_ARCH_LAHAINA) $(CONFIG_ARCH_PARROT)))
 CONFIG_WLAN_FEATURE_PKT_CAPTURE := y
 CONFIG_WLAN_FEATURE_PKT_CAPTURE_V2 := y
 CONFIG_DP_RX_UDP_OVER_PEER_ROAM := y
+CONFIG_WLAN_BOOST_CPU_FREQ_IN_ROAM := y
 endif
 endif
 

+ 3 - 0
core/hdd/src/wlan_hdd_assoc.c

@@ -2705,6 +2705,9 @@ struct osif_cm_ops osif_ops = {
 #endif
 	.send_vdev_keys_cb = hdd_cm_send_vdev_keys,
 	.get_scan_ie_params_cb = hdd_cm_get_scan_ie_params,
+#ifdef WLAN_BOOST_CPU_FREQ_IN_ROAM
+	.perfd_set_cpufreq_cb = hdd_cm_perfd_set_cpufreq,
+#endif
 };
 
 QDF_STATUS hdd_cm_register_cb(void)

+ 20 - 0
core/hdd/src/wlan_hdd_cm_api.h

@@ -136,6 +136,26 @@ QDF_STATUS hdd_cm_get_handoff_param(struct wlan_objmgr_psoc *psoc,
  */
 QDF_STATUS hdd_cm_napi_serialize_control(bool action);
 
+#ifdef WLAN_BOOST_CPU_FREQ_IN_ROAM
+/**
+ * hdd_cm_perfd_set_cpufreq() - API to set CPU min freq
+ * @action: set or reset the CPU freq
+ *
+ * This function sets/resets the CPU min frequency
+ * by sending netlink msg to cnss-daemon, which will
+ * communicate to perf daemon to set/reset CPU freq.
+ *
+ * Return: qdf status
+ */
+QDF_STATUS hdd_cm_perfd_set_cpufreq(bool action);
+#else
+static inline
+QDF_STATUS hdd_cm_perfd_set_cpufreq(bool action)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 #ifdef WLAN_FEATURE_FILS_SK
 /**
  * hdd_cm_save_gtk() - save gtk api

+ 33 - 0
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -663,3 +663,36 @@ QDF_STATUS hdd_cm_napi_serialize_control(bool action)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+#ifdef WLAN_BOOST_CPU_FREQ_IN_ROAM
+QDF_STATUS hdd_cm_perfd_set_cpufreq(bool action)
+{
+	struct wlan_core_minfreq req;
+	struct hdd_context *hdd_ctx;
+
+	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+	if (unlikely(!hdd_ctx)) {
+		hdd_err("cannot get hdd_context");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	if (action) {
+		req.magic    = WLAN_CORE_MINFREQ_MAGIC;
+		req.reserved = 0; /* unused */
+		req.coremask = 0x00ff;/* big and little cluster */
+		req.freq     = 0xfff;/* set to max freq */
+	} else {
+		req.magic    = WLAN_CORE_MINFREQ_MAGIC;
+		req.reserved = 0; /* unused */
+		req.coremask = 0; /* not valid */
+		req.freq     = 0; /* reset */
+	}
+
+	hdd_debug("CPU min freq to 0x%x coremask 0x%x", req.freq, req.coremask);
+	/* the following service function returns void */
+	wlan_hdd_send_svc_nlink_msg(hdd_ctx->radio_index,
+				    WLAN_SVC_CORE_MINFREQ,
+				    &req, sizeof(struct wlan_core_minfreq));
+	return QDF_STATUS_SUCCESS;
+}
+#endif