blob: 4b01ebd7299a658099fc45c2136e7c7252c042e6 [file] [log] [blame]
Forest Bond5449c682009-04-25 10:30:44 -04001/*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 *
20 * File: vntwifi.h
21 *
22 * Purpose: export VNT Host WiFi library function
23 *
24 * Author: Yiching Chen
25 *
26 * Date: Jan 7, 2004
27 *
28 */
29
30#ifndef __VNTWIFI_H__
31#define __VNTWIFI_H__
32
Forest Bond5449c682009-04-25 10:30:44 -040033#include "ttype.h"
Forest Bond5449c682009-04-25 10:30:44 -040034#include "80211mgr.h"
Forest Bond5449c682009-04-25 10:30:44 -040035#include "card.h"
Jim Lieb612822f2009-08-12 14:54:03 -070036#include "wpa2.h"
Forest Bond5449c682009-04-25 10:30:44 -040037
38/*--------------------- Export Definitions -------------------------*/
39#define RATE_1M 0
40#define RATE_2M 1
41#define RATE_5M 2
42#define RATE_11M 3
43#define RATE_6M 4
44#define RATE_9M 5
45#define RATE_12M 6
46#define RATE_18M 7
47#define RATE_24M 8
48#define RATE_36M 9
49#define RATE_48M 10
50#define RATE_54M 11
51#define RATE_AUTO 12
52#define MAX_RATE 12
53
54// key CipherSuite
55#define KEY_CTL_WEP 0x00
56#define KEY_CTL_NONE 0x01
57#define KEY_CTL_TKIP 0x02
58#define KEY_CTL_CCMP 0x03
59#define KEY_CTL_INVALID 0xFF
60
61#define CHANNEL_MAX_24G 14
62
63#define MAX_BSS_NUM 42
64
Forest Bond5449c682009-04-25 10:30:44 -040065// Pre-configured Authenticaiton Mode (from XP)
66typedef enum tagWMAC_AUTHENTICATION_MODE {
Joe Perchesd9d644e2013-03-18 10:45:08 -070067 WMAC_AUTH_OPEN,
68 WMAC_AUTH_SHAREKEY,
69 WMAC_AUTH_AUTO,
70 WMAC_AUTH_WPA,
71 WMAC_AUTH_WPAPSK,
72 WMAC_AUTH_WPANONE,
73 WMAC_AUTH_WPA2,
74 WMAC_AUTH_WPA2PSK,
75 WMAC_AUTH_MAX // Not a real mode, defined as upper bound
Forest Bond5449c682009-04-25 10:30:44 -040076} WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE;
77
78typedef enum tagWMAC_ENCRYPTION_MODE {
Joe Perchesd9d644e2013-03-18 10:45:08 -070079 WMAC_ENCRYPTION_WEPEnabled,
80 WMAC_ENCRYPTION_WEPDisabled,
81 WMAC_ENCRYPTION_WEPKeyAbsent,
82 WMAC_ENCRYPTION_WEPNotSupported,
83 WMAC_ENCRYPTION_TKIPEnabled,
84 WMAC_ENCRYPTION_TKIPKeyAbsent,
85 WMAC_ENCRYPTION_AESEnabled,
86 WMAC_ENCRYPTION_AESKeyAbsent
Forest Bond5449c682009-04-25 10:30:44 -040087} WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE;
88
89// Pre-configured Mode (from XP)
90
91typedef enum tagWMAC_CONFIG_MODE {
Joe Perchesd9d644e2013-03-18 10:45:08 -070092 WMAC_CONFIG_ESS_STA = 0,
93 WMAC_CONFIG_IBSS_STA,
94 WMAC_CONFIG_AUTO,
95 WMAC_CONFIG_AP
Forest Bond5449c682009-04-25 10:30:44 -040096} WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE;
97
Forest Bond5449c682009-04-25 10:30:44 -040098typedef enum tagWMAC_POWER_MODE {
Joe Perchesd9d644e2013-03-18 10:45:08 -070099 WMAC_POWER_CAM,
100 WMAC_POWER_FAST,
101 WMAC_POWER_MAX
Forest Bond5449c682009-04-25 10:30:44 -0400102} WMAC_POWER_MODE, *PWMAC_POWER_MODE;
103
104#define VNTWIFIbIsShortSlotTime(wCapInfo) \
Joe Perchesd9d644e2013-03-18 10:45:08 -0700105 WLAN_GET_CAP_INFO_SHORTSLOTTIME(wCapInfo) \
Forest Bond5449c682009-04-25 10:30:44 -0400106
107#define VNTWIFIbIsProtectMode(byERP) \
Joe Perchesd9d644e2013-03-18 10:45:08 -0700108 ((byERP & WLAN_EID_ERP_USE_PROTECTION) != 0) \
Forest Bond5449c682009-04-25 10:30:44 -0400109
110#define VNTWIFIbIsBarkerMode(byERP) \
Joe Perchesd9d644e2013-03-18 10:45:08 -0700111 ((byERP & WLAN_EID_ERP_BARKER_MODE) != 0) \
Forest Bond5449c682009-04-25 10:30:44 -0400112
113#define VNTWIFIbIsShortPreamble(wCapInfo) \
Joe Perchesd9d644e2013-03-18 10:45:08 -0700114 WLAN_GET_CAP_INFO_SHORTPREAMBLE(wCapInfo) \
Forest Bond5449c682009-04-25 10:30:44 -0400115
Joe Perchesd9d644e2013-03-18 10:45:08 -0700116#define VNTWIFIbIsEncryption(wCapInfo) \
117 WLAN_GET_CAP_INFO_PRIVACY(wCapInfo) \
Forest Bond5449c682009-04-25 10:30:44 -0400118
Joe Perchesd9d644e2013-03-18 10:45:08 -0700119#define VNTWIFIbIsESS(wCapInfo) \
120 WLAN_GET_CAP_INFO_ESS(wCapInfo) \
Forest Bond5449c682009-04-25 10:30:44 -0400121
Forest Bond5449c682009-04-25 10:30:44 -0400122/*--------------------- Export Classes ----------------------------*/
123
124/*--------------------- Export Variables --------------------------*/
125
Forest Bond5449c682009-04-25 10:30:44 -0400126/*--------------------- Export Types ------------------------------*/
127
Forest Bond5449c682009-04-25 10:30:44 -0400128/*--------------------- Export Functions --------------------------*/
129
Charles Clément6b35b7b2010-05-07 12:30:19 -0700130void
Joe Perchesd9d644e2013-03-18 10:45:08 -0700131VNTWIFIvSetIBSSParameter(
132 void *pMgmtHandle,
133 unsigned short wBeaconPeriod,
134 unsigned short wATIMWindow,
135 unsigned int uChannel
136);
Forest Bond5449c682009-04-25 10:30:44 -0400137
Charles Clément6b35b7b2010-05-07 12:30:19 -0700138void
Joe Perchesd9d644e2013-03-18 10:45:08 -0700139VNTWIFIvSetOPMode(
140 void *pMgmtHandle,
141 WMAC_CONFIG_MODE eOPMode
142);
Forest Bond5449c682009-04-25 10:30:44 -0400143
144PWLAN_IE_SSID
145VNTWIFIpGetCurrentSSID(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700146 void *pMgmtHandle
147);
Forest Bond5449c682009-04-25 10:30:44 -0400148
Charles Clémentb6e95cd2010-06-02 09:52:01 -0700149unsigned int
Forest Bond5449c682009-04-25 10:30:44 -0400150VNTWIFIpGetCurrentChannel(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700151 void *pMgmtHandle
152);
Forest Bond5449c682009-04-25 10:30:44 -0400153
Charles Clément2986db52010-06-24 11:02:26 -0700154unsigned short
Joe Perchesd9d644e2013-03-18 10:45:08 -0700155VNTWIFIwGetAssocID(
156 void *pMgmtHandle
157);
Forest Bond5449c682009-04-25 10:30:44 -0400158
Charles Clément3fc9b582010-06-24 11:02:27 -0700159unsigned char
Joe Perchesd9d644e2013-03-18 10:45:08 -0700160VNTWIFIbyGetMaxSupportRate(
161 PWLAN_IE_SUPP_RATES pSupportRateIEs,
162 PWLAN_IE_SUPP_RATES pExtSupportRateIEs
163);
Forest Bond5449c682009-04-25 10:30:44 -0400164
Charles Clément3fc9b582010-06-24 11:02:27 -0700165unsigned char
Joe Perchesd9d644e2013-03-18 10:45:08 -0700166VNTWIFIbyGetACKTxRate(
167 unsigned char byRxDataRate,
168 PWLAN_IE_SUPP_RATES pSupportRateIEs,
169 PWLAN_IE_SUPP_RATES pExtSupportRateIEs
170);
Forest Bond5449c682009-04-25 10:30:44 -0400171
Charles Clément6b35b7b2010-05-07 12:30:19 -0700172void
Joe Perchesd9d644e2013-03-18 10:45:08 -0700173VNTWIFIvSetAuthenticationMode(
174 void *pMgmtHandle,
175 WMAC_AUTHENTICATION_MODE eAuthMode
176);
Forest Bond5449c682009-04-25 10:30:44 -0400177
Charles Clément6b35b7b2010-05-07 12:30:19 -0700178void
Joe Perchesd9d644e2013-03-18 10:45:08 -0700179VNTWIFIvSetEncryptionMode(
180 void *pMgmtHandle,
181 WMAC_ENCRYPTION_MODE eEncryptionMode
182);
Forest Bond5449c682009-04-25 10:30:44 -0400183
Charles Clément7b6a0012010-08-01 17:15:50 +0200184bool
Forest Bond5449c682009-04-25 10:30:44 -0400185VNTWIFIbConfigPhyMode(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700186 void *pMgmtHandle,
187 CARD_PHY_TYPE ePhyType
188);
Forest Bond5449c682009-04-25 10:30:44 -0400189
Charles Clément6b35b7b2010-05-07 12:30:19 -0700190void
Forest Bond5449c682009-04-25 10:30:44 -0400191VNTWIFIbGetConfigPhyMode(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700192 void *pMgmtHandle,
193 void *pePhyType
194);
Forest Bond5449c682009-04-25 10:30:44 -0400195
Charles Clément6b35b7b2010-05-07 12:30:19 -0700196void
Charles Clémentfe4f34b2010-06-25 10:48:53 -0700197VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount,
Joe Perchesd9d644e2013-03-18 10:45:08 -0700198 void **pvFirstBSS);
Forest Bond5449c682009-04-25 10:30:44 -0400199
Charles Clément6b35b7b2010-05-07 12:30:19 -0700200void
Joe Perchesd9d644e2013-03-18 10:45:08 -0700201VNTWIFIvGetNextBSS(
202 void *pMgmtHandle,
203 void *pvCurrentBSS,
204 void **pvNextBSS
205);
Forest Bond5449c682009-04-25 10:30:44 -0400206
Charles Clément6b35b7b2010-05-07 12:30:19 -0700207void
Forest Bond5449c682009-04-25 10:30:44 -0400208VNTWIFIvUpdateNodeTxCounter(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700209 void *pMgmtHandle,
210 unsigned char *pbyDestAddress,
211 bool bTxOk,
212 unsigned short wRate,
213 unsigned char *pbyTxFailCount
214);
Forest Bond5449c682009-04-25 10:30:44 -0400215
Charles Clément6b35b7b2010-05-07 12:30:19 -0700216void
Forest Bond5449c682009-04-25 10:30:44 -0400217VNTWIFIvGetTxRate(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700218 void *pMgmtHandle,
219 unsigned char *pbyDestAddress,
220 unsigned short *pwTxDataRate,
221 unsigned char *pbyACKRate,
222 unsigned char *pbyCCKBasicRate,
223 unsigned char *pbyOFDMBasicRate
224);
Forest Bond5449c682009-04-25 10:30:44 -0400225/*
Joe Perchesd9d644e2013-03-18 10:45:08 -0700226 bool
227 VNTWIFIbInit(
228 void *pAdapterHandler,
229 void **pMgmtHandler
230);
Forest Bond5449c682009-04-25 10:30:44 -0400231*/
232
Charles Clément3fc9b582010-06-24 11:02:27 -0700233unsigned char
Forest Bond5449c682009-04-25 10:30:44 -0400234VNTWIFIbyGetKeyCypher(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700235 void *pMgmtHandle,
236 bool bGroupKey
237);
Forest Bond5449c682009-04-25 10:30:44 -0400238
Charles Clément7b6a0012010-08-01 17:15:50 +0200239bool
Joe Perchesd9d644e2013-03-18 10:45:08 -0700240VNTWIFIbSetPMKIDCache(
241 void *pMgmtObject,
242 unsigned long ulCount,
243 void *pPMKIDInfo
244);
Forest Bond5449c682009-04-25 10:30:44 -0400245
Charles Clément7b6a0012010-08-01 17:15:50 +0200246bool
Joe Perchesd9d644e2013-03-18 10:45:08 -0700247VNTWIFIbCommandRunning(
248 void *pMgmtObject
249);
Forest Bond5449c682009-04-25 10:30:44 -0400250
Charles Clément2986db52010-06-24 11:02:26 -0700251unsigned short
Forest Bond5449c682009-04-25 10:30:44 -0400252VNTWIFIwGetMaxSupportRate(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700253 void *pMgmtObject
254);
Forest Bond5449c682009-04-25 10:30:44 -0400255
256// for 802.11h
Charles Clément6b35b7b2010-05-07 12:30:19 -0700257void
Joe Perchesd9d644e2013-03-18 10:45:08 -0700258VNTWIFIvSet11h(
259 void *pMgmtObject,
260 bool b11hEnable
261);
Forest Bond5449c682009-04-25 10:30:44 -0400262
Charles Clément7b6a0012010-08-01 17:15:50 +0200263bool
Forest Bond5449c682009-04-25 10:30:44 -0400264VNTWIFIbMeasureReport(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700265 void *pMgmtObject,
266 bool bEndOfReport,
267 void *pvMeasureEID,
268 unsigned char byReportMode,
269 unsigned char byBasicMap,
270 unsigned char byCCAFraction,
271 unsigned char *pbyRPIs
272);
Forest Bond5449c682009-04-25 10:30:44 -0400273
Charles Clément7b6a0012010-08-01 17:15:50 +0200274bool
Forest Bond5449c682009-04-25 10:30:44 -0400275VNTWIFIbChannelSwitch(
Joe Perchesd9d644e2013-03-18 10:45:08 -0700276 void *pMgmtObject,
277 unsigned char byNewChannel
278);
Forest Bond5449c682009-04-25 10:30:44 -0400279/*
Joe Perchesd9d644e2013-03-18 10:45:08 -0700280 bool
281 VNTWIFIbRadarPresent(
282 void *pMgmtObject,
283 unsigned char byChannel
284);
Forest Bond5449c682009-04-25 10:30:44 -0400285*/
286
Forest Bond5449c682009-04-25 10:30:44 -0400287#endif //__VNTWIFI_H__