Merge branch 'topic/aoa' into to-push
[sfrench/cifs-2.6.git] / drivers / staging / winbond / bssdscpt.h
1 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 //      bssdscpt.c
3 //              BSS descriptor data base
4 //      history :
5 //
6 //      Description:
7 //              BSS descriptor data base will store the information of the stations at the
8 //              surrounding environment. The first entry( psBSS(0) ) will not be used and the
9 //              second one( psBSS(1) ) will be used for the broadcast address.
10 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11
12 //#define MAX_ACC_RSSI_COUNT            10
13 #define MAX_ACC_RSSI_COUNT              6
14
15 ///////////////////////////////////////////////////////////////////////////
16 //
17 // BSS Description set Element , to store scan received Beacon information
18 //
19 // Our's differs slightly from the specs. The specify a PHY_Parameter_Set.
20 // Since we're only doing a DS design right now, we just have a DS structure.
21 //////////////////////////////////////////////////////////////////////////////
22 typedef struct BSSDescriptionElement
23 {
24         u32             SlotValid;
25         u32             PowerSaveMode;
26         RXLAYER1        RxLayer1;
27
28     u8          abPeerAddress[ MAC_ADDR_LENGTH + 2 ]; // peer MAC Address associated with this session. 6-OCTET value
29     u32         dwBgScanStamp;          // BgScan Sequence Counter stamp, record psROAM->dwScanCounter.
30
31         u16             Beacon_Period;
32         u16             wATIM_Window;
33
34     u8          abBssID[ MAC_ADDR_LENGTH + 2 ];                         // 6B
35
36     u8          bBssType;
37     u8          DTIM_Period;        // 1 octet usually from TIM element, if present
38         u8              boInTimerHandler;
39         u8              boERP;                  // analysis ERP or (extended) supported rate element
40
41         u8              Timestamp[8];
42         u8              BasicRate[32];
43         u8              OperationalRate[32];
44         u32             dwBasicRateBitmap;                      //bit map, retrieve from SupportedRateSet
45         u32             dwOperationalRateBitmap;        //bit map, retrieve from SupportedRateSet and
46                                                                                 // ExtendedSupportedRateSet
47         // For RSSI calculating
48         u32             HalRssi[MAX_ACC_RSSI_COUNT]; // Encode. It must use MACRO of HAL to get the LNA and AGC data
49         u32             HalRssiIndex;
50
51         ////From beacon/probe response
52     struct SSID_Element SSID;                           // 34B
53         u8      reserved_1[ 2 ];
54
55     struct Capability_Information_Element   CapabilityInformation;  // 2B
56         u8      reserved_2[ 2 ];
57
58     struct CF_Parameter_Set_Element    CF_Parameter_Set;                // 8B
59     struct IBSS_Parameter_Set_Element  IBSS_Parameter_Set;              // 4B
60     struct TIM_Element                 TIM_Element_Set;                         // 256B
61
62     struct DS_Parameter_Set_Element    DS_Parameter_Set;                // 3B
63         u8      reserved_3;
64
65         struct ERP_Information_Element          ERP_Information_Set;    // 3B
66         u8      reserved_4;
67
68     struct Supported_Rates_Element     SupportedRateSet;                        // 10B
69         u8      reserved_5[2];
70
71         struct Extended_Supported_Rates_Element ExtendedSupportedRateSet;       // 257B
72         u8      reserved_6[3];
73
74         u8      band;
75         u8      reserved_7[3];
76
77         // for MLME module
78     u16         wState;                 // the current state of the system
79         u16             wIndex;                 // THIS BSS element entry index
80
81         void*   psAdapter;              // pointer to THIS Adapter
82         OS_TIMER        nTimer;  // MLME timer
83
84     // Authentication
85     u16         wAuthAlgo;      // peer MAC MLME use Auth algorithm, default OPEN_AUTH
86     u16         wAuthSeqNum;    // current local MAC sendout AuthReq sequence number
87
88         u8              auth_challengeText[128];
89
90         ////For XP:
91     u32         ies_len;                // information element length
92     u8          ies[256];               // information element
93
94         ////For WPA
95         u8      RsnIe_Type[2];          //added by ws for distinguish WPA and WPA2 05/14/04
96         u8      RsnIe_len;
97     u8  Rsn_Num;
98
99     // to record the rsn cipher suites,addded by ws 09/05/04
100         SUITE_SELECTOR                  group_cipher; // 4B
101         SUITE_SELECTOR                  pairwise_key_cipher_suites[WLAN_MAX_PAIRWISE_CIPHER_SUITE_COUNT];
102         SUITE_SELECTOR                  auth_key_mgt_suites[WLAN_MAX_AUTH_KEY_MGT_SUITE_LIST_COUNT];
103
104         u16                                     pairwise_key_cipher_suite_count;
105         u16                                     auth_key_mgt_suite_count;
106
107         u8                                      pairwise_key_cipher_suite_selected;
108         u8                                      auth_key_mgt_suite_selected;
109         u8                                      reserved_8[2];
110
111         struct RSN_Capability_Element  rsn_capabilities; // 2B
112         u8                                      reserved_9[2];
113
114     //to record the rsn cipher suites for WPA2
115     #ifdef _WPA2_
116         u32                                     pre_auth;               //added by WS for distinguish for 05/04/04
117     SUITE_SELECTOR                      wpa2_group_cipher; // 4B
118         SUITE_SELECTOR                  wpa2_pairwise_key_cipher_suites[WLAN_MAX_PAIRWISE_CIPHER_SUITE_COUNT];
119         SUITE_SELECTOR                  wpa2_auth_key_mgt_suites[WLAN_MAX_AUTH_KEY_MGT_SUITE_LIST_COUNT];
120
121         u16                                     wpa2_pairwise_key_cipher_suite_count;
122         u16                                     wpa2_auth_key_mgt_suite_count;
123
124         u8                                      wpa2_pairwise_key_cipher_suite_selected;
125         u8                                      wpa2_auth_key_mgt_suite_selected;
126         u8                                      reserved_10[2];
127
128         struct RSN_Capability_Element  wpa2_rsn_capabilities; // 2B
129         u8                                      reserved_11[2];
130     #endif //endif _WPA2_
131
132         //For Replay protection
133 //      u8              PairwiseTSC[6];
134 //      u8              GroupTSC[6];
135
136         ////For up-to-date
137         u32             ScanTimeStamp;  //for the decision whether the station/AP(may exist at
138                                                         //different channels) has left. It must be detected by
139                                                         //scanning. Local device may connected or disconnected.
140         u32             BssTimeStamp;   //Only for the decision whether the station/AP(exist in
141                                                         //the same channel, and no scanning) if local device has
142                                                         //connected successfully.
143
144         // 20061108 Add for storing WPS_IE. [E id][Length][OUI][Data]
145         u8              WPS_IE_Data[MAX_IE_APPEND_SIZE];
146         u16             WPS_IE_length;
147         u16             WPS_IE_length_tmp; // For verify there is an WPS_IE in Beacon or probe response
148
149 } WB_BSSDESCRIPTION, *PWB_BSSDESCRIPTION;
150
151 #define wBSSConnectedSTA(Adapter)             \
152     ((u16)(Adapter)->sLocalPara.wConnectedSTAindex)
153
154 #define psBSS(i)                        (&(Adapter->asBSSDescriptElement[(i)]))
155
156