qcacld-3.0: Add QDF defer API's
Replace CDF defer API's with QDF defer API's Change-Id: I67a9f57a76813bf2c35c42d69013133aad0b2393 CRs-Fixed: 981188
This commit is contained in:

committato da
Gerrit - the friendly Code Review server

parent
8e0ccd330b
commit
42958bb929
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was originally distributed by Qualcomm Atheros, Inc.
|
||||
* under proprietary terms before Copyright ownership was assigned
|
||||
* to the Linux Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: cdf_defer.h
|
||||
* This file abstracts deferred execution contexts.
|
||||
*/
|
||||
|
||||
#ifndef __CDF_DEFER_H
|
||||
#define __CDF_DEFER_H
|
||||
|
||||
#include <cdf_types.h>
|
||||
#include <i_cdf_defer.h>
|
||||
|
||||
/**
|
||||
* This implements work queues (worker threads, kernel threads etc.).
|
||||
* Note that there is no cancel on a scheduled work. You cannot free a work
|
||||
* item if its queued. You cannot know if a work item is queued or not unless
|
||||
* its running, whence you know its not queued.
|
||||
*
|
||||
* so if, say, a module is asked to unload itself, how exactly will it make
|
||||
* sure that the work's not queued, for OS'es that dont provide such a
|
||||
* mechanism??
|
||||
*/
|
||||
|
||||
/* cdf_work_t - representation of a work queue */
|
||||
typedef __cdf_work_t cdf_work_t;
|
||||
|
||||
/* cdf_work_t - representation of a bottom half */
|
||||
typedef __cdf_bh_t cdf_bh_t;
|
||||
|
||||
/**
|
||||
* cdf_create_bh() - this creates the Bottom half deferred handler
|
||||
* @hdl: OS handle
|
||||
* @bh: Bottom instance
|
||||
* @func: Func deferred function to run at bottom half interrupt
|
||||
* context
|
||||
* Return: None
|
||||
*/
|
||||
static inline void
|
||||
cdf_create_bh(cdf_handle_t hdl, cdf_bh_t *bh, cdf_defer_fn_t func, void *arg)
|
||||
{
|
||||
__cdf_init_bh(hdl, bh, func, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_sched_bh() - schedule a bottom half (DPC)
|
||||
* @hdl: OS handle
|
||||
* @bh: Bottom instance
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_sched_bh(cdf_handle_t hdl, cdf_bh_t *bh)
|
||||
{
|
||||
__cdf_sched_bh(hdl, bh);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_destroy_bh() - destroy a bottom half (DPC)
|
||||
* @hdl: OS handle
|
||||
* @bh: Bottom instance
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_destroy_bh(cdf_handle_t hdl, cdf_bh_t *bh)
|
||||
{
|
||||
__cdf_disable_bh(hdl, bh);
|
||||
}
|
||||
|
||||
/*********************Non-Interrupt Context deferred Execution***************/
|
||||
|
||||
/**
|
||||
* cdf_create_work() - create a work/task queue, This runs in non-interrupt
|
||||
* context, so can be preempted by H/W & S/W intr
|
||||
* @work: Work instance
|
||||
* @func: Deferred function to run at bottom half non-interrupt
|
||||
* context
|
||||
* @arg: Argument for the deferred function
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void
|
||||
cdf_create_work(cdf_work_t *work,
|
||||
cdf_defer_fn_t func, void *arg)
|
||||
{
|
||||
__cdf_init_work(work, func, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_sched_work() - schedule a deferred task on non-interrupt context
|
||||
* @work: Work instance
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_schedule_work(cdf_work_t *work)
|
||||
{
|
||||
__cdf_schedule_work(work);
|
||||
}
|
||||
#endif /*__CDF_DEFER_H*/
|
@@ -33,7 +33,7 @@
|
||||
#include <cdf_lock.h>
|
||||
#include <qdf_time.h>
|
||||
#include <cdf_softirq_timer.h>
|
||||
#include <cdf_defer.h>
|
||||
#include <qdf_defer.h>
|
||||
#include <cdf_nbuf.h>
|
||||
#include <cds_if_upperproto.h>
|
||||
|
||||
@@ -233,7 +233,7 @@ typedef struct {
|
||||
struct _NIC_DEV {
|
||||
void *bdev; /* bus device handle */
|
||||
struct net_device *netdev; /* net device handle (wifi%d) */
|
||||
cdf_bh_t intr_tq; /* tasklet */
|
||||
qdf_bh_t intr_tq; /* tasklet */
|
||||
struct net_device_stats devstats; /* net device statisitics */
|
||||
HAL_BUS_CONTEXT bc;
|
||||
#ifdef ATH_PERF_PWR_OFFLOAD
|
||||
|
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was originally distributed by Qualcomm Atheros, Inc.
|
||||
* under proprietary terms before Copyright ownership was assigned
|
||||
* to the Linux Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include "i_cdf_defer.h"
|
||||
|
||||
/**
|
||||
* __cdf_defer_func() - defer work handler
|
||||
* @work: Pointer to defer work
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
void __cdf_defer_func(struct work_struct *work)
|
||||
{
|
||||
__cdf_work_t *ctx = container_of(work, __cdf_work_t, work);
|
||||
if (ctx->fn == NULL) {
|
||||
CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
|
||||
"No callback registered !!");
|
||||
return;
|
||||
}
|
||||
ctx->fn(ctx->arg);
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was originally distributed by Qualcomm Atheros, Inc.
|
||||
* under proprietary terms before Copyright ownership was assigned
|
||||
* to the Linux Foundation.
|
||||
*/
|
||||
|
||||
#ifndef _I_CDF_DEFER_H
|
||||
#define _I_CDF_DEFER_H
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/interrupt.h>
|
||||
#ifdef CONFIG_CNSS
|
||||
#include <net/cnss.h>
|
||||
#endif
|
||||
#include <cdf_types.h>
|
||||
#include <qdf_status.h>
|
||||
#include <cdf_trace.h>
|
||||
|
||||
typedef struct tasklet_struct __cdf_bh_t;
|
||||
|
||||
typedef void (*__cdf_bh_fn_t)(unsigned long arg);
|
||||
|
||||
/* wrapper around the real task func */
|
||||
typedef struct {
|
||||
struct work_struct work;
|
||||
cdf_defer_fn_t fn;
|
||||
void *arg;
|
||||
} __cdf_work_t;
|
||||
|
||||
extern void __cdf_defer_func(struct work_struct *work);
|
||||
|
||||
static inline QDF_STATUS
|
||||
__cdf_init_work(__cdf_work_t *work, cdf_defer_fn_t func, void *arg)
|
||||
{
|
||||
/*Initilize func and argument in work struct */
|
||||
work->fn = func;
|
||||
work->arg = arg;
|
||||
#ifdef CONFIG_CNSS
|
||||
cnss_init_work(&work->work, __cdf_defer_func);
|
||||
#else
|
||||
INIT_WORK(&work->work, __cdf_defer_func);
|
||||
#endif
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS __cdf_schedule_work(__cdf_work_t *work)
|
||||
{
|
||||
schedule_work(&work->work);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS __cdf_init_bh(cdf_handle_t hdl,
|
||||
struct tasklet_struct *bh,
|
||||
cdf_defer_fn_t func, void *arg)
|
||||
{
|
||||
tasklet_init(bh, (__cdf_bh_fn_t) func, (unsigned long)arg);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
__cdf_sched_bh(cdf_handle_t hdl, struct tasklet_struct *bh)
|
||||
{
|
||||
tasklet_schedule(bh);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
__cdf_disable_bh(cdf_handle_t hdl, struct tasklet_struct *bh)
|
||||
{
|
||||
tasklet_kill(bh);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /*_I_CDF_DEFER_H*/
|
@@ -6753,10 +6753,10 @@ void cds_check_concurrent_intf_and_restart_sap(hdd_station_ctx_t *hdd_sta_ctx,
|
||||
operationChannel)
|
||||
#endif
|
||||
) {
|
||||
cdf_create_work(&hdd_ctx->sta_ap_intf_check_work,
|
||||
qdf_create_work(0, &hdd_ctx->sta_ap_intf_check_work,
|
||||
cds_check_sta_ap_concurrent_ch_intf,
|
||||
(void *)adapter);
|
||||
cdf_schedule_work(&hdd_ctx->sta_ap_intf_check_work);
|
||||
qdf_sched_work(0, &hdd_ctx->sta_ap_intf_check_work);
|
||||
cds_info("Checking for Concurrent Change interference");
|
||||
}
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@
|
||||
#include "wlan_hdd_tdls.h"
|
||||
#endif
|
||||
#include "wlan_hdd_cfg80211.h"
|
||||
#include <cdf_defer.h>
|
||||
#include <qdf_defer.h>
|
||||
#ifdef WLAN_FEATURE_MBSSID
|
||||
#include "sap_api.h"
|
||||
#endif
|
||||
@@ -1253,7 +1253,7 @@ struct hdd_context_s {
|
||||
tSirScanType ioctl_scan_mode;
|
||||
|
||||
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
|
||||
cdf_work_t sta_ap_intf_check_work;
|
||||
qdf_work_t sta_ap_intf_check_work;
|
||||
#endif
|
||||
|
||||
struct work_struct sap_start_work;
|
||||
|
@@ -1444,7 +1444,7 @@ struct wma_tx_ack_work_ctx {
|
||||
tp_wma_handle wma_handle;
|
||||
uint16_t sub_type;
|
||||
int32_t status;
|
||||
cdf_work_t ack_cmp_work;
|
||||
qdf_work_t ack_cmp_work;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -888,10 +888,10 @@ wma_data_tx_ack_comp_hdlr(void *wma_context, cdf_nbuf_t netbuf, int32_t status)
|
||||
ack_work->sub_type = 0;
|
||||
ack_work->status = status;
|
||||
|
||||
cdf_create_work(&ack_work->ack_cmp_work,
|
||||
qdf_create_work(0, &ack_work->ack_cmp_work,
|
||||
wma_data_tx_ack_work_handler,
|
||||
ack_work);
|
||||
cdf_schedule_work(&ack_work->ack_cmp_work);
|
||||
qdf_sched_work(0, &ack_work->ack_cmp_work);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1562,11 +1562,11 @@ wma_mgmt_tx_ack_comp_hdlr(void *wma_context, cdf_nbuf_t netbuf, int32_t status)
|
||||
ack_work->sub_type = pFc->subType;
|
||||
ack_work->status = status;
|
||||
|
||||
cdf_create_work(&ack_work->ack_cmp_work,
|
||||
qdf_create_work(0, &ack_work->ack_cmp_work,
|
||||
wma_mgmt_tx_ack_work_handler,
|
||||
ack_work);
|
||||
|
||||
cdf_schedule_work(&ack_work->ack_cmp_work);
|
||||
qdf_sched_work(0, &ack_work->ack_cmp_work);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Fai riferimento in un nuovo problema
Block a user