]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/rtl8723au/include/wlan_bssdef.h
Merge 3.16-rc2 into staging-next
[karo-tx-linux.git] / drivers / staging / rtl8723au / include / wlan_bssdef.h
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 /*  Key mapping keys require a BSSID */
61 struct ndis_802_11_key {
62         u32 Length;             /*  Length of this structure */
63         u32 KeyIndex;
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 */
68 };
69
70 struct wlan_phy_info {
71         u8      SignalStrength;/* in percentage) */
72         u8      SignalQuality;/* in percentage) */
73         u8      Optimum_antenna;  /* for Antenna diversity */
74         u8      Reserved_0;
75 };
76
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 */
83         int is_8021x;
84
85         /* bwmode 20/40 and ch_offset UP/LOW */
86 };
87
88 struct wlan_bssid_ex {
89         u32  Length;
90         u8 MacAddress[ETH_ALEN];
91         u16 reserved;
92         struct cfg80211_ssid Ssid;
93         u32  Privacy;
94         long  Rssi;/* in dBM, raw data , get from PHY) */
95         u16 beacon_interval;
96         u16 capability;
97         u64 tsf;
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;
103         u32  IELength;
104         u8  IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and capability info*/
105 } __packed;
106
107 static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
108 {
109         return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength;
110 }
111
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 */
116         int     fixed;
117         unsigned long   last_scanned; /* timestamp for the network */
118         int     aid;            /* will only be valid when a BSS is joined. */
119         int     join_res;
120         struct wlan_bssid_ex    network; /* must be the last item */
121         struct wlan_bcn_info    BcnInfo;
122 };
123
124 enum VRTL_CARRIER_SENSE {
125         DISABLE_VCS,
126         ENABLE_VCS,
127         AUTO_VCS
128 };
129
130 enum VCS_TYPE {
131         NONE_VCS,
132         RTS_CTS,
133         CTS_TO_SELF
134 };
135
136 /* john */
137 #define NUM_PRE_AUTH_KEY 16
138 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
139
140 #endif /* ifndef WLAN_BSSDEF_H_ */