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