Browse Source

qcacld-3.0: Optimize ndpinactimeout vdev set param

Currently host sends two ndp inactivity timeout
params to firmware one after the other.

Combine these two ndp inactivity timeout vdev
set params and send to WMI to reduce number of
transactions.
Also replace target wmi pdev/vdev params with host wmi
pdev/vdev params to fix existing broken layering
violation.

Change-Id: Icaeca85f2aa074f04d268b819fe86f4b7879c25b
CRs-Fixed: 3333749
Divyajyothi Goparaju 2 years ago
parent
commit
5f85944f38

+ 1 - 1
components/target_if/p2p/src/target_if_p2p.c

@@ -369,7 +369,7 @@ QDF_STATUS target_if_p2p_set_noa(struct wlan_objmgr_psoc *psoc,
 	target_if_debug("psoc:%pK, vdev_id:%d disable_noa:%d",
 	target_if_debug("psoc:%pK, vdev_id:%d disable_noa:%d",
 				psoc, vdev_id, disable_noa);
 				psoc, vdev_id, disable_noa);
 	param.vdev_id = vdev_id;
 	param.vdev_id = vdev_id;
-	param.param_id = WMI_VDEV_PARAM_DISABLE_NOA_P2P_GO;
+	param.param_id = wmi_vdev_param_disable_noa_p2p_go;
 	param.param_value = (uint32_t)disable_noa;
 	param.param_value = (uint32_t)disable_noa;
 
 
 	return wmi_unified_vdev_set_param_send(wmi_handle, &param);
 	return wmi_unified_vdev_set_param_send(wmi_handle, &param);

+ 4 - 4
components/target_if/pkt_capture/src/target_if_pkt_capture.c

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -56,7 +56,7 @@ target_if_set_packet_capture_mode(struct wlan_objmgr_psoc *psoc,
 			psoc, vdev_id, mode);
 			psoc, vdev_id, mode);
 
 
 	param.vdev_id = vdev_id;
 	param.vdev_id = vdev_id;
-	param.param_id = WMI_VDEV_PARAM_PACKET_CAPTURE_MODE;
+	param.param_id = wmi_vdev_param_packet_capture_mode;
 	param.param_value = (uint32_t)mode;
 	param.param_value = (uint32_t)mode;
 
 
 	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
 	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
@@ -104,7 +104,7 @@ target_if_set_packet_capture_config
 			psoc, vdev_id, config_value);
 			psoc, vdev_id, config_value);
 
 
 	param.vdev_id = vdev_id;
 	param.vdev_id = vdev_id;
-	param.param_id = WMI_VDEV_PARAM_SMART_MONITOR_CONFIG;
+	param.param_id = wmi_vdev_param_smart_monitor_config;
 	param.param_value = (uint32_t)config_value;
 	param.param_value = (uint32_t)config_value;
 
 
 	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
 	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
@@ -155,7 +155,7 @@ target_if_set_packet_capture_beacon_interval
 			psoc, vdev_id, nth_value);
 			psoc, vdev_id, nth_value);
 
 
 	param.vdev_id = vdev_id;
 	param.vdev_id = vdev_id;
-	param.param_id = WMI_VDEV_PARAM_NTH_BEACON_TO_HOST;
+	param.param_id = wmi_vdev_param_nth_beacon_to_host;
 	param.param_value = nth_value;
 	param.param_value = nth_value;
 
 
 	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
 	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);

+ 1 - 1
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h

@@ -194,7 +194,7 @@ wlan_cm_tgt_send_roam_vendor_handoff_config(struct wlan_objmgr_psoc *psoc,
 #define CFG_DISABLE_4WAY_HS_OFFLOAD_DEFAULT BIT(0)
 #define CFG_DISABLE_4WAY_HS_OFFLOAD_DEFAULT BIT(0)
 
 
 /**
 /**
- * wlan_cm_tgt_send_roam_offload_init()  - Send WMI_VDEV_PARAM_ROAM_FW_OFFLOAD
+ * wlan_cm_tgt_send_roam_offload_init()  - Send wmi_vdev_param_roam_fw_offload
  * to init/deinit roaming module at firmware
  * to init/deinit roaming module at firmware
  * @psoc: PSOC pointer
  * @psoc: PSOC pointer
  * @vdev_id: vdev id
  * @vdev_id: vdev id

+ 38 - 11
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -623,11 +623,11 @@ int hdd_init_nan_data_mode(struct hdd_adapter *adapter)
 		hdd_err("Failed to get sifs burst value, use default");
 		hdd_err("Failed to get sifs burst value, use default");
 
 
 	ret_val = wma_cli_set_command((int)adapter->vdev_id,
 	ret_val = wma_cli_set_command((int)adapter->vdev_id,
-				      (int)WMI_PDEV_PARAM_BURST_ENABLE,
+				      (int)wmi_pdev_param_burst_enable,
 				      enable_sifs_burst,
 				      enable_sifs_burst,
 				      PDEV_CMD);
 				      PDEV_CMD);
 	if (0 != ret_val)
 	if (0 != ret_val)
-		hdd_err("WMI_PDEV_PARAM_BURST_ENABLE set failed %d", ret_val);
+		hdd_err("wmi_pdev_param_burst_enable set failed %d", ret_val);
 
 
 	/* RTS CTS PARAM  */
 	/* RTS CTS PARAM  */
 	status = ucfg_fwol_get_rts_profile(hdd_ctx->psoc, &rts_profile);
 	status = ucfg_fwol_get_rts_profile(hdd_ctx->psoc, &rts_profile);
@@ -917,6 +917,12 @@ int hdd_ndi_delete(uint8_t vdev_id, const char *iface_name,
 	return ret;
 	return ret;
 }
 }
 
 
+#define MAX_VDEV_NDP_PARAMS 2
+/* params being sent:
+ * wmi_vdev_param_ndp_inactivity_timeout
+ * wmi_vdev_param_ndp_keepalive_timeout
+ */
+
 void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 				struct nan_datapath_inf_create_rsp *ndi_rsp)
 				struct nan_datapath_inf_create_rsp *ndi_rsp)
 {
 {
@@ -928,6 +934,9 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 	uint16_t ndp_keep_alive_period;
 	uint16_t ndp_keep_alive_period;
 	struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BCAST_INIT;
 	struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BCAST_INIT;
 	struct wlan_objmgr_vdev *vdev;
 	struct wlan_objmgr_vdev *vdev;
+	struct dev_set_param setparam[MAX_VDEV_NDP_PARAMS] = {};
+	uint8_t index = 0;
+	QDF_STATUS status;
 
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	if (!hdd_ctx)
 	if (!hdd_ctx)
@@ -969,18 +978,35 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 		if (QDF_IS_STATUS_ERROR(cfg_nan_get_ndp_inactivity_timeout(
 		if (QDF_IS_STATUS_ERROR(cfg_nan_get_ndp_inactivity_timeout(
 		    hdd_ctx->psoc, &ndp_inactivity_timeout)))
 		    hdd_ctx->psoc, &ndp_inactivity_timeout)))
 			hdd_err("Failed to fetch inactivity timeout value");
 			hdd_err("Failed to fetch inactivity timeout value");
-
-		sme_cli_set_command(adapter->vdev_id,
-				    WMI_VDEV_PARAM_NDP_INACTIVITY_TIMEOUT,
-				    ndp_inactivity_timeout, VDEV_CMD);
+		status = mlme_check_index_setparam(
+					setparam,
+					wmi_vdev_param_ndp_inactivity_timeout,
+					ndp_inactivity_timeout, index++,
+					MAX_VDEV_NDP_PARAMS);
+		if (QDF_IS_STATUS_ERROR(status)) {
+			hdd_err("failed at wmi_vdev_param_ndp_inactivity_timeout");
+			goto error;
+		}
 
 
 		if (QDF_IS_STATUS_SUCCESS(cfg_nan_get_ndp_keepalive_period(
 		if (QDF_IS_STATUS_SUCCESS(cfg_nan_get_ndp_keepalive_period(
 						hdd_ctx->psoc,
 						hdd_ctx->psoc,
-						&ndp_keep_alive_period)))
-			sme_cli_set_command(
-				adapter->vdev_id,
-				WMI_VDEV_PARAM_NDP_KEEPALIVE_TIMEOUT,
-				ndp_keep_alive_period, VDEV_CMD);
+						&ndp_keep_alive_period))) {
+			status = mlme_check_index_setparam(
+					setparam,
+					wmi_vdev_param_ndp_keepalive_timeout,
+					ndp_keep_alive_period, index++,
+					MAX_VDEV_NDP_PARAMS);
+			if (QDF_IS_STATUS_ERROR(status)) {
+				hdd_err("failed at wmi_vdev_param_ndp_keepalive_timeout");
+				goto error;
+			}
+		}
+		status = sme_send_multi_pdev_vdev_set_params(MLME_VDEV_SETPARAM,
+							     adapter->vdev_id,
+							     setparam,
+							     index);
+		if (QDF_IS_STATUS_ERROR(status))
+			hdd_err("failed to send vdev set params");
 	} else {
 	} else {
 		hdd_alert("NDI interface creation failed with reason %d",
 		hdd_alert("NDI interface creation failed with reason %d",
 			ndi_rsp->reason /* create_reason */);
 			ndi_rsp->reason /* create_reason */);
@@ -991,6 +1017,7 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 	hdd_roam_register_sta(adapter, &roam_info->bssid,
 	hdd_roam_register_sta(adapter, &roam_info->bssid,
 			      roam_info->fAuthRequired);
 			      roam_info->fAuthRequired);
 
 
+error:
 	qdf_mem_free(roam_info);
 	qdf_mem_free(roam_info);
 }
 }