qcacld-3.0: Migrate driver transitions to osif_driver_sync

With the recent addition of osif_driver_sync APIs, DSC use is abstracted
behind a common interface. Migrate HDD to the new interface by updating
driver transitions to use the new APIs.

Change-Id: I394f007dd5485cd8d22aee84af74f8854ed54bb6
CRs-Fixed: 2408211
This commit is contained in:
Dustin Brown 2019-03-01 13:43:43 -08:00 • committed by nshrivas
commit c1d81af5c6
5 changed files with 40 additions and 110 deletions

View file

@ -30,30 +30,26 @@ struct osif_psoc_sync;
/**
* osif_psoc_sync_create() - create a psoc synchronization context
* @dsc_driver: parent dsc_driver to the psoc
* @out_psoc_sync: out parameter for the new synchronization context
*
* Return: Errno
*/
qdf_must_check int
osif_psoc_sync_create(struct dsc_driver *dsc_driver,
struct osif_psoc_sync **out_psoc_sync);
osif_psoc_sync_create(struct osif_psoc_sync **out_psoc_sync);
/**
* osif_psoc_sync_create_and_trans() - create a psoc synchronization context
* @dsc_driver: parent dsc_driver to the psoc
* @out_psoc_sync: out parameter for the new synchronization context
*
* For protecting the device creation process.
*
* Return: Errno
*/
#define osif_psoc_sync_create_and_trans(dsc_driver, out_psoc_sync) \
__osif_psoc_sync_create_and_trans(dsc_driver, out_psoc_sync, __func__)
#define osif_psoc_sync_create_and_trans(out_psoc_sync) \
__osif_psoc_sync_create_and_trans(out_psoc_sync, __func__)
qdf_must_check int
__osif_psoc_sync_create_and_trans(struct dsc_driver *dsc_driver,
struct osif_psoc_sync **out_psoc_sync,
__osif_psoc_sync_create_and_trans(struct osif_psoc_sync **out_psoc_sync,
const char *desc);
/**

View file

@ -17,12 +17,12 @@
*/
#include "linux/device.h"
#include "__osif_driver_sync.h"
#include "__osif_psoc_sync.h"
#include "osif_psoc_sync.h"
#include "qdf_lock.h"
#include "qdf_status.h"
#include "qdf_types.h"
#include "wlan_dsc_driver.h"
#include "wlan_dsc_psoc.h"
#include "wlan_dsc_vdev.h"
@ -90,16 +90,11 @@ static void osif_psoc_sync_put(struct osif_psoc_sync *psoc_sync)
qdf_mem_zero(psoc_sync, sizeof(*psoc_sync));
}
int osif_psoc_sync_create(struct dsc_driver *dsc_driver,
struct osif_psoc_sync **out_psoc_sync)
int osif_psoc_sync_create(struct osif_psoc_sync **out_psoc_sync)
{
QDF_STATUS status;
struct osif_psoc_sync *psoc_sync;
QDF_BUG(dsc_driver);
if (!dsc_driver)
return -EINVAL;
QDF_BUG(out_psoc_sync);
if (!out_psoc_sync)
return -EINVAL;
@ -110,7 +105,7 @@ int osif_psoc_sync_create(struct dsc_driver *dsc_driver,
if (!psoc_sync)
return -ENOMEM;
status = dsc_psoc_create(dsc_driver, &psoc_sync->dsc_psoc);
status = osif_driver_sync_dsc_psoc_create(&psoc_sync->dsc_psoc);
if (QDF_IS_STATUS_ERROR(status))
goto sync_put;
@ -126,15 +121,14 @@ sync_put:
return qdf_status_to_os_return(status);
}
int __osif_psoc_sync_create_and_trans(struct dsc_driver *dsc_driver,
struct osif_psoc_sync **out_psoc_sync,
int __osif_psoc_sync_create_and_trans(struct osif_psoc_sync **out_psoc_sync,
const char *desc)
{
struct osif_psoc_sync *psoc_sync;
QDF_STATUS status;
int errno;
errno = osif_psoc_sync_create(dsc_driver, &psoc_sync);
errno = osif_psoc_sync_create(&psoc_sync);
if (errno)
return errno;