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 /* Key mapping keys require a BSSID */
61 struct ndis_802_11_key {
62 u32 Length; /* Length of this structure */
64 u32 KeyLength; /* length of key in bytes */
65 unsigned char BSSID[6];
66 unsigned long long KeyRSC;
67 u8 KeyMaterial[32]; /* variable length depending on above field */
70 struct wlan_phy_info {
71 u8 SignalStrength;/* in percentage) */
72 u8 SignalQuality;/* in percentage) */
73 u8 Optimum_antenna; /* for Antenna diversity */
77 struct wlan_bcn_info {
78 /* these infor get from rtw_get_encrypt_info when
79 * * translate scan to UI */
80 u8 encryp_protocol;/* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2 */
81 int group_cipher; /* WPA/WPA2 group cipher */
82 int pairwise_cipher;/* WPA/WPA2/WEP pairwise cipher */
85 /* bwmode 20/40 and ch_offset UP/LOW */
88 struct wlan_bssid_ex {
90 u8 MacAddress[ETH_ALEN];
92 struct cfg80211_ssid Ssid;
94 long Rssi;/* in dBM, raw data , get from PHY) */
98 u32 ATIMWindow; /* units are Kusec */
99 u32 DSConfig; /* Frequency, units are kHz */
100 enum nl80211_iftype ifmode;
101 unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
102 struct wlan_phy_info PhyInfo;
104 u8 IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and capability info*/
107 static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
109 return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength;
112 struct wlan_network {
113 struct list_head list;
114 int network_type; /* refer to ieee80211.h for 11A/B/G */
115 /* set to fixed when not to be removed as site-surveying */
117 unsigned long last_scanned; /* timestamp for the network */
118 int aid; /* will only be valid when a BSS is joined. */
120 struct wlan_bssid_ex network; /* must be the last item */
121 struct wlan_bcn_info BcnInfo;
124 enum VRTL_CARRIER_SENSE {
137 #define NUM_PRE_AUTH_KEY 16
138 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
140 #endif /* ifndef WLAN_BSSDEF_H_ */