xref: /wlan-driver/qcacld-3.0/core/dp/txrx/wdi_event.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
3  *
4  * 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 
19 #ifndef _WDI_EVENT_H_
20 #define _WDI_EVENT_H_
21 
22 #include "athdefs.h"
23 #include "qdf_nbuf.h"
24 #include <cdp_txrx_stats_struct.h>
25 
26 #define WDI_NO_VAL (-1)
27 
28 struct wdi_event_rx_peer_invalid_msg {
29 	qdf_nbuf_t msdu;
30 	struct ieee80211_frame *wh;
31 	uint8_t vdev_id;
32 };
33 
34 #define WDI_EVENT_NOTIFY_BASE   0x200
35 enum 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 */
43 typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data,
44 					u_int16_t peer_id, uint32_t status);
45 
46 /* Opaque event notify */
47 typedef 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 
62 typedef struct wdi_event_subscribe_t {
63 	/* subscriber event callback structure head */
64 	wdi_event_cb callback;
65 	/* subscriber object that processes the event callback */
66 	void *context;
67 	struct {
68 		/*
69 		 * private - the event subscriber SW shall not use this struct
70 		 */
71 		struct wdi_event_subscribe_t *next;
72 		struct wdi_event_subscribe_t *prev;
73 	} priv;
74 } wdi_event_subscribe;
75 
76 #endif
77