blob: 3c1683ded84c85b553d8b6d5bead20a18dcaea0e [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2015 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef __HDD_NAPI_H__
29#define __HDD_NAPI_H__
30
31#ifdef FEATURE_NAPI
32/**
33 * DOC: wlan_hdd_napi.h
34 *
35 * WLAN NAPI interface module headers
36 */
37
38/* CLD headers */
39#include "hif_napi.h"
40/* Linux headers */
41#include <linux/netdevice.h> /* net_device */
42
43#define HDD_NAPI_ANY (-1)
44
45int hdd_napi_enabled(int id);
46int hdd_napi_create(void);
47int hdd_napi_destroy(int force);
48
49int hdd_napi_stats(char *buf,
50 int max,
51 char *indp,
52 struct qca_napi_data *napid);
53
54/* the following triggers napi_enable/disable as required */
55int hdd_napi_event(enum qca_napi_event event, void *data);
56
57int hdd_napi_poll(struct napi_struct *napi, int budget);
58
59struct qca_napi_data *hdd_napi_get_all(void);
60
61#else /* ! defined(FEATURE_NAPI) */
62#include "hif_napi.h"
63/**
64 * Stub API
65 *
66 */
67
68#define HDD_NAPI_ANY (-1)
69
70static inline int hdd_napi_enabled(int id) { return 0; }
71static inline int hdd_napi_create(void) { return -EPERM; }
72static inline int hdd_napi_destroy(int force) { return 0; }
73static inline int hdd_napi_stats(char *buf, int max, char *indp,
74 struct qca_napi_data *napid)
75{ return 0; }
76static inline int hdd_napi_event(enum qca_napi_event event, void *data)
77{ return 0; }
78static inline struct qca_napi_data *hdd_napi_get_all(void) { return NULL; }
79
80#endif /* FEATURE_NAPI */
81
82#endif /* HDD_NAPI_H__ */