net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / 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
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 };
70
71 struct stadel_event {
72         unsigned char macaddr[6];
73         unsigned char rsvd[2]; /* for reason */
74         unsigned char locally_generated;
75         int mac_id;
76 };
77
78 struct addba_event {
79         unsigned int tid;
80 };
81
82 struct wmm_event {
83         unsigned char wmm;
84 };
85
86 #ifdef CONFIG_H2CLBK
87 struct c2hlbk_event {
88         unsigned char mac[6];
89         unsigned short  s0;
90         unsigned short  s1;
91         unsigned int    w0;
92         unsigned char   b0;
93         unsigned short  s2;
94         unsigned char   b1;
95         unsigned int    w1;
96 };
97 #endif/* CONFIG_H2CLBK */
98
99 #define GEN_EVT_CODE(event)     event ## _EVT_
100
101
102
103 struct fwevent {
104         u32     parmsize;
105         void (*event_callback)(_adapter *dev, u8 *pbuf);
106 };
107
108
109 #define C2HEVENT_SZ                     32
110
111 struct event_node {
112         unsigned char *node;
113         unsigned char evt_code;
114         unsigned short evt_sz;
115         volatile int    *caller_ff_tail;
116         int     caller_ff_sz;
117 };
118
119 struct c2hevent_queue {
120         volatile int    head;
121         volatile int    tail;
122         struct  event_node      nodes[C2HEVENT_SZ];
123         unsigned char   seq;
124 };
125
126 #define NETWORK_QUEUE_SZ        4
127
128 struct network_queue {
129         volatile int    head;
130         volatile int    tail;
131         WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ];
132 };
133
134
135 #endif /* _WLANEVENT_H_ */