Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 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 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 33 | #include "ttype.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 34 | #include "80211mgr.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 35 | #include "card.h" |
Jim Lieb | 612822f | 2009-08-12 14:54:03 -0700 | [diff] [blame] | 36 | #include "wpa2.h" |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 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 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 65 | // Pre-configured Authenticaiton Mode (from XP) |
| 66 | typedef enum tagWMAC_AUTHENTICATION_MODE { |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 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 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 76 | } WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE; |
| 77 | |
| 78 | typedef enum tagWMAC_ENCRYPTION_MODE { |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 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 |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 87 | } WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE; |
| 88 | |
| 89 | // Pre-configured Mode (from XP) |
| 90 | |
| 91 | typedef enum tagWMAC_CONFIG_MODE { |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 92 | WMAC_CONFIG_ESS_STA = 0, |
| 93 | WMAC_CONFIG_IBSS_STA, |
| 94 | WMAC_CONFIG_AUTO, |
| 95 | WMAC_CONFIG_AP |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 96 | } WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE; |
| 97 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 98 | typedef enum tagWMAC_POWER_MODE { |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 99 | WMAC_POWER_CAM, |
| 100 | WMAC_POWER_FAST, |
| 101 | WMAC_POWER_MAX |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 102 | } WMAC_POWER_MODE, *PWMAC_POWER_MODE; |
| 103 | |
| 104 | #define VNTWIFIbIsShortSlotTime(wCapInfo) \ |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 105 | WLAN_GET_CAP_INFO_SHORTSLOTTIME(wCapInfo) \ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 106 | |
| 107 | #define VNTWIFIbIsProtectMode(byERP) \ |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 108 | ((byERP & WLAN_EID_ERP_USE_PROTECTION) != 0) \ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 109 | |
| 110 | #define VNTWIFIbIsBarkerMode(byERP) \ |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 111 | ((byERP & WLAN_EID_ERP_BARKER_MODE) != 0) \ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 112 | |
| 113 | #define VNTWIFIbIsShortPreamble(wCapInfo) \ |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 114 | WLAN_GET_CAP_INFO_SHORTPREAMBLE(wCapInfo) \ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 115 | |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 116 | #define VNTWIFIbIsEncryption(wCapInfo) \ |
| 117 | WLAN_GET_CAP_INFO_PRIVACY(wCapInfo) \ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 118 | |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 119 | #define VNTWIFIbIsESS(wCapInfo) \ |
| 120 | WLAN_GET_CAP_INFO_ESS(wCapInfo) \ |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 121 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 122 | /*--------------------- Export Classes ----------------------------*/ |
| 123 | |
| 124 | /*--------------------- Export Variables --------------------------*/ |
| 125 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 126 | /*--------------------- Export Types ------------------------------*/ |
| 127 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 128 | /*--------------------- Export Functions --------------------------*/ |
| 129 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 130 | void |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 131 | VNTWIFIvSetIBSSParameter( |
| 132 | void *pMgmtHandle, |
| 133 | unsigned short wBeaconPeriod, |
| 134 | unsigned short wATIMWindow, |
| 135 | unsigned int uChannel |
| 136 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 137 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 138 | void |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 139 | VNTWIFIvSetOPMode( |
| 140 | void *pMgmtHandle, |
| 141 | WMAC_CONFIG_MODE eOPMode |
| 142 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 143 | |
| 144 | PWLAN_IE_SSID |
| 145 | VNTWIFIpGetCurrentSSID( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 146 | void *pMgmtHandle |
| 147 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 148 | |
Charles Clément | b6e95cd | 2010-06-02 09:52:01 -0700 | [diff] [blame] | 149 | unsigned int |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 150 | VNTWIFIpGetCurrentChannel( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 151 | void *pMgmtHandle |
| 152 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 153 | |
Charles Clément | 2986db5 | 2010-06-24 11:02:26 -0700 | [diff] [blame] | 154 | unsigned short |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 155 | VNTWIFIwGetAssocID( |
| 156 | void *pMgmtHandle |
| 157 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 158 | |
Charles Clément | 3fc9b58 | 2010-06-24 11:02:27 -0700 | [diff] [blame] | 159 | unsigned char |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 160 | VNTWIFIbyGetMaxSupportRate( |
| 161 | PWLAN_IE_SUPP_RATES pSupportRateIEs, |
| 162 | PWLAN_IE_SUPP_RATES pExtSupportRateIEs |
| 163 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 164 | |
Charles Clément | 3fc9b58 | 2010-06-24 11:02:27 -0700 | [diff] [blame] | 165 | unsigned char |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 166 | VNTWIFIbyGetACKTxRate( |
| 167 | unsigned char byRxDataRate, |
| 168 | PWLAN_IE_SUPP_RATES pSupportRateIEs, |
| 169 | PWLAN_IE_SUPP_RATES pExtSupportRateIEs |
| 170 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 171 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 172 | void |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 173 | VNTWIFIvSetAuthenticationMode( |
| 174 | void *pMgmtHandle, |
| 175 | WMAC_AUTHENTICATION_MODE eAuthMode |
| 176 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 177 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 178 | void |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 179 | VNTWIFIvSetEncryptionMode( |
| 180 | void *pMgmtHandle, |
| 181 | WMAC_ENCRYPTION_MODE eEncryptionMode |
| 182 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 183 | |
Charles Clément | 7b6a001 | 2010-08-01 17:15:50 +0200 | [diff] [blame] | 184 | bool |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 185 | VNTWIFIbConfigPhyMode( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 186 | void *pMgmtHandle, |
| 187 | CARD_PHY_TYPE ePhyType |
| 188 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 189 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 190 | void |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 191 | VNTWIFIbGetConfigPhyMode( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 192 | void *pMgmtHandle, |
| 193 | void *pePhyType |
| 194 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 195 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 196 | void |
Charles Clément | fe4f34b | 2010-06-25 10:48:53 -0700 | [diff] [blame] | 197 | VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 198 | void **pvFirstBSS); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 199 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 200 | void |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 201 | VNTWIFIvGetNextBSS( |
| 202 | void *pMgmtHandle, |
| 203 | void *pvCurrentBSS, |
| 204 | void **pvNextBSS |
| 205 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 206 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 207 | void |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 208 | VNTWIFIvUpdateNodeTxCounter( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 209 | void *pMgmtHandle, |
| 210 | unsigned char *pbyDestAddress, |
| 211 | bool bTxOk, |
| 212 | unsigned short wRate, |
| 213 | unsigned char *pbyTxFailCount |
| 214 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 215 | |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 216 | void |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 217 | VNTWIFIvGetTxRate( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 218 | void *pMgmtHandle, |
| 219 | unsigned char *pbyDestAddress, |
| 220 | unsigned short *pwTxDataRate, |
| 221 | unsigned char *pbyACKRate, |
| 222 | unsigned char *pbyCCKBasicRate, |
| 223 | unsigned char *pbyOFDMBasicRate |
| 224 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 225 | |
Charles Clément | 3fc9b58 | 2010-06-24 11:02:27 -0700 | [diff] [blame] | 226 | unsigned char |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 227 | VNTWIFIbyGetKeyCypher( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 228 | void *pMgmtHandle, |
| 229 | bool bGroupKey |
| 230 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 231 | |
Charles Clément | 7b6a001 | 2010-08-01 17:15:50 +0200 | [diff] [blame] | 232 | bool |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 233 | VNTWIFIbSetPMKIDCache( |
| 234 | void *pMgmtObject, |
| 235 | unsigned long ulCount, |
| 236 | void *pPMKIDInfo |
| 237 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 238 | |
Charles Clément | 7b6a001 | 2010-08-01 17:15:50 +0200 | [diff] [blame] | 239 | bool |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 240 | VNTWIFIbCommandRunning( |
| 241 | void *pMgmtObject |
| 242 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 243 | |
Charles Clément | 2986db5 | 2010-06-24 11:02:26 -0700 | [diff] [blame] | 244 | unsigned short |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 245 | VNTWIFIwGetMaxSupportRate( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 246 | void *pMgmtObject |
| 247 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 248 | |
| 249 | // for 802.11h |
Charles Clément | 6b35b7b | 2010-05-07 12:30:19 -0700 | [diff] [blame] | 250 | void |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 251 | VNTWIFIvSet11h( |
| 252 | void *pMgmtObject, |
| 253 | bool b11hEnable |
| 254 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 255 | |
Charles Clément | 7b6a001 | 2010-08-01 17:15:50 +0200 | [diff] [blame] | 256 | bool |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 257 | VNTWIFIbMeasureReport( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 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 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 266 | |
Charles Clément | 7b6a001 | 2010-08-01 17:15:50 +0200 | [diff] [blame] | 267 | bool |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 268 | VNTWIFIbChannelSwitch( |
Joe Perches | d9d644e | 2013-03-18 10:45:08 -0700 | [diff] [blame] | 269 | void *pMgmtObject, |
| 270 | unsigned char byNewChannel |
| 271 | ); |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 272 | |
Forest Bond | 5449c68 | 2009-04-25 10:30:44 -0400 | [diff] [blame] | 273 | #endif //__VNTWIFI_H__ |