add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rtl8192du / include / rtw_event.h
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 #include <drv_conf.h>
23 #include <osdep_service.h>
24
25 #ifndef CONFIG_RTL8711FW
26 #ifdef PLATFORM_LINUX
27 #include <wlan_bssdef.h>
28 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
29 #include <asm/semaphore.h>
30 #else
31 #include <linux/semaphore.h>
32 #endif
33 #include <linux/sem.h>
34 #endif
35 #else
36 #include <wlan_bssdef.h>
37 #endif//CONFIG_RTL8711FW
38
39
40
41 #ifdef CONFIG_H2CLBK
42 #include <h2clbk.h>
43 #endif
44
45 /*
46 Used to report a bss has been scanned
47
48 */
49 struct survey_event     {
50         WLAN_BSSID_EX bss;
51 };
52
53 /*
54 Used to report that the requested site survey has been done.
55
56 bss_cnt indicates the number of bss that has been reported.
57
58
59 */
60 struct surveydone_event {
61         unsigned int    bss_cnt;        
62         
63 };
64
65 /*
66 Used to report the link result of joinning the given bss
67
68
69 join_res:
70 -1: authentication fail
71 -2: association fail
72 > 0: TID
73
74 */
75 struct joinbss_event {
76         struct  wlan_network    network;
77 };
78
79 /*
80 Used to report a given STA has joinned the created BSS.
81 It is used in AP/Ad-HoC(M) mode.
82
83
84 */
85 struct stassoc_event {
86         unsigned char macaddr[6];
87         unsigned char rsvd[2];
88         int    cam_id;
89         
90 };
91
92 struct stadel_event {
93  unsigned char macaddr[6];
94  unsigned char rsvd[2]; //for reason
95  int mac_id;
96 };
97
98 struct addba_event
99 {
100         unsigned int tid;
101 };
102
103
104 #ifdef CONFIG_H2CLBK
105 struct c2hlbk_event{
106         unsigned char mac[6];
107         unsigned short  s0;
108         unsigned short  s1;
109         unsigned int    w0;
110         unsigned char   b0;
111         unsigned short  s2;
112         unsigned char   b1;
113         unsigned int    w1;     
114 };
115 #endif//CONFIG_H2CLBK
116
117 #define GEN_EVT_CODE(event)     event ## _EVT_
118
119
120
121 struct fwevent {
122         u32     parmsize;
123         void (*event_callback)(_adapter *dev, u8 *pbuf);
124 };
125
126
127 #define C2HEVENT_SZ                     32      
128
129 struct event_node{
130         unsigned char *node;
131         unsigned char evt_code;
132         unsigned short evt_sz;
133         volatile int    *caller_ff_tail;
134         int     caller_ff_sz;
135 };
136
137 struct c2hevent_queue {
138         volatile int    head;
139         volatile int    tail;
140         struct  event_node      nodes[C2HEVENT_SZ];
141         unsigned char   seq;
142 };
143
144 #define NETWORK_QUEUE_SZ        4
145
146 struct network_queue {
147         volatile int    head;
148         volatile int    tail;
149         WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ];       
150 };
151
152
153 #endif // _WLANEVENT_H_
154