瀏覽代碼

qcacld-3.0: Integrate DSC (vdev vendor commands)

As part of DSC integration, use vdev op start/stop for appropriate
vendor commands.

Change-Id: I5d296e7e97158bcc11db04361e0211d1a44b7fcd
CRs-Fixed: 2402142
Dustin Brown 6 年之前
父節點
當前提交
a09acf4e35

+ 11 - 3
core/hdd/src/wlan_hdd_apf.c

@@ -23,6 +23,7 @@
  */
 
 #include "wlan_hdd_apf.h"
+#include "osif_sync.h"
 #include "qca_vendor.h"
 #include "wlan_osif_request_manager.h"
 
@@ -708,12 +709,19 @@ int
 wlan_hdd_cfg80211_apf_offload(struct wiphy *wiphy, struct wireless_dev *wdev,
 			      const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_apf_offload(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_apf_offload(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 

+ 203 - 66
core/hdd/src/wlan_hdd_cfg80211.c

@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/etherdevice.h>
 #include <linux/wireless.h>
+#include "osif_sync.h"
 #include <wlan_hdd_includes.h>
 #include <net/arp.h>
 #include <net/cfg80211.h>
@@ -118,7 +119,6 @@
 #include <wlan_hdd_sar_limits.h>
 #include <wlan_hdd_ota_test.h>
 #include "wlan_policy_mgr_ucfg.h"
-#include "osif_sync.h"
 #include "wlan_mlme_ucfg_api.h"
 #include "wlan_mlme_public_struct.h"
 #include "wlan_extscan_ucfg_api.h"
@@ -2923,13 +2923,20 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 				    struct wireless_dev *wdev,
 				    const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_do_acs(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_do_acs(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -3385,14 +3392,21 @@ wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy,
 				       const void *data,
 				       int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_scanning_mac_oui(wiphy, wdev,
-						       data, data_len);
+	errno = __wlan_hdd_cfg80211_set_scanning_mac_oui(wiphy, wdev,
+							 data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -4132,14 +4146,21 @@ wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
 				const void *data,
 				int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_ext_roam_params(wiphy, wdev,
+	errno = __wlan_hdd_cfg80211_set_ext_roam_params(wiphy, wdev,
 							data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #define PWR_SAVE_FAIL_CMD_INDEX \
@@ -4509,13 +4530,21 @@ static int wlan_hdd_cfg80211_handle_wisa_cmd(struct wiphy *wiphy,
 						   const void *data,
 						   int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_handle_wisa_cmd(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_handle_wisa_cmd(wiphy, wdev,
+						    data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 struct hdd_station_info *hdd_get_stainfo(struct hdd_station_info *astainfo,
@@ -4649,13 +4678,21 @@ static int wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 					     struct wireless_dev *wdev,
 					     const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_keymgmt_set_key(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_keymgmt_set_key(wiphy, wdev,
+						    data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 
@@ -6646,14 +6683,21 @@ static int wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
 						    const void *data,
 						    int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_wifi_configuration_set(wiphy, wdev,
-							 data, data_len);
+	errno = __wlan_hdd_cfg80211_wifi_configuration_set(wiphy, wdev,
+							   data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -7073,14 +7117,21 @@ send_err:
 static int wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
 		struct wireless_dev *wdev, const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_wifi_test_config(wiphy, wdev,
-			data, data_len);
+	errno = __wlan_hdd_cfg80211_set_wifi_test_config(wiphy, wdev,
+							 data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 static const struct
@@ -7732,14 +7783,21 @@ static int wlan_hdd_cfg80211_offloaded_packets(struct wiphy *wiphy,
 						const void *data,
 						int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_offloaded_packets(wiphy,
-					wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_offloaded_packets(wiphy, wdev,
+						      data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 
@@ -7827,13 +7885,20 @@ static int wlan_hdd_cfg80211_set_ns_offload(struct wiphy *wiphy,
 					struct wireless_dev *wdev,
 					const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_ns_offload(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_set_ns_offload(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif /* WLAN_NS_OFFLOAD */
 
@@ -8075,14 +8140,21 @@ static int wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
 						const void *data,
 						int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_probable_oper_channel(wiphy, wdev,
-						data, data_len);
+	errno = __wlan_hdd_cfg80211_set_probable_oper_channel(wiphy, wdev,
+							      data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 static const struct
@@ -8273,14 +8345,21 @@ static int wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
 						 const void *data,
 						 int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_link_properties(wiphy,
-			wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_get_link_properties(wiphy, wdev,
+							data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 static const struct nla_policy
@@ -8560,13 +8639,21 @@ static int wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy,
 		struct wireless_dev *wdev,
 		const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sta_roam_policy(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_sta_roam_policy(wiphy, wdev,
+						    data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #ifdef FEATURE_WLAN_CH_AVOID
@@ -8905,14 +8992,21 @@ static int wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy,
 		struct wireless_dev *wdev,
 		const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sap_configuration_set(wiphy,
-			wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_sap_configuration_set(wiphy, wdev,
+							  data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #ifndef QCA_SUPPORT_CP_STATS
@@ -9685,14 +9779,21 @@ static int wlan_hdd_cfg80211_update_vendor_channel(struct wiphy *wiphy,
 						struct wireless_dev *wdev,
 						const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_update_vendor_channel(wiphy, wdev, data,
-								data_len);
+	errno = __wlan_hdd_cfg80211_update_vendor_channel(wiphy, wdev,
+							  data, data_len);
 	cds_ssr_protect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -9708,13 +9809,20 @@ static int wlan_hdd_cfg80211_setband(struct wiphy *wiphy,
 				    struct wireless_dev *wdev,
 				    const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_setband(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_setband(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -10239,13 +10347,21 @@ static int wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
 					  struct wireless_dev *wdev,
 					  const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_fast_roaming(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_set_fast_roaming(wiphy, wdev,
+						     data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /*
@@ -10830,13 +10946,20 @@ static int wlan_hdd_cfg80211_set_nud_stats(struct wiphy *wiphy,
 					   struct wireless_dev *wdev,
 					   const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_nud_stats(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_set_nud_stats(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #undef STATS_SET_INVALID
@@ -11354,13 +11477,20 @@ static int wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy,
 					   struct wireless_dev *wdev,
 					   const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_nud_stats(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_get_nud_stats(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #undef QCA_ATTR_NUD_STATS_SET_INVALID
@@ -11590,13 +11720,20 @@ static int wlan_hdd_cfg80211_get_chain_rssi(struct wiphy *wiphy,
 					    const void *data,
 					    int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_chain_rssi(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_get_chain_rssi(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 12 - 4
core/hdd/src/wlan_hdd_disa.c

@@ -24,6 +24,7 @@
  */
 
 #include "wlan_hdd_disa.h"
+#include "osif_sync.h"
 #include "wlan_disa_ucfg_api.h"
 #include "wlan_osif_request_manager.h"
 #include "sme_api.h"
@@ -470,12 +471,19 @@ int wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy,
 						const void *data,
 						int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_encrypt_decrypt_msg(wiphy, wdev,
-						data, data_len);
+	errno = __wlan_hdd_cfg80211_encrypt_decrypt_msg(wiphy, wdev,
+							data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }

+ 122 - 43
core/hdd/src/wlan_hdd_ext_scan.c

@@ -25,9 +25,9 @@
 
 #ifdef FEATURE_WLAN_EXTSCAN
 
+#include "osif_sync.h"
 #include "wlan_hdd_ext_scan.h"
 #include "wlan_hdd_regulatory.h"
-#include "osif_sync.h"
 #include "cds_utils.h"
 #include "cds_sched.h"
 #include <qca_vendor.h>
@@ -1699,14 +1699,21 @@ int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy,
 						struct wireless_dev *wdev,
 						const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_get_capabilities(wiphy, wdev, data,
-		data_len);
+	errno = __wlan_hdd_cfg80211_extscan_get_capabilities(wiphy, wdev,
+							     data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1837,14 +1844,21 @@ int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy,
 					struct wireless_dev *wdev,
 					const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_get_cached_results(wiphy, wdev, data,
-								data_len);
+	errno = __wlan_hdd_cfg80211_extscan_get_cached_results(wiphy, wdev,
+							       data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -2074,14 +2088,21 @@ int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy,
 					struct wireless_dev *wdev,
 					const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(wiphy, wdev, data,
-					data_len);
+	errno = __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(wiphy, wdev,
+							      data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 
@@ -2267,14 +2288,22 @@ int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy,
 				struct wireless_dev *wdev,
 				const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_set_significant_change(wiphy, wdev,
-					data, data_len);
+	errno = __wlan_hdd_cfg80211_extscan_set_significant_change(wiphy, wdev,
+								   data,
+								   data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -3219,13 +3248,20 @@ int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
 				    struct wireless_dev *wdev,
 				    const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_start(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_extscan_start(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 
@@ -3330,13 +3366,20 @@ int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy,
 				   struct wireless_dev *wdev,
 				   const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_stop(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_extscan_stop(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 
@@ -3444,14 +3487,21 @@ int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
 						  const void *data,
 						  int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(wiphy, wdev,
-							      data, data_len);
+	errno = __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(wiphy, wdev,
+								data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -3559,14 +3609,23 @@ int wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy *wiphy,
 						struct wireless_dev *wdev,
 						const void *data, int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_reset_significant_change(wiphy, wdev,
-						data, data_len);
+	errno = __wlan_hdd_cfg80211_extscan_reset_significant_change(wiphy,
+								     wdev,
+								     data,
+								     data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 
@@ -3885,14 +3944,20 @@ int wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
 				    const void *data,
 				    int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_epno_list(wiphy, wdev,
-						data, data_len);
+	errno = __wlan_hdd_cfg80211_set_epno_list(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -4135,14 +4200,21 @@ int wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
 					 const void *data,
 					 int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_passpoint_list(wiphy, wdev,
-						     data, data_len);
+	errno = __wlan_hdd_cfg80211_set_passpoint_list(wiphy, wdev,
+						       data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -4235,14 +4307,21 @@ int wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
 					   const void *data,
 					   int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_reset_passpoint_list(wiphy, wdev,
-						       data, data_len);
+	errno = __wlan_hdd_cfg80211_reset_passpoint_list(wiphy, wdev,
+							 data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 86 - 30
core/hdd/src/wlan_hdd_ocb.c

@@ -24,6 +24,7 @@
 
 #include "cds_sched.h"
 #include "wlan_hdd_assoc.h"
+#include "osif_sync.h"
 #include "wlan_hdd_main.h"
 #include "wlan_hdd_ocb.h"
 #include "wlan_hdd_trace.h"
@@ -938,13 +939,20 @@ int wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
 				     const void *data,
 				     int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_set_config(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_ocb_set_config(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1052,13 +1060,21 @@ int wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
 				       const void *data,
 				       int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_set_utc_time(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_ocb_set_utc_time(wiphy, wdev,
+						     data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1168,14 +1184,21 @@ int wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
 					      const void *data,
 					      int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_start_timing_advert(wiphy, wdev,
-							  data, data_len);
+	errno = __wlan_hdd_cfg80211_ocb_start_timing_advert(wiphy, wdev,
+							    data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1265,14 +1288,21 @@ int wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
 					     const void *data,
 					     int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_stop_timing_advert(wiphy, wdev,
-							 data, data_len);
+	errno = __wlan_hdd_cfg80211_ocb_stop_timing_advert(wiphy, wdev,
+							   data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 struct hdd_ocb_get_tsf_timer_priv {
@@ -1459,14 +1489,21 @@ int wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_get_tsf_timer(wiphy, wdev,
-						    data, data_len);
+	errno = __wlan_hdd_cfg80211_ocb_get_tsf_timer(wiphy, wdev,
+						      data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 struct hdd_dcc_stats_priv {
@@ -1711,14 +1748,20 @@ int wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
 				    const void *data,
 				    int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dcc_get_stats(wiphy, wdev,
-						data, data_len);
+	errno = __wlan_hdd_cfg80211_dcc_get_stats(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1795,14 +1838,21 @@ int wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy,
 				      const void *data,
 				      int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dcc_clear_stats(wiphy, wdev,
-						  data, data_len);
+	errno = __wlan_hdd_cfg80211_dcc_clear_stats(wiphy, wdev,
+						    data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 struct hdd_dcc_update_ndl_priv {
@@ -1978,14 +2028,20 @@ int wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
 				     const void *data,
 				     int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dcc_update_ndl(wiphy, wdev,
-						 data, data_len);
+	errno = __wlan_hdd_cfg80211_dcc_update_ndl(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 16 - 11
core/hdd/src/wlan_hdd_scan.c

@@ -31,10 +31,10 @@
 #include "ani_global.h"
 #include "dot11f.h"
 #include "cds_sched.h"
+#include "osif_sync.h"
 #include "wlan_hdd_p2p.h"
 #include "wlan_hdd_trace.h"
 #include "wlan_hdd_scan.h"
-#include "osif_sync.h"
 #include "wlan_policy_mgr_api.h"
 #include "wlan_hdd_power.h"
 #include "wma_api.h"
@@ -1157,14 +1157,20 @@ int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
 		struct wireless_dev *wdev, const void *data,
 		int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_vendor_scan(wiphy, wdev,
-					      data, data_len);
+	errno = __wlan_hdd_cfg80211_vendor_scan(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1212,14 +1218,13 @@ static int __wlan_hdd_vendor_abort_scan(
  *
  * Return: zero for success and non zero for failure
  */
-int wlan_hdd_vendor_abort_scan(
-	struct wiphy *wiphy, struct wireless_dev *wdev,
-	const void *data, int data_len)
+int wlan_hdd_vendor_abort_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
+			       const void *data, int data_len)
 {
-	struct osif_psoc_sync *psoc_sync;
+	struct osif_vdev_sync *vdev_sync;
 	int errno;
 
-	errno = osif_psoc_sync_op_start(wiphy_dev(wiphy), &psoc_sync);
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
 	if (errno)
 		return errno;
 
@@ -1227,7 +1232,7 @@ int wlan_hdd_vendor_abort_scan(
 	errno = __wlan_hdd_vendor_abort_scan(wiphy, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	osif_psoc_sync_op_stop(psoc_sync);
+	osif_vdev_sync_op_stop(vdev_sync);
 
 	return errno;
 }

+ 43 - 14
core/hdd/src/wlan_hdd_stats.c

@@ -26,6 +26,7 @@
 #include "wlan_hdd_stats.h"
 #include "sme_api.h"
 #include "cds_sched.h"
+#include "osif_sync.h"
 #include "wlan_hdd_trace.h"
 #include "wlan_hdd_lpass.h"
 #include "hif.h"
@@ -1333,13 +1334,20 @@ int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ll_stats_set(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_ll_stats_set(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 const struct
@@ -1703,13 +1711,20 @@ int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ll_stats_clear(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_ll_stats_clear(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -2849,14 +2864,21 @@ int wlan_hdd_cfg80211_ll_stats_ext_set_param(struct wiphy *wiphy,
 					     const void *data,
 					     int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ll_stats_ext_set_param(wiphy, wdev,
-							 data, data_len);
+	errno = __wlan_hdd_cfg80211_ll_stats_ext_set_param(wiphy, wdev,
+							   data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif /* WLAN_FEATURE_LINK_LAYER_STATS */
 
@@ -2918,14 +2940,21 @@ int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_stats_ext_request(wiphy, wdev,
-						    data, data_len);
+	errno = __wlan_hdd_cfg80211_stats_ext_request(wiphy, wdev,
+						      data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 void wlan_hdd_cfg80211_stats_ext_callback(hdd_handle_t hdd_handle,

+ 13 - 4
core/hdd/src/wlan_hdd_subnet_detect.c

@@ -28,6 +28,7 @@
 #include <net/cfg80211.h>
 #include <ani_global.h>
 #include "sme_api.h"
+#include "osif_sync.h"
 #include "wlan_hdd_main.h"
 #include "wlan_hdd_subnet_detect.h"
 #include <qca_vendor.h>
@@ -183,14 +184,22 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
 int wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
 		struct wireless_dev *wdev, const void *data, int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
 
-	ret = __wlan_hdd_cfg80211_set_gateway_params(
-				wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_set_gateway_params(wiphy, wdev,
+						       data, data_len);
 	cds_ssr_unprotect(__func__);
-	return ret;
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #undef PARAM_MAC_ADDR
 #undef PARAM_IPV4_ADDR

+ 43 - 13
core/hdd/src/wlan_hdd_tdls.c

@@ -24,6 +24,7 @@
 
 #include <wlan_hdd_includes.h>
 #include <ani_global.h>
+#include "osif_sync.h"
 #include <wlan_hdd_hostapd.h>
 #include <wlan_hdd_trace.h>
 #include <net/cfg80211.h>
@@ -270,14 +271,21 @@ int wlan_hdd_cfg80211_configure_tdls_mode(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_configure_tdls_mode(wiphy, wdev, data,
+	errno = __wlan_hdd_cfg80211_configure_tdls_mode(wiphy, wdev, data,
 							data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -294,14 +302,21 @@ int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_exttdls_get_status(wiphy, wdev, data,
-							data_len);
+	errno = __wlan_hdd_cfg80211_exttdls_get_status(wiphy, wdev,
+						       data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -341,13 +356,20 @@ int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_exttdls_enable(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_exttdls_enable(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -385,13 +407,21 @@ int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_exttdls_disable(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_exttdls_disable(wiphy, wdev,
+						    data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #if TDLS_MGMT_VERSION2

+ 12 - 3
core/hdd/src/wlan_hdd_tsf.c

@@ -20,6 +20,7 @@
  * wlan_hdd_tsf.c - WLAN Host Device Driver tsf related implementation
  */
 
+#include "osif_sync.h"
 #include "wlan_hdd_main.h"
 #include "wlan_hdd_tsf.h"
 #include "wma_api.h"
@@ -27,6 +28,7 @@
 #include <qca_vendor.h>
 #include <linux/errqueue.h>
 #include "ol_txrx_api.h"
+
 static struct completion tsf_sync_get_completion_evt;
 #define WLAN_TSF_SYNC_GET_TIMEOUT 2000
 #define WLAN_HDD_CAPTURE_TSF_REQ_TIMEOUT_MS 500
@@ -1646,13 +1648,20 @@ int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy,
 					const void *data,
 					int data_len)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_handle_tsf_cmd(wiphy, wdev, data, data_len);
+	errno = __wlan_hdd_cfg80211_handle_tsf_cmd(wiphy, wdev, data, data_len);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**