xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8189es/include/rtw_event.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef _RTW_EVENT_H_
21 #define _RTW_EVENT_H_
22 
23 #ifdef CONFIG_H2CLBK
24 #include <h2clbk.h>
25 #endif
26 
27 /*
28 Used to report a bss has been scanned
29 
30 */
31 struct survey_event	{
32 	WLAN_BSSID_EX bss;
33 };
34 
35 /*
36 Used to report that the requested site survey has been done.
37 
38 bss_cnt indicates the number of bss that has been reported.
39 
40 
41 */
42 struct surveydone_event {
43 	unsigned int	bss_cnt;
44 
45 };
46 
47 /*
48 Used to report the link result of joinning the given bss
49 
50 
51 join_res:
52 -1: authentication fail
53 -2: association fail
54 > 0: TID
55 
56 */
57 struct joinbss_event {
58 	struct	wlan_network	network;
59 };
60 
61 /*
62 Used to report a given STA has joinned the created BSS.
63 It is used in AP/Ad-HoC(M) mode.
64 
65 
66 */
67 struct stassoc_event {
68 	unsigned char macaddr[6];
69 	unsigned char rsvd[2];
70 	int    cam_id;
71 
72 };
73 
74 struct stadel_event {
75  unsigned char macaddr[6];
76  unsigned char rsvd[2]; //for reason
77  int mac_id;
78 };
79 
80 struct addba_event
81 {
82  	unsigned int tid;
83 };
84 
85 struct wmm_event
86 {
87  	unsigned char wmm;
88 };
89 
90 #ifdef CONFIG_H2CLBK
91 struct c2hlbk_event{
92 	unsigned char mac[6];
93 	unsigned short	s0;
94 	unsigned short	s1;
95 	unsigned int	w0;
96 	unsigned char	b0;
97 	unsigned short  s2;
98 	unsigned char	b1;
99 	unsigned int	w1;
100 };
101 #endif//CONFIG_H2CLBK
102 
103 #define GEN_EVT_CODE(event)	event ## _EVT_
104 
105 
106 
107 struct fwevent {
108 	u32	parmsize;
109 	void (*event_callback)(_adapter *dev, u8 *pbuf);
110 };
111 
112 
113 #define C2HEVENT_SZ			32
114 
115 struct event_node{
116 	unsigned char *node;
117 	unsigned char evt_code;
118 	unsigned short evt_sz;
119 	volatile int	*caller_ff_tail;
120 	int	caller_ff_sz;
121 };
122 
123 struct c2hevent_queue {
124 	volatile int	head;
125 	volatile int	tail;
126 	struct	event_node	nodes[C2HEVENT_SZ];
127 	unsigned char	seq;
128 };
129 
130 #define NETWORK_QUEUE_SZ	4
131 
132 struct network_queue {
133 	volatile int	head;
134 	volatile int	tail;
135 	WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ];
136 };
137 
138 
139 #endif // _WLANEVENT_H_
140 
141