1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2017 Realtek Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 *****************************************************************************/ 16 #ifndef _RTW_EVENT_H_ 17 #define _RTW_EVENT_H_ 18 19 #ifdef CONFIG_H2CLBK 20 #include <h2clbk.h> 21 #endif 22 23 /* 24 Used to report a bss has been scanned 25 26 */ 27 struct survey_event { 28 WLAN_BSSID_EX bss; 29 }; 30 31 /* 32 Used to report that the requested site survey has been done. 33 34 bss_cnt indicates the number of bss that has been reported. 35 36 37 */ 38 struct surveydone_event { 39 unsigned int bss_cnt; 40 41 }; 42 43 /* 44 Used to report the link result of joinning the given bss 45 46 47 join_res: 48 -1: authentication fail 49 -2: association fail 50 > 0: TID 51 52 */ 53 struct joinbss_event { 54 struct wlan_network network; 55 }; 56 57 /* 58 Used to report a given STA has joinned the created BSS. 59 It is used in AP/Ad-HoC(M) mode. 60 61 62 */ 63 struct stassoc_event { 64 unsigned char macaddr[6]; 65 }; 66 67 struct stadel_event { 68 unsigned char macaddr[6]; 69 unsigned char rsvd[2]; /* for reason */ 70 unsigned char locally_generated; 71 int mac_id; 72 }; 73 74 struct addba_event { 75 unsigned int tid; 76 }; 77 78 struct wmm_event { 79 unsigned char wmm; 80 }; 81 82 #ifdef CONFIG_H2CLBK 83 struct c2hlbk_event { 84 unsigned char mac[6]; 85 unsigned short s0; 86 unsigned short s1; 87 unsigned int w0; 88 unsigned char b0; 89 unsigned short s2; 90 unsigned char b1; 91 unsigned int w1; 92 }; 93 #endif/* CONFIG_H2CLBK */ 94 95 #define GEN_EVT_CODE(event) event ## _EVT_ 96 97 98 99 struct fwevent { 100 u32 parmsize; 101 void (*event_callback)(_adapter *dev, u8 *pbuf); 102 }; 103 104 105 #define C2HEVENT_SZ 32 106 107 struct event_node { 108 unsigned char *node; 109 unsigned char evt_code; 110 unsigned short evt_sz; 111 volatile int *caller_ff_tail; 112 int caller_ff_sz; 113 }; 114 115 struct c2hevent_queue { 116 volatile int head; 117 volatile int tail; 118 struct event_node nodes[C2HEVENT_SZ]; 119 unsigned char seq; 120 }; 121 122 #define NETWORK_QUEUE_SZ 4 123 124 struct network_queue { 125 volatile int head; 126 volatile int tail; 127 WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ]; 128 }; 129 130 131 #endif /* _WLANEVENT_H_ */ 132