1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
14 ******************************************************************************/
15 #ifndef __WLAN_BSSDEF_H__
16 #define __WLAN_BSSDEF_H__
22 #define NDIS_802_11_LENGTH_RATES 8
23 #define NDIS_802_11_LENGTH_RATES_EX 16
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
31 * Except the IELength, all other fields are fixed length. Therefore,
32 * we can define a macro to present the partial sum.
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 */
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,
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 */
68 /* bwmode 20/40 and ch_offset UP/LOW */
71 struct wlan_bssid_ex {
73 u8 MacAddress[ETH_ALEN];
75 struct cfg80211_ssid Ssid;
77 long Rssi;/* in dBM, raw data , get from PHY) */
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 */
88 u8 IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and capability info*/
91 static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
93 return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength;
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 */
101 unsigned long last_scanned; /* timestamp for the network */
103 struct wlan_bssid_ex network; /* must be the last item */
104 struct wlan_bcn_info BcnInfo;
107 enum VRTL_CARRIER_SENSE {
120 #define NUM_PRE_AUTH_KEY 16
121 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
123 #endif /* ifndef WLAN_BSSDEF_H_ */