aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/vt6655/vntwifi.h
blob: 2854dfcb19aa4a29e25434d8722ad6a615a4bb14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *
 * File: vntwifi.h
 *
 * Purpose: export VNT Host WiFi library function
 *
 * Author: Yiching Chen
 *
 * Date: Jan 7, 2004
 *
 */

#ifndef __VNTWIFI_H__
#define __VNTWIFI_H__

#include "ttype.h"
#include "80211mgr.h"
#include "card.h"
#include "wpa2.h"

/*---------------------  Export Definitions -------------------------*/
#define RATE_1M         0
#define RATE_2M         1
#define RATE_5M         2
#define RATE_11M        3
#define RATE_6M         4
#define RATE_9M         5
#define RATE_12M        6
#define RATE_18M        7
#define RATE_24M        8
#define RATE_36M        9
#define RATE_48M       10
#define RATE_54M       11
#define RATE_AUTO      12
#define MAX_RATE       12

// key CipherSuite
#define KEY_CTL_WEP         0x00
#define KEY_CTL_NONE        0x01
#define KEY_CTL_TKIP        0x02
#define KEY_CTL_CCMP        0x03
#define KEY_CTL_INVALID     0xFF

#define CHANNEL_MAX_24G         14

#define MAX_BSS_NUM             42

// Pre-configured Authenticaiton Mode (from XP)
typedef enum tagWMAC_AUTHENTICATION_MODE {

    WMAC_AUTH_OPEN,
    WMAC_AUTH_SHAREKEY,
    WMAC_AUTH_AUTO,
    WMAC_AUTH_WPA,
    WMAC_AUTH_WPAPSK,
    WMAC_AUTH_WPANONE,
    WMAC_AUTH_WPA2,
    WMAC_AUTH_WPA2PSK,
    WMAC_AUTH_MAX       // Not a real mode, defined as upper bound

} WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE;

typedef enum tagWMAC_ENCRYPTION_MODE {

    WMAC_ENCRYPTION_WEPEnabled,
    WMAC_ENCRYPTION_WEPDisabled,
    WMAC_ENCRYPTION_WEPKeyAbsent,
    WMAC_ENCRYPTION_WEPNotSupported,
    WMAC_ENCRYPTION_TKIPEnabled,
    WMAC_ENCRYPTION_TKIPKeyAbsent,
    WMAC_ENCRYPTION_AESEnabled,
    WMAC_ENCRYPTION_AESKeyAbsent

} WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE;

// Pre-configured Mode (from XP)

typedef enum tagWMAC_CONFIG_MODE {

    WMAC_CONFIG_ESS_STA = 0,
    WMAC_CONFIG_IBSS_STA,
    WMAC_CONFIG_AUTO,
    WMAC_CONFIG_AP

} WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE;



typedef enum tagWMAC_POWER_MODE {

    WMAC_POWER_CAM,
    WMAC_POWER_FAST,
    WMAC_POWER_MAX

} WMAC_POWER_MODE, *PWMAC_POWER_MODE;

#define VNTWIFIbIsShortSlotTime(wCapInfo)               \
        WLAN_GET_CAP_INFO_SHORTSLOTTIME(wCapInfo)       \

#define VNTWIFIbIsProtectMode(byERP)                    \
        ((byERP & WLAN_EID_ERP_USE_PROTECTION) != 0)    \

#define VNTWIFIbIsBarkerMode(byERP)                     \
        ((byERP & WLAN_EID_ERP_BARKER_MODE) != 0)       \

#define VNTWIFIbIsShortPreamble(wCapInfo)               \
        WLAN_GET_CAP_INFO_SHORTPREAMBLE(wCapInfo)       \

#define VNTWIFIbIsEncryption(wCapInfo)                  \
        WLAN_GET_CAP_INFO_PRIVACY(wCapInfo)             \

#define VNTWIFIbIsESS(wCapInfo)                         \
        WLAN_GET_CAP_INFO_ESS(wCapInfo)                 \


/*---------------------  Export Classes  ----------------------------*/

/*---------------------  Export Variables  --------------------------*/


/*---------------------  Export Types  ------------------------------*/


/*---------------------  Export Functions  --------------------------*/

VOID
VNTWIFIvSetIBSSParameter (
    IN PVOID pMgmtHandle,
    IN WORD  wBeaconPeriod,
    IN WORD  wATIMWindow,
    IN UINT  uChannel
    );

VOID
VNTWIFIvSetOPMode (
    IN PVOID pMgmtHandle,
    IN WMAC_CONFIG_MODE eOPMode
    );

PWLAN_IE_SSID
VNTWIFIpGetCurrentSSID(
    IN PVOID pMgmtHandle
    );

UINT
VNTWIFIpGetCurrentChannel(
    IN PVOID pMgmtHandle
    );

WORD
VNTWIFIwGetAssocID (
    IN PVOID pMgmtHandle
    );

BYTE
VNTWIFIbyGetMaxSupportRate (
    IN PWLAN_IE_SUPP_RATES pSupportRateIEs,
    IN PWLAN_IE_SUPP_RATES pExtSupportRateIEs
    );

BYTE
VNTWIFIbyGetACKTxRate (
    IN BYTE byRxDataRate,
    IN PWLAN_IE_SUPP_RATES pSupportRateIEs,
    IN PWLAN_IE_SUPP_RATES pExtSupportRateIEs
    );

VOID
VNTWIFIvSetAuthenticationMode (
    IN PVOID pMgmtHandle,
    IN WMAC_AUTHENTICATION_MODE eAuthMode
    );

VOID
VNTWIFIvSetEncryptionMode (
    IN PVOID pMgmtHandle,
    IN WMAC_ENCRYPTION_MODE eEncryptionMode
    );


BOOL
VNTWIFIbConfigPhyMode(
    IN PVOID pMgmtHandle,
    IN CARD_PHY_TYPE ePhyType
    );

VOID
VNTWIFIbGetConfigPhyMode(
    IN  PVOID pMgmtHandle,
    OUT PVOID pePhyType
    );

VOID
VNTWIFIvQueryBSSList(
    IN PVOID    pMgmtHandle,
    OUT PUINT   puBSSCount,
    OUT PVOID   *pvFirstBSS
    );




VOID
VNTWIFIvGetNextBSS (
    IN PVOID            pMgmtHandle,
    IN PVOID            pvCurrentBSS,
    OUT PVOID           *pvNextBSS
    );



VOID
VNTWIFIvUpdateNodeTxCounter(
    IN PVOID    pMgmtHandle,
    IN PBYTE    pbyDestAddress,
    IN BOOL     bTxOk,
    IN WORD     wRate,
    IN PBYTE    pbyTxFailCount
    );


VOID
VNTWIFIvGetTxRate(
    IN PVOID    pMgmtHandle,
    IN PBYTE    pbyDestAddress,
    OUT PWORD   pwTxDataRate,
    OUT PBYTE   pbyACKRate,
    OUT PBYTE   pbyCCKBasicRate,
    OUT PBYTE   pbyOFDMBasicRate
    );
/*
BOOL
VNTWIFIbInit(
    IN PVOID    pAdapterHandler,
    OUT PVOID   *pMgmtHandler
    );
*/

BYTE
VNTWIFIbyGetKeyCypher(
    IN PVOID    pMgmtHandle,
    IN BOOL     bGroupKey
    );




BOOL
VNTWIFIbSetPMKIDCache (
    IN PVOID pMgmtObject,
    IN ULONG ulCount,
    IN PVOID pPMKIDInfo
    );

BOOL
VNTWIFIbCommandRunning (
    IN PVOID pMgmtObject
    );

WORD
VNTWIFIwGetMaxSupportRate(
    IN PVOID pMgmtObject
    );

// for 802.11h
VOID
VNTWIFIvSet11h (
    IN PVOID pMgmtObject,
    IN BOOL  b11hEnable
    );

BOOL
VNTWIFIbMeasureReport(
    IN PVOID pMgmtObject,
    IN BOOL  bEndOfReport,
    IN PVOID pvMeasureEID,
    IN BYTE  byReportMode,
    IN BYTE  byBasicMap,
    IN BYTE  byCCAFraction,
    IN PBYTE pbyRPIs
    );

BOOL
VNTWIFIbChannelSwitch(
    IN PVOID pMgmtObject,
    IN BYTE  byNewChannel
    );
/*
BOOL
VNTWIFIbRadarPresent(
    IN PVOID pMgmtObject,
    IN BYTE  byChannel
    );
*/

#endif //__VNTWIFI_H__