staging: r8712u: Merging Realtek's latest (v2.6.6). Added copyright banners.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / rtl8712 / rtl871x_event.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2010 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 _RTL871x_EVENT_H_
21 #define _RTL871x_EVENT_H_
22
23 #include "osdep_service.h"
24
25 #include "wlan_bssdef.h"
26 #include <linux/semaphore.h>
27 #include <linux/sem.h>
28
29 /*
30  * Used to report a bss has been scanned
31 */
32 struct survey_event     {
33         struct ndis_wlan_bssid_ex bss;
34 };
35
36 /*
37  * Used to report that the requested site survey has been done.
38  * bss_cnt indicates the number of bss that has been reported.
39 */
40 struct surveydone_event {
41         unsigned int    bss_cnt;
42
43 };
44
45 /*
46  * Used to report the link result of joinning the given bss
47  * join_res:
48  *  -1: authentication fail
49  *  -2: association fail
50  *  > 0: TID
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 struct stassoc_event {
61         unsigned char macaddr[6];
62         unsigned char rsvd[2];
63         int    cam_id;
64 };
65
66 struct stadel_event {
67         unsigned char macaddr[6];
68         unsigned char rsvd[2];
69 };
70
71 struct addba_event {
72         unsigned int tid;
73 };
74
75 #define GEN_EVT_CODE(event)     event ## _EVT_
76
77 struct fwevent {
78         u32     parmsize;
79         void (*event_callback)(struct _adapter *dev, u8 *pbuf);
80 };
81
82 #define C2HEVENT_SZ                     32
83 struct event_node {
84         unsigned char *node;
85         unsigned char evt_code;
86         unsigned short evt_sz;
87         /*volatile*/ int *caller_ff_tail;
88         int     caller_ff_sz;
89 };
90
91 struct c2hevent_queue {
92         /*volatile*/ int        head;
93         /*volatile*/ int        tail;
94         struct  event_node      nodes[C2HEVENT_SZ];
95         unsigned char   seq;
96 };
97
98 #define NETWORK_QUEUE_SZ        4
99
100 struct network_queue {
101         /*volatile*/ int        head;
102         /*volatile*/ int        tail;
103         struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ];
104 };
105
106 struct ADDBA_Req_Report_parm {
107         unsigned char MacAddress[ETH_ALEN];
108         unsigned short StartSeqNum;
109         unsigned char tid;
110 };
111 #include "rtl8712_event.h"
112
113 #endif /* _WLANEVENT_H_ */
114