vntwifi.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. #ifndef __VNTWIFI_H__
  30. #define __VNTWIFI_H__
  31. #include "ttype.h"
  32. #include "80211mgr.h"
  33. #include "card.h"
  34. #include "wpa2.h"
  35. /*--------------------- Export Definitions -------------------------*/
  36. #define RATE_1M 0
  37. #define RATE_2M 1
  38. #define RATE_5M 2
  39. #define RATE_11M 3
  40. #define RATE_6M 4
  41. #define RATE_9M 5
  42. #define RATE_12M 6
  43. #define RATE_18M 7
  44. #define RATE_24M 8
  45. #define RATE_36M 9
  46. #define RATE_48M 10
  47. #define RATE_54M 11
  48. #define RATE_AUTO 12
  49. #define MAX_RATE 12
  50. // key CipherSuite
  51. #define KEY_CTL_WEP 0x00
  52. #define KEY_CTL_NONE 0x01
  53. #define KEY_CTL_TKIP 0x02
  54. #define KEY_CTL_CCMP 0x03
  55. #define KEY_CTL_INVALID 0xFF
  56. #define CHANNEL_MAX_24G 14
  57. #define MAX_BSS_NUM 42
  58. // Pre-configured Authenticaiton Mode (from XP)
  59. typedef enum tagWMAC_AUTHENTICATION_MODE {
  60. WMAC_AUTH_OPEN,
  61. WMAC_AUTH_SHAREKEY,
  62. WMAC_AUTH_AUTO,
  63. WMAC_AUTH_WPA,
  64. WMAC_AUTH_WPAPSK,
  65. WMAC_AUTH_WPANONE,
  66. WMAC_AUTH_WPA2,
  67. WMAC_AUTH_WPA2PSK,
  68. WMAC_AUTH_MAX // Not a real mode, defined as upper bound
  69. } WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE;
  70. typedef enum tagWMAC_ENCRYPTION_MODE {
  71. WMAC_ENCRYPTION_WEPEnabled,
  72. WMAC_ENCRYPTION_WEPDisabled,
  73. WMAC_ENCRYPTION_WEPKeyAbsent,
  74. WMAC_ENCRYPTION_WEPNotSupported,
  75. WMAC_ENCRYPTION_TKIPEnabled,
  76. WMAC_ENCRYPTION_TKIPKeyAbsent,
  77. WMAC_ENCRYPTION_AESEnabled,
  78. WMAC_ENCRYPTION_AESKeyAbsent
  79. } WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE;
  80. // Pre-configured Mode (from XP)
  81. typedef enum tagWMAC_CONFIG_MODE {
  82. WMAC_CONFIG_ESS_STA = 0,
  83. WMAC_CONFIG_IBSS_STA,
  84. WMAC_CONFIG_AUTO,
  85. WMAC_CONFIG_AP
  86. } WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE;
  87. typedef enum tagWMAC_POWER_MODE {
  88. WMAC_POWER_CAM,
  89. WMAC_POWER_FAST,
  90. WMAC_POWER_MAX
  91. } WMAC_POWER_MODE, *PWMAC_POWER_MODE;
  92. #define VNTWIFIbIsShortSlotTime(wCapInfo) \
  93. WLAN_GET_CAP_INFO_SHORTSLOTTIME(wCapInfo) \
  94. #define VNTWIFIbIsProtectMode(byERP) \
  95. ((byERP & WLAN_EID_ERP_USE_PROTECTION) != 0) \
  96. #define VNTWIFIbIsBarkerMode(byERP) \
  97. ((byERP & WLAN_EID_ERP_BARKER_MODE) != 0) \
  98. #define VNTWIFIbIsShortPreamble(wCapInfo) \
  99. WLAN_GET_CAP_INFO_SHORTPREAMBLE(wCapInfo) \
  100. #define VNTWIFIbIsEncryption(wCapInfo) \
  101. WLAN_GET_CAP_INFO_PRIVACY(wCapInfo) \
  102. #define VNTWIFIbIsESS(wCapInfo) \
  103. WLAN_GET_CAP_INFO_ESS(wCapInfo) \
  104. /*--------------------- Export Classes ----------------------------*/
  105. /*--------------------- Export Variables --------------------------*/
  106. /*--------------------- Export Types ------------------------------*/
  107. /*--------------------- Export Functions --------------------------*/
  108. void
  109. VNTWIFIvSetIBSSParameter (
  110. void *pMgmtHandle,
  111. unsigned short wBeaconPeriod,
  112. unsigned short wATIMWindow,
  113. unsigned int uChannel
  114. );
  115. void
  116. VNTWIFIvSetOPMode (
  117. void *pMgmtHandle,
  118. WMAC_CONFIG_MODE eOPMode
  119. );
  120. PWLAN_IE_SSID
  121. VNTWIFIpGetCurrentSSID(
  122. void *pMgmtHandle
  123. );
  124. unsigned int
  125. VNTWIFIpGetCurrentChannel(
  126. void *pMgmtHandle
  127. );
  128. unsigned short
  129. VNTWIFIwGetAssocID (
  130. void *pMgmtHandle
  131. );
  132. unsigned char
  133. VNTWIFIbyGetMaxSupportRate (
  134. PWLAN_IE_SUPP_RATES pSupportRateIEs,
  135. PWLAN_IE_SUPP_RATES pExtSupportRateIEs
  136. );
  137. unsigned char
  138. VNTWIFIbyGetACKTxRate (
  139. unsigned char byRxDataRate,
  140. PWLAN_IE_SUPP_RATES pSupportRateIEs,
  141. PWLAN_IE_SUPP_RATES pExtSupportRateIEs
  142. );
  143. void
  144. VNTWIFIvSetAuthenticationMode (
  145. void *pMgmtHandle,
  146. WMAC_AUTHENTICATION_MODE eAuthMode
  147. );
  148. void
  149. VNTWIFIvSetEncryptionMode (
  150. void *pMgmtHandle,
  151. WMAC_ENCRYPTION_MODE eEncryptionMode
  152. );
  153. bool
  154. VNTWIFIbConfigPhyMode(
  155. void *pMgmtHandle,
  156. CARD_PHY_TYPE ePhyType
  157. );
  158. void
  159. VNTWIFIbGetConfigPhyMode(
  160. void *pMgmtHandle,
  161. void *pePhyType
  162. );
  163. void
  164. VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount,
  165. void **pvFirstBSS);
  166. void
  167. VNTWIFIvGetNextBSS (
  168. void *pMgmtHandle,
  169. void *pvCurrentBSS,
  170. void **pvNextBSS
  171. );
  172. void
  173. VNTWIFIvUpdateNodeTxCounter(
  174. void *pMgmtHandle,
  175. unsigned char *pbyDestAddress,
  176. bool bTxOk,
  177. unsigned short wRate,
  178. unsigned char *pbyTxFailCount
  179. );
  180. void
  181. VNTWIFIvGetTxRate(
  182. void *pMgmtHandle,
  183. unsigned char *pbyDestAddress,
  184. unsigned short *pwTxDataRate,
  185. unsigned char *pbyACKRate,
  186. unsigned char *pbyCCKBasicRate,
  187. unsigned char *pbyOFDMBasicRate
  188. );
  189. /*
  190. bool
  191. VNTWIFIbInit(
  192. void *pAdapterHandler,
  193. void **pMgmtHandler
  194. );
  195. */
  196. unsigned char
  197. VNTWIFIbyGetKeyCypher(
  198. void *pMgmtHandle,
  199. bool bGroupKey
  200. );
  201. bool
  202. VNTWIFIbSetPMKIDCache (
  203. void *pMgmtObject,
  204. unsigned long ulCount,
  205. void *pPMKIDInfo
  206. );
  207. bool
  208. VNTWIFIbCommandRunning (
  209. void *pMgmtObject
  210. );
  211. unsigned short
  212. VNTWIFIwGetMaxSupportRate(
  213. void *pMgmtObject
  214. );
  215. // for 802.11h
  216. void
  217. VNTWIFIvSet11h (
  218. void *pMgmtObject,
  219. bool b11hEnable
  220. );
  221. bool
  222. VNTWIFIbMeasureReport(
  223. void *pMgmtObject,
  224. bool bEndOfReport,
  225. void *pvMeasureEID,
  226. unsigned char byReportMode,
  227. unsigned char byBasicMap,
  228. unsigned char byCCAFraction,
  229. unsigned char *pbyRPIs
  230. );
  231. bool
  232. VNTWIFIbChannelSwitch(
  233. void *pMgmtObject,
  234. unsigned char byNewChannel
  235. );
  236. /*
  237. bool
  238. VNTWIFIbRadarPresent(
  239. void *pMgmtObject,
  240. unsigned char byChannel
  241. );
  242. */
  243. #endif //__VNTWIFI_H__