qcacmn: Add qdf API for delayed workqueue

Add qdf API for delayed workqueue

Change-Id: Ic67f200ac6c9749b088bbd0769491d22583eed11
CRs-Fixed: 2738374
This commit is contained in:
Jayachandran Sreekumaran 2020-07-22 16:12:13 +05:30 • committed by snandini
commit 3be1a0a167
3 changed files with 41 additions and 6 deletions

View file

@ -55,6 +55,7 @@ linux/src/qdf_status.o \
linux/src/qdf_threads.o \
linux/src/qdf_trace.o \
linux/src/qdf_vfs.o \
linux/src/qdf_delayed_work.o \
src/qdf_flex_mem.o \
src/qdf_parse.o \
src/qdf_str.o \

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -78,7 +78,10 @@ void __qdf_delayed_work_destroy(struct qdf_delayed_work *dwork,
*
* Return: true if started successfully
*/
bool qdf_delayed_work_start(struct qdf_delayed_work *dwork, uint32_t msec);
#define qdf_delayed_work_start(dwork, msec) \
__qdf_delayed_work_start(dwork, msec)
bool __qdf_delayed_work_start(struct qdf_delayed_work *dwork, uint32_t msec);
/**
* qdf_delayed_work_stop_sync() - Synchronously stop execution of @dwork
@ -89,7 +92,23 @@ bool qdf_delayed_work_start(struct qdf_delayed_work *dwork, uint32_t msec);
*
* Return: true if @dwork was queued or running
*/
bool qdf_delayed_work_stop_sync(struct qdf_delayed_work *dwork);
#define qdf_delayed_work_stop_sync(dwork) \
__qdf_delayed_work_stop_sync(dwork)
bool __qdf_delayed_work_stop_sync(struct qdf_delayed_work *dwork);
/**
* qdf_delayed_work_stop() - Stop execution of @dwork
* @dwork: the delayed work to stop
*
* Kill off a pending delayed_work
*
* Return: true if dwork was pending and canceled
*/
#define qdf_delayed_work_stop(dwork) \
__qdf_delayed_work_stop(dwork)
bool __qdf_delayed_work_stop(struct qdf_delayed_work *dwork);
#ifdef WLAN_DELAYED_WORK_DEBUG
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -20,6 +20,7 @@
#include "qdf_status.h"
#include "qdf_trace.h"
#include "qdf_types.h"
#include "qdf_module.h"
#ifdef WLAN_DELAYED_WORK_DEBUG
#include "qdf_tracker.h"
@ -98,6 +99,8 @@ QDF_STATUS __qdf_delayed_work_create(struct qdf_delayed_work *dwork,
return QDF_STATUS_SUCCESS;
}
qdf_export_symbol(__qdf_delayed_work_create);
void __qdf_delayed_work_destroy(struct qdf_delayed_work *dwork,
const char *func, uint32_t line)
{
@ -105,13 +108,25 @@ void __qdf_delayed_work_destroy(struct qdf_delayed_work *dwork,
qdf_dwork_dbg_untrack(dwork, func, line);
}
bool qdf_delayed_work_start(struct qdf_delayed_work *dwork, uint32_t msec)
qdf_export_symbol(__qdf_delayed_work_destroy);
bool __qdf_delayed_work_start(struct qdf_delayed_work *dwork, uint32_t msec)
{
return schedule_delayed_work(&dwork->dwork, msecs_to_jiffies(msec));
}
bool qdf_delayed_work_stop_sync(struct qdf_delayed_work *dwork)
qdf_export_symbol(__qdf_delayed_work_start);
bool __qdf_delayed_work_stop_sync(struct qdf_delayed_work *dwork)
{
return cancel_delayed_work_sync(&dwork->dwork);
}
qdf_export_symbol(__qdf_delayed_work_stop_sync);
bool __qdf_delayed_work_stop(struct qdf_delayed_work *dwork)
{
return cancel_delayed_work(&dwork->dwork);
}
qdf_export_symbol(__qdf_delayed_work_stop);