diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 7237cbffc0c4..5723b87a9f83 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -13774,6 +13774,29 @@ err: return errno; } +static int _wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, + struct net_device *net_dev, + enum nl80211_iftype type, + u32 *flags, + struct vif_params *params) +{ + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync); + if (errno) + return errno; + + cds_ssr_protect(__func__); + errno = __wlan_hdd_cfg80211_change_iface(wiphy, net_dev, type, + flags, params); + cds_ssr_unprotect(__func__); + + osif_vdev_sync_trans_stop(vdev_sync); + + return errno; +} + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) /** * wlan_hdd_cfg80211_change_iface() - change interface cfg80211 op @@ -13791,14 +13814,8 @@ static int wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, u32 *flags, struct vif_params *params) { - int ret; - - cds_ssr_protect(__func__); - ret = - __wlan_hdd_cfg80211_change_iface(wiphy, ndev, type, flags, params); - cds_ssr_unprotect(__func__); - - return ret; + return _wlan_hdd_cfg80211_change_iface(wiphy, ndev, type, + flags, params); } #else static int wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, @@ -13806,14 +13823,8 @@ static int wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy, enum nl80211_iftype type, struct vif_params *params) { - int ret; - - cds_ssr_protect(__func__); - ret = __wlan_hdd_cfg80211_change_iface(wiphy, ndev, type, + return _wlan_hdd_cfg80211_change_iface(wiphy, ndev, type, ¶ms->flags, params); - cds_ssr_unprotect(__func__); - - return ret; } #endif /* KERNEL_VERSION(4, 12, 0) */ diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 04912c0bbdd9..2a18f5faa49d 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -35,6 +35,7 @@ #include #include #include +#include "osif_sync.h" #include #include #include @@ -453,15 +454,22 @@ static int __hdd_hostapd_open(struct net_device *dev) * * Return: 0 on success, error number otherwise */ -static int hdd_hostapd_open(struct net_device *dev) +static int hdd_hostapd_open(struct net_device *net_dev) { - int ret; + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync); + if (errno) + return errno; cds_ssr_protect(__func__); - ret = __hdd_hostapd_open(dev); + errno = __hdd_hostapd_open(net_dev); cds_ssr_unprotect(__func__); - return ret; + osif_vdev_sync_trans_stop(vdev_sync); + + return errno; } /** @@ -519,15 +527,22 @@ static int __hdd_hostapd_stop(struct net_device *dev) * * Return: 0 on success, error number otherwise */ -int hdd_hostapd_stop(struct net_device *dev) +int hdd_hostapd_stop(struct net_device *net_dev) { - int ret; + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync); + if (errno) + return errno; cds_ssr_protect(__func__); - ret = __hdd_hostapd_stop(dev); + errno = __hdd_hostapd_stop(net_dev); cds_ssr_unprotect(__func__); - return ret; + osif_vdev_sync_trans_stop(vdev_sync); + + return errno; } /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b92d76b126b0..d773dd5429dd 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -26,7 +26,6 @@ /* Include Files */ #include #include "cfg_ucfg_api.h" -#include "wlan_dsc.h" #include #include #include @@ -2197,15 +2196,22 @@ static int __hdd_mon_open(struct net_device *dev) * * Return: 0 for success; non-zero for failure */ -static int hdd_mon_open(struct net_device *dev) +static int hdd_mon_open(struct net_device *net_dev) { - int ret; + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync); + if (errno) + return errno; cds_ssr_protect(__func__); - ret = __hdd_mon_open(dev); + errno = __hdd_mon_open(net_dev); cds_ssr_unprotect(__func__); - return ret; + osif_vdev_sync_trans_stop(vdev_sync); + + return errno; } #endif @@ -3156,15 +3162,22 @@ err_hdd_hdd_init_deinit_lock: * * Return: 0 for success; non-zero for failure */ -static int hdd_open(struct net_device *dev) +static int hdd_open(struct net_device *net_dev) { - int ret; + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync); + if (errno) + return errno; cds_ssr_protect(__func__); - ret = __hdd_open(dev); + errno = __hdd_open(net_dev); cds_ssr_unprotect(__func__); - return ret; + osif_vdev_sync_trans_stop(vdev_sync); + + return errno; } /** @@ -3267,15 +3280,22 @@ static int __hdd_stop(struct net_device *dev) * * Return: 0 for success and error number for failure */ -static int hdd_stop(struct net_device *dev) +static int hdd_stop(struct net_device *net_dev) { - int ret; + int errno; + struct osif_vdev_sync *vdev_sync; + + errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync); + if (errno) + return errno; cds_ssr_protect(__func__); - ret = __hdd_stop(dev); + errno = __hdd_stop(net_dev); cds_ssr_unprotect(__func__); - return ret; + osif_vdev_sync_trans_stop(vdev_sync); + + return errno; } /**