• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __WLAN_BSSDEF_H__
15 #define __WLAN_BSSDEF_H__
16 
17 #define MAX_IE_SZ	768
18 
19 #define NDIS_802_11_LENGTH_SSID         32
20 #define NDIS_802_11_LENGTH_RATES        8
21 #define NDIS_802_11_LENGTH_RATES_EX     16
22 
23 struct ndis_802_11_ssid {
24 	u32 SsidLength;
25 	u8  Ssid[32];
26 };
27 
28 enum NDIS_802_11_NETWORK_TYPE {
29 	Ndis802_11FH,
30 	Ndis802_11DS,
31 	Ndis802_11OFDM5,
32 	Ndis802_11OFDM24,
33 	Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound*/
34 };
35 
36 struct NDIS_802_11_CONFIGURATION_FH {
37 	u32 Length;             /* Length of structure */
38 	u32 HopPattern;         /* As defined by 802.11, MSB set */
39 	u32 HopSet;             /* to one if non-802.11 */
40 	u32 DwellTime;          /* units are Kusec */
41 };
42 
43 /*
44  * FW will only save the channel number in DSConfig.
45  * ODI Handler will convert the channel number to freq. number.
46  */
47 struct NDIS_802_11_CONFIGURATION {
48 	u32 Length;             /* Length of structure */
49 	u32 BeaconPeriod;       /* units are Kusec */
50 	u32 ATIMWindow;         /* units are Kusec */
51 	u32 DSConfig;           /* Frequency, units are kHz */
52 	struct NDIS_802_11_CONFIGURATION_FH FHConfig;
53 };
54 
55 enum NDIS_802_11_NETWORK_INFRASTRUCTURE {
56 	Ndis802_11IBSS,
57 	Ndis802_11Infrastructure,
58 	Ndis802_11AutoUnknown,
59 	Ndis802_11InfrastructureMax, /*Not a real value,defined as upper bound*/
60 	Ndis802_11APMode
61 };
62 
63 struct NDIS_802_11_FIXED_IEs {
64 	u8  Timestamp[8];
65 	u16 BeaconInterval;
66 	u16 Capabilities;
67 };
68 
69 struct wlan_bssid_ex {
70 	u32 Length;
71 	unsigned char  MacAddress[6];
72 	u8  Reserved[2];
73 	struct ndis_802_11_ssid  Ssid;
74 	__le32 Privacy;
75 	s32 Rssi;
76 	enum NDIS_802_11_NETWORK_TYPE  NetworkTypeInUse;
77 	struct NDIS_802_11_CONFIGURATION  Configuration;
78 	enum NDIS_802_11_NETWORK_INFRASTRUCTURE  InfrastructureMode;
79 	u8 rates[NDIS_802_11_LENGTH_RATES_EX];
80 	/* number of content bytes in EIs, which varies */
81 	u32 IELength;
82 	/*(timestamp, beacon interval, and capability information) */
83 	u8 IEs[MAX_IE_SZ];
84 };
85 
86 enum NDIS_802_11_AUTHENTICATION_MODE {
87 	Ndis802_11AuthModeOpen,
88 	Ndis802_11AuthModeShared,
89 	Ndis802_11AuthModeAutoSwitch,
90 	Ndis802_11AuthModeWPA,
91 	Ndis802_11AuthModeWPAPSK,
92 	Ndis802_11AuthModeWPANone,
93 	Ndis802_11AuthModeMax      /* Not a real mode, defined as upper bound */
94 };
95 
96 enum {
97 	Ndis802_11WEPEnabled,
98 	Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
99 	Ndis802_11WEPDisabled,
100 	Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
101 	Ndis802_11WEPKeyAbsent,
102 	Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
103 	Ndis802_11WEPNotSupported,
104 	Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
105 	Ndis802_11Encryption2Enabled,
106 	Ndis802_11Encryption2KeyAbsent,
107 	Ndis802_11Encryption3Enabled,
108 	Ndis802_11Encryption3KeyAbsent
109 };
110 
111 #define NDIS_802_11_AI_REQFI_CAPABILITIES      1
112 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL    2
113 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS  4
114 
115 #define NDIS_802_11_AI_RESFI_CAPABILITIES      1
116 #define NDIS_802_11_AI_RESFI_STATUSCODE        2
117 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID     4
118 
119 struct NDIS_802_11_AI_REQFI {
120 	u16 Capabilities;
121 	u16 ListenInterval;
122 	unsigned char CurrentAPAddress[6];
123 };
124 
125 struct NDIS_802_11_AI_RESFI {
126 	u16 Capabilities;
127 	u16 StatusCode;
128 	u16 AssociationId;
129 };
130 
131 struct NDIS_802_11_ASSOCIATION_INFORMATION {
132 	u32 Length;
133 	u16 AvailableRequestFixedIEs;
134 	struct NDIS_802_11_AI_REQFI RequestFixedIEs;
135 	u32 RequestIELength;
136 	u32 OffsetRequestIEs;
137 	u16 AvailableResponseFixedIEs;
138 	struct NDIS_802_11_AI_RESFI ResponseFixedIEs;
139 	u32 ResponseIELength;
140 	u32 OffsetResponseIEs;
141 };
142 
143 /* Key mapping keys require a BSSID*/
144 struct NDIS_802_11_KEY {
145 	u32 Length;			/* Length of this structure */
146 	u32 KeyIndex;
147 	u32 KeyLength;			/* length of key in bytes */
148 	unsigned char BSSID[6];
149 	unsigned long long KeyRSC;
150 	u8  KeyMaterial[32];		/* variable length */
151 };
152 
153 struct NDIS_802_11_REMOVE_KEY {
154 	u32 Length;			/* Length of this structure */
155 	u32 KeyIndex;
156 	unsigned char BSSID[6];
157 };
158 
159 struct NDIS_802_11_WEP {
160 	u32 Length;		  /* Length of this structure */
161 	u32 KeyIndex;		  /* 0 is the per-client key,
162 				   * 1-N are the global keys
163 				   */
164 	u32 KeyLength;		  /* length of key in bytes */
165 	u8  KeyMaterial[16];      /* variable length depending on above field */
166 };
167 
168 /* mask for authentication/integrity fields */
169 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS        0x0f
170 #define NDIS_802_11_AUTH_REQUEST_REAUTH			0x01
171 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE		0x02
172 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR		0x06
173 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR		0x0E
174 
175 /* MIC check time, 60 seconds. */
176 #define MIC_CHECK_TIME	60000000
177 
178 #ifndef Ndis802_11APMode
179 #define Ndis802_11APMode (Ndis802_11InfrastructureMax + 1)
180 #endif
181 
182 struct	wlan_network {
183 	struct list_head list;
184 	int	network_type;	/*refer to ieee80211.h for WIRELESS_11A/B/G */
185 	int	fixed;		/* set to fixed when not to be removed asi
186 				 * site-surveying
187 				 */
188 	unsigned int	last_scanned; /*timestamp for the network */
189 	int	aid;		/*will only be valid when a BSS is joined. */
190 	int	join_res;
191 	struct wlan_bssid_ex network; /*must be the last item */
192 };
193 
194 enum VRTL_CARRIER_SENSE {
195 	DISABLE_VCS,
196 	ENABLE_VCS,
197 	AUTO_VCS
198 };
199 
200 enum VCS_TYPE {
201 	NONE_VCS,
202 	RTS_CTS,
203 	CTS_TO_SELF
204 };
205 
206 #define PWR_CAM 0
207 #define PWR_MINPS 1
208 #define PWR_MAXPS 2
209 #define PWR_UAPSD 3
210 #define PWR_VOIP 4
211 
212 enum UAPSD_MAX_SP {
213 	NO_LIMIT,
214 	TWO_MSDU,
215 	FOUR_MSDU,
216 	SIX_MSDU
217 };
218 
219 #define NUM_PRE_AUTH_KEY 16
220 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
221 
222 #endif /* #ifndef WLAN_BSSDEF_H_ */
223 
224