wifi_constants.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /******************************************************************************
  2. * Copyright (c) 2013-2016 Realtek Semiconductor Corp.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. ******************************************************************************
  16. * @file wifi_constants.h
  17. * @author
  18. * @version
  19. * @brief This file provides the data types used for wlan API.
  20. ******************************************************************************
  21. */
  22. #ifndef _WIFI_CONSTANTS_H
  23. #define _WIFI_CONSTANTS_H
  24. /** @addtogroup nic NIC
  25. * @ingroup wlan
  26. * @brief NIC functions
  27. * @{
  28. */
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #ifndef WLAN0_NAME
  33. #define WLAN0_NAME "wlan0"
  34. #endif
  35. #ifndef WLAN1_NAME
  36. #define WLAN1_NAME "wlan1"
  37. #endif
  38. #define WEP_ENABLED 0x0001
  39. #define TKIP_ENABLED 0x0002
  40. #define AES_ENABLED 0x0004
  41. #define WSEC_SWFLAG 0x0008
  42. #define AES_CMAC_ENABLED 0x0010
  43. #define SHARED_ENABLED 0x00008000
  44. #define WPA_SECURITY 0x00200000
  45. #define WPA2_SECURITY 0x00400000
  46. #define WPA3_SECURITY 0x00800000
  47. #define WPS_ENABLED 0x10000000
  48. #define IEEE_8021X_ENABLED 0x80000000
  49. #define RTW_MAX_PSK_LEN (64)
  50. #define RTW_MIN_PSK_LEN (8)
  51. #define MCSSET_LEN 16
  52. /**
  53. * @brief The enumeration lists the results of the function.
  54. */
  55. enum
  56. {
  57. RTW_SUCCESS = 0, /**< Success */
  58. RTW_PENDING = 1, /**< Pending */
  59. RTW_TIMEOUT = 2, /**< Timeout */
  60. RTW_PARTIAL_RESULTS = 3, /**< Partial results */
  61. RTW_INVALID_KEY = 4, /**< Invalid key */
  62. RTW_DOES_NOT_EXIST = 5, /**< Does not exist */
  63. RTW_NOT_AUTHENTICATED = 6, /**< Not authenticated */
  64. RTW_NOT_KEYED = 7, /**< Not keyed */
  65. RTW_IOCTL_FAIL = 8, /**< IOCTL fail */
  66. RTW_BUFFER_UNAVAILABLE_TEMPORARY = 9, /**< Buffer unavailable temporarily */
  67. RTW_BUFFER_UNAVAILABLE_PERMANENT = 10, /**< Buffer unavailable permanently */
  68. RTW_WPS_PBC_OVERLAP = 11, /**< WPS PBC overlap */
  69. RTW_CONNECTION_LOST = 12, /**< Connection lost */
  70. RTW_ERROR = -1, /**< Generic Error */
  71. RTW_BADARG = -2, /**< Bad Argument */
  72. RTW_BADOPTION = -3, /**< Bad option */
  73. RTW_NOTUP = -4, /**< Not up */
  74. RTW_NOTDOWN = -5, /**< Not down */
  75. RTW_NOTAP = -6, /**< Not AP */
  76. RTW_NOTSTA = -7, /**< Not STA */
  77. RTW_BADKEYIDX = -8, /**< BAD Key Index */
  78. RTW_RADIOOFF = -9, /**< Radio Off */
  79. RTW_NOTBANDLOCKED = -10, /**< Not band locked */
  80. RTW_NOCLK = -11, /**< No Clock */
  81. RTW_BADRATESET = -12, /**< BAD Rate valueset */
  82. RTW_BADBAND = -13, /**< BAD Band */
  83. RTW_BUFTOOSHORT = -14, /**< Buffer too short */
  84. RTW_BUFTOOLONG = -15, /**< Buffer too long */
  85. RTW_BUSY = -16, /**< Busy */
  86. RTW_NOTASSOCIATED = -17, /**< Not Associated */
  87. RTW_BADSSIDLEN = -18, /**< Bad SSID len */
  88. RTW_OUTOFRANGECHAN = -19, /**< Out of Range Channel */
  89. RTW_BADCHAN = -20, /**< Bad Channel */
  90. RTW_BADADDR = -21, /**< Bad Address */
  91. RTW_NORESOURCE = -22, /**< Not Enough Resources */
  92. RTW_UNSUPPORTED = -23, /**< Unsupported */
  93. RTW_BADLEN = -24, /**< Bad length */
  94. RTW_NOTREADY = -25, /**< Not Ready */
  95. RTW_EPERM = -26, /**< Not Permitted */
  96. RTW_NOMEM = -27, /**< No Memory */
  97. RTW_ASSOCIATED = -28, /**< Associated */
  98. RTW_RANGE = -29, /**< Not In Range */
  99. RTW_NOTFOUND = -30, /**< Not Found */
  100. RTW_WME_NOT_ENABLED = -31, /**< WME Not Enabled */
  101. RTW_TSPEC_NOTFOUND = -32, /**< TSPEC Not Found */
  102. RTW_ACM_NOTSUPPORTED = -33, /**< ACM Not Supported */
  103. RTW_NOT_WME_ASSOCIATION = -34, /**< Not WME Association */
  104. RTW_SDIO_ERROR = -35, /**< SDIO Bus Error */
  105. RTW_WLAN_DOWN = -36, /**< WLAN Not Accessible */
  106. RTW_BAD_VERSION = -37, /**< Incorrect version */
  107. RTW_TXFAIL = -38, /**< TX failure */
  108. RTW_RXFAIL = -39, /**< RX failure */
  109. RTW_NODEVICE = -40, /**< Device not present */
  110. RTW_UNFINISHED = -41, /**< To be finished */
  111. RTW_NONRESIDENT = -42, /**< access to nonresident overlay */
  112. RTW_DISABLED = -43 /**< Disabled in this build */
  113. };
  114. typedef unsigned long rtw_result_t;
  115. /**
  116. * @brief The enumeration lists the possible security types to set when connection.\n
  117. * Station mode supports OPEN, WEP, and WPA2.\n
  118. * AP mode support OPEN and WPA2.
  119. */
  120. enum {
  121. RTW_SECURITY_OPEN = 0, /**< Open security */
  122. RTW_SECURITY_WEP_PSK = WEP_ENABLED, /**< WEP PSK Security with open authentication */
  123. RTW_SECURITY_WEP_SHARED = ( WEP_ENABLED | SHARED_ENABLED ), /**< WEP PSK Security with shared authentication */
  124. RTW_SECURITY_WPA_TKIP_PSK = ( WPA_SECURITY | TKIP_ENABLED ), /**< WPA PSK Security with TKIP */
  125. RTW_SECURITY_WPA_TKIP_8021X = ( IEEE_8021X_ENABLED | WPA_SECURITY | TKIP_ENABLED ), /**< WPA 8021X Security with TKIP */
  126. RTW_SECURITY_WPA_AES_PSK = ( WPA_SECURITY | AES_ENABLED ), /**< WPA PSK Security with AES */
  127. RTW_SECURITY_WPA_AES_8021X = ( IEEE_8021X_ENABLED | WPA_SECURITY | AES_ENABLED ), /**< WPA 8021X Security with AES */
  128. RTW_SECURITY_WPA2_AES_PSK = ( WPA2_SECURITY | AES_ENABLED ), /**< WPA2 PSK Security with AES */
  129. RTW_SECURITY_WPA2_AES_8021X = ( IEEE_8021X_ENABLED | WPA2_SECURITY | WEP_ENABLED ), /**< WPA2 8021X Security with AES */
  130. RTW_SECURITY_WPA2_TKIP_PSK = ( WPA2_SECURITY | TKIP_ENABLED ), /**< WPA2 PSK Security with TKIP */
  131. RTW_SECURITY_WPA2_TKIP_8021X = ( IEEE_8021X_ENABLED | WPA2_SECURITY | TKIP_ENABLED ), /**< WPA2 8021X Security with TKIP */
  132. RTW_SECURITY_WPA2_MIXED_PSK = ( WPA2_SECURITY | AES_ENABLED | TKIP_ENABLED ), /**< WPA2 PSK Security with AES & TKIP */
  133. RTW_SECURITY_WPA_WPA2_MIXED_PSK = ( WPA_SECURITY | WPA2_SECURITY ), /**< WPA/WPA2 PSK Security */
  134. RTW_SECURITY_WPA_WPA2_MIXED_8021X = ( IEEE_8021X_ENABLED | WPA_SECURITY | WPA2_SECURITY ), /**< WPA/WPA2 8021X Security */
  135. RTW_SECURITY_WPA2_AES_CMAC = ( WPA2_SECURITY | AES_CMAC_ENABLED), /**< WPA2 Security with AES and Management Frame Protection */
  136. RTW_SECURITY_WPS_OPEN = WPS_ENABLED, /**< WPS with open security */
  137. RTW_SECURITY_WPS_SECURE = (WPS_ENABLED | AES_ENABLED), /**< WPS with AES security */
  138. RTW_SECURITY_WPA3_AES_PSK = (WPA3_SECURITY | AES_ENABLED), /**< WPA3-AES with AES security */
  139. RTW_SECURITY_UNKNOWN = -1, /**< May be returned by scan function if security is unknown. Do not pass this to the join function! */
  140. RTW_SECURITY_FORCE_32_BIT = 0x7fffffff /**< Exists only to force rtw_security_t type to 32 bits */
  141. };
  142. typedef unsigned long rtw_security_t;
  143. enum {
  144. RTW_ENCRYPTION_UNKNOWN = 0,
  145. RTW_ENCRYPTION_OPEN = 1,
  146. RTW_ENCRYPTION_WEP40 = 2,
  147. RTW_ENCRYPTION_WPA_TKIP = 3,
  148. RTW_ENCRYPTION_WPA_AES = 4,
  149. RTW_ENCRYPTION_WPA2_TKIP = 5,
  150. RTW_ENCRYPTION_WPA2_AES = 6,
  151. RTW_ENCRYPTION_WPA2_MIXED = 7,
  152. RTW_ENCRYPTION_WEP104 = 9,
  153. RTW_ENCRYPTION_UNDEF = 0xFF,
  154. };
  155. typedef unsigned long rtw_encryption_t;
  156. enum {
  157. RTW_FALSE = 0,
  158. RTW_TRUE = 1
  159. };
  160. typedef unsigned long rtw_bool_t;
  161. /**
  162. * @brief The enumeration lists the band types.
  163. */
  164. enum {
  165. RTW_802_11_BAND_5GHZ = 0, /**< Denotes 5GHz radio band */
  166. RTW_802_11_BAND_2_4GHZ = 1 /**< Denotes 2.4GHz radio band */
  167. };
  168. typedef unsigned long rtw_802_11_band_t;
  169. /**
  170. * @brief The enumeration lists all the country codes able to set to Wi-Fi driver.
  171. */
  172. enum {
  173. /* CHANNEL PLAN */
  174. RTW_COUNTRY_WORLD1, // 0x20
  175. RTW_COUNTRY_ETSI1, // 0x21
  176. RTW_COUNTRY_FCC1, // 0x22
  177. RTW_COUNTRY_MKK1, // 0x23
  178. RTW_COUNTRY_ETSI2, // 0x24
  179. RTW_COUNTRY_FCC2, // 0x2A
  180. RTW_COUNTRY_WORLD2, // 0x47
  181. RTW_COUNTRY_MKK2, // 0x58
  182. RTW_COUNTRY_GLOBAL, // 0x41
  183. /* SPECIAL */
  184. RTW_COUNTRY_WORLD, // WORLD1
  185. RTW_COUNTRY_EU, // ETSI1
  186. /* JAPANESE */
  187. RTW_COUNTRY_JP, // MKK1
  188. /* FCC , 19 countries*/
  189. RTW_COUNTRY_AS, // FCC2
  190. RTW_COUNTRY_BM,
  191. RTW_COUNTRY_CA,
  192. RTW_COUNTRY_DM,
  193. RTW_COUNTRY_DO,
  194. RTW_COUNTRY_FM,
  195. RTW_COUNTRY_GD,
  196. RTW_COUNTRY_GT,
  197. RTW_COUNTRY_GU,
  198. RTW_COUNTRY_HT,
  199. RTW_COUNTRY_MH,
  200. RTW_COUNTRY_MP,
  201. RTW_COUNTRY_NI,
  202. RTW_COUNTRY_PA,
  203. RTW_COUNTRY_PR,
  204. RTW_COUNTRY_PW,
  205. RTW_COUNTRY_TW,
  206. RTW_COUNTRY_US,
  207. RTW_COUNTRY_VI,
  208. /* others, ETSI */
  209. RTW_COUNTRY_AD, // ETSI1
  210. RTW_COUNTRY_AE,
  211. RTW_COUNTRY_AF,
  212. RTW_COUNTRY_AI,
  213. RTW_COUNTRY_AL,
  214. RTW_COUNTRY_AM,
  215. RTW_COUNTRY_AN,
  216. RTW_COUNTRY_AR,
  217. RTW_COUNTRY_AT,
  218. RTW_COUNTRY_AU,
  219. RTW_COUNTRY_AW,
  220. RTW_COUNTRY_AZ,
  221. RTW_COUNTRY_BA,
  222. RTW_COUNTRY_BB,
  223. RTW_COUNTRY_BD,
  224. RTW_COUNTRY_BE,
  225. RTW_COUNTRY_BF,
  226. RTW_COUNTRY_BG,
  227. RTW_COUNTRY_BH,
  228. RTW_COUNTRY_BL,
  229. RTW_COUNTRY_BN,
  230. RTW_COUNTRY_BO,
  231. RTW_COUNTRY_BR,
  232. RTW_COUNTRY_BS,
  233. RTW_COUNTRY_BT,
  234. RTW_COUNTRY_BY,
  235. RTW_COUNTRY_BZ,
  236. RTW_COUNTRY_CF,
  237. RTW_COUNTRY_CH,
  238. RTW_COUNTRY_CI,
  239. RTW_COUNTRY_CL,
  240. RTW_COUNTRY_CN,
  241. RTW_COUNTRY_CO,
  242. RTW_COUNTRY_CR,
  243. RTW_COUNTRY_CX,
  244. RTW_COUNTRY_CY,
  245. RTW_COUNTRY_CZ,
  246. RTW_COUNTRY_DE,
  247. RTW_COUNTRY_DK,
  248. RTW_COUNTRY_DZ,
  249. RTW_COUNTRY_EC,
  250. RTW_COUNTRY_EE,
  251. RTW_COUNTRY_EG,
  252. RTW_COUNTRY_ES,
  253. RTW_COUNTRY_ET,
  254. RTW_COUNTRY_FI,
  255. RTW_COUNTRY_FR,
  256. RTW_COUNTRY_GB,
  257. RTW_COUNTRY_GE,
  258. RTW_COUNTRY_GF,
  259. RTW_COUNTRY_GH,
  260. RTW_COUNTRY_GL,
  261. RTW_COUNTRY_GP,
  262. RTW_COUNTRY_GR,
  263. RTW_COUNTRY_GY,
  264. RTW_COUNTRY_HK,
  265. RTW_COUNTRY_HN,
  266. RTW_COUNTRY_HR,
  267. RTW_COUNTRY_HU,
  268. RTW_COUNTRY_ID,
  269. RTW_COUNTRY_IE,
  270. RTW_COUNTRY_IL,
  271. RTW_COUNTRY_IN,
  272. RTW_COUNTRY_IQ,
  273. RTW_COUNTRY_IR,
  274. RTW_COUNTRY_IS,
  275. RTW_COUNTRY_IT,
  276. RTW_COUNTRY_JM,
  277. RTW_COUNTRY_JO,
  278. RTW_COUNTRY_KE,
  279. RTW_COUNTRY_KH,
  280. RTW_COUNTRY_KN,
  281. RTW_COUNTRY_KP,
  282. RTW_COUNTRY_KR,
  283. RTW_COUNTRY_KW,
  284. RTW_COUNTRY_KY,
  285. RTW_COUNTRY_KZ,
  286. RTW_COUNTRY_LA,
  287. RTW_COUNTRY_LB,
  288. RTW_COUNTRY_LC,
  289. RTW_COUNTRY_LI,
  290. RTW_COUNTRY_LK,
  291. RTW_COUNTRY_LR,
  292. RTW_COUNTRY_LS,
  293. RTW_COUNTRY_LT,
  294. RTW_COUNTRY_LU,
  295. RTW_COUNTRY_LV,
  296. RTW_COUNTRY_MA,
  297. RTW_COUNTRY_MC,
  298. RTW_COUNTRY_MD,
  299. RTW_COUNTRY_ME,
  300. RTW_COUNTRY_MF,
  301. RTW_COUNTRY_MK,
  302. RTW_COUNTRY_MN,
  303. RTW_COUNTRY_MO,
  304. RTW_COUNTRY_MQ,
  305. RTW_COUNTRY_MR,
  306. RTW_COUNTRY_MT,
  307. RTW_COUNTRY_MU,
  308. RTW_COUNTRY_MV,
  309. RTW_COUNTRY_MW,
  310. RTW_COUNTRY_MX,
  311. RTW_COUNTRY_MY,
  312. RTW_COUNTRY_NG,
  313. RTW_COUNTRY_NL,
  314. RTW_COUNTRY_NO,
  315. RTW_COUNTRY_NP,
  316. RTW_COUNTRY_NZ,
  317. RTW_COUNTRY_OM,
  318. RTW_COUNTRY_PE,
  319. RTW_COUNTRY_PF,
  320. RTW_COUNTRY_PG,
  321. RTW_COUNTRY_PH,
  322. RTW_COUNTRY_PK,
  323. RTW_COUNTRY_PL,
  324. RTW_COUNTRY_PM,
  325. RTW_COUNTRY_PT,
  326. RTW_COUNTRY_PY,
  327. RTW_COUNTRY_QA,
  328. RTW_COUNTRY_RS,
  329. RTW_COUNTRY_RU,
  330. RTW_COUNTRY_RW,
  331. RTW_COUNTRY_SA,
  332. RTW_COUNTRY_SE,
  333. RTW_COUNTRY_SG,
  334. RTW_COUNTRY_SI,
  335. RTW_COUNTRY_SK,
  336. RTW_COUNTRY_SN,
  337. RTW_COUNTRY_SR,
  338. RTW_COUNTRY_SV,
  339. RTW_COUNTRY_SY,
  340. RTW_COUNTRY_TC,
  341. RTW_COUNTRY_TD,
  342. RTW_COUNTRY_TG,
  343. RTW_COUNTRY_TH,
  344. RTW_COUNTRY_TN,
  345. RTW_COUNTRY_TR,
  346. RTW_COUNTRY_TT,
  347. RTW_COUNTRY_TZ,
  348. RTW_COUNTRY_UA,
  349. RTW_COUNTRY_UG,
  350. RTW_COUNTRY_UY,
  351. RTW_COUNTRY_UZ,
  352. RTW_COUNTRY_VC,
  353. RTW_COUNTRY_VE,
  354. RTW_COUNTRY_VN,
  355. RTW_COUNTRY_VU,
  356. RTW_COUNTRY_WF,
  357. RTW_COUNTRY_WS,
  358. RTW_COUNTRY_YE,
  359. RTW_COUNTRY_YT,
  360. RTW_COUNTRY_ZA,
  361. RTW_COUNTRY_ZW,
  362. RTW_COUNTRY_MAX
  363. };
  364. typedef unsigned long rtw_country_code_t;
  365. /**
  366. * @brief The enumeration lists the adaptivity types.
  367. */
  368. enum {
  369. RTW_ADAPTIVITY_DISABLE = 0,
  370. RTW_ADAPTIVITY_NORMAL, // CE
  371. RTW_ADAPTIVITY_CARRIER_SENSE // MKK
  372. };
  373. typedef unsigned long rtw_adaptivity_mode_t;
  374. /**
  375. * @brief The enumeration lists the supported operation mode by WIFI driver,
  376. * including station and AP mode.
  377. */
  378. enum {
  379. RTW_MODE_NONE = 0,
  380. RTW_MODE_STA,
  381. RTW_MODE_AP,
  382. RTW_MODE_STA_AP,
  383. RTW_MODE_PROMISC,
  384. RTW_MODE_P2P
  385. };
  386. typedef unsigned long rtw_mode_t;
  387. enum {
  388. RTW_SCAN_FULL = 0,
  389. RTW_SCAN_SOCIAL,
  390. RTW_SCAN_ONE
  391. };
  392. typedef unsigned long rtw_scan_mode_t;
  393. /**
  394. * @brief The enumeration lists the supported autoreconnect mode by WIFI driver.
  395. */
  396. typedef enum{
  397. RTW_AUTORECONNECT_DISABLE,
  398. RTW_AUTORECONNECT_FINITE,
  399. RTW_AUTORECONNECT_INFINITE
  400. } rtw_autoreconnect_mode_t;
  401. /**
  402. * @brief The enumeration lists the status to describe the connection link.
  403. */
  404. enum {
  405. RTW_LINK_DISCONNECTED = 0,
  406. RTW_LINK_CONNECTED
  407. };
  408. typedef unsigned long rtw_link_status_t;
  409. /**
  410. * @brief The enumeration lists the scan types.
  411. */
  412. enum {
  413. RTW_SCAN_TYPE_ACTIVE = 0x00, /**< Actively scan a network by sending 802.11 probe(s) */
  414. RTW_SCAN_TYPE_PASSIVE = 0x01, /**< Passively scan a network by listening for beacons from APs */
  415. RTW_SCAN_TYPE_PROHIBITED_CHANNELS = 0x04 /**< Passively scan on channels not enabled by the country code */
  416. };
  417. typedef unsigned long rtw_scan_type_t;
  418. /**
  419. * @brief The enumeration lists the bss types.
  420. */
  421. enum {
  422. RTW_BSS_TYPE_INFRASTRUCTURE = 0, /**< Denotes infrastructure network */
  423. RTW_BSS_TYPE_ADHOC = 1, /**< Denotes an 802.11 ad-hoc IBSS network */
  424. RTW_BSS_TYPE_ANY = 2, /**< Denotes either infrastructure or ad-hoc network */
  425. RTW_BSS_TYPE_UNKNOWN = -1 /**< May be returned by scan function if BSS type is unknown. Do not pass this to the Join function */
  426. };
  427. typedef unsigned long rtw_bss_type_t;
  428. enum {
  429. RTW_SCAN_COMMAMD = 0x01
  430. };
  431. typedef unsigned long rtw_scan_command_t;
  432. enum{
  433. COMMAND1 = 0x01
  434. };
  435. typedef unsigned long rtw_command_type;
  436. enum {
  437. RTW_WPS_TYPE_DEFAULT = 0x0000,
  438. RTW_WPS_TYPE_USER_SPECIFIED = 0x0001,
  439. RTW_WPS_TYPE_MACHINE_SPECIFIED = 0x0002,
  440. RTW_WPS_TYPE_REKEY = 0x0003,
  441. RTW_WPS_TYPE_PUSHBUTTON = 0x0004,
  442. RTW_WPS_TYPE_REGISTRAR_SPECIFIED = 0x0005,
  443. RTW_WPS_TYPE_NONE = 0x0006,
  444. RTW_WPS_TYPE_WSC = 0x0007
  445. };
  446. typedef unsigned long rtw_wps_type_t;
  447. /**
  448. * @brief The enumeration lists all the network bgn mode.
  449. */
  450. enum {
  451. RTW_NETWORK_B = 1,
  452. RTW_NETWORK_BG = 3,
  453. RTW_NETWORK_BGN = 11
  454. };
  455. typedef unsigned long rtw_network_mode_t;
  456. /**
  457. * @brief The enumeration lists the interfaces.
  458. */
  459. enum {
  460. RTW_STA_INTERFACE = 0, /**< STA or Client Interface */
  461. RTW_AP_INTERFACE = 1, /**< SoftAP Interface */
  462. };
  463. typedef unsigned long rtw_interface_t;
  464. /**
  465. * @brief The enumeration lists the packet filter rules.
  466. */
  467. enum {
  468. RTW_POSITIVE_MATCHING = 0, /**< Receive the data matching with this pattern and discard the other data */
  469. RTW_NEGATIVE_MATCHING = 1 /**< Discard the data matching with this pattern and receive the other data */
  470. };
  471. typedef unsigned long rtw_packet_filter_rule_t;
  472. /**
  473. * @brief The enumeration lists the promisc levels.
  474. */
  475. enum {
  476. RTW_PROMISC_DISABLE = 0, /**< Disable the promisc */
  477. RTW_PROMISC_ENABLE = 1, /**< Fetch all ethernet packets */
  478. RTW_PROMISC_ENABLE_1 = 2, /**< Fetch only B/M packets */
  479. RTW_PROMISC_ENABLE_2 = 3, /**< Fetch all 802.11 packets*/
  480. RTW_PROMISC_ENABLE_3 = 4, /**< Fetch only B/M 802.11 packets*/
  481. RTW_PROMISC_ENABLE_4 = 5, /**< Fetch all 802.11 packets & MIMO PLCP headers. Please note that the PLCP header would be struct rtw_rx_info_t defined in wifi_structures.h*/
  482. };
  483. typedef unsigned long rtw_rcr_level_t;
  484. /**
  485. * @brief The enumeration lists the promisc rx type.
  486. */
  487. #if CONFIG_UNSUPPORT_PLCPHDR_RPT
  488. enum {
  489. RTW_RX_NORMAL = 0, /**< The supported 802.11 packet*/
  490. RTW_RX_UNSUPPORT = 1, /**< Unsupported 802.11 packet info */
  491. };
  492. typedef unsigned long rtw_rx_type_t;
  493. #endif
  494. /**
  495. * @brief The enumeration lists the disconnect reasons.
  496. */
  497. enum{
  498. RTW_NO_ERROR = 0,
  499. RTW_NONE_NETWORK = 1,
  500. RTW_CONNECT_FAIL = 2,
  501. RTW_WRONG_PASSWORD = 3 ,
  502. RTW_4WAY_HANDSHAKE_TIMEOUT = 4,
  503. RTW_DHCP_FAIL = 5,
  504. RTW_UNKNOWN,
  505. };
  506. typedef unsigned long rtw_connect_error_flag_t;
  507. enum {
  508. RTW_TX_PWR_PERCENTAGE_100 = 0, /* 100%, default target output power. */
  509. RTW_TX_PWR_PERCENTAGE_75 = 1, /* 75% */
  510. RTW_TX_PWR_PERCENTAGE_50 = 2, /* 50% */
  511. RTW_TX_PWR_PERCENTAGE_25 = 3, /* 25% */
  512. RTW_TX_PWR_PERCENTAGE_12_5 = 4, /* 12.5% */
  513. };
  514. typedef unsigned long rtw_tx_pwr_percentage_t;
  515. /**
  516. * @brief The enumeration is event type indicated from wlan driver.
  517. */
  518. enum _WIFI_EVENT_INDICATE{
  519. WIFI_EVENT_CONNECT = 0,
  520. WIFI_EVENT_DISCONNECT = 1,
  521. WIFI_EVENT_FOURWAY_HANDSHAKE_DONE = 2,
  522. WIFI_EVENT_SCAN_RESULT_REPORT = 3,
  523. WIFI_EVENT_SCAN_DONE = 4,
  524. WIFI_EVENT_RECONNECTION_FAIL = 5,
  525. WIFI_EVENT_SEND_ACTION_DONE = 6,
  526. WIFI_EVENT_RX_MGNT = 7,
  527. WIFI_EVENT_STA_ASSOC = 8,
  528. WIFI_EVENT_STA_DISASSOC = 9,
  529. WIFI_EVENT_STA_WPS_START = 10,
  530. WIFI_EVENT_WPS_FINISH = 11,
  531. WIFI_EVENT_EAPOL_START = 12,
  532. WIFI_EVENT_EAPOL_RECVD = 13,
  533. WIFI_EVENT_NO_NETWORK = 14,
  534. WIFI_EVENT_BEACON_AFTER_DHCP = 15,
  535. WIFI_EVENT_IP_CHANGED = 16,
  536. WIFI_EVENT_ICV_ERROR = 17,
  537. WIFI_EVENT_CHALLENGE_FAIL = 18,
  538. WIFI_EVENT_SCAN_START = 19,
  539. WIFI_EVENT_SCAN_FAILED = 20,
  540. WIFI_EVENT_AUTHENTICATION = 21,
  541. WIFI_EVENT_AUTH_REJECT =22 ,
  542. WIFI_EVENT_DEAUTH =23 ,
  543. WIFI_EVENT_AUTH_TIMEOUT =24 ,
  544. WIFI_EVENT_ASSOCIATING = 25,
  545. WIFI_EVENT_ASSOCIATED =26 ,
  546. WIFI_EVENT_ASSOC_REJECT =27 ,
  547. WIFI_EVENT_ASSOC_TIMEOUT =28 ,
  548. WIFI_EVENT_HANDSHAKE_FAILED =29 ,
  549. WIFI_EVENT_4WAY_HANDSHAKE = 30,
  550. WIFI_EVENT_GROUP_HANDSHAKE = 31,
  551. WIFI_EVENT_GROUP_HANDSHAKE_DONE = 32,
  552. WIFI_EVENT_CONN_TIMEOUT =33,
  553. WIFI_EVENT_LEAVE_BUSY_TRAFFIC =34,
  554. WIFI_EVENT_MAX,
  555. };
  556. typedef unsigned long rtw_event_indicate_t;
  557. #ifdef __cplusplus
  558. }
  559. #endif
  560. /*\@}*/
  561. #endif /* _WIFI_CONSTANTS_H */