1 /* 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 33 #include "ttype.h" 34 #include "80211mgr.h" 35 #include "card.h" 36 #include "wpa2.h" 37 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 65 // Pre-configured Authenticaiton Mode (from XP) 66 typedef enum tagWMAC_AUTHENTICATION_MODE { 67 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 76 } WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE; 77 78 typedef enum tagWMAC_ENCRYPTION_MODE { 79 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 87 } WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE; 88 89 // Pre-configured Mode (from XP) 90 91 typedef enum tagWMAC_CONFIG_MODE { 92 WMAC_CONFIG_ESS_STA = 0, 93 WMAC_CONFIG_IBSS_STA, 94 WMAC_CONFIG_AUTO, 95 WMAC_CONFIG_AP 96 } WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE; 97 98 typedef enum tagWMAC_POWER_MODE { 99 WMAC_POWER_CAM, 100 WMAC_POWER_FAST, 101 WMAC_POWER_MAX 102 } WMAC_POWER_MODE, *PWMAC_POWER_MODE; 103 104 #define VNTWIFIbIsShortSlotTime(wCapInfo) \ 105 WLAN_GET_CAP_INFO_SHORTSLOTTIME(wCapInfo) \ 106 107 #define VNTWIFIbIsProtectMode(byERP) \ 108 ((byERP & WLAN_EID_ERP_USE_PROTECTION) != 0) \ 109 110 #define VNTWIFIbIsBarkerMode(byERP) \ 111 ((byERP & WLAN_EID_ERP_BARKER_MODE) != 0) \ 112 113 #define VNTWIFIbIsShortPreamble(wCapInfo) \ 114 WLAN_GET_CAP_INFO_SHORTPREAMBLE(wCapInfo) \ 115 116 #define VNTWIFIbIsEncryption(wCapInfo) \ 117 WLAN_GET_CAP_INFO_PRIVACY(wCapInfo) \ 118 119 #define VNTWIFIbIsESS(wCapInfo) \ 120 WLAN_GET_CAP_INFO_ESS(wCapInfo) \ 121 122 /*--------------------- Export Classes ----------------------------*/ 123 124 /*--------------------- Export Variables --------------------------*/ 125 126 /*--------------------- Export Types ------------------------------*/ 127 128 /*--------------------- Export Functions --------------------------*/ 129 130 void 131 VNTWIFIvSetIBSSParameter( 132 void *pMgmtHandle, 133 unsigned short wBeaconPeriod, 134 unsigned short wATIMWindow, 135 unsigned int uChannel 136 ); 137 138 void 139 VNTWIFIvSetOPMode( 140 void *pMgmtHandle, 141 WMAC_CONFIG_MODE eOPMode 142 ); 143 144 PWLAN_IE_SSID 145 VNTWIFIpGetCurrentSSID( 146 void *pMgmtHandle 147 ); 148 149 unsigned int 150 VNTWIFIpGetCurrentChannel( 151 void *pMgmtHandle 152 ); 153 154 unsigned short 155 VNTWIFIwGetAssocID( 156 void *pMgmtHandle 157 ); 158 159 unsigned char 160 VNTWIFIbyGetMaxSupportRate( 161 PWLAN_IE_SUPP_RATES pSupportRateIEs, 162 PWLAN_IE_SUPP_RATES pExtSupportRateIEs 163 ); 164 165 unsigned char 166 VNTWIFIbyGetACKTxRate( 167 unsigned char byRxDataRate, 168 PWLAN_IE_SUPP_RATES pSupportRateIEs, 169 PWLAN_IE_SUPP_RATES pExtSupportRateIEs 170 ); 171 172 void 173 VNTWIFIvSetAuthenticationMode( 174 void *pMgmtHandle, 175 WMAC_AUTHENTICATION_MODE eAuthMode 176 ); 177 178 void 179 VNTWIFIvSetEncryptionMode( 180 void *pMgmtHandle, 181 WMAC_ENCRYPTION_MODE eEncryptionMode 182 ); 183 184 bool 185 VNTWIFIbConfigPhyMode( 186 void *pMgmtHandle, 187 CARD_PHY_TYPE ePhyType 188 ); 189 190 void 191 VNTWIFIbGetConfigPhyMode( 192 void *pMgmtHandle, 193 void *pePhyType 194 ); 195 196 void 197 VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, 198 void **pvFirstBSS); 199 200 void 201 VNTWIFIvGetNextBSS( 202 void *pMgmtHandle, 203 void *pvCurrentBSS, 204 void **pvNextBSS 205 ); 206 207 void 208 VNTWIFIvUpdateNodeTxCounter( 209 void *pMgmtHandle, 210 unsigned char *pbyDestAddress, 211 bool bTxOk, 212 unsigned short wRate, 213 unsigned char *pbyTxFailCount 214 ); 215 216 void 217 VNTWIFIvGetTxRate( 218 void *pMgmtHandle, 219 unsigned char *pbyDestAddress, 220 unsigned short *pwTxDataRate, 221 unsigned char *pbyACKRate, 222 unsigned char *pbyCCKBasicRate, 223 unsigned char *pbyOFDMBasicRate 224 ); 225 226 unsigned char 227 VNTWIFIbyGetKeyCypher( 228 void *pMgmtHandle, 229 bool bGroupKey 230 ); 231 232 bool 233 VNTWIFIbSetPMKIDCache( 234 void *pMgmtObject, 235 unsigned long ulCount, 236 void *pPMKIDInfo 237 ); 238 239 bool 240 VNTWIFIbCommandRunning( 241 void *pMgmtObject 242 ); 243 244 unsigned short 245 VNTWIFIwGetMaxSupportRate( 246 void *pMgmtObject 247 ); 248 249 // for 802.11h 250 void 251 VNTWIFIvSet11h( 252 void *pMgmtObject, 253 bool b11hEnable 254 ); 255 256 bool 257 VNTWIFIbMeasureReport( 258 void *pMgmtObject, 259 bool bEndOfReport, 260 void *pvMeasureEID, 261 unsigned char byReportMode, 262 unsigned char byBasicMap, 263 unsigned char byCCAFraction, 264 unsigned char *pbyRPIs 265 ); 266 267 bool 268 VNTWIFIbChannelSwitch( 269 void *pMgmtObject, 270 unsigned char byNewChannel 271 ); 272 273 #endif //__VNTWIFI_H__ 274