• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ******************************************************************************/
15 #ifndef __WLAN_BSSDEF_H__
16 #define __WLAN_BSSDEF_H__
17 
18 
19 #define MAX_IE_SZ	768
20 
21 
22 #define NDIS_802_11_LENGTH_RATES        8
23 #define NDIS_802_11_LENGTH_RATES_EX     16
24 
25 /* Length is the 4 bytes multiples of the sum of
26  * sizeof(6 * sizeof(unsigned char)) + 2 + sizeof(struct ndis_802_11_ssid) +
27  * sizeof(u32) + sizeof(long) + sizeof(enum ndis_802_11_net_type) +
28  * sizeof(struct ndis_802_11_config) + sizeof(sizeof(unsigned char) *
29  * NDIS_802_11_LENGTH_RATES_EX) + IELength
30  *
31  * Except the IELength, all other fields are fixed length. Therefore,
32  * we can define a macro to present the partial sum.
33  */
34 
35 enum ndis_802_11_auth_mode {
36 	Ndis802_11AuthModeOpen,
37 	Ndis802_11AuthModeShared,
38 	Ndis802_11AuthModeAutoSwitch,
39 	Ndis802_11AuthModeWPA,
40 	Ndis802_11AuthModeWPAPSK,
41 	Ndis802_11AuthModeWPANone,
42 	dis802_11AuthModeMax       /*  upper bound */
43 };
44 
45 enum  {
46 	Ndis802_11WEPEnabled,
47 	Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
48 	Ndis802_11WEPDisabled,
49 	Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
50 	Ndis802_11WEPKeyAbsent,
51 	Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
52 	Ndis802_11WEPNotSupported,
53 	Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
54 	Ndis802_11Encryption2Enabled,
55 	Ndis802_11Encryption2KeyAbsent,
56 	Ndis802_11Encryption3Enabled,
57 	Ndis802_11Encryption3KeyAbsent,
58 };
59 
60 struct wlan_bcn_info {
61 	/* these infor get from rtw_get_encrypt_info when
62 	 *	 * translate scan to UI */
63 	u8 encryp_protocol;/* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2 */
64 	int group_cipher; /* WPA/WPA2 group cipher */
65 	int pairwise_cipher;/* WPA/WPA2/WEP pairwise cipher */
66 	int is_8021x;
67 
68 	/* bwmode 20/40 and ch_offset UP/LOW */
69 };
70 
71 struct wlan_bssid_ex {
72 	u32  Length;
73 	u8 MacAddress[ETH_ALEN];
74 	u16 reserved;
75 	struct cfg80211_ssid Ssid;
76 	u32  Privacy;
77 	long  Rssi;/* in dBM, raw data , get from PHY) */
78 	u16 beacon_interval;
79 	u16 capability;
80 	u64 tsf;
81 	u32 ATIMWindow;         /*  units are Kusec */
82 	u32 DSConfig;           /*  Frequency, units are kHz */
83 	enum nl80211_iftype ifmode;
84 	unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
85 	u8 SignalStrength;/* in percentage */
86 	u8 SignalQuality;/* in percentage */
87 	u32  IELength;
88 	u8  IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and capability info*/
89 } __packed;
90 
get_wlan_bssid_ex_sz(struct wlan_bssid_ex * bss)91 static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
92 {
93 	return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength;
94 }
95 
96 struct	wlan_network {
97 	struct list_head	list;
98 	int	network_type;	/* refer to ieee80211.h for 11A/B/G */
99 	/*  set to fixed when not to be removed as site-surveying */
100 	int	fixed;
101 	unsigned long	last_scanned; /* timestamp for the network */
102 	int	join_res;
103 	struct wlan_bssid_ex	network; /* must be the last item */
104 	struct wlan_bcn_info	BcnInfo;
105 };
106 
107 enum VRTL_CARRIER_SENSE {
108 	DISABLE_VCS,
109 	ENABLE_VCS,
110 	AUTO_VCS
111 };
112 
113 enum VCS_TYPE {
114 	NONE_VCS,
115 	RTS_CTS,
116 	CTS_TO_SELF
117 };
118 
119 /* john */
120 #define NUM_PRE_AUTH_KEY 16
121 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
122 
123 #endif /* ifndef WLAN_BSSDEF_H_ */
124