blob: 857f284d19be143c799e3b8cb4794d16f3b5d9af [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Yun Park196641d2017-04-06 22:29:34 -07002 * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
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 _WDI_EVENT_H_
29#define _WDI_EVENT_H_
30
31#include "athdefs.h"
Nirav Shahcbc6d722016-03-01 16:24:53 +053032#include "qdf_nbuf.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080033#define WDI_EVENT_BASE 0x100 /* Event starting number */
34
35enum WDI_EVENT {
36 WDI_EVENT_TX_STATUS = WDI_EVENT_BASE,
37 WDI_EVENT_RX_DESC,
38 WDI_EVENT_RX_DESC_REMOTE,
39 WDI_EVENT_RATE_FIND,
40 WDI_EVENT_RATE_UPDATE,
Nirav Shahdcc4c872016-07-28 11:35:26 +053041 WDI_EVENT_SW_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042 WDI_EVENT_RX_PEER_INVALID,
43 /* End of new event items */
44
45 WDI_EVENT_LAST
46};
47
48struct wdi_event_rx_peer_invalid_msg {
Nirav Shahcbc6d722016-03-01 16:24:53 +053049 qdf_nbuf_t msdu;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050 struct ieee80211_frame *wh;
51 uint8_t vdev_id;
52};
53
54#define WDI_NUM_EVENTS (WDI_EVENT_LAST - WDI_EVENT_BASE)
55
56#define WDI_EVENT_NOTIFY_BASE 0x200
57enum WDI_EVENT_NOTIFY {
58 WDI_EVENT_SUB_DEALLOCATE = WDI_EVENT_NOTIFY_BASE,
59 /* End of new notification types */
60
61 WDI_EVENT_NOTIFY_LAST
62};
63
64/* Opaque event callback */
65typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data);
66
67/* Opaque event notify */
68typedef void (*wdi_event_notify)(enum WDI_EVENT_NOTIFY notify,
69 enum WDI_EVENT event);
70
71/**
72 * @typedef wdi_event_subscribe
73 * @brief Used by consumers to subscribe to WDI event notifications.
74 * @details
75 * The event_subscribe struct includes pointers to other event_subscribe
76 * objects. These pointers are simply to simplify the management of
77 * lists of event subscribers. These pointers are set during the
78 * event_sub() function, and shall not be modified except by the
79 * WDI event management SW, until after the object's event subscription
80 * is canceled by calling event_unsub().
81 */
82
83typedef struct wdi_event_subscribe_t {
Yun Park196641d2017-04-06 22:29:34 -070084 /* subscriber event callback structure head */
85 wdi_event_cb callback;
86 /* subscriber object that processes the event callback */
87 void *context;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080088 struct {
Yun Park196641d2017-04-06 22:29:34 -070089 /*
90 * private - the event subscriber SW shall not use this struct
91 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092 struct wdi_event_subscribe_t *next;
93 struct wdi_event_subscribe_t *prev;
94 } priv;
95} wdi_event_subscribe;
96
97#endif