xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8822bs/include/rtw_event.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  *****************************************************************************/
15 #ifndef _RTW_EVENT_H_
16 #define _RTW_EVENT_H_
17 
18 #ifdef CONFIG_H2CLBK
19 	#include <h2clbk.h>
20 #endif
21 
22 /*
23 Used to report a bss has been scanned
24 
25 */
26 struct survey_event	{
27 	WLAN_BSSID_EX bss;
28 };
29 
30 /*
31 Used to report that the requested site survey has been done.
32 
33 bss_cnt indicates the number of bss that has been reported.
34 
35 
36 */
37 struct surveydone_event {
38 	unsigned int	bss_cnt;
39 	bool acs; /* aim to trigger channel selection */
40 };
41 
42 /*
43 Used to report the link result of joinning the given bss
44 
45 
46 join_res:
47 -1: authentication fail
48 -2: association fail
49 > 0: TID
50 
51 */
52 struct joinbss_event {
53 	struct	wlan_network	network;
54 };
55 
56 /*
57 Used to report a given STA has joinned the created BSS.
58 It is used in AP/Ad-HoC(M) mode.
59 
60 
61 */
62 struct stassoc_event {
63 	unsigned char macaddr[6];
64 };
65 
66 struct stadel_event {
67 	unsigned char macaddr[6];
68 	unsigned char rsvd[2]; /* for reason */
69 	unsigned char locally_generated;
70 	int mac_id;
71 };
72 
73 struct addba_event {
74 	unsigned int tid;
75 };
76 
77 struct wmm_event {
78 	unsigned char wmm;
79 };
80 
81 #ifdef CONFIG_H2CLBK
82 struct c2hlbk_event {
83 	unsigned char mac[6];
84 	unsigned short	s0;
85 	unsigned short	s1;
86 	unsigned int	w0;
87 	unsigned char	b0;
88 	unsigned short  s2;
89 	unsigned char	b1;
90 	unsigned int	w1;
91 };
92 #endif/* CONFIG_H2CLBK */
93 
94 #define GEN_EVT_CODE(event)	event ## _EVT_
95 
96 
97 
98 struct fwevent {
99 	u32	parmsize;
100 	void (*event_callback)(_adapter *dev, u8 *pbuf);
101 };
102 
103 
104 #define C2HEVENT_SZ			32
105 
106 struct event_node {
107 	unsigned char *node;
108 	unsigned char evt_code;
109 	unsigned short evt_sz;
110 	volatile int	*caller_ff_tail;
111 	int	caller_ff_sz;
112 };
113 
114 struct c2hevent_queue {
115 	volatile int	head;
116 	volatile int	tail;
117 	struct	event_node	nodes[C2HEVENT_SZ];
118 	unsigned char	seq;
119 };
120 
121 #define NETWORK_QUEUE_SZ	4
122 
123 struct network_queue {
124 	volatile int	head;
125 	volatile int	tail;
126 	WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ];
127 };
128 
129 
130 #endif /* _WLANEVENT_H_ */
131