1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. 5 * 6 * Modifications for inclusion into the Linux staging tree are 7 * Copyright(c) 2010 Larry Finger. All rights reserved. 8 * 9 * Contact information: 10 * WLAN FAE <wlanfae@realtek.com> 11 * Larry Finger <Larry.Finger@lwfinger.net> 12 * 13 ******************************************************************************/ 14 #ifndef _RTL871x_EVENT_H_ 15 #define _RTL871x_EVENT_H_ 16 17 #include "osdep_service.h" 18 19 #include "wlan_bssdef.h" 20 #include <linux/semaphore.h> 21 #include <linux/sem.h> 22 23 /* 24 * Used to report a bss has been scanned 25 */ 26 struct survey_event { 27 struct wlan_bssid_ex bss; 28 }; 29 30 /* 31 * Used to report that the requested site survey has been done. 32 * bss_cnt indicates the number of bss that has been reported. 33 */ 34 struct surveydone_event { 35 unsigned int bss_cnt; 36 37 }; 38 39 /* 40 * Used to report the link result of joinning the given bss 41 * join_res: 42 * -1: authentication fail 43 * -2: association fail 44 * > 0: TID 45 */ 46 struct joinbss_event { 47 struct wlan_network network; 48 }; 49 50 /* 51 * Used to report a given STA has joinned the created BSS. 52 * It is used in AP/Ad-HoC(M) mode. 53 */ 54 struct stassoc_event { 55 unsigned char macaddr[6]; 56 unsigned char rsvd[2]; 57 __le32 cam_id; 58 }; 59 60 struct stadel_event { 61 unsigned char macaddr[6]; 62 unsigned char rsvd[2]; 63 }; 64 65 struct addba_event { 66 unsigned int tid; 67 }; 68 69 #define GEN_EVT_CODE(event) event ## _EVT_ 70 71 struct fwevent { 72 u32 parmsize; 73 void (*event_callback)(struct _adapter *dev, u8 *pbuf); 74 }; 75 76 #define C2HEVENT_SZ 32 77 struct event_node { 78 unsigned char *node; 79 unsigned char evt_code; 80 unsigned short evt_sz; 81 /*volatile*/ int *caller_ff_tail; 82 int caller_ff_sz; 83 }; 84 85 struct c2hevent_queue { 86 /*volatile*/ int head; 87 /*volatile*/ int tail; 88 struct event_node nodes[C2HEVENT_SZ]; 89 unsigned char seq; 90 }; 91 92 #define NETWORK_QUEUE_SZ 4 93 94 struct network_queue { 95 /*volatile*/ int head; 96 /*volatile*/ int tail; 97 struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ]; 98 }; 99 100 struct ADDBA_Req_Report_parm { 101 unsigned char MacAddress[ETH_ALEN]; 102 unsigned short StartSeqNum; 103 unsigned char tid; 104 }; 105 #include "rtl8712_event.h" 106 107 #endif /* _WLANEVENT_H_ */ 108 109