blob: 7ce213b9c59950b60648077b655e4b73aac0ddca [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
Venkata Sharath Chandra Manchala1240fc72017-10-26 17:32:29 -070035#define WDI_NO_VAL (-1)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036enum WDI_EVENT {
37 WDI_EVENT_TX_STATUS = WDI_EVENT_BASE,
38 WDI_EVENT_RX_DESC,
39 WDI_EVENT_RX_DESC_REMOTE,
40 WDI_EVENT_RATE_FIND,
41 WDI_EVENT_RATE_UPDATE,
Nirav Shahdcc4c872016-07-28 11:35:26 +053042 WDI_EVENT_SW_EVENT,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080043 WDI_EVENT_RX_PEER_INVALID,
Venkata Sharath Chandra Manchala1240fc72017-10-26 17:32:29 -070044 /* From WIN definations */
45 WDI_EVENT_LITE_RX,
46 WDI_EVENT_LITE_T2H,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080047 /* End of new event items */
48
49 WDI_EVENT_LAST
50};
51
52struct wdi_event_rx_peer_invalid_msg {
Nirav Shahcbc6d722016-03-01 16:24:53 +053053 qdf_nbuf_t msdu;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054 struct ieee80211_frame *wh;
55 uint8_t vdev_id;
56};
57
58#define WDI_NUM_EVENTS (WDI_EVENT_LAST - WDI_EVENT_BASE)
59
60#define WDI_EVENT_NOTIFY_BASE 0x200
61enum WDI_EVENT_NOTIFY {
62 WDI_EVENT_SUB_DEALLOCATE = WDI_EVENT_NOTIFY_BASE,
63 /* End of new notification types */
64
65 WDI_EVENT_NOTIFY_LAST
66};
67
68/* Opaque event callback */
Venkata Sharath Chandra Manchala1240fc72017-10-26 17:32:29 -070069typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data,
70 u_int16_t peer_id, uint32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080071
72/* Opaque event notify */
73typedef void (*wdi_event_notify)(enum WDI_EVENT_NOTIFY notify,
74 enum WDI_EVENT event);
75
76/**
77 * @typedef wdi_event_subscribe
78 * @brief Used by consumers to subscribe to WDI event notifications.
79 * @details
80 * The event_subscribe struct includes pointers to other event_subscribe
81 * objects. These pointers are simply to simplify the management of
82 * lists of event subscribers. These pointers are set during the
83 * event_sub() function, and shall not be modified except by the
84 * WDI event management SW, until after the object's event subscription
85 * is canceled by calling event_unsub().
86 */
87
88typedef struct wdi_event_subscribe_t {
Yun Park196641d2017-04-06 22:29:34 -070089 /* subscriber event callback structure head */
90 wdi_event_cb callback;
91 /* subscriber object that processes the event callback */
92 void *context;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080093 struct {
Yun Park196641d2017-04-06 22:29:34 -070094 /*
95 * private - the event subscriber SW shall not use this struct
96 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080097 struct wdi_event_subscribe_t *next;
98 struct wdi_event_subscribe_t *prev;
99 } priv;
100} wdi_event_subscribe;
101
102#endif