Kaynağa Gözat

qcacld-3.0: Integrate DSC (vdev cfg80211 ops)

As part of DSC integration, use vdev op start/stop for appropriate
cfg80211 operation callback handlers.

Change-Id: Id2a13469267547b878e234cb3c0b16e74abe00d5
CRs-Fixed: 2402143
Dustin Brown 6 yıl önce
ebeveyn
işleme
1d31b08769

+ 289 - 113
core/hdd/src/wlan_hdd_cfg80211.c

@@ -13630,13 +13630,20 @@ static int wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
 					struct net_device *dev,
 					struct bss_parameters *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_change_bss(wiphy, dev, params);
+	errno = __wlan_hdd_cfg80211_change_bss(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -14094,13 +14101,20 @@ static int wlan_hdd_change_station(struct wiphy *wiphy,
 				   struct station_parameters *params)
 #endif
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_change_station(wiphy, dev, mac, params);
+	errno = __wlan_hdd_change_station(wiphy, dev, mac, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #ifdef CRYPTO_SET_KEY_CONVERGED
@@ -14661,14 +14675,21 @@ static int wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
 				     const u8 *mac_addr,
 				     struct key_params *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(ndev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_add_key(wiphy, ndev, key_index, pairwise,
-					  mac_addr, params);
+	errno = __wlan_hdd_cfg80211_add_key(wiphy, ndev, key_index, pairwise,
+					    mac_addr, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /*
@@ -14778,14 +14799,21 @@ static int wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
 						      struct key_params *)
 				     )
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(ndev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_key(wiphy, ndev, key_index, pairwise,
-					  mac_addr, cookie, callback);
+	errno = __wlan_hdd_cfg80211_get_key(wiphy, ndev, key_index, pairwise,
+					    mac_addr, cookie, callback);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -14836,14 +14864,21 @@ static int wlan_hdd_cfg80211_del_key(struct wiphy *wiphy,
 					u8 key_index,
 					bool pairwise, const u8 *mac_addr)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_del_key(wiphy, dev, key_index,
-					  pairwise, mac_addr);
+	errno = __wlan_hdd_cfg80211_del_key(wiphy, dev, key_index,
+					    pairwise, mac_addr);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #ifndef CRYPTO_SET_KEY_CONVERGED
@@ -15090,15 +15125,21 @@ static int wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
 					     u8 key_index,
 					     bool unicast, bool multicast)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(ndev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret =
-		__wlan_hdd_cfg80211_set_default_key(wiphy, ndev, key_index, unicast,
-						    multicast);
+	errno = __wlan_hdd_cfg80211_set_default_key(wiphy, ndev, key_index,
+						    unicast, multicast);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /*
@@ -17925,13 +17966,20 @@ static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
 				     struct net_device *ndev,
 				     struct cfg80211_connect_params *req)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(ndev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_connect(wiphy, ndev, req);
+	errno = __wlan_hdd_cfg80211_connect(wiphy, ndev, req);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 int wlan_hdd_disconnect(struct hdd_adapter *adapter, u16 reason)
@@ -18270,13 +18318,20 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
 static int wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
 					struct net_device *dev, u16 reason)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_disconnect(wiphy, dev, reason);
+	errno = __wlan_hdd_cfg80211_disconnect(wiphy, dev, reason);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -18577,13 +18632,20 @@ static int wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       struct cfg80211_ibss_params *params)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_join_ibss(wiphy, dev, params);
+	errno = __wlan_hdd_cfg80211_join_ibss(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -18690,13 +18752,20 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
 static int wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
 					struct net_device *dev)
 {
-	int ret = 0;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_leave_ibss(wiphy, dev);
+	errno = __wlan_hdd_cfg80211_leave_ibss(wiphy, dev);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -18834,13 +18903,20 @@ static int wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy,
 					   struct net_device *netdev,
 					   u8 key_index)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_set_default_mgmt_key(wiphy, netdev, key_index);
+	errno = __wlan_hdd_set_default_mgmt_key(wiphy, netdev, key_index);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -18871,13 +18947,20 @@ static int wlan_hdd_set_txq_params(struct wiphy *wiphy,
 				   struct net_device *dev,
 				   struct ieee80211_txq_params *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_set_txq_params(wiphy, dev, params);
+	errno = __wlan_hdd_set_txq_params(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -19062,57 +19145,72 @@ void wlan_hdd_del_station(struct hdd_adapter *adapter)
 }
 #endif
 
-#if defined(USE_CFG80211_DEL_STA_V2)
 /**
- * wlan_hdd_cfg80211_del_station() - delete station v2
+ * wlan_hdd_cfg80211_del_station() - delete station entry handler
  * @wiphy: Pointer to wiphy
- * @param: Pointer to delete station parameter
+ * @dev: net_device to operate against
+ * @mac: binary mac address
+ * @reason_code: reason for the deauthorization/disassociation
+ * @subtype: management frame subtype to indicate removal
  *
- * Return: 0 for success, non-zero for failure
+ * Return: Errno
  */
+static int _wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
+					  struct net_device *dev,
+					  const uint8_t *mac,
+					  uint16_t reason_code,
+					  uint8_t subtype)
+{
+	int errno;
+	struct csr_del_sta_params delStaParams;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
+
+	cds_ssr_protect(__func__);
+	wlansap_populate_del_sta_params(mac, reason_code, subtype,
+					&delStaParams);
+	errno = __wlan_hdd_cfg80211_del_station(wiphy, dev, &delStaParams);
+	cds_ssr_unprotect(__func__);
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
+}
+
+#ifdef USE_CFG80211_DEL_STA_V2
 int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
 				  struct net_device *dev,
 				  struct station_del_parameters *param)
-#else
-/**
- * wlan_hdd_cfg80211_del_station() - delete station
- * @wiphy: Pointer to wiphy
- * @mac: Pointer to station mac address
- *
- * Return: 0 for success, non-zero for failure
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
+{
+	if (!param)
+		return -EINVAL;
+
+	return _wlan_hdd_cfg80211_del_station(wiphy, dev, param->mac,
+					      param->reason_code,
+					      param->subtype);
+}
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
 				  const uint8_t *mac)
-#else
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  uint8_t *mac)
-#endif
-#endif
 {
-	int ret;
-	struct csr_del_sta_params delStaParams;
+	uint16_t reason = eSIR_MAC_DEAUTH_LEAVING_BSS_REASON;
+	uint8_t subtype = SIR_MAC_MGMT_DEAUTH >> 4;
 
-	cds_ssr_protect(__func__);
-#if defined(USE_CFG80211_DEL_STA_V2)
-	if (NULL == param) {
-		hdd_err("Invalid argument passed");
-		return -EINVAL;
-	}
-	wlansap_populate_del_sta_params(param->mac, param->reason_code,
-					param->subtype, &delStaParams);
+	return _wlan_hdd_cfg80211_del_station(wiphy, dev, mac, reason, subtype);
+}
 #else
-	wlansap_populate_del_sta_params(mac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
-					(SIR_MAC_MGMT_DEAUTH >> 4),
-					&delStaParams);
-#endif
-	ret = __wlan_hdd_cfg80211_del_station(wiphy, dev, &delStaParams);
-	cds_ssr_unprotect(__func__);
+int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
+				  uint8_t *mac)
+{
+	uint16_t reason = eSIR_MAC_DEAUTH_LEAVING_BSS_REASON;
+	uint8_t subtype = SIR_MAC_MGMT_DEAUTH >> 4;
 
-	return ret;
+	return _wlan_hdd_cfg80211_del_station(wiphy, dev, mac, reason, subtype);
 }
+#endif
 
 /**
  * __wlan_hdd_cfg80211_add_station() - add station
@@ -19193,13 +19291,20 @@ static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
 					 struct station_parameters *params)
 #endif
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_add_station(wiphy, dev, mac, params);
+	errno = __wlan_hdd_cfg80211_add_station(wiphy, dev, mac, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #if defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
@@ -19395,13 +19500,20 @@ static int wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       struct cfg80211_pmksa *pmksa)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_pmksa(wiphy, dev, pmksa);
+	errno = __wlan_hdd_cfg80211_set_pmksa(wiphy, dev, pmksa);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -19483,13 +19595,20 @@ static int wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       struct cfg80211_pmksa *pmksa)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_del_pmksa(wiphy, dev, pmksa);
+	errno = __wlan_hdd_cfg80211_del_pmksa(wiphy, dev, pmksa);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 
 }
 
@@ -19551,13 +19670,20 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
 static int wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
 					 struct net_device *dev)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_flush_pmksa(wiphy, dev);
+	errno = __wlan_hdd_cfg80211_flush_pmksa(wiphy, dev);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #if defined(KERNEL_SUPPORT_11R_CFG80211)
@@ -19628,13 +19754,20 @@ wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct cfg80211_update_ft_ies_params *ftie)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_update_ft_ies(wiphy, dev, ftie);
+	errno = __wlan_hdd_cfg80211_update_ft_ies(wiphy, dev, ftie);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 
@@ -19802,13 +19935,20 @@ int wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
 				     struct net_device *dev,
 				     struct cfg80211_gtk_rekey_data *data)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_rekey_data(wiphy, dev, data);
+	errno = __wlan_hdd_cfg80211_set_rekey_data(wiphy, dev, data);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif /* WLAN_FEATURE_GTK_OFFLOAD */
 
@@ -19944,13 +20084,20 @@ wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
 			      struct net_device *dev,
 			      const struct cfg80211_acl_data *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_mac_acl(wiphy, dev, params);
+	errno = __wlan_hdd_cfg80211_set_mac_acl(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #ifdef WLAN_NL80211_TESTMODE
@@ -20218,13 +20365,20 @@ wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
 				       struct net_device *dev,
 				       struct cfg80211_chan_def *chandef)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_ap_channel_width(wiphy, dev, chandef);
+	errno = __wlan_hdd_cfg80211_set_ap_channel_width(wiphy, dev, chandef);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 
@@ -20291,12 +20445,20 @@ static int wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct cfg80211_csa_settings *csa_params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_channel_switch(wiphy, dev, csa_params);
+	errno = __wlan_hdd_cfg80211_channel_switch(wiphy, dev, csa_params);
 	cds_ssr_unprotect(__func__);
-	return ret;
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 
@@ -20653,14 +20815,21 @@ wlan_hdd_cfg80211_update_connect_params(struct wiphy *wiphy,
 					struct cfg80211_connect_params *req,
 					uint32_t changed)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_update_connect_params(wiphy, dev,
-							req, changed);
+	errno = __wlan_hdd_cfg80211_update_connect_params(wiphy, dev,
+							  req, changed);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 
@@ -20717,13 +20886,20 @@ wlan_hdd_cfg80211_external_auth(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct cfg80211_external_auth_params *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_external_auth(wiphy, dev, params);
+	errno = __wlan_hdd_cfg80211_external_auth(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 

+ 31 - 9
core/hdd/src/wlan_hdd_hostapd.c

@@ -38,6 +38,7 @@
 #include "osif_sync.h"
 #include <wlan_hdd_includes.h>
 #include <qc_sap_ioctl.h>
+#include "osif_sync.h"
 #include <wlan_hdd_hostapd.h>
 #include <wlan_hdd_hostapd_wext.h>
 #include <wlan_hdd_green_ap.h>
@@ -5870,13 +5871,20 @@ static enum hw_mode_bandwidth wlan_hdd_get_channel_bw(
 int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 				struct net_device *dev)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_stop_ap(wiphy, dev);
+	errno = __wlan_hdd_cfg80211_stop_ap(wiphy, dev);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) || \
@@ -6290,13 +6298,20 @@ int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct cfg80211_ap_settings *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_start_ap(wiphy, dev, params);
+	errno = __wlan_hdd_cfg80211_start_ap(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -6380,13 +6395,20 @@ int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct cfg80211_beacon_data *params)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_change_beacon(wiphy, dev, params);
+	errno = __wlan_hdd_cfg80211_change_beacon(wiphy, dev, params);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 48 - 23
core/hdd/src/wlan_hdd_p2p.c

@@ -163,16 +163,21 @@ int wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
 					struct ieee80211_channel *chan,
 					unsigned int duration, u64 *cookie)
 {
-	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_remain_on_channel(wiphy,
-						    wdev,
-						    chan,
-						    duration, cookie);
+	errno = __wlan_hdd_cfg80211_remain_on_channel(wiphy, wdev, chan,
+						      duration, cookie);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 static int
@@ -204,15 +209,21 @@ int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
 					       struct wireless_dev *wdev,
 					       u64 cookie)
 {
-	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_cancel_remain_on_channel(wiphy,
-							   wdev,
-							   cookie);
+	errno = __wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy, wdev,
+							     cookie);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
@@ -293,23 +304,30 @@ int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		     bool dont_wait_for_ack, u64 *cookie)
 #endif /* LINUX_VERSION_CODE */
 {
-	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__);
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-	ret = __wlan_hdd_mgmt_tx(wiphy, wdev, params->chan, params->offchan,
-				 params->wait, params->buf, params->len,
-				 params->no_cck, params->dont_wait_for_ack,
-				 cookie);
+	errno = __wlan_hdd_mgmt_tx(wiphy, wdev, params->chan, params->offchan,
+				   params->wait, params->buf, params->len,
+				   params->no_cck, params->dont_wait_for_ack,
+				   cookie);
 #else
-	ret = __wlan_hdd_mgmt_tx(wiphy, wdev, chan, offchan,
-				 wait, buf, len, no_cck,
-				 dont_wait_for_ack, cookie);
+	errno = __wlan_hdd_mgmt_tx(wiphy, wdev, chan, offchan,
+				   wait, buf, len, no_cck,
+				   dont_wait_for_ack, cookie);
 #endif /* LINUX_VERSION_CODE */
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
@@ -339,13 +357,20 @@ static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
 int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
 					  struct wireless_dev *wdev, u64 cookie)
 {
-	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_mgmt_tx_cancel_wait(wiphy, wdev, cookie);
+	errno = __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(wiphy, wdev, cookie);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 12 - 5
core/hdd/src/wlan_hdd_power.c

@@ -28,6 +28,7 @@
 #include <linux/pm.h>
 #include <linux/wait.h>
 #include <linux/cpu.h>
+#include "osif_sync.h"
 #include <wlan_hdd_includes.h>
 #if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
 #include <linux/wakelock.h>
@@ -78,7 +79,6 @@
 #include <wlan_cfg80211_mc_cp_stats.h>
 #include "wlan_p2p_ucfg_api.h"
 #include "wlan_mlme_ucfg_api.h"
-#include "osif_sync.h"
 
 /* Preprocessor definitions and constants */
 #ifdef QCA_WIFI_NAPIER_EMULATION
@@ -1986,14 +1986,21 @@ int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 				     bool allow_power_save,
 				     int timeout)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_power_mgmt(wiphy, dev,
-		allow_power_save, timeout);
+	errno = __wlan_hdd_cfg80211_set_power_mgmt(wiphy, dev, allow_power_save,
+						   timeout);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 41 - 13
core/hdd/src/wlan_hdd_scan.c

@@ -712,13 +712,20 @@ error:
 int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 			   struct cfg80211_scan_request *request)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(request->wdev->netdev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_scan(wiphy,
-				request, NL_SCAN);
+	errno = __wlan_hdd_cfg80211_scan(wiphy, request, NL_SCAN);
 	cds_ssr_unprotect(__func__);
-	return ret;
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -1335,13 +1342,20 @@ int wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 				       struct cfg80211_sched_scan_request
 				       *request)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sched_scan_start(wiphy, dev, request);
+	errno = __wlan_hdd_cfg80211_sched_scan_start(wiphy, dev, request);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 int wlan_hdd_sched_scan_stop(struct net_device *dev)
@@ -1450,26 +1464,40 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev)
 int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
 				      struct net_device *dev)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sched_scan_stop(dev);
+	errno = __wlan_hdd_cfg80211_sched_scan_stop(dev);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #else
 int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
 				      struct net_device *dev,
 				      uint64_t reqid)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sched_scan_stop(dev);
+	errno = __wlan_hdd_cfg80211_sched_scan_stop(dev);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif /* KERNEL_VERSION(4, 12, 0) */
 #endif /*FEATURE_WLAN_SCAN_PNO */

+ 31 - 9
core/hdd/src/wlan_hdd_stats.c

@@ -4652,13 +4652,20 @@ int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
 				  struct net_device *dev, const uint8_t *mac,
 				  struct station_info *sinfo)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_station(wiphy, dev, mac, sinfo);
+	errno = __wlan_hdd_cfg80211_get_station(wiphy, dev, mac, sinfo);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -4705,12 +4712,20 @@ int wlan_hdd_cfg80211_dump_station(struct wiphy *wiphy,
 				int idx, u8 *mac,
 				struct station_info *sinfo)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dump_station(wiphy, dev, idx, mac, sinfo);
+	errno = __wlan_hdd_cfg80211_dump_station(wiphy, dev, idx, mac, sinfo);
 	cds_ssr_unprotect(__func__);
-	return ret;
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -4909,13 +4924,20 @@ int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
 				  struct net_device *dev,
 				  int idx, struct survey_info *survey)
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dump_survey(wiphy, dev, idx, survey);
+	errno = __wlan_hdd_cfg80211_dump_survey(wiphy, dev, idx, survey);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**

+ 35 - 21
core/hdd/src/wlan_hdd_tdls.c

@@ -594,36 +594,43 @@ int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
 #endif
 #endif
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
 #if TDLS_MGMT_VERSION2
-	ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
-						dialog_token, status_code,
-						peer_capability, buf, len);
+	errno = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
+					      dialog_token, status_code,
+					      peer_capability, buf, len);
 #else /* TDLS_MGMT_VERSION2 */
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) || defined(WITH_BACKPORTS)
-	ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
-					dialog_token, status_code,
-					peer_capability, initiator,
-					buf, len);
+	errno = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
+					      dialog_token, status_code,
+					      peer_capability, initiator,
+					      buf, len);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-	ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
-					dialog_token, status_code,
-					peer_capability, buf, len);
+	errno = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
+					      dialog_token, status_code,
+					      peer_capability, buf, len);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
-	ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
-					dialog_token, status_code,
-					peer_capability, buf, len);
+	errno = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
+					      dialog_token, status_code,
+					      peer_capability, buf, len);
 #else
-	ret = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
-					dialog_token, status_code, buf, len);
+	errno = __wlan_hdd_cfg80211_tdls_mgmt(wiphy, dev, peer, action_code,
+					      dialog_token, status_code,
+					      buf, len);
 #endif
 #endif
-
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 /**
@@ -714,13 +721,20 @@ int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
 				enum nl80211_tdls_operation oper)
 #endif
 {
-	int ret;
+	int errno;
+	struct osif_vdev_sync *vdev_sync;
+
+	errno = osif_vdev_sync_op_start(dev, &vdev_sync);
+	if (errno)
+		return errno;
 
 	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_tdls_oper(wiphy, dev, peer, oper);
+	errno = __wlan_hdd_cfg80211_tdls_oper(wiphy, dev, peer, oper);
 	cds_ssr_unprotect(__func__);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 
 int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx,