Browse Source

qcacld-3.0: Add support for WMI over QMI

Add support for WMI over QMI to reduce power consumption for
periodic stats report.

Change-Id: Iec725b357d9bcfa33029aedf7c568814499bc130
CRs-fixed: 2521826
Manikandan Mohan 5 years ago
parent
commit
1baadae237
4 changed files with 34 additions and 6 deletions
  1. 1 0
      Kbuild
  2. 3 0
      configs/default_defconfig
  3. 19 0
      core/cds/src/cds_api.c
  4. 11 6
      core/hdd/src/wlan_hdd_stats.c

+ 1 - 0
Kbuild

@@ -2928,6 +2928,7 @@ ccflags-$(CONFIG_HASTINGS_BT_WAR) += -DHASTINGS_BT_WAR
 cppflags-$(CONFIG_SLUB_DEBUG_ON) += -DHIF_CONFIG_SLUB_DEBUG_ON
 
 ccflags-$(CONFIG_FOURTH_CONNECTION) += -DFEATURE_FOURTH_CONNECTION
+ccflags-$(CONFIG_WMI_SEND_RECV_QMI) += -DWLAN_FEATURE_WMI_SEND_RECV_QMI
 
 KBUILD_CPPFLAGS += $(cppflags-y)
 

+ 3 - 0
configs/default_defconfig

@@ -848,7 +848,10 @@ ifeq ($(CONFIG_LITHIUM), y)
 		CONFIG_WLAN_FEATURE_DP_EVENT_HISTORY := y
 	endif
 	CONFIG_WLAN_DP_PER_RING_TYPE_CONFIG := y
+	#Enable WMI TX/RX over QMI
+	CONFIG_WMI_SEND_RECV_QMI := y
 endif
+
 #Flag to enable hdd memory dump feature
 CONFIG_FEATURE_MEMDUMP_ENABLE := y
 

+ 19 - 0
core/cds/src/cds_api.c

@@ -193,6 +193,23 @@ static bool cds_is_drv_connected(void)
 	return ((ret > 0) ? true : false);
 }
 
+static QDF_STATUS cds_wmi_send_recv_qmi(void *buf, uint32_t len, void * cb_ctx,
+					qdf_wmi_recv_qmi_cb wmi_rx_cb)
+{
+	qdf_device_t qdf_ctx;
+
+	qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
+	if (!qdf_ctx) {
+		cds_err("cds context is invalid");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	if (pld_qmi_send(qdf_ctx->dev, 0, buf, len, cb_ctx, wmi_rx_cb))
+		return QDF_STATUS_E_INVAL;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS cds_init(void)
 {
 	QDF_STATUS status;
@@ -213,6 +230,7 @@ QDF_STATUS cds_init(void)
 	qdf_register_fw_down_callback(cds_is_fw_down);
 	qdf_register_recovering_state_query_callback(cds_is_driver_recovering);
 	qdf_register_drv_connected_callback(cds_is_drv_connected);
+	qdf_register_wmi_send_recv_qmi_callback(cds_wmi_send_recv_qmi);
 
 	return QDF_STATUS_SUCCESS;
 
@@ -237,6 +255,7 @@ void cds_deinit(void)
 	qdf_register_recovering_state_query_callback(NULL);
 	qdf_register_fw_down_callback(NULL);
 	qdf_register_self_recovery_callback(NULL);
+	qdf_register_wmi_send_recv_qmi_callback(NULL);
 
 	gp_cds_context->qdf_ctx = NULL;
 	qdf_mem_zero(&g_qdf_ctx, sizeof(g_qdf_ctx));

+ 11 - 6
core/hdd/src/wlan_hdd_stats.c

@@ -1550,13 +1550,21 @@ int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy,
 {
 	struct osif_vdev_sync *vdev_sync;
 	int errno;
+	qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 
 	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
 	if (errno)
 		return errno;
 
+	errno = pld_qmi_send_get(qdf_ctx->dev);
+	if (errno)
+		goto end;
+
 	errno = __wlan_hdd_cfg80211_ll_stats_get(wiphy, wdev, data, data_len);
 
+	pld_qmi_send_put(qdf_ctx->dev);
+
+end:
 	osif_vdev_sync_op_stop(vdev_sync);
 
 	return errno;
@@ -4673,23 +4681,20 @@ static int _wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 					  struct station_info *sinfo)
 {
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
-	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	qdf_device_t qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 	int errno;
 
 	errno = wlan_hdd_validate_context(hdd_ctx);
 	if (errno)
 		return errno;
 
-	errno = hif_pm_runtime_get_sync(hif_ctx);
+	errno = pld_qmi_send_get(qdf_ctx->dev);
 	if (errno)
 		return errno;
 
 	errno = __wlan_hdd_cfg80211_get_station(wiphy, dev, mac, sinfo);
 
-	if (wlan_hdd_rx_rpm_mark_last_busy(hdd_ctx, hif_ctx))
-		hif_pm_runtime_put(hif_ctx);
-	else
-		hif_pm_runtime_put_sync_suspend(hif_ctx);
+	pld_qmi_send_put(qdf_ctx->dev);
 
 	return errno;
 }