qcacmn: Make inline OS-abstraction APIs as non-inline
OS-abstraction API's are made non-inline to avoid direct usage of kernel API's. Change-Id: Ib35aa9271d98054ab582fc079e62714bb7fdae99
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2021 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
|
||||
@@ -49,6 +49,155 @@ typedef __qdf_workqueue_t qdf_workqueue_t;
|
||||
*/
|
||||
typedef __qdf_bh_t qdf_bh_t;
|
||||
|
||||
#ifdef ENHANCED_OS_ABSTRACTION
|
||||
/**
|
||||
* qdf_create_bh - creates the bottom half deferred handler
|
||||
* @bh: pointer to bottom
|
||||
* @func: deferred function to run at bottom half interrupt context.
|
||||
* @arg: argument for the deferred function
|
||||
* Return: none
|
||||
*/
|
||||
void
|
||||
qdf_create_bh(qdf_bh_t *bh, qdf_defer_fn_t func, void *arg);
|
||||
|
||||
/**
|
||||
* qdf_sched - schedule a bottom half (DPC)
|
||||
* @bh: pointer to bottom
|
||||
* Return: none
|
||||
*/
|
||||
void qdf_sched_bh(qdf_bh_t *bh);
|
||||
|
||||
/**
|
||||
* qdf_destroy_bh - destroy the bh (synchronous)
|
||||
* @bh: pointer to bottom
|
||||
* Return: none
|
||||
*/
|
||||
void qdf_destroy_bh(qdf_bh_t *bh);
|
||||
|
||||
/**
|
||||
* qdf_create_workqueue - create a workqueue, This runs in non-interrupt
|
||||
* context, so can be preempted by H/W & S/W intr
|
||||
* @name: string
|
||||
*
|
||||
* Return: pointer of type qdf_workqueue_t
|
||||
*/
|
||||
qdf_workqueue_t *qdf_create_workqueue(char *name);
|
||||
|
||||
/**
|
||||
* qdf_create_singlethread_workqueue() - create a single threaded workqueue
|
||||
* @name: string
|
||||
*
|
||||
* This API creates a dedicated work queue with a single worker thread to avoid
|
||||
* wasting unnecessary resources when works which needs to be submitted in this
|
||||
* queue are not very critical and frequent.
|
||||
*
|
||||
* Return: pointer of type qdf_workqueue_t
|
||||
*/
|
||||
qdf_workqueue_t *qdf_create_singlethread_workqueue(char *name);
|
||||
|
||||
/**
|
||||
* qdf_alloc_unbound_workqueue - allocate an unbound workqueue
|
||||
* @name: string
|
||||
*
|
||||
* Return: pointer of type qdf_workqueue_t
|
||||
*/
|
||||
qdf_workqueue_t *qdf_alloc_unbound_workqueue(char *name);
|
||||
|
||||
/**
|
||||
* qdf_destroy_workqueue - Destroy the workqueue
|
||||
* @hdl: OS handle
|
||||
* @wqueue: pointer to workqueue
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void qdf_destroy_workqueue(qdf_handle_t hdl, qdf_workqueue_t *wqueue);
|
||||
|
||||
/**
|
||||
* qdf_cancel_work() - Cancel a work
|
||||
* @work: pointer to work
|
||||
*
|
||||
* Cancel work and wait for its execution to finish.
|
||||
* This function can be used even if the work re-queues
|
||||
* itself or migrates to another workqueue. On return
|
||||
* from this function, work is guaranteed to be not
|
||||
* pending or executing on any CPU. The caller must
|
||||
* ensure that the workqueue on which work was last
|
||||
* queued can't be destroyed before this function returns.
|
||||
*
|
||||
* Return: true if work was pending, false otherwise
|
||||
*/
|
||||
bool qdf_cancel_work(qdf_work_t *work);
|
||||
|
||||
/**
|
||||
* qdf_disable_work - disable the deferred task (synchronous)
|
||||
* @work: pointer to work
|
||||
*
|
||||
* Return: unsigned int
|
||||
*/
|
||||
uint32_t qdf_disable_work(qdf_work_t *work);
|
||||
|
||||
/**
|
||||
* qdf_flush_work - Flush a deferred task on non-interrupt context
|
||||
* @work: pointer to work
|
||||
*
|
||||
* Wait until work has finished execution. work is guaranteed to be
|
||||
* idle on return if it hasn't been requeued since flush started.
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void qdf_flush_work(qdf_work_t *work);
|
||||
|
||||
/**
|
||||
* qdf_create_work - create a work/task queue, This runs in non-interrupt
|
||||
* context, so can be preempted by H/W & S/W intr
|
||||
* @hdl: OS handle
|
||||
* @work: pointer to work
|
||||
* @func: deferred function to run at bottom half non-interrupt context.
|
||||
* @arg: argument for the deferred function
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS qdf_create_work(qdf_handle_t hdl, qdf_work_t *work,
|
||||
qdf_defer_fn_t func, void *arg);
|
||||
|
||||
/**
|
||||
* qdf_sched_work - Schedule a deferred task on non-interrupt context
|
||||
* @hdl: OS handle
|
||||
* @work: pointer to work
|
||||
*
|
||||
* Retrun: none
|
||||
*/
|
||||
void qdf_sched_work(qdf_handle_t hdl, qdf_work_t *work);
|
||||
|
||||
/**
|
||||
* qdf_queue_work - Queue the work/task
|
||||
* @hdl: OS handle
|
||||
* @wqueue: pointer to workqueue
|
||||
* @work: pointer to work
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void
|
||||
qdf_queue_work(qdf_handle_t hdl, qdf_workqueue_t *wqueue, qdf_work_t *work);
|
||||
|
||||
/**
|
||||
* qdf_flush_workqueue - flush the workqueue
|
||||
* @hdl: OS handle
|
||||
* @wqueue: pointer to workqueue
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void qdf_flush_workqueue(qdf_handle_t hdl, qdf_workqueue_t *wqueue);
|
||||
|
||||
/**
|
||||
* qdf_destroy_work - destroy the deferred task (synchronous)
|
||||
* @hdl: OS handle
|
||||
* @work: pointer to work
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void qdf_destroy_work(qdf_handle_t hdl, qdf_work_t *work);
|
||||
#else
|
||||
/**
|
||||
* qdf_create_bh - creates the bottom half deferred handler
|
||||
* @bh: pointer to bottom
|
||||
@@ -250,5 +399,6 @@ static inline void qdf_destroy_work(qdf_handle_t hdl, qdf_work_t *work)
|
||||
{
|
||||
__qdf_disable_work(work);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*_QDF_DEFER_H*/
|
||||
|
Reference in New Issue
Block a user