qcacld-3.0: Integrate DSC (vdev up/down/change mode)

The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.

As part of integrating the DSC APIs into HDD, protect vdev up, down, and
mode change.

Change-Id: Ie6c8df3e4166bbfed5496b474bc49ecdb9a8ca91
CRs-Fixed: 2397318
This commit is contained in:
Dustin Brown 2019-01-17 11:00:22 -08:00 committed by nshrivas
parent 61f7096e75
commit 0e1e1624b5
3 changed files with 82 additions and 36 deletions

View File

@ -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,
&params->flags, params);
cds_ssr_unprotect(__func__);
return ret;
}
#endif /* KERNEL_VERSION(4, 12, 0) */

View File

@ -35,6 +35,7 @@
#include <cds_api.h>
#include <cds_sched.h>
#include <linux/etherdevice.h>
#include "osif_sync.h"
#include <wlan_hdd_includes.h>
#include <qc_sap_ioctl.h>
#include <wlan_hdd_hostapd.h>
@ -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;
}
/**

View File

@ -26,7 +26,6 @@
/* Include Files */
#include <wbuff.h>
#include "cfg_ucfg_api.h"
#include "wlan_dsc.h"
#include <wlan_hdd_includes.h>
#include <cds_api.h>
#include <cds_sched.h>
@ -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;
}
/**