PageRenderTime 63ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/source/kernel/android-2.6.35/drivers/staging/rtl8192e/ieee80211.h

https://bitbucket.org/tfzxyinhao/kindle-fire
C++ Header | 2684 lines | 1913 code | 358 blank | 413 comment | 47 complexity | 736a05ca1a5f9aed46d094901576fbbc MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-3.0, 0BSD, MPL-2.0-no-copyleft-exception, GPL-2.0, LGPL-2.0, BSD-3-Clause, LGPL-2.1, Apache-2.0, AGPL-3.0, GPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. /*
  2. * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11
  3. * remains copyright by the original authors
  4. *
  5. * Portions of the merged code are based on Host AP (software wireless
  6. * LAN access point) driver for Intersil Prism2/2.5/3.
  7. *
  8. * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
  9. * <jkmaline@cc.hut.fi>
  10. * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
  11. *
  12. * Adaption to a generic IEEE 802.11 stack by James Ketrenos
  13. * <jketreno@linux.intel.com>
  14. * Copyright (c) 2004, Intel Corporation
  15. *
  16. * Modified for Realtek's wi-fi cards by Andrea Merello
  17. * <andreamrl@tiscali.it>
  18. *
  19. * This program is free software; you can redistribute it and/or modify
  20. * it under the terms of the GNU General Public License version 2 as
  21. * published by the Free Software Foundation. See README and COPYING for
  22. * more details.
  23. */
  24. #ifndef IEEE80211_H
  25. #define IEEE80211_H
  26. #include <linux/if_ether.h> /* ETH_ALEN */
  27. #include <linux/kernel.h> /* ARRAY_SIZE */
  28. #include <linux/version.h>
  29. #include <linux/module.h>
  30. #include <linux/jiffies.h>
  31. #include <linux/timer.h>
  32. #include <linux/sched.h>
  33. #include <linux/delay.h>
  34. #include <linux/wireless.h>
  35. #include "ieee80211/rtl819x_HT.h"
  36. #include "ieee80211/rtl819x_BA.h"
  37. #include "ieee80211/rtl819x_TS.h"
  38. #ifndef IW_MODE_MONITOR
  39. #define IW_MODE_MONITOR 6
  40. #endif
  41. #ifndef IWEVCUSTOM
  42. #define IWEVCUSTOM 0x8c02
  43. #endif
  44. #ifndef container_of
  45. /**
  46. * container_of - cast a member of a structure out to the containing structure
  47. *
  48. * @ptr: the pointer to the member.
  49. * @type: the type of the container struct this is embedded in.
  50. * @member: the name of the member within the struct.
  51. *
  52. */
  53. #define container_of(ptr, type, member) ({ \
  54. const typeof( ((type *)0)->member ) *__mptr = (ptr); \
  55. (type *)( (char *)__mptr - offsetof(type,member) );})
  56. #endif
  57. #define KEY_TYPE_NA 0x0
  58. #define KEY_TYPE_WEP40 0x1
  59. #define KEY_TYPE_TKIP 0x2
  60. #define KEY_TYPE_CCMP 0x4
  61. #define KEY_TYPE_WEP104 0x5
  62. /* added for rtl819x tx procedure */
  63. #define MAX_QUEUE_SIZE 0x10
  64. //
  65. // 8190 queue mapping
  66. //
  67. #define BK_QUEUE 0
  68. #define BE_QUEUE 1
  69. #define VI_QUEUE 2
  70. #define VO_QUEUE 3
  71. #define HCCA_QUEUE 4
  72. #define TXCMD_QUEUE 5
  73. #define MGNT_QUEUE 6
  74. #define HIGH_QUEUE 7
  75. #define BEACON_QUEUE 8
  76. #define LOW_QUEUE BE_QUEUE
  77. #define NORMAL_QUEUE MGNT_QUEUE
  78. //added by amy for ps
  79. #define SWRF_TIMEOUT 50
  80. //added by amy for LEAP related
  81. #define IE_CISCO_FLAG_POSITION 0x08 // Flag byte: byte 8, numbered from 0.
  82. #define SUPPORT_CKIP_MIC 0x08 // bit3
  83. #define SUPPORT_CKIP_PK 0x10 // bit4
  84. /* defined for skb cb field */
  85. /* At most 28 byte */
  86. typedef struct cb_desc {
  87. /* Tx Desc Related flags (8-9) */
  88. u8 bLastIniPkt:1;
  89. u8 bCmdOrInit:1;
  90. u8 bFirstSeg:1;
  91. u8 bLastSeg:1;
  92. u8 bEncrypt:1;
  93. u8 bTxDisableRateFallBack:1;
  94. u8 bTxUseDriverAssingedRate:1;
  95. u8 bHwSec:1; //indicate whether use Hw security. WB
  96. u8 reserved1;
  97. /* Tx Firmware Relaged flags (10-11)*/
  98. u8 bCTSEnable:1;
  99. u8 bRTSEnable:1;
  100. u8 bUseShortGI:1;
  101. u8 bUseShortPreamble:1;
  102. u8 bTxEnableFwCalcDur:1;
  103. u8 bAMPDUEnable:1;
  104. u8 bRTSSTBC:1;
  105. u8 RTSSC:1;
  106. u8 bRTSBW:1;
  107. u8 bPacketBW:1;
  108. u8 bRTSUseShortPreamble:1;
  109. u8 bRTSUseShortGI:1;
  110. u8 bMulticast:1;
  111. u8 bBroadcast:1;
  112. //u8 reserved2:2;
  113. u8 drv_agg_enable:1;
  114. u8 reserved2:1;
  115. /* Tx Desc related element(12-19) */
  116. u8 rata_index;
  117. u8 queue_index;
  118. //u8 reserved3;
  119. //u8 reserved4;
  120. u16 txbuf_size;
  121. //u8 reserved5;
  122. u8 RATRIndex;
  123. u8 reserved6;
  124. u8 reserved7;
  125. u8 reserved8;
  126. /* Tx firmware related element(20-27) */
  127. u8 data_rate;
  128. u8 rts_rate;
  129. u8 ampdu_factor;
  130. u8 ampdu_density;
  131. //u8 reserved9;
  132. //u8 reserved10;
  133. //u8 reserved11;
  134. u8 DrvAggrNum;
  135. u16 pkt_size;
  136. u8 reserved12;
  137. }cb_desc, *pcb_desc;
  138. /*--------------------------Define -------------------------------------------*/
  139. #define MGN_1M 0x02
  140. #define MGN_2M 0x04
  141. #define MGN_5_5M 0x0b
  142. #define MGN_11M 0x16
  143. #define MGN_6M 0x0c
  144. #define MGN_9M 0x12
  145. #define MGN_12M 0x18
  146. #define MGN_18M 0x24
  147. #define MGN_24M 0x30
  148. #define MGN_36M 0x48
  149. #define MGN_48M 0x60
  150. #define MGN_54M 0x6c
  151. #define MGN_MCS0 0x80
  152. #define MGN_MCS1 0x81
  153. #define MGN_MCS2 0x82
  154. #define MGN_MCS3 0x83
  155. #define MGN_MCS4 0x84
  156. #define MGN_MCS5 0x85
  157. #define MGN_MCS6 0x86
  158. #define MGN_MCS7 0x87
  159. #define MGN_MCS8 0x88
  160. #define MGN_MCS9 0x89
  161. #define MGN_MCS10 0x8a
  162. #define MGN_MCS11 0x8b
  163. #define MGN_MCS12 0x8c
  164. #define MGN_MCS13 0x8d
  165. #define MGN_MCS14 0x8e
  166. #define MGN_MCS15 0x8f
  167. //----------------------------------------------------------------------------
  168. // 802.11 Management frame Reason Code field
  169. //----------------------------------------------------------------------------
  170. enum _ReasonCode{
  171. unspec_reason = 0x1,
  172. auth_not_valid = 0x2,
  173. deauth_lv_ss = 0x3,
  174. inactivity = 0x4,
  175. ap_overload = 0x5,
  176. class2_err = 0x6,
  177. class3_err = 0x7,
  178. disas_lv_ss = 0x8,
  179. asoc_not_auth = 0x9,
  180. //----MIC_CHECK
  181. mic_failure = 0xe,
  182. //----END MIC_CHECK
  183. // Reason code defined in 802.11i D10.0 p.28.
  184. invalid_IE = 0x0d,
  185. four_way_tmout = 0x0f,
  186. two_way_tmout = 0x10,
  187. IE_dismatch = 0x11,
  188. invalid_Gcipher = 0x12,
  189. invalid_Pcipher = 0x13,
  190. invalid_AKMP = 0x14,
  191. unsup_RSNIEver = 0x15,
  192. invalid_RSNIE = 0x16,
  193. auth_802_1x_fail= 0x17,
  194. ciper_reject = 0x18,
  195. // Reason code defined in 7.3.1.7, 802.1e D13.0, p.42. Added by Annie, 2005-11-15.
  196. QoS_unspec = 0x20, // 32
  197. QAP_bandwidth = 0x21, // 33
  198. poor_condition = 0x22, // 34
  199. no_facility = 0x23, // 35
  200. // Where is 36???
  201. req_declined = 0x25, // 37
  202. invalid_param = 0x26, // 38
  203. req_not_honored= 0x27, // 39
  204. TS_not_created = 0x2F, // 47
  205. DL_not_allowed = 0x30, // 48
  206. dest_not_exist = 0x31, // 49
  207. dest_not_QSTA = 0x32, // 50
  208. };
  209. #define aSifsTime (((priv->ieee80211->current_network.mode == IEEE_A)||(priv->ieee80211->current_network.mode == IEEE_N_24G)||(priv->ieee80211->current_network.mode == IEEE_N_5G))? 16 : 10)
  210. #define MGMT_QUEUE_NUM 5
  211. #define IEEE_CMD_SET_WPA_PARAM 1
  212. #define IEEE_CMD_SET_WPA_IE 2
  213. #define IEEE_CMD_SET_ENCRYPTION 3
  214. #define IEEE_CMD_MLME 4
  215. #define IEEE_PARAM_WPA_ENABLED 1
  216. #define IEEE_PARAM_TKIP_COUNTERMEASURES 2
  217. #define IEEE_PARAM_DROP_UNENCRYPTED 3
  218. #define IEEE_PARAM_PRIVACY_INVOKED 4
  219. #define IEEE_PARAM_AUTH_ALGS 5
  220. #define IEEE_PARAM_IEEE_802_1X 6
  221. //It should consistent with the driver_XXX.c
  222. // David, 2006.9.26
  223. #define IEEE_PARAM_WPAX_SELECT 7
  224. //Added for notify the encryption type selection
  225. // David, 2006.9.26
  226. #define IEEE_PROTO_WPA 1
  227. #define IEEE_PROTO_RSN 2
  228. //Added for notify the encryption type selection
  229. // David, 2006.9.26
  230. #define IEEE_WPAX_USEGROUP 0
  231. #define IEEE_WPAX_WEP40 1
  232. #define IEEE_WPAX_TKIP 2
  233. #define IEEE_WPAX_WRAP 3
  234. #define IEEE_WPAX_CCMP 4
  235. #define IEEE_WPAX_WEP104 5
  236. #define IEEE_KEY_MGMT_IEEE8021X 1
  237. #define IEEE_KEY_MGMT_PSK 2
  238. #define IEEE_MLME_STA_DEAUTH 1
  239. #define IEEE_MLME_STA_DISASSOC 2
  240. #define IEEE_CRYPT_ERR_UNKNOWN_ALG 2
  241. #define IEEE_CRYPT_ERR_UNKNOWN_ADDR 3
  242. #define IEEE_CRYPT_ERR_CRYPT_INIT_FAILED 4
  243. #define IEEE_CRYPT_ERR_KEY_SET_FAILED 5
  244. #define IEEE_CRYPT_ERR_TX_KEY_SET_FAILED 6
  245. #define IEEE_CRYPT_ERR_CARD_CONF_FAILED 7
  246. #define IEEE_CRYPT_ALG_NAME_LEN 16
  247. #define MAX_IE_LEN 0xff
  248. // added for kernel conflict
  249. #define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl
  250. #define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl
  251. #define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl
  252. #define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl
  253. #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl
  254. #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl
  255. #define ieee80211_ccmp_null ieee80211_ccmp_null_rsl
  256. #define ieee80211_tkip_null ieee80211_tkip_null_rsl
  257. #define ieee80211_wep_null ieee80211_wep_null_rsl
  258. #define free_ieee80211 free_ieee80211_rsl
  259. #define alloc_ieee80211 alloc_ieee80211_rsl
  260. #define ieee80211_rx ieee80211_rx_rsl
  261. #define ieee80211_rx_mgt ieee80211_rx_mgt_rsl
  262. #define ieee80211_get_beacon ieee80211_get_beacon_rsl
  263. #define ieee80211_rtl_wake_queue ieee80211_rtl_wake_queue_rsl
  264. #define ieee80211_rtl_stop_queue ieee80211_rtl_stop_queue_rsl
  265. #define ieee80211_reset_queue ieee80211_reset_queue_rsl
  266. #define ieee80211_softmac_stop_protocol ieee80211_softmac_stop_protocol_rsl
  267. #define ieee80211_softmac_start_protocol ieee80211_softmac_start_protocol_rsl
  268. #define ieee80211_is_shortslot ieee80211_is_shortslot_rsl
  269. #define ieee80211_is_54g ieee80211_is_54g_rsl
  270. #define ieee80211_wpa_supplicant_ioctl ieee80211_wpa_supplicant_ioctl_rsl
  271. #define ieee80211_ps_tx_ack ieee80211_ps_tx_ack_rsl
  272. #define ieee80211_softmac_xmit ieee80211_softmac_xmit_rsl
  273. #define ieee80211_stop_send_beacons ieee80211_stop_send_beacons_rsl
  274. #define notify_wx_assoc_event notify_wx_assoc_event_rsl
  275. #define SendDisassociation SendDisassociation_rsl
  276. #define ieee80211_disassociate ieee80211_disassociate_rsl
  277. #define ieee80211_start_send_beacons ieee80211_start_send_beacons_rsl
  278. #define ieee80211_stop_scan ieee80211_stop_scan_rsl
  279. #define ieee80211_send_probe_requests ieee80211_send_probe_requests_rsl
  280. #define ieee80211_softmac_scan_syncro ieee80211_softmac_scan_syncro_rsl
  281. #define ieee80211_start_scan_syncro ieee80211_start_scan_syncro_rsl
  282. #define ieee80211_wx_get_essid ieee80211_wx_get_essid_rsl
  283. #define ieee80211_wx_set_essid ieee80211_wx_set_essid_rsl
  284. #define ieee80211_wx_set_rate ieee80211_wx_set_rate_rsl
  285. #define ieee80211_wx_get_rate ieee80211_wx_get_rate_rsl
  286. #define ieee80211_wx_set_wap ieee80211_wx_set_wap_rsl
  287. #define ieee80211_wx_get_wap ieee80211_wx_get_wap_rsl
  288. #define ieee80211_wx_set_mode ieee80211_wx_set_mode_rsl
  289. #define ieee80211_wx_get_mode ieee80211_wx_get_mode_rsl
  290. #define ieee80211_wx_set_scan ieee80211_wx_set_scan_rsl
  291. #define ieee80211_wx_get_freq ieee80211_wx_get_freq_rsl
  292. #define ieee80211_wx_set_freq ieee80211_wx_set_freq_rsl
  293. #define ieee80211_wx_set_rawtx ieee80211_wx_set_rawtx_rsl
  294. #define ieee80211_wx_get_name ieee80211_wx_get_name_rsl
  295. #define ieee80211_wx_set_power ieee80211_wx_set_power_rsl
  296. #define ieee80211_wx_get_power ieee80211_wx_get_power_rsl
  297. #define ieee80211_wlan_frequencies ieee80211_wlan_frequencies_rsl
  298. #define ieee80211_wx_set_rts ieee80211_wx_set_rts_rsl
  299. #define ieee80211_wx_get_rts ieee80211_wx_get_rts_rsl
  300. #define ieee80211_txb_free ieee80211_txb_free_rsl
  301. #define ieee80211_wx_set_gen_ie ieee80211_wx_set_gen_ie_rsl
  302. #define ieee80211_wx_get_scan ieee80211_wx_get_scan_rsl
  303. #define ieee80211_wx_set_encode ieee80211_wx_set_encode_rsl
  304. #define ieee80211_wx_get_encode ieee80211_wx_get_encode_rsl
  305. #if WIRELESS_EXT >= 18
  306. #define ieee80211_wx_set_mlme ieee80211_wx_set_mlme_rsl
  307. #define ieee80211_wx_set_auth ieee80211_wx_set_auth_rsl
  308. #define ieee80211_wx_set_encode_ext ieee80211_wx_set_encode_ext_rsl
  309. #define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl
  310. #endif
  311. typedef struct ieee_param {
  312. u32 cmd;
  313. u8 sta_addr[ETH_ALEN];
  314. union {
  315. struct {
  316. u8 name;
  317. u32 value;
  318. } wpa_param;
  319. struct {
  320. u32 len;
  321. u8 reserved[32];
  322. u8 data[0];
  323. } wpa_ie;
  324. struct{
  325. int command;
  326. int reason_code;
  327. } mlme;
  328. struct {
  329. u8 alg[IEEE_CRYPT_ALG_NAME_LEN];
  330. u8 set_tx;
  331. u32 err;
  332. u8 idx;
  333. u8 seq[8]; /* sequence counter (set: RX, get: TX) */
  334. u16 key_len;
  335. u8 key[0];
  336. } crypt;
  337. } u;
  338. }ieee_param;
  339. #if WIRELESS_EXT < 17
  340. #define IW_QUAL_QUAL_INVALID 0x10
  341. #define IW_QUAL_LEVEL_INVALID 0x20
  342. #define IW_QUAL_NOISE_INVALID 0x40
  343. #define IW_QUAL_QUAL_UPDATED 0x1
  344. #define IW_QUAL_LEVEL_UPDATED 0x2
  345. #define IW_QUAL_NOISE_UPDATED 0x4
  346. #endif
  347. #define MSECS(t) msecs_to_jiffies(t)
  348. #define msleep_interruptible_rsl msleep_interruptible
  349. #define IEEE80211_DATA_LEN 2304
  350. /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
  351. 6.2.1.1.2.
  352. The figure in section 7.1.2 suggests a body size of up to 2312
  353. bytes is allowed, which is a bit confusing, I suspect this
  354. represents the 2304 bytes of real data, plus a possible 8 bytes of
  355. WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
  356. #define IEEE80211_1ADDR_LEN 10
  357. #define IEEE80211_2ADDR_LEN 16
  358. #define IEEE80211_3ADDR_LEN 24
  359. #define IEEE80211_4ADDR_LEN 30
  360. #define IEEE80211_FCS_LEN 4
  361. #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
  362. #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
  363. #define IEEE80211_MGMT_HDR_LEN 24
  364. #define IEEE80211_DATA_HDR3_LEN 24
  365. #define IEEE80211_DATA_HDR4_LEN 30
  366. #define MIN_FRAG_THRESHOLD 256U
  367. #define MAX_FRAG_THRESHOLD 2346U
  368. /* Frame control field constants */
  369. #define IEEE80211_FCTL_VERS 0x0003
  370. #define IEEE80211_FCTL_FTYPE 0x000c
  371. #define IEEE80211_FCTL_STYPE 0x00f0
  372. #define IEEE80211_FCTL_FRAMETYPE 0x00fc
  373. #define IEEE80211_FCTL_TODS 0x0100
  374. #define IEEE80211_FCTL_FROMDS 0x0200
  375. #define IEEE80211_FCTL_DSTODS 0x0300 //added by david
  376. #define IEEE80211_FCTL_MOREFRAGS 0x0400
  377. #define IEEE80211_FCTL_RETRY 0x0800
  378. #define IEEE80211_FCTL_PM 0x1000
  379. #define IEEE80211_FCTL_MOREDATA 0x2000
  380. #define IEEE80211_FCTL_WEP 0x4000
  381. #define IEEE80211_FCTL_ORDER 0x8000
  382. #define IEEE80211_FTYPE_MGMT 0x0000
  383. #define IEEE80211_FTYPE_CTL 0x0004
  384. #define IEEE80211_FTYPE_DATA 0x0008
  385. /* management */
  386. #define IEEE80211_STYPE_ASSOC_REQ 0x0000
  387. #define IEEE80211_STYPE_ASSOC_RESP 0x0010
  388. #define IEEE80211_STYPE_REASSOC_REQ 0x0020
  389. #define IEEE80211_STYPE_REASSOC_RESP 0x0030
  390. #define IEEE80211_STYPE_PROBE_REQ 0x0040
  391. #define IEEE80211_STYPE_PROBE_RESP 0x0050
  392. #define IEEE80211_STYPE_BEACON 0x0080
  393. #define IEEE80211_STYPE_ATIM 0x0090
  394. #define IEEE80211_STYPE_DISASSOC 0x00A0
  395. #define IEEE80211_STYPE_AUTH 0x00B0
  396. #define IEEE80211_STYPE_DEAUTH 0x00C0
  397. #define IEEE80211_STYPE_MANAGE_ACT 0x00D0
  398. /* control */
  399. #define IEEE80211_STYPE_PSPOLL 0x00A0
  400. #define IEEE80211_STYPE_RTS 0x00B0
  401. #define IEEE80211_STYPE_CTS 0x00C0
  402. #define IEEE80211_STYPE_ACK 0x00D0
  403. #define IEEE80211_STYPE_CFEND 0x00E0
  404. #define IEEE80211_STYPE_CFENDACK 0x00F0
  405. #define IEEE80211_STYPE_BLOCKACK 0x0094
  406. /* data */
  407. #define IEEE80211_STYPE_DATA 0x0000
  408. #define IEEE80211_STYPE_DATA_CFACK 0x0010
  409. #define IEEE80211_STYPE_DATA_CFPOLL 0x0020
  410. #define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030
  411. #define IEEE80211_STYPE_NULLFUNC 0x0040
  412. #define IEEE80211_STYPE_CFACK 0x0050
  413. #define IEEE80211_STYPE_CFPOLL 0x0060
  414. #define IEEE80211_STYPE_CFACKPOLL 0x0070
  415. #define IEEE80211_STYPE_QOS_DATA 0x0080 //added for WMM 2006/8/2
  416. #define IEEE80211_STYPE_QOS_NULL 0x00C0
  417. #define IEEE80211_SCTL_FRAG 0x000F
  418. #define IEEE80211_SCTL_SEQ 0xFFF0
  419. /* QOS control */
  420. #define IEEE80211_QCTL_TID 0x000F
  421. #define FC_QOS_BIT BIT7
  422. #define IsDataFrame(pdu) ( ((pdu[0] & 0x0C)==0x08) ? true : false )
  423. #define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)) )
  424. //added by wb. Is this right?
  425. #define IsQoSDataFrame(pframe) ((*(u16*)pframe&(IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA))
  426. #define Frame_Order(pframe) (*(u16*)pframe&IEEE80211_FCTL_ORDER)
  427. #define SN_LESS(a, b) (((a-b)&0x800)!=0)
  428. #define SN_EQUAL(a, b) (a == b)
  429. #define MAX_DEV_ADDR_SIZE 8
  430. typedef enum _ACT_CATEGORY{
  431. ACT_CAT_QOS = 1,
  432. ACT_CAT_DLS = 2,
  433. ACT_CAT_BA = 3,
  434. ACT_CAT_HT = 7,
  435. ACT_CAT_WMM = 17,
  436. } ACT_CATEGORY, *PACT_CATEGORY;
  437. typedef enum _TS_ACTION{
  438. ACT_ADDTSREQ = 0,
  439. ACT_ADDTSRSP = 1,
  440. ACT_DELTS = 2,
  441. ACT_SCHEDULE = 3,
  442. } TS_ACTION, *PTS_ACTION;
  443. typedef enum _BA_ACTION{
  444. ACT_ADDBAREQ = 0,
  445. ACT_ADDBARSP = 1,
  446. ACT_DELBA = 2,
  447. } BA_ACTION, *PBA_ACTION;
  448. typedef enum _InitialGainOpType{
  449. IG_Backup=0,
  450. IG_Restore,
  451. IG_Max
  452. }InitialGainOpType;
  453. /* debug macros */
  454. #define CONFIG_IEEE80211_DEBUG
  455. #ifdef CONFIG_IEEE80211_DEBUG
  456. extern u32 ieee80211_debug_level;
  457. #define IEEE80211_DEBUG(level, fmt, args...) \
  458. do { if (ieee80211_debug_level & (level)) \
  459. printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)
  460. //wb added to debug out data buf
  461. //if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA
  462. #define IEEE80211_DEBUG_DATA(level, data, datalen) \
  463. do{ if ((ieee80211_debug_level & (level)) == (level)) \
  464. { \
  465. int i; \
  466. u8* pdata = (u8*) data; \
  467. printk(KERN_DEBUG "ieee80211: %s()\n", __FUNCTION__); \
  468. for(i=0; i<(int)(datalen); i++) \
  469. { \
  470. printk("%2x ", pdata[i]); \
  471. if ((i+1)%16 == 0) printk("\n"); \
  472. } \
  473. printk("\n"); \
  474. } \
  475. } while (0)
  476. #else
  477. #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
  478. #define IEEE80211_DEBUG_DATA(level, data, datalen) do {} while(0)
  479. #endif /* CONFIG_IEEE80211_DEBUG */
  480. /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
  481. /*
  482. * To use the debug system;
  483. *
  484. * If you are defining a new debug classification, simply add it to the #define
  485. * list here in the form of:
  486. *
  487. * #define IEEE80211_DL_xxxx VALUE
  488. *
  489. * shifting value to the left one bit from the previous entry. xxxx should be
  490. * the name of the classification (for example, WEP)
  491. *
  492. * You then need to either add a IEEE80211_xxxx_DEBUG() macro definition for your
  493. * classification, or use IEEE80211_DEBUG(IEEE80211_DL_xxxx, ...) whenever you want
  494. * to send output to that classification.
  495. *
  496. * To add your debug level to the list of levels seen when you perform
  497. *
  498. * % cat /proc/net/ipw/debug_level
  499. *
  500. * you simply need to add your entry to the ipw_debug_levels array.
  501. *
  502. * If you do not see debug_level in /proc/net/ipw then you do not have
  503. * CONFIG_IEEE80211_DEBUG defined in your kernel configuration
  504. *
  505. */
  506. #define IEEE80211_DL_INFO (1<<0)
  507. #define IEEE80211_DL_WX (1<<1)
  508. #define IEEE80211_DL_SCAN (1<<2)
  509. #define IEEE80211_DL_STATE (1<<3)
  510. #define IEEE80211_DL_MGMT (1<<4)
  511. #define IEEE80211_DL_FRAG (1<<5)
  512. #define IEEE80211_DL_EAP (1<<6)
  513. #define IEEE80211_DL_DROP (1<<7)
  514. #define IEEE80211_DL_TX (1<<8)
  515. #define IEEE80211_DL_RX (1<<9)
  516. #define IEEE80211_DL_HT (1<<10) //HT
  517. #define IEEE80211_DL_BA (1<<11) //ba
  518. #define IEEE80211_DL_TS (1<<12) //TS
  519. #define IEEE80211_DL_QOS (1<<13)
  520. #define IEEE80211_DL_REORDER (1<<14)
  521. #define IEEE80211_DL_IOT (1<<15)
  522. #define IEEE80211_DL_IPS (1<<16)
  523. #define IEEE80211_DL_TRACE (1<<29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen
  524. #define IEEE80211_DL_DATA (1<<30) //use this flag to control whether print data buf out.
  525. #define IEEE80211_DL_ERR (1<<31) //always open
  526. #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
  527. #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
  528. #define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a)
  529. #define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a)
  530. #define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a)
  531. #define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a)
  532. #define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a)
  533. #define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a)
  534. #define IEEE80211_DEBUG_EAP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## a)
  535. #define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
  536. #define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
  537. #define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
  538. #define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
  539. #ifdef CONFIG_IEEE80211_DEBUG
  540. /* Added by Annie, 2005-11-22. */
  541. #define MAX_STR_LEN 64
  542. /* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/
  543. #define PRINTABLE(_ch) (_ch>'!' && _ch<'~')
  544. #define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \
  545. if((_Comp) & level) \
  546. { \
  547. int __i; \
  548. u8 buffer[MAX_STR_LEN]; \
  549. int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
  550. memset(buffer, 0, MAX_STR_LEN); \
  551. memcpy(buffer, (u8 *)_Ptr, length ); \
  552. for( __i=0; __i<MAX_STR_LEN; __i++ ) \
  553. { \
  554. if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
  555. } \
  556. buffer[length] = '\0'; \
  557. printk("Rtl819x: "); \
  558. printk(_TitleString); \
  559. printk(": %d, <%s>\n", _Len, buffer); \
  560. }
  561. #else
  562. #define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0)
  563. #endif
  564. #include <linux/netdevice.h>
  565. #include <linux/if_arp.h> /* ARPHRD_ETHER */
  566. #ifndef WIRELESS_SPY
  567. #define WIRELESS_SPY // enable iwspy support
  568. #endif
  569. #include <net/iw_handler.h> // new driver API
  570. #ifndef ETH_P_PAE
  571. #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
  572. #endif /* ETH_P_PAE */
  573. #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
  574. #ifndef ETH_P_80211_RAW
  575. #define ETH_P_80211_RAW (ETH_P_ECONET + 1)
  576. #endif
  577. /* IEEE 802.11 defines */
  578. #define P80211_OUI_LEN 3
  579. struct ieee80211_snap_hdr {
  580. u8 dsap; /* always 0xAA */
  581. u8 ssap; /* always 0xAA */
  582. u8 ctrl; /* always 0x03 */
  583. u8 oui[P80211_OUI_LEN]; /* organizational universal id */
  584. } __attribute__ ((packed));
  585. #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
  586. #define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS)
  587. #define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
  588. #define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
  589. #define WLAN_FC_GET_FRAMETYPE(fc) ((fc) & IEEE80211_FCTL_FRAMETYPE)
  590. #define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
  591. #define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
  592. /* Authentication algorithms */
  593. #define WLAN_AUTH_OPEN 0
  594. #define WLAN_AUTH_SHARED_KEY 1
  595. #define WLAN_AUTH_LEAP 2
  596. #define WLAN_AUTH_CHALLENGE_LEN 128
  597. #define WLAN_CAPABILITY_BSS (1<<0)
  598. #define WLAN_CAPABILITY_IBSS (1<<1)
  599. #define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
  600. #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
  601. #define WLAN_CAPABILITY_PRIVACY (1<<4)
  602. #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
  603. #define WLAN_CAPABILITY_PBCC (1<<6)
  604. #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
  605. #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
  606. #define WLAN_CAPABILITY_QOS (1<<9)
  607. #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
  608. #define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
  609. /* 802.11g ERP information element */
  610. #define WLAN_ERP_NON_ERP_PRESENT (1<<0)
  611. #define WLAN_ERP_USE_PROTECTION (1<<1)
  612. #define WLAN_ERP_BARKER_PREAMBLE (1<<2)
  613. /* Status codes */
  614. enum ieee80211_statuscode {
  615. WLAN_STATUS_SUCCESS = 0,
  616. WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
  617. WLAN_STATUS_CAPS_UNSUPPORTED = 10,
  618. WLAN_STATUS_REASSOC_NO_ASSOC = 11,
  619. WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
  620. WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
  621. WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
  622. WLAN_STATUS_CHALLENGE_FAIL = 15,
  623. WLAN_STATUS_AUTH_TIMEOUT = 16,
  624. WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
  625. WLAN_STATUS_ASSOC_DENIED_RATES = 18,
  626. /* 802.11b */
  627. WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
  628. WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
  629. WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
  630. /* 802.11h */
  631. WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
  632. WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
  633. WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
  634. /* 802.11g */
  635. WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
  636. WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
  637. /* 802.11i */
  638. WLAN_STATUS_INVALID_IE = 40,
  639. WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
  640. WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
  641. WLAN_STATUS_INVALID_AKMP = 43,
  642. WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
  643. WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
  644. WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
  645. };
  646. /* Reason codes */
  647. enum ieee80211_reasoncode {
  648. WLAN_REASON_UNSPECIFIED = 1,
  649. WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
  650. WLAN_REASON_DEAUTH_LEAVING = 3,
  651. WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
  652. WLAN_REASON_DISASSOC_AP_BUSY = 5,
  653. WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
  654. WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
  655. WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
  656. WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
  657. /* 802.11h */
  658. WLAN_REASON_DISASSOC_BAD_POWER = 10,
  659. WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
  660. /* 802.11i */
  661. WLAN_REASON_INVALID_IE = 13,
  662. WLAN_REASON_MIC_FAILURE = 14,
  663. WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
  664. WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
  665. WLAN_REASON_IE_DIFFERENT = 17,
  666. WLAN_REASON_INVALID_GROUP_CIPHER = 18,
  667. WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
  668. WLAN_REASON_INVALID_AKMP = 20,
  669. WLAN_REASON_UNSUPP_RSN_VERSION = 21,
  670. WLAN_REASON_INVALID_RSN_IE_CAP = 22,
  671. WLAN_REASON_IEEE8021X_FAILED = 23,
  672. WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
  673. };
  674. #define IEEE80211_STATMASK_SIGNAL (1<<0)
  675. #define IEEE80211_STATMASK_RSSI (1<<1)
  676. #define IEEE80211_STATMASK_NOISE (1<<2)
  677. #define IEEE80211_STATMASK_RATE (1<<3)
  678. #define IEEE80211_STATMASK_WEMASK 0x7
  679. #define IEEE80211_CCK_MODULATION (1<<0)
  680. #define IEEE80211_OFDM_MODULATION (1<<1)
  681. #define IEEE80211_24GHZ_BAND (1<<0)
  682. #define IEEE80211_52GHZ_BAND (1<<1)
  683. #define IEEE80211_CCK_RATE_LEN 4
  684. #define IEEE80211_CCK_RATE_1MB 0x02
  685. #define IEEE80211_CCK_RATE_2MB 0x04
  686. #define IEEE80211_CCK_RATE_5MB 0x0B
  687. #define IEEE80211_CCK_RATE_11MB 0x16
  688. #define IEEE80211_OFDM_RATE_LEN 8
  689. #define IEEE80211_OFDM_RATE_6MB 0x0C
  690. #define IEEE80211_OFDM_RATE_9MB 0x12
  691. #define IEEE80211_OFDM_RATE_12MB 0x18
  692. #define IEEE80211_OFDM_RATE_18MB 0x24
  693. #define IEEE80211_OFDM_RATE_24MB 0x30
  694. #define IEEE80211_OFDM_RATE_36MB 0x48
  695. #define IEEE80211_OFDM_RATE_48MB 0x60
  696. #define IEEE80211_OFDM_RATE_54MB 0x6C
  697. #define IEEE80211_BASIC_RATE_MASK 0x80
  698. #define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
  699. #define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
  700. #define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
  701. #define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
  702. #define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
  703. #define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
  704. #define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
  705. #define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
  706. #define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
  707. #define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
  708. #define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
  709. #define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
  710. #define IEEE80211_CCK_RATES_MASK 0x0000000F
  711. #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
  712. IEEE80211_CCK_RATE_2MB_MASK)
  713. #define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
  714. IEEE80211_CCK_RATE_5MB_MASK | \
  715. IEEE80211_CCK_RATE_11MB_MASK)
  716. #define IEEE80211_OFDM_RATES_MASK 0x00000FF0
  717. #define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
  718. IEEE80211_OFDM_RATE_12MB_MASK | \
  719. IEEE80211_OFDM_RATE_24MB_MASK)
  720. #define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
  721. IEEE80211_OFDM_RATE_9MB_MASK | \
  722. IEEE80211_OFDM_RATE_18MB_MASK | \
  723. IEEE80211_OFDM_RATE_36MB_MASK | \
  724. IEEE80211_OFDM_RATE_48MB_MASK | \
  725. IEEE80211_OFDM_RATE_54MB_MASK)
  726. #define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
  727. IEEE80211_CCK_DEFAULT_RATES_MASK)
  728. #define IEEE80211_NUM_OFDM_RATES 8
  729. #define IEEE80211_NUM_CCK_RATES 4
  730. #define IEEE80211_OFDM_SHIFT_MASK_A 4
  731. /* this is stolen and modified from the madwifi driver*/
  732. #define IEEE80211_FC0_TYPE_MASK 0x0c
  733. #define IEEE80211_FC0_TYPE_DATA 0x08
  734. #define IEEE80211_FC0_SUBTYPE_MASK 0xB0
  735. #define IEEE80211_FC0_SUBTYPE_QOS 0x80
  736. #define IEEE80211_QOS_HAS_SEQ(fc) \
  737. (((fc) & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == \
  738. (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
  739. /* this is stolen from ipw2200 driver */
  740. #define IEEE_IBSS_MAC_HASH_SIZE 31
  741. struct ieee_ibss_seq {
  742. u8 mac[ETH_ALEN];
  743. u16 seq_num[17];
  744. u16 frag_num[17];
  745. unsigned long packet_time[17];
  746. struct list_head list;
  747. };
  748. /* NOTE: This data is for statistical purposes; not all hardware provides this
  749. * information for frames received. Not setting these will not cause
  750. * any adverse affects. */
  751. struct ieee80211_rx_stats {
  752. #if 1
  753. u32 mac_time[2];
  754. s8 rssi;
  755. u8 signal;
  756. u8 noise;
  757. u16 rate; /* in 100 kbps */
  758. u8 received_channel;
  759. u8 control;
  760. u8 mask;
  761. u8 freq;
  762. u16 len;
  763. u64 tsf;
  764. u32 beacon_time;
  765. u8 nic_type;
  766. u16 Length;
  767. // u8 DataRate; // In 0.5 Mbps
  768. u8 SignalQuality; // in 0-100 index.
  769. s32 RecvSignalPower; // Real power in dBm for this packet, no beautification and aggregation.
  770. s8 RxPower; // in dBm Translate from PWdB
  771. u8 SignalStrength; // in 0-100 index.
  772. u16 bHwError:1;
  773. u16 bCRC:1;
  774. u16 bICV:1;
  775. u16 bShortPreamble:1;
  776. u16 Antenna:1; //for rtl8185
  777. u16 Decrypted:1; //for rtl8185, rtl8187
  778. u16 Wakeup:1; //for rtl8185
  779. u16 Reserved0:1; //for rtl8185
  780. u8 AGC;
  781. u32 TimeStampLow;
  782. u32 TimeStampHigh;
  783. bool bShift;
  784. bool bIsQosData; // Added by Annie, 2005-12-22.
  785. u8 UserPriority;
  786. //1!!!!!!!!!!!!!!!!!!!!!!!!!!!
  787. //1Attention Please!!!<11n or 8190 specific code should be put below this line>
  788. //1!!!!!!!!!!!!!!!!!!!!!!!!!!!
  789. u8 RxDrvInfoSize;
  790. u8 RxBufShift;
  791. bool bIsAMPDU;
  792. bool bFirstMPDU;
  793. bool bContainHTC;
  794. bool RxIs40MHzPacket;
  795. u32 RxPWDBAll;
  796. u8 RxMIMOSignalStrength[4]; // in 0~100 index
  797. s8 RxMIMOSignalQuality[2];
  798. bool bPacketMatchBSSID;
  799. bool bIsCCK;
  800. bool bPacketToSelf;
  801. //added by amy
  802. u8* virtual_address;
  803. u16 packetlength; // Total packet length: Must equal to sum of all FragLength
  804. u16 fraglength; // FragLength should equal to PacketLength in non-fragment case
  805. u16 fragoffset; // Data offset for this fragment
  806. u16 ntotalfrag;
  807. bool bisrxaggrsubframe;
  808. bool bPacketBeacon; //cosa add for rssi
  809. bool bToSelfBA; //cosa add for rssi
  810. char cck_adc_pwdb[4]; //cosa add for rx path selection
  811. u16 Seq_Num;
  812. #endif
  813. };
  814. /* IEEE 802.11 requires that STA supports concurrent reception of at least
  815. * three fragmented frames. This define can be increased to support more
  816. * concurrent frames, but it should be noted that each entry can consume about
  817. * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
  818. #define IEEE80211_FRAG_CACHE_LEN 4
  819. struct ieee80211_frag_entry {
  820. unsigned long first_frag_time;
  821. unsigned int seq;
  822. unsigned int last_frag;
  823. struct sk_buff *skb;
  824. u8 src_addr[ETH_ALEN];
  825. u8 dst_addr[ETH_ALEN];
  826. };
  827. struct ieee80211_stats {
  828. unsigned int tx_unicast_frames;
  829. unsigned int tx_multicast_frames;
  830. unsigned int tx_fragments;
  831. unsigned int tx_unicast_octets;
  832. unsigned int tx_multicast_octets;
  833. unsigned int tx_deferred_transmissions;
  834. unsigned int tx_single_retry_frames;
  835. unsigned int tx_multiple_retry_frames;
  836. unsigned int tx_retry_limit_exceeded;
  837. unsigned int tx_discards;
  838. unsigned int rx_unicast_frames;
  839. unsigned int rx_multicast_frames;
  840. unsigned int rx_fragments;
  841. unsigned int rx_unicast_octets;
  842. unsigned int rx_multicast_octets;
  843. unsigned int rx_fcs_errors;
  844. unsigned int rx_discards_no_buffer;
  845. unsigned int tx_discards_wrong_sa;
  846. unsigned int rx_discards_undecryptable;
  847. unsigned int rx_message_in_msg_fragments;
  848. unsigned int rx_message_in_bad_msg_fragments;
  849. };
  850. struct ieee80211_device;
  851. #include "ieee80211_crypt.h"
  852. #define SEC_KEY_1 (1<<0)
  853. #define SEC_KEY_2 (1<<1)
  854. #define SEC_KEY_3 (1<<2)
  855. #define SEC_KEY_4 (1<<3)
  856. #define SEC_ACTIVE_KEY (1<<4)
  857. #define SEC_AUTH_MODE (1<<5)
  858. #define SEC_UNICAST_GROUP (1<<6)
  859. #define SEC_LEVEL (1<<7)
  860. #define SEC_ENABLED (1<<8)
  861. #define SEC_ENCRYPT (1<<9)
  862. #define SEC_LEVEL_0 0 /* None */
  863. #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
  864. #define SEC_LEVEL_2 2 /* Level 1 + TKIP */
  865. #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
  866. #define SEC_LEVEL_3 4 /* Level 2 + CCMP */
  867. #define SEC_ALG_NONE 0
  868. #define SEC_ALG_WEP 1
  869. #define SEC_ALG_TKIP 2
  870. #define SEC_ALG_CCMP 3
  871. #define WEP_KEYS 4
  872. #define WEP_KEY_LEN 13
  873. #define SCM_KEY_LEN 32
  874. #define SCM_TEMPORAL_KEY_LENGTH 16
  875. struct ieee80211_security {
  876. u16 active_key:2,
  877. enabled:1,
  878. auth_mode:2,
  879. auth_algo:4,
  880. unicast_uses_group:1,
  881. encrypt:1;
  882. u8 key_sizes[WEP_KEYS];
  883. u8 keys[WEP_KEYS][SCM_KEY_LEN];
  884. u8 level;
  885. u16 flags;
  886. } __attribute__ ((packed));
  887. /*
  888. 802.11 data frame from AP
  889. ,-------------------------------------------------------------------.
  890. Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
  891. |------|------|---------|---------|---------|------|---------|------|
  892. Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs |
  893. | | tion | (BSSID) | | | ence | data | |
  894. `-------------------------------------------------------------------'
  895. Total: 28-2340 bytes
  896. */
  897. /* Management Frame Information Element Types */
  898. enum ieee80211_mfie {
  899. MFIE_TYPE_SSID = 0,
  900. MFIE_TYPE_RATES = 1,
  901. MFIE_TYPE_FH_SET = 2,
  902. MFIE_TYPE_DS_SET = 3,
  903. MFIE_TYPE_CF_SET = 4,
  904. MFIE_TYPE_TIM = 5,
  905. MFIE_TYPE_IBSS_SET = 6,
  906. MFIE_TYPE_COUNTRY = 7,
  907. MFIE_TYPE_HOP_PARAMS = 8,
  908. MFIE_TYPE_HOP_TABLE = 9,
  909. MFIE_TYPE_REQUEST = 10,
  910. MFIE_TYPE_CHALLENGE = 16,
  911. MFIE_TYPE_POWER_CONSTRAINT = 32,
  912. MFIE_TYPE_POWER_CAPABILITY = 33,
  913. MFIE_TYPE_TPC_REQUEST = 34,
  914. MFIE_TYPE_TPC_REPORT = 35,
  915. MFIE_TYPE_SUPP_CHANNELS = 36,
  916. MFIE_TYPE_CSA = 37,
  917. MFIE_TYPE_MEASURE_REQUEST = 38,
  918. MFIE_TYPE_MEASURE_REPORT = 39,
  919. MFIE_TYPE_QUIET = 40,
  920. MFIE_TYPE_IBSS_DFS = 41,
  921. MFIE_TYPE_ERP = 42,
  922. MFIE_TYPE_RSN = 48,
  923. MFIE_TYPE_RATES_EX = 50,
  924. MFIE_TYPE_HT_CAP= 45,
  925. MFIE_TYPE_HT_INFO= 61,
  926. MFIE_TYPE_AIRONET=133,
  927. MFIE_TYPE_GENERIC = 221,
  928. MFIE_TYPE_QOS_PARAMETER = 222,
  929. };
  930. /* Minimal header; can be used for passing 802.11 frames with sufficient
  931. * information to determine what type of underlying data type is actually
  932. * stored in the data. */
  933. struct ieee80211_hdr {
  934. __le16 frame_ctl;
  935. __le16 duration_id;
  936. u8 payload[0];
  937. } __attribute__ ((packed));
  938. struct ieee80211_hdr_1addr {
  939. __le16 frame_ctl;
  940. __le16 duration_id;
  941. u8 addr1[ETH_ALEN];
  942. u8 payload[0];
  943. } __attribute__ ((packed));
  944. struct ieee80211_hdr_2addr {
  945. __le16 frame_ctl;
  946. __le16 duration_id;
  947. u8 addr1[ETH_ALEN];
  948. u8 addr2[ETH_ALEN];
  949. u8 payload[0];
  950. } __attribute__ ((packed));
  951. struct ieee80211_hdr_3addr {
  952. __le16 frame_ctl;
  953. __le16 duration_id;
  954. u8 addr1[ETH_ALEN];
  955. u8 addr2[ETH_ALEN];
  956. u8 addr3[ETH_ALEN];
  957. __le16 seq_ctl;
  958. u8 payload[0];
  959. } __attribute__ ((packed));
  960. struct ieee80211_hdr_4addr {
  961. __le16 frame_ctl;
  962. __le16 duration_id;
  963. u8 addr1[ETH_ALEN];
  964. u8 addr2[ETH_ALEN];
  965. u8 addr3[ETH_ALEN];
  966. __le16 seq_ctl;
  967. u8 addr4[ETH_ALEN];
  968. u8 payload[0];
  969. } __attribute__ ((packed));
  970. struct ieee80211_hdr_3addrqos {
  971. __le16 frame_ctl;
  972. __le16 duration_id;
  973. u8 addr1[ETH_ALEN];
  974. u8 addr2[ETH_ALEN];
  975. u8 addr3[ETH_ALEN];
  976. __le16 seq_ctl;
  977. u8 payload[0];
  978. __le16 qos_ctl;
  979. } __attribute__ ((packed));
  980. struct ieee80211_hdr_4addrqos {
  981. __le16 frame_ctl;
  982. __le16 duration_id;
  983. u8 addr1[ETH_ALEN];
  984. u8 addr2[ETH_ALEN];
  985. u8 addr3[ETH_ALEN];
  986. __le16 seq_ctl;
  987. u8 addr4[ETH_ALEN];
  988. u8 payload[0];
  989. __le16 qos_ctl;
  990. } __attribute__ ((packed));
  991. struct ieee80211_info_element {
  992. u8 id;
  993. u8 len;
  994. u8 data[0];
  995. } __attribute__ ((packed));
  996. struct ieee80211_authentication {
  997. struct ieee80211_hdr_3addr header;
  998. __le16 algorithm;
  999. __le16 transaction;
  1000. __le16 status;
  1001. /*challenge*/
  1002. struct ieee80211_info_element info_element[0];
  1003. } __attribute__ ((packed));
  1004. struct ieee80211_disassoc {
  1005. struct ieee80211_hdr_3addr header;
  1006. __le16 reason;
  1007. } __attribute__ ((packed));
  1008. struct ieee80211_probe_request {
  1009. struct ieee80211_hdr_3addr header;
  1010. /* SSID, supported rates */
  1011. struct ieee80211_info_element info_element[0];
  1012. } __attribute__ ((packed));
  1013. struct ieee80211_probe_response {
  1014. struct ieee80211_hdr_3addr header;
  1015. u32 time_stamp[2];
  1016. __le16 beacon_interval;
  1017. __le16 capability;
  1018. /* SSID, supported rates, FH params, DS params,
  1019. * CF params, IBSS params, TIM (if beacon), RSN */
  1020. struct ieee80211_info_element info_element[0];
  1021. } __attribute__ ((packed));
  1022. /* Alias beacon for probe_response */
  1023. #define ieee80211_beacon ieee80211_probe_response
  1024. struct ieee80211_assoc_request_frame {
  1025. struct ieee80211_hdr_3addr header;
  1026. __le16 capability;
  1027. __le16 listen_interval;
  1028. /* SSID, supported rates, RSN */
  1029. struct ieee80211_info_element info_element[0];
  1030. } __attribute__ ((packed));
  1031. struct ieee80211_reassoc_request_frame {
  1032. struct ieee80211_hdr_3addr header;
  1033. __le16 capability;
  1034. __le16 listen_interval;
  1035. u8 current_ap[ETH_ALEN];
  1036. /* SSID, supported rates, RSN */
  1037. struct ieee80211_info_element info_element[0];
  1038. } __attribute__ ((packed));
  1039. struct ieee80211_assoc_response_frame {
  1040. struct ieee80211_hdr_3addr header;
  1041. __le16 capability;
  1042. __le16 status;
  1043. __le16 aid;
  1044. struct ieee80211_info_element info_element[0]; /* supported rates */
  1045. } __attribute__ ((packed));
  1046. struct ieee80211_txb {
  1047. u8 nr_frags;
  1048. u8 encrypted;
  1049. u8 queue_index;
  1050. u8 rts_included;
  1051. u16 reserved;
  1052. __le16 frag_size;
  1053. __le16 payload_size;
  1054. struct sk_buff *fragments[0];
  1055. };
  1056. #define MAX_TX_AGG_COUNT 16
  1057. struct ieee80211_drv_agg_txb {
  1058. u8 nr_drv_agg_frames;
  1059. struct sk_buff *tx_agg_frames[MAX_TX_AGG_COUNT];
  1060. }__attribute__((packed));
  1061. #define MAX_SUBFRAME_COUNT 64
  1062. struct ieee80211_rxb {
  1063. u8 nr_subframes;
  1064. struct sk_buff *subframes[MAX_SUBFRAME_COUNT];
  1065. u8 dst[ETH_ALEN];
  1066. u8 src[ETH_ALEN];
  1067. }__attribute__((packed));
  1068. typedef union _frameqos {
  1069. u16 shortdata;
  1070. u8 chardata[2];
  1071. struct {
  1072. u16 tid:4;
  1073. u16 eosp:1;
  1074. u16 ack_policy:2;
  1075. u16 reserved:1;
  1076. u16 txop:8;
  1077. }field;
  1078. }frameqos,*pframeqos;
  1079. /* SWEEP TABLE ENTRIES NUMBER*/
  1080. #define MAX_SWEEP_TAB_ENTRIES 42
  1081. #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
  1082. /* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs
  1083. * only use 8, and then use extended rates for the remaining supported
  1084. * rates. Other APs, however, stick all of their supported rates on the
  1085. * main rates information element... */
  1086. #define MAX_RATES_LENGTH ((u8)12)
  1087. #define MAX_RATES_EX_LENGTH ((u8)16)
  1088. #define MAX_NETWORK_COUNT 128
  1089. #define MAX_CHANNEL_NUMBER 161
  1090. #define IEEE80211_SOFTMAC_SCAN_TIME 100
  1091. //(HZ / 2)
  1092. #define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2)
  1093. #define CRC_LENGTH 4U
  1094. #define MAX_WPA_IE_LEN 64
  1095. #define NETWORK_EMPTY_ESSID (1<<0)
  1096. #define NETWORK_HAS_OFDM (1<<1)
  1097. #define NETWORK_HAS_CCK (1<<2)
  1098. /* QoS structure */
  1099. #define NETWORK_HAS_QOS_PARAMETERS (1<<3)
  1100. #define NETWORK_HAS_QOS_INFORMATION (1<<4)
  1101. #define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \
  1102. NETWORK_HAS_QOS_INFORMATION)
  1103. /* 802.11h */
  1104. #define NETWORK_HAS_POWER_CONSTRAINT (1<<5)
  1105. #define NETWORK_HAS_CSA (1<<6)
  1106. #define NETWORK_HAS_QUIET (1<<7)
  1107. #define NETWORK_HAS_IBSS_DFS (1<<8)
  1108. #define NETWORK_HAS_TPC_REPORT (1<<9)
  1109. #define NETWORK_HAS_ERP_VALUE (1<<10)
  1110. #define QOS_QUEUE_NUM 4
  1111. #define QOS_OUI_LEN 3
  1112. #define QOS_OUI_TYPE 2
  1113. #define QOS_ELEMENT_ID 221
  1114. #define QOS_OUI_INFO_SUB_TYPE 0
  1115. #define QOS_OUI_PARAM_SUB_TYPE 1
  1116. #define QOS_VERSION_1 1
  1117. #define QOS_AIFSN_MIN_VALUE 2
  1118. #if 1
  1119. struct ieee80211_qos_information_element {
  1120. u8 elementID;
  1121. u8 length;
  1122. u8 qui[QOS_OUI_LEN];
  1123. u8 qui_type;
  1124. u8 qui_subtype;
  1125. u8 version;
  1126. u8 ac_info;
  1127. } __attribute__ ((packed));
  1128. struct ieee80211_qos_ac_parameter {
  1129. u8 aci_aifsn;
  1130. u8 ecw_min_max;
  1131. __le16 tx_op_limit;
  1132. } __attribute__ ((packed));
  1133. struct ieee80211_qos_parameter_info {
  1134. struct ieee80211_qos_information_element info_element;
  1135. u8 reserved;
  1136. struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
  1137. } __attribute__ ((packed));
  1138. struct ieee80211_qos_parameters {
  1139. __le16 cw_min[QOS_QUEUE_NUM];
  1140. __le16 cw_max[QOS_QUEUE_NUM];
  1141. u8 aifs[QOS_QUEUE_NUM];
  1142. u8 flag[QOS_QUEUE_NUM];
  1143. __le16 tx_op_limit[QOS_QUEUE_NUM];
  1144. } __attribute__ ((packed));
  1145. struct ieee80211_qos_data {
  1146. struct ieee80211_qos_parameters parameters;
  1147. int active;
  1148. int supported;
  1149. u8 param_count;
  1150. u8 old_param_count;
  1151. };
  1152. struct ieee80211_tim_parameters {
  1153. u8 tim_count;
  1154. u8 tim_period;
  1155. } __attribute__ ((packed));
  1156. //#else
  1157. struct ieee80211_wmm_ac_param {
  1158. u8 ac_aci_acm_aifsn;
  1159. u8 ac_ecwmin_ecwmax;
  1160. u16 ac_txop_limit;
  1161. };
  1162. struct ieee80211_wmm_ts_info {
  1163. u8 ac_dir_tid;
  1164. u8 ac_up_psb;
  1165. u8 reserved;
  1166. } __attribute__ ((packed));
  1167. struct ieee80211_wmm_tspec_elem {
  1168. struct ieee80211_wmm_ts_info ts_info;
  1169. u16 norm_msdu_size;
  1170. u16 max_msdu_size;
  1171. u32 min_serv_inter;
  1172. u32 max_serv_inter;
  1173. u32 inact_inter;
  1174. u32 suspen_inter;
  1175. u32 serv_start_time;
  1176. u32 min_data_rate;
  1177. u32 mean_data_rate;
  1178. u32 peak_data_rate;
  1179. u32 max_burst_size;
  1180. u32 delay_bound;
  1181. u32 min_phy_rate;
  1182. u16 surp_band_allow;
  1183. u16 medium_time;
  1184. }__attribute__((packed));
  1185. #endif
  1186. enum eap_type {
  1187. EAP_PACKET = 0,
  1188. EAPOL_START,
  1189. EAPOL_LOGOFF,
  1190. EAPOL_KEY,
  1191. EAPOL_ENCAP_ASF_ALERT
  1192. };
  1193. static const char *eap_types[] = {
  1194. [EAP_PACKET] = "EAP-Packet",
  1195. [EAPOL_START] = "EAPOL-Start",
  1196. [EAPOL_LOGOFF] = "EAPOL-Logoff",
  1197. [EAPOL_KEY] = "EAPOL-Key",
  1198. [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert"
  1199. };
  1200. static inline const char *eap_get_type(int type)
  1201. {
  1202. return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
  1203. }
  1204. //added by amy for reorder
  1205. static inline u8 Frame_QoSTID(u8* buf)
  1206. {
  1207. struct ieee80211_hdr_3addr *hdr;
  1208. u16 fc;
  1209. hdr = (struct ieee80211_hdr_3addr *)buf;
  1210. fc = le16_to_cpu(hdr->frame_ctl);
  1211. return (u8)((frameqos*)(buf + (((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24)))->field.tid;
  1212. }
  1213. //added by amy for reorder
  1214. struct eapol {
  1215. u8 snap[6];
  1216. u16 ethertype;
  1217. u8 version;
  1218. u8 type;
  1219. u16 length;
  1220. } __attribute__ ((packed));
  1221. struct ieee80211_softmac_stats{
  1222. unsigned int rx_ass_ok;
  1223. unsigned int rx_ass_err;
  1224. unsigned int rx_probe_rq;
  1225. unsigned int tx_probe_rs;
  1226. unsigned int tx_beacons;
  1227. unsigned int rx_auth_rq;
  1228. unsigned int rx_auth_rs_ok;
  1229. unsigned int rx_auth_rs_err;
  1230. unsigned int tx_auth_rq;
  1231. unsigned int no_auth_rs;
  1232. unsigned int no_ass_rs;
  1233. unsigned int tx_ass_rq;
  1234. unsigned int rx_ass_rq;
  1235. unsigned int tx_probe_rq;
  1236. unsigned int reassoc;
  1237. unsigned int swtxstop;
  1238. unsigned int swtxawake;
  1239. unsigned char CurrentShowTxate;
  1240. unsigned char last_packet_rate;
  1241. unsigned int txretrycount;
  1242. };
  1243. #define BEACON_PROBE_SSID_ID_POSITION 12
  1244. struct ieee80211_info_element_hdr {
  1245. u8 id;
  1246. u8 len;
  1247. } __attribute__ ((packed));
  1248. /*
  1249. * These are the data types that can make up management packets
  1250. *
  1251. u16 auth_algorithm;
  1252. u16 auth_sequence;
  1253. u16 beacon_interval;
  1254. u16 capability;
  1255. u8 current_ap[ETH_ALEN];
  1256. u16 listen_interval;
  1257. struct {
  1258. u16 association_id:14, reserved:2;
  1259. } __attribute__ ((packed));
  1260. u32 time_stamp[2];
  1261. u16 reason;
  1262. u16 status;
  1263. */
  1264. #define IEEE80211_DEFAULT_TX_ESSID "Penguin"
  1265. #define IEEE80211_DEFAULT_BASIC_RATE 2 //1Mbps
  1266. enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
  1267. #define MAX_SP_Len (WMM_all_frame << 4)
  1268. #define IEEE80211_QOS_TID 0x0f
  1269. #define QOS_CTL_NOTCONTAIN_ACK (0x01 << 5)
  1270. #define IEEE80211_DTIM_MBCAST 4
  1271. #define IEEE80211_DTIM_UCAST 2
  1272. #define IEEE80211_DTIM_VALID 1
  1273. #define IEEE80211_DTIM_INVALID 0
  1274. #define IEEE80211_PS_DISABLED 0
  1275. #define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST
  1276. #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
  1277. //added by David for QoS 2006/6/30
  1278. //#define WMM_Hang_8187
  1279. #ifdef WMM_Hang_8187
  1280. #undef WMM_Hang_8187
  1281. #endif
  1282. #define WME_AC_BK 0x00
  1283. #define WME_AC_BE 0x01
  1284. #define WME_AC_VI 0x02
  1285. #define WME_AC_VO 0x03
  1286. #define WME_ACI_MASK 0x03
  1287. #define WME_AIFSN_MASK 0x03
  1288. #define WME_AC_PRAM_LEN 16
  1289. #define MAX_RECEIVE_BUFFER_SIZE 9100
  1290. //UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP
  1291. //#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1))
  1292. #if 1
  1293. #define UP2AC(up) ( \
  1294. ((up) < 1) ? WME_AC_BE : \
  1295. ((up) < 3) ? WME_AC_BK : \
  1296. ((up) < 4) ? WME_AC_BE : \
  1297. ((up) < 6) ? WME_AC_VI : \
  1298. WME_AC_VO)
  1299. #endif
  1300. //AC Mapping to UP, using in Tx part for selecting the corresponding TX queue
  1301. #define AC2UP(_ac) ( \
  1302. ((_ac) == WME_AC_VO) ? 6 : \
  1303. ((_ac) == WME_AC_VI) ? 5 : \
  1304. ((_ac) == WME_AC_BK) ? 1 : \
  1305. 0)
  1306. #define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
  1307. #define ETHERNET_HEADER_SIZE 14 /* length of two Ethernet address plus ether type*/
  1308. struct ether_header {
  1309. u8 ether_dhost[ETHER_ADDR_LEN];
  1310. u8 ether_shost[ETHER_ADDR_LEN];
  1311. u16 ether_type;
  1312. } __attribute__((packed));
  1313. #ifndef ETHERTYPE_PAE
  1314. #define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
  1315. #endif
  1316. #ifndef ETHERTYPE_IP
  1317. #define ETHERTYPE_IP 0x0800 /* IP protocol */
  1318. #endif
  1319. typedef struct _bss_ht{
  1320. bool support_ht;
  1321. // HT related elements
  1322. u8 ht_cap_buf[32];
  1323. u16 ht_cap_len;
  1324. u8 ht_info_buf[32];
  1325. u16 ht_info_len;
  1326. HT_SPEC_VER ht_spec_ver;
  1327. //HT_CAPABILITY_ELE bdHTCapEle;
  1328. //HT_INFORMATION_ELE bdHTInfoEle;
  1329. bool aggregation;
  1330. bool long_slot_time;
  1331. }bss_ht, *pbss_ht;
  1332. typedef enum _erp_t{
  1333. ERP_NonERPpresent = 0x01,
  1334. ERP_UseProtection = 0x02,
  1335. ERP_BarkerPreambleMode = 0x04,
  1336. } erp_t;
  1337. struct ieee80211_network {
  1338. /* These entries are used to identify a unique network */
  1339. u8 bssid[ETH_ALEN];
  1340. u8 channel;
  1341. /* Ensure null-terminated for any debug msgs */
  1342. u8 ssid[IW_ESSID_MAX_SIZE + 1];
  1343. u8 ssid_len;
  1344. #if 1
  1345. struct ieee80211_qos_data qos_data;
  1346. #else
  1347. // Qos related. Added by Annie, 2005-11-01.
  1348. BSS_QOS BssQos;
  1349. #endif
  1350. //added by amy for LEAP
  1351. bool bWithAironetIE;
  1352. bool bCkipSupported;
  1353. bool bCcxRmEnable;
  1354. u16 CcxRmState[2];
  1355. // CCXv4 S59, MBSSID.
  1356. bool bMBssidValid;
  1357. u8 MBssidMask;
  1358. u8 MBssid[6];
  1359. // CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20.
  1360. bool bWithCcxVerNum;
  1361. u8 BssCcxVerNumber;
  1362. /* These are network statistics */
  1363. struct ieee80211_rx_stats stats;
  1364. u16 capability;
  1365. u8 rates[MAX_RATES_LENGTH];
  1366. u8 rates_len;
  1367. u8 rates_ex[MAX_RATES_EX_LENGTH];
  1368. u8 rates_ex_len;
  1369. unsigned long last_scanned;
  1370. u8 mode;
  1371. u32 flags;
  1372. u32 last_associate;
  1373. u32 time_stamp[2];
  1374. u16 beacon_interval;
  1375. u16 listen_interval;
  1376. u16 atim_window;
  1377. u8 erp_value;
  1378. u8 wpa_ie[MAX_WPA_IE_LEN];
  1379. size_t wpa_ie_len;
  1380. u8 rsn_ie[MAX_WPA_IE_LEN];
  1381. size_t rsn_ie_len;
  1382. struct ieee80211_tim_parameters tim;
  1383. u8 dtim_period;
  1384. u8 dtim_data;
  1385. u32 last_dtim_sta_time[2];
  1386. //appeded for QoS
  1387. u8 wmm_info;
  1388. struct ieee80211_wmm_ac_param wmm_param[4];
  1389. u8 QoS_Enable;
  1390. #ifdef THOMAS_TURBO
  1391. u8 Turbo_Enable;//enable turbo mode, added by thomas
  1392. #endif
  1393. #ifdef ENABLE_DOT11D
  1394. u16 CountryIeLen;
  1395. u8 CountryIeBuf[MAX_IE_LEN];
  1396. #endif
  1397. // HT Related, by amy, 2008.04.29
  1398. BSS_HT bssht;
  1399. // Add to handle broadcom AP management frame CCK rate.
  1400. bool broadcom_cap_exist;
  1401. bool ralink_cap_exist;
  1402. bool atheros_cap_exist;
  1403. bool cisco_cap_exist;
  1404. bool unknown_cap_exist;
  1405. // u8 berp_info;
  1406. bool berp_info_valid;
  1407. bool buseprotection;
  1408. //put at the end of the structure.
  1409. struct list_head list;
  1410. };
  1411. #if 1
  1412. enum ieee80211_state {
  1413. /* the card is not linked at all */
  1414. IEEE80211_NOLINK = 0,
  1415. /* IEEE80211_ASSOCIATING* are for BSS client mode
  1416. * the driver shall not perform RX filtering unless
  1417. * the state is LINKED.
  1418. * The driver shal…

Large files files are truncated, but you can click here to view the full file