blob: fcf771bbce562b49813148a97924d4e0ec0aea17 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Rakshith Suresh Patkard31f1e52019-05-09 13:25:00 +05302 * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef _WDI_EVENT_H_
20#define _WDI_EVENT_H_
21
22#include "athdefs.h"
Nirav Shahcbc6d722016-03-01 16:24:53 +053023#include "qdf_nbuf.h"
Rakshith Suresh Patkard31f1e52019-05-09 13:25:00 +053024#include <cdp_txrx_stats_struct.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080025
Venkata Sharath Chandra Manchala1240fc72017-10-26 17:32:29 -070026#define WDI_NO_VAL (-1)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080027
28struct wdi_event_rx_peer_invalid_msg {
Nirav Shahcbc6d722016-03-01 16:24:53 +053029 qdf_nbuf_t msdu;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080030 struct ieee80211_frame *wh;
31 uint8_t vdev_id;
32};
33
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080034#define WDI_EVENT_NOTIFY_BASE 0x200
35enum WDI_EVENT_NOTIFY {
36 WDI_EVENT_SUB_DEALLOCATE = WDI_EVENT_NOTIFY_BASE,
37 /* End of new notification types */
38
39 WDI_EVENT_NOTIFY_LAST
40};
41
42/* Opaque event callback */
Venkata Sharath Chandra Manchala1240fc72017-10-26 17:32:29 -070043typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data,
44 u_int16_t peer_id, uint32_t status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080045
46/* Opaque event notify */
47typedef void (*wdi_event_notify)(enum WDI_EVENT_NOTIFY notify,
48 enum WDI_EVENT event);
49
50/**
51 * @typedef wdi_event_subscribe
52 * @brief Used by consumers to subscribe to WDI event notifications.
53 * @details
54 * The event_subscribe struct includes pointers to other event_subscribe
55 * objects. These pointers are simply to simplify the management of
56 * lists of event subscribers. These pointers are set during the
57 * event_sub() function, and shall not be modified except by the
58 * WDI event management SW, until after the object's event subscription
59 * is canceled by calling event_unsub().
60 */
61
62typedef struct wdi_event_subscribe_t {
Yun Park196641d2017-04-06 22:29:34 -070063 /* subscriber event callback structure head */
64 wdi_event_cb callback;
65 /* subscriber object that processes the event callback */
66 void *context;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080067 struct {
Yun Park196641d2017-04-06 22:29:34 -070068 /*
69 * private - the event subscriber SW shall not use this struct
70 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080071 struct wdi_event_subscribe_t *next;
72 struct wdi_event_subscribe_t *prev;
73 } priv;
74} wdi_event_subscribe;
75
76#endif