PageRenderTime 67ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/tfzxyinhao/kindle-fire
C++ Header | 1908 lines | 1309 code | 285 blank | 314 comment | 41 complexity | 0d11b11bff95c9abbee7bf0c1591639f 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/semaphore.h>
  34. #include <linux/delay.h>
  35. #include <linux/wireless.h>
  36. #include <linux/ieee80211.h>
  37. #include "rtl819x_HT.h"
  38. #include "rtl819x_BA.h"
  39. #include "rtl819x_TS.h"
  40. #define KEY_TYPE_NA 0x0
  41. #define KEY_TYPE_WEP40 0x1
  42. #define KEY_TYPE_TKIP 0x2
  43. #define KEY_TYPE_CCMP 0x4
  44. #define KEY_TYPE_WEP104 0x5
  45. #define aSifsTime (((priv->ieee80211->current_network.mode == IEEE_A) || \
  46. (priv->ieee80211->current_network.mode == IEEE_N_24G) || \
  47. (priv->ieee80211->current_network.mode == IEEE_N_5G)) \
  48. ? 16 : 10)
  49. #define MGMT_QUEUE_NUM 5
  50. #define IEEE_CMD_SET_WPA_PARAM 1
  51. #define IEEE_CMD_SET_WPA_IE 2
  52. #define IEEE_CMD_SET_ENCRYPTION 3
  53. #define IEEE_CMD_MLME 4
  54. #define IEEE_PARAM_WPA_ENABLED 1
  55. #define IEEE_PARAM_TKIP_COUNTERMEASURES 2
  56. #define IEEE_PARAM_DROP_UNENCRYPTED 3
  57. #define IEEE_PARAM_PRIVACY_INVOKED 4
  58. #define IEEE_PARAM_AUTH_ALGS 5
  59. #define IEEE_PARAM_IEEE_802_1X 6
  60. //It should consistent with the driver_XXX.c
  61. // David, 2006.9.26
  62. #define IEEE_PARAM_WPAX_SELECT 7
  63. //Added for notify the encryption type selection
  64. // David, 2006.9.26
  65. #define IEEE_PROTO_WPA 1
  66. #define IEEE_PROTO_RSN 2
  67. //Added for notify the encryption type selection
  68. // David, 2006.9.26
  69. #define IEEE_WPAX_USEGROUP 0
  70. #define IEEE_WPAX_WEP40 1
  71. #define IEEE_WPAX_TKIP 2
  72. #define IEEE_WPAX_WRAP 3
  73. #define IEEE_WPAX_CCMP 4
  74. #define IEEE_WPAX_WEP104 5
  75. #define IEEE_KEY_MGMT_IEEE8021X 1
  76. #define IEEE_KEY_MGMT_PSK 2
  77. #define IEEE_MLME_STA_DEAUTH 1
  78. #define IEEE_MLME_STA_DISASSOC 2
  79. #define IEEE_CRYPT_ERR_UNKNOWN_ALG 2
  80. #define IEEE_CRYPT_ERR_UNKNOWN_ADDR 3
  81. #define IEEE_CRYPT_ERR_CRYPT_INIT_FAILED 4
  82. #define IEEE_CRYPT_ERR_KEY_SET_FAILED 5
  83. #define IEEE_CRYPT_ERR_TX_KEY_SET_FAILED 6
  84. #define IEEE_CRYPT_ERR_CARD_CONF_FAILED 7
  85. #define IEEE_CRYPT_ALG_NAME_LEN 16
  86. #define MAX_IE_LEN 0xff
  87. typedef struct ieee_param {
  88. u32 cmd;
  89. u8 sta_addr[ETH_ALEN];
  90. union {
  91. struct {
  92. u8 name;
  93. u32 value;
  94. } wpa_param;
  95. struct {
  96. u32 len;
  97. u8 reserved[32];
  98. u8 data[0];
  99. } wpa_ie;
  100. struct{
  101. int command;
  102. int reason_code;
  103. } mlme;
  104. struct {
  105. u8 alg[IEEE_CRYPT_ALG_NAME_LEN];
  106. u8 set_tx;
  107. u32 err;
  108. u8 idx;
  109. u8 seq[8]; /* sequence counter (set: RX, get: TX) */
  110. u16 key_len;
  111. u8 key[0];
  112. } crypt;
  113. } u;
  114. }ieee_param;
  115. #define MSECS(t) msecs_to_jiffies(t)
  116. #define msleep_interruptible_rsl msleep_interruptible
  117. #define IEEE80211_DATA_LEN 2304
  118. /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
  119. 6.2.1.1.2.
  120. The figure in section 7.1.2 suggests a body size of up to 2312
  121. bytes is allowed, which is a bit confusing, I suspect this
  122. represents the 2304 bytes of real data, plus a possible 8 bytes of
  123. WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
  124. #define IEEE80211_1ADDR_LEN 10
  125. #define IEEE80211_2ADDR_LEN 16
  126. #define IEEE80211_3ADDR_LEN 24
  127. #define IEEE80211_4ADDR_LEN 30
  128. #define IEEE80211_FCS_LEN 4
  129. #define IEEE80211_HLEN IEEE80211_4ADDR_LEN
  130. #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
  131. #define IEEE80211_MGMT_HDR_LEN 24
  132. #define IEEE80211_DATA_HDR3_LEN 24
  133. #define IEEE80211_DATA_HDR4_LEN 30
  134. #define MIN_FRAG_THRESHOLD 256U
  135. #define MAX_FRAG_THRESHOLD 2346U
  136. /* Frame control field constants */
  137. #define IEEE80211_FCTL_FRAMETYPE 0x00fc
  138. #define IEEE80211_FCTL_DSTODS 0x0300 //added by david
  139. #define IEEE80211_FCTL_WEP 0x4000
  140. /* management */
  141. #define IEEE80211_STYPE_MANAGE_ACT 0x00D0
  142. /* control */
  143. #define IEEE80211_STYPE_BLOCKACK 0x0094
  144. /* QOS control */
  145. #define IEEE80211_QCTL_TID 0x000F
  146. /* debug macros */
  147. #define CONFIG_IEEE80211_DEBUG
  148. #ifdef CONFIG_IEEE80211_DEBUG
  149. extern u32 ieee80211_debug_level;
  150. #define IEEE80211_DEBUG(level, fmt, args...) \
  151. do { \
  152. if (ieee80211_debug_level & (level)) \
  153. printk(KERN_DEBUG "ieee80211: " fmt, ## args); \
  154. } while (0)
  155. #define IEEE80211_DEBUG_DATA(level, data, datalen) \
  156. do { \
  157. if ((ieee80211_debug_level & (level)) == (level)) { \
  158. u8 *pdata = (u8 *)data; \
  159. int i; \
  160. printk(KERN_DEBUG "ieee80211: %s()\n", __func__); \
  161. for (i = 0; i < (int)(datalen); i++) { \
  162. printk("%2x ", pdata[i]); \
  163. if ((i + 1) % 16 == 0) \
  164. printk("\n"); \
  165. } \
  166. printk("\n"); \
  167. } \
  168. } while (0)
  169. #else
  170. #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
  171. #define IEEE80211_DEBUG_DATA(level, data, datalen) do {} while(0)
  172. #endif /* CONFIG_IEEE80211_DEBUG */
  173. /*
  174. * To use the debug system;
  175. *
  176. * If you are defining a new debug classification, simply add it to the #define
  177. * list here in the form of:
  178. *
  179. * #define IEEE80211_DL_xxxx VALUE
  180. *
  181. * shifting value to the left one bit from the previous entry. xxxx should be
  182. * the name of the classification (for example, WEP)
  183. *
  184. * You then need to either add a IEEE80211_xxxx_DEBUG() macro definition for your
  185. * classification, or use IEEE80211_DEBUG(IEEE80211_DL_xxxx, ...) whenever you want
  186. * to send output to that classification.
  187. *
  188. * To add your debug level to the list of levels seen when you perform
  189. *
  190. * % cat /proc/net/ipw/debug_level
  191. *
  192. * you simply need to add your entry to the ipw_debug_levels array.
  193. *
  194. * If you do not see debug_level in /proc/net/ipw then you do not have
  195. * CONFIG_IEEE80211_DEBUG defined in your kernel configuration
  196. *
  197. */
  198. #define IEEE80211_DL_INFO (1<<0)
  199. #define IEEE80211_DL_WX (1<<1)
  200. #define IEEE80211_DL_SCAN (1<<2)
  201. #define IEEE80211_DL_STATE (1<<3)
  202. #define IEEE80211_DL_MGMT (1<<4)
  203. #define IEEE80211_DL_FRAG (1<<5)
  204. #define IEEE80211_DL_EAP (1<<6)
  205. #define IEEE80211_DL_DROP (1<<7)
  206. #define IEEE80211_DL_TX (1<<8)
  207. #define IEEE80211_DL_RX (1<<9)
  208. #define IEEE80211_DL_HT (1 << 10)
  209. #define IEEE80211_DL_BA (1 << 11)
  210. #define IEEE80211_DL_TS (1 << 12)
  211. #define IEEE80211_DL_QOS (1 << 13)
  212. #define IEEE80211_DL_REORDER (1 << 14)
  213. #define IEEE80211_DL_IOT (1 << 15)
  214. #define IEEE80211_DL_IPS (1 << 16)
  215. #define IEEE80211_DL_TRACE (1 << 29)
  216. #define IEEE80211_DL_DATA (1 << 30)
  217. #define IEEE80211_DL_ERR (1 << 31)
  218. #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
  219. #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
  220. #define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a)
  221. #define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a)
  222. #define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a)
  223. #define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a)
  224. #define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a)
  225. #define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a)
  226. #define IEEE80211_DEBUG_EAP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## a)
  227. #define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
  228. #define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
  229. #define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
  230. #define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
  231. #include <linux/netdevice.h>
  232. #include <linux/if_arp.h> /* ARPHRD_ETHER */
  233. #ifndef WIRELESS_SPY
  234. #define WIRELESS_SPY // enable iwspy support
  235. #endif
  236. #include <net/iw_handler.h> // new driver API
  237. #ifndef ETH_P_PAE
  238. #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
  239. #endif /* ETH_P_PAE */
  240. #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
  241. #ifndef ETH_P_80211_RAW
  242. #define ETH_P_80211_RAW (ETH_P_ECONET + 1)
  243. #endif
  244. /* IEEE 802.11 defines */
  245. #define P80211_OUI_LEN 3
  246. struct ieee80211_snap_hdr {
  247. u8 dsap; /* always 0xAA */
  248. u8 ssap; /* always 0xAA */
  249. u8 ctrl; /* always 0x03 */
  250. u8 oui[P80211_OUI_LEN]; /* organizational universal id */
  251. } __attribute__ ((packed));
  252. #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
  253. #define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS)
  254. #define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
  255. #define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
  256. #define WLAN_FC_GET_FRAMETYPE(fc) ((fc) & IEEE80211_FCTL_FRAMETYPE)
  257. #define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
  258. #define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
  259. #define RTL_WLAN_AUTH_LEAP 2
  260. #define WLAN_CAPABILITY_BSS (1<<0)
  261. #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
  262. #define IEEE80211_STATMASK_SIGNAL (1<<0)
  263. #define IEEE80211_STATMASK_RSSI (1<<1)
  264. #define IEEE80211_STATMASK_NOISE (1<<2)
  265. #define IEEE80211_STATMASK_RATE (1<<3)
  266. #define IEEE80211_STATMASK_WEMASK 0x7
  267. #define IEEE80211_CCK_MODULATION (1<<0)
  268. #define IEEE80211_OFDM_MODULATION (1<<1)
  269. #define IEEE80211_24GHZ_BAND (1<<0)
  270. #define IEEE80211_52GHZ_BAND (1<<1)
  271. #define IEEE80211_CCK_RATE_LEN 4
  272. #define IEEE80211_CCK_RATE_1MB 0x02
  273. #define IEEE80211_CCK_RATE_2MB 0x04
  274. #define IEEE80211_CCK_RATE_5MB 0x0B
  275. #define IEEE80211_CCK_RATE_11MB 0x16
  276. #define IEEE80211_OFDM_RATE_LEN 8
  277. #define IEEE80211_OFDM_RATE_6MB 0x0C
  278. #define IEEE80211_OFDM_RATE_9MB 0x12
  279. #define IEEE80211_OFDM_RATE_12MB 0x18
  280. #define IEEE80211_OFDM_RATE_18MB 0x24
  281. #define IEEE80211_OFDM_RATE_24MB 0x30
  282. #define IEEE80211_OFDM_RATE_36MB 0x48
  283. #define IEEE80211_OFDM_RATE_48MB 0x60
  284. #define IEEE80211_OFDM_RATE_54MB 0x6C
  285. #define IEEE80211_BASIC_RATE_MASK 0x80
  286. #define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
  287. #define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
  288. #define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
  289. #define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
  290. #define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
  291. #define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
  292. #define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
  293. #define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
  294. #define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
  295. #define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
  296. #define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
  297. #define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
  298. #define IEEE80211_CCK_RATES_MASK 0x0000000F
  299. #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
  300. IEEE80211_CCK_RATE_2MB_MASK)
  301. #define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
  302. IEEE80211_CCK_RATE_5MB_MASK | \
  303. IEEE80211_CCK_RATE_11MB_MASK)
  304. #define IEEE80211_OFDM_RATES_MASK 0x00000FF0
  305. #define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
  306. IEEE80211_OFDM_RATE_12MB_MASK | \
  307. IEEE80211_OFDM_RATE_24MB_MASK)
  308. #define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
  309. IEEE80211_OFDM_RATE_9MB_MASK | \
  310. IEEE80211_OFDM_RATE_18MB_MASK | \
  311. IEEE80211_OFDM_RATE_36MB_MASK | \
  312. IEEE80211_OFDM_RATE_48MB_MASK | \
  313. IEEE80211_OFDM_RATE_54MB_MASK)
  314. #define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
  315. IEEE80211_CCK_DEFAULT_RATES_MASK)
  316. #define IEEE80211_NUM_OFDM_RATES 8
  317. #define IEEE80211_NUM_CCK_RATES 4
  318. #define IEEE80211_OFDM_SHIFT_MASK_A 4
  319. /* this is stolen and modified from the madwifi driver*/
  320. #define IEEE80211_FC0_TYPE_MASK 0x0c
  321. #define IEEE80211_FC0_TYPE_DATA 0x08
  322. #define IEEE80211_FC0_SUBTYPE_MASK 0xB0
  323. #define IEEE80211_FC0_SUBTYPE_QOS 0x80
  324. #define IEEE80211_QOS_HAS_SEQ(fc) \
  325. (((fc) & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == \
  326. (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
  327. /* this is stolen from ipw2200 driver */
  328. #define IEEE_IBSS_MAC_HASH_SIZE 31
  329. struct ieee_ibss_seq {
  330. u8 mac[ETH_ALEN];
  331. u16 seq_num[17];
  332. u16 frag_num[17];
  333. unsigned long packet_time[17];
  334. struct list_head list;
  335. };
  336. /* NOTE: This data is for statistical purposes; not all hardware provides this
  337. * information for frames received. Not setting these will not cause
  338. * any adverse affects. */
  339. struct ieee80211_rx_stats {
  340. u32 mac_time[2];
  341. s8 rssi;
  342. u8 signal;
  343. u8 noise;
  344. u16 rate; /* in 100 kbps */
  345. u8 received_channel;
  346. u8 control;
  347. u8 mask;
  348. u8 freq;
  349. u16 len;
  350. u64 tsf;
  351. u32 beacon_time;
  352. u8 nic_type;
  353. u16 Length;
  354. u8 SignalQuality; /* in 0-100 index */
  355. /* real power in dBm for this packet, no beautification & aggregation */
  356. s32 RecvSignalPower;
  357. s8 RxPower; /* in dBm Translate from PWdB */
  358. u8 SignalStrength; /* in 0-100 index */
  359. u16 bHwError:1;
  360. u16 bCRC:1;
  361. u16 bICV:1;
  362. u16 bShortPreamble:1;
  363. u16 Antenna:1; /* RTL8185 */
  364. u16 Decrypted:1; /* RTL8185, RTL8187 */
  365. u16 Wakeup:1; /* RTL8185 */
  366. u16 Reserved0:1; /* RTL8185 */
  367. u8 AGC;
  368. u32 TimeStampLow;
  369. u32 TimeStampHigh;
  370. bool bShift;
  371. bool bIsQosData;
  372. u8 UserPriority;
  373. /* < 11n or 8190 specific code */
  374. u8 RxDrvInfoSize;
  375. u8 RxBufShift;
  376. bool bIsAMPDU;
  377. bool bFirstMPDU;
  378. bool bContainHTC;
  379. bool RxIs40MHzPacket;
  380. u32 RxPWDBAll;
  381. u8 RxMIMOSignalStrength[4]; /* in 0~100 index */
  382. s8 RxMIMOSignalQuality[2];
  383. bool bPacketMatchBSSID;
  384. bool bIsCCK;
  385. bool bPacketToSelf;
  386. u8 *virtual_address;
  387. /* total packet length: must equal to sum of all FragLength */
  388. u16 packetlength;
  389. /* FragLength should equal to PacketLength in non-fragment case */
  390. u16 fraglength;
  391. u16 fragoffset; /* data offset for this fragment */
  392. u16 ntotalfrag;
  393. bool bisrxaggrsubframe;
  394. bool bPacketBeacon; /* for rssi */
  395. bool bToSelfBA; /* for rssi */
  396. char cck_adc_pwdb[4]; /* for rx path selection */
  397. u16 Seq_Num;
  398. u8 nTotalAggPkt; /* number of aggregated packets */
  399. };
  400. /* IEEE 802.11 requires that STA supports concurrent reception of at least
  401. * three fragmented frames. This define can be increased to support more
  402. * concurrent frames, but it should be noted that each entry can consume about
  403. * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
  404. #define IEEE80211_FRAG_CACHE_LEN 4
  405. struct ieee80211_frag_entry {
  406. unsigned long first_frag_time;
  407. unsigned int seq;
  408. unsigned int last_frag;
  409. struct sk_buff *skb;
  410. u8 src_addr[ETH_ALEN];
  411. u8 dst_addr[ETH_ALEN];
  412. };
  413. struct ieee80211_stats {
  414. unsigned int tx_unicast_frames;
  415. unsigned int tx_multicast_frames;
  416. unsigned int tx_fragments;
  417. unsigned int tx_unicast_octets;
  418. unsigned int tx_multicast_octets;
  419. unsigned int tx_deferred_transmissions;
  420. unsigned int tx_single_retry_frames;
  421. unsigned int tx_multiple_retry_frames;
  422. unsigned int tx_retry_limit_exceeded;
  423. unsigned int tx_discards;
  424. unsigned int rx_unicast_frames;
  425. unsigned int rx_multicast_frames;
  426. unsigned int rx_fragments;
  427. unsigned int rx_unicast_octets;
  428. unsigned int rx_multicast_octets;
  429. unsigned int rx_fcs_errors;
  430. unsigned int rx_discards_no_buffer;
  431. unsigned int tx_discards_wrong_sa;
  432. unsigned int rx_discards_undecryptable;
  433. unsigned int rx_message_in_msg_fragments;
  434. unsigned int rx_message_in_bad_msg_fragments;
  435. };
  436. struct ieee80211_device;
  437. #include "ieee80211_crypt.h"
  438. #define SEC_KEY_1 (1<<0)
  439. #define SEC_KEY_2 (1<<1)
  440. #define SEC_KEY_3 (1<<2)
  441. #define SEC_KEY_4 (1<<3)
  442. #define SEC_ACTIVE_KEY (1<<4)
  443. #define SEC_AUTH_MODE (1<<5)
  444. #define SEC_UNICAST_GROUP (1<<6)
  445. #define SEC_LEVEL (1<<7)
  446. #define SEC_ENABLED (1<<8)
  447. #define SEC_LEVEL_0 0 /* None */
  448. #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
  449. #define SEC_LEVEL_2 2 /* Level 1 + TKIP */
  450. #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
  451. #define SEC_LEVEL_3 4 /* Level 2 + CCMP */
  452. #define WEP_KEYS 4
  453. #define WEP_KEY_LEN 13
  454. #define SCM_KEY_LEN 32
  455. struct ieee80211_security {
  456. u16 active_key:2,
  457. enabled:1,
  458. auth_mode:2,
  459. auth_algo:4,
  460. unicast_uses_group:1,
  461. encrypt:1;
  462. u8 key_sizes[WEP_KEYS];
  463. u8 keys[WEP_KEYS][SCM_KEY_LEN];
  464. u8 level;
  465. u16 flags;
  466. } __attribute__ ((packed));
  467. /*
  468. 802.11 data frame from AP
  469. ,-------------------------------------------------------------------.
  470. Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
  471. |------|------|---------|---------|---------|------|---------|------|
  472. Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs |
  473. | | tion | (BSSID) | | | ence | data | |
  474. `-------------------------------------------------------------------'
  475. Total: 28-2340 bytes
  476. */
  477. /* Management Frame Information Element Types */
  478. enum {
  479. MFIE_TYPE_SSID = 0,
  480. MFIE_TYPE_RATES = 1,
  481. MFIE_TYPE_FH_SET = 2,
  482. MFIE_TYPE_DS_SET = 3,
  483. MFIE_TYPE_CF_SET = 4,
  484. MFIE_TYPE_TIM = 5,
  485. MFIE_TYPE_IBSS_SET = 6,
  486. MFIE_TYPE_COUNTRY = 7,
  487. MFIE_TYPE_HOP_PARAMS = 8,
  488. MFIE_TYPE_HOP_TABLE = 9,
  489. MFIE_TYPE_REQUEST = 10,
  490. MFIE_TYPE_CHALLENGE = 16,
  491. MFIE_TYPE_POWER_CONSTRAINT = 32,
  492. MFIE_TYPE_POWER_CAPABILITY = 33,
  493. MFIE_TYPE_TPC_REQUEST = 34,
  494. MFIE_TYPE_TPC_REPORT = 35,
  495. MFIE_TYPE_SUPP_CHANNELS = 36,
  496. MFIE_TYPE_CSA = 37,
  497. MFIE_TYPE_MEASURE_REQUEST = 38,
  498. MFIE_TYPE_MEASURE_REPORT = 39,
  499. MFIE_TYPE_QUIET = 40,
  500. MFIE_TYPE_IBSS_DFS = 41,
  501. MFIE_TYPE_ERP = 42,
  502. MFIE_TYPE_RSN = 48,
  503. MFIE_TYPE_RATES_EX = 50,
  504. MFIE_TYPE_HT_CAP= 45,
  505. MFIE_TYPE_HT_INFO= 61,
  506. MFIE_TYPE_AIRONET=133,
  507. MFIE_TYPE_GENERIC = 221,
  508. MFIE_TYPE_QOS_PARAMETER = 222,
  509. };
  510. /* Minimal header; can be used for passing 802.11 frames with sufficient
  511. * information to determine what type of underlying data type is actually
  512. * stored in the data. */
  513. struct rtl_ieee80211_hdr {
  514. __le16 frame_ctl;
  515. __le16 duration_id;
  516. u8 payload[0];
  517. } __attribute__ ((packed));
  518. struct ieee80211_hdr_1addr {
  519. __le16 frame_ctl;
  520. __le16 duration_id;
  521. u8 addr1[ETH_ALEN];
  522. u8 payload[0];
  523. } __attribute__ ((packed));
  524. struct ieee80211_hdr_2addr {
  525. __le16 frame_ctl;
  526. __le16 duration_id;
  527. u8 addr1[ETH_ALEN];
  528. u8 addr2[ETH_ALEN];
  529. u8 payload[0];
  530. } __attribute__ ((packed));
  531. struct ieee80211_hdr_4addr {
  532. __le16 frame_ctl;
  533. __le16 duration_id;
  534. u8 addr1[ETH_ALEN];
  535. u8 addr2[ETH_ALEN];
  536. u8 addr3[ETH_ALEN];
  537. __le16 seq_ctl;
  538. u8 addr4[ETH_ALEN];
  539. u8 payload[0];
  540. } __attribute__ ((packed));
  541. struct ieee80211_hdr_3addrqos {
  542. __le16 frame_ctl;
  543. __le16 duration_id;
  544. u8 addr1[ETH_ALEN];
  545. u8 addr2[ETH_ALEN];
  546. u8 addr3[ETH_ALEN];
  547. __le16 seq_ctl;
  548. u8 payload[0];
  549. __le16 qos_ctl;
  550. } __attribute__ ((packed));
  551. struct ieee80211_hdr_4addrqos {
  552. __le16 frame_ctl;
  553. __le16 duration_id;
  554. u8 addr1[ETH_ALEN];
  555. u8 addr2[ETH_ALEN];
  556. u8 addr3[ETH_ALEN];
  557. __le16 seq_ctl;
  558. u8 addr4[ETH_ALEN];
  559. u8 payload[0];
  560. __le16 qos_ctl;
  561. } __attribute__ ((packed));
  562. struct ieee80211_info_element {
  563. u8 id;
  564. u8 len;
  565. u8 data[0];
  566. } __attribute__ ((packed));
  567. struct ieee80211_authentication {
  568. struct ieee80211_hdr_3addr header;
  569. __le16 algorithm;
  570. __le16 transaction;
  571. __le16 status;
  572. /* challenge */
  573. struct ieee80211_info_element info_element[0];
  574. } __attribute__ ((packed));
  575. struct ieee80211_disassoc {
  576. struct ieee80211_hdr_3addr header;
  577. __le16 reason;
  578. } __attribute__ ((packed));
  579. struct ieee80211_probe_request {
  580. struct ieee80211_hdr_3addr header;
  581. /* SSID, supported rates */
  582. struct ieee80211_info_element info_element[0];
  583. } __attribute__ ((packed));
  584. struct ieee80211_probe_response {
  585. struct ieee80211_hdr_3addr header;
  586. u32 time_stamp[2];
  587. __le16 beacon_interval;
  588. __le16 capability;
  589. /* SSID, supported rates, FH params, DS params,
  590. * CF params, IBSS params, TIM (if beacon), RSN */
  591. struct ieee80211_info_element info_element[0];
  592. } __attribute__ ((packed));
  593. struct ieee80211_assoc_request_frame {
  594. struct ieee80211_hdr_3addr header;
  595. __le16 capability;
  596. __le16 listen_interval;
  597. /* SSID, supported rates, RSN */
  598. struct ieee80211_info_element info_element[0];
  599. } __attribute__ ((packed));
  600. struct ieee80211_reassoc_request_frame {
  601. struct ieee80211_hdr_3addr header;
  602. __le16 capability;
  603. __le16 listen_interval;
  604. u8 current_ap[ETH_ALEN];
  605. /* SSID, supported rates, RSN */
  606. struct ieee80211_info_element info_element[0];
  607. } __attribute__ ((packed));
  608. struct ieee80211_assoc_response_frame {
  609. struct ieee80211_hdr_3addr header;
  610. __le16 capability;
  611. __le16 status;
  612. __le16 aid;
  613. struct ieee80211_info_element info_element[0]; /* supported rates */
  614. } __attribute__ ((packed));
  615. struct ieee80211_txb {
  616. u8 nr_frags;
  617. u8 encrypted;
  618. u8 queue_index;
  619. u8 rts_included;
  620. u16 reserved;
  621. __le16 frag_size;
  622. __le16 payload_size;
  623. struct sk_buff *fragments[0];
  624. };
  625. #define MAX_SUBFRAME_COUNT 64
  626. struct ieee80211_rxb {
  627. u8 nr_subframes;
  628. struct sk_buff *subframes[MAX_SUBFRAME_COUNT];
  629. u8 dst[ETH_ALEN];
  630. u8 src[ETH_ALEN];
  631. }__attribute__((packed));
  632. /* SWEEP TABLE ENTRIES NUMBER */
  633. #define MAX_SWEEP_TAB_ENTRIES 42
  634. #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
  635. /* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs
  636. * only use 8, and then use extended rates for the remaining supported
  637. * rates. Other APs, however, stick all of their supported rates on the
  638. * main rates information element... */
  639. #define MAX_RATES_LENGTH ((u8)12)
  640. #define MAX_RATES_EX_LENGTH ((u8)16)
  641. #define MAX_NETWORK_COUNT 128
  642. #define MAX_CHANNEL_NUMBER 161
  643. #define IEEE80211_SOFTMAC_SCAN_TIME 100 /* (HZ / 2) */
  644. #define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2)
  645. #define CRC_LENGTH 4U
  646. #define MAX_WPA_IE_LEN 64
  647. #define NETWORK_EMPTY_ESSID (1 << 0)
  648. #define NETWORK_HAS_OFDM (1 << 1)
  649. #define NETWORK_HAS_CCK (1 << 2)
  650. /* QoS structure */
  651. #define NETWORK_HAS_QOS_PARAMETERS (1 << 3)
  652. #define NETWORK_HAS_QOS_INFORMATION (1 << 4)
  653. #define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \
  654. NETWORK_HAS_QOS_INFORMATION)
  655. #define NETWORK_HAS_ERP_VALUE (1 << 10)
  656. #define QOS_QUEUE_NUM 4
  657. #define QOS_OUI_LEN 3
  658. #define QOS_OUI_TYPE 2
  659. #define QOS_ELEMENT_ID 221
  660. #define QOS_OUI_INFO_SUB_TYPE 0
  661. #define QOS_OUI_PARAM_SUB_TYPE 1
  662. #define QOS_VERSION_1 1
  663. #define QOS_AIFSN_MIN_VALUE 2
  664. struct ieee80211_qos_information_element {
  665. u8 elementID;
  666. u8 length;
  667. u8 qui[QOS_OUI_LEN];
  668. u8 qui_type;
  669. u8 qui_subtype;
  670. u8 version;
  671. u8 ac_info;
  672. } __attribute__ ((packed));
  673. struct ieee80211_qos_ac_parameter {
  674. u8 aci_aifsn;
  675. u8 ecw_min_max;
  676. __le16 tx_op_limit;
  677. } __attribute__ ((packed));
  678. struct ieee80211_qos_parameter_info {
  679. struct ieee80211_qos_information_element info_element;
  680. u8 reserved;
  681. struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
  682. } __attribute__ ((packed));
  683. struct ieee80211_qos_parameters {
  684. __le16 cw_min[QOS_QUEUE_NUM];
  685. __le16 cw_max[QOS_QUEUE_NUM];
  686. u8 aifs[QOS_QUEUE_NUM];
  687. u8 flag[QOS_QUEUE_NUM];
  688. __le16 tx_op_limit[QOS_QUEUE_NUM];
  689. } __attribute__ ((packed));
  690. struct ieee80211_qos_data {
  691. struct ieee80211_qos_parameters parameters;
  692. int active;
  693. int supported;
  694. u8 param_count;
  695. u8 old_param_count;
  696. };
  697. struct ieee80211_tim_parameters {
  698. u8 tim_count;
  699. u8 tim_period;
  700. } __attribute__ ((packed));
  701. struct ieee80211_wmm_ac_param {
  702. u8 ac_aci_acm_aifsn;
  703. u8 ac_ecwmin_ecwmax;
  704. u16 ac_txop_limit;
  705. };
  706. struct ieee80211_wmm_ts_info {
  707. u8 ac_dir_tid;
  708. u8 ac_up_psb;
  709. u8 reserved;
  710. } __attribute__ ((packed));
  711. struct ieee80211_wmm_tspec_elem {
  712. struct ieee80211_wmm_ts_info ts_info;
  713. u16 norm_msdu_size;
  714. u16 max_msdu_size;
  715. u32 min_serv_inter;
  716. u32 max_serv_inter;
  717. u32 inact_inter;
  718. u32 suspen_inter;
  719. u32 serv_start_time;
  720. u32 min_data_rate;
  721. u32 mean_data_rate;
  722. u32 peak_data_rate;
  723. u32 max_burst_size;
  724. u32 delay_bound;
  725. u32 min_phy_rate;
  726. u16 surp_band_allow;
  727. u16 medium_time;
  728. }__attribute__((packed));
  729. enum eap_type {
  730. EAP_PACKET = 0,
  731. EAPOL_START,
  732. EAPOL_LOGOFF,
  733. EAPOL_KEY,
  734. EAPOL_ENCAP_ASF_ALERT
  735. };
  736. static const char *eap_types[] = {
  737. [EAP_PACKET] = "EAP-Packet",
  738. [EAPOL_START] = "EAPOL-Start",
  739. [EAPOL_LOGOFF] = "EAPOL-Logoff",
  740. [EAPOL_KEY] = "EAPOL-Key",
  741. [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert"
  742. };
  743. static inline const char *eap_get_type(int type)
  744. {
  745. return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
  746. }
  747. struct eapol {
  748. u8 snap[6];
  749. u16 ethertype;
  750. u8 version;
  751. u8 type;
  752. u16 length;
  753. } __attribute__ ((packed));
  754. struct ieee80211_softmac_stats {
  755. unsigned int rx_ass_ok;
  756. unsigned int rx_ass_err;
  757. unsigned int rx_probe_rq;
  758. unsigned int tx_probe_rs;
  759. unsigned int tx_beacons;
  760. unsigned int rx_auth_rq;
  761. unsigned int rx_auth_rs_ok;
  762. unsigned int rx_auth_rs_err;
  763. unsigned int tx_auth_rq;
  764. unsigned int no_auth_rs;
  765. unsigned int no_ass_rs;
  766. unsigned int tx_ass_rq;
  767. unsigned int rx_ass_rq;
  768. unsigned int tx_probe_rq;
  769. unsigned int reassoc;
  770. unsigned int swtxstop;
  771. unsigned int swtxawake;
  772. unsigned char CurrentShowTxate;
  773. unsigned char last_packet_rate;
  774. unsigned int txretrycount;
  775. };
  776. #define BEACON_PROBE_SSID_ID_POSITION 12
  777. struct ieee80211_info_element_hdr {
  778. u8 id;
  779. u8 len;
  780. } __attribute__ ((packed));
  781. /*
  782. * These are the data types that can make up management packets
  783. *
  784. u16 auth_algorithm;
  785. u16 auth_sequence;
  786. u16 beacon_interval;
  787. u16 capability;
  788. u8 current_ap[ETH_ALEN];
  789. u16 listen_interval;
  790. struct {
  791. u16 association_id:14, reserved:2;
  792. } __attribute__ ((packed));
  793. u32 time_stamp[2];
  794. u16 reason;
  795. u16 status;
  796. */
  797. #define IEEE80211_DEFAULT_TX_ESSID "Penguin"
  798. #define IEEE80211_DEFAULT_BASIC_RATE 2 /* 1Mbps */
  799. enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
  800. #define MAX_SP_Len (WMM_all_frame << 4)
  801. #define IEEE80211_QOS_TID 0x0f
  802. #define QOS_CTL_NOTCONTAIN_ACK (0x01 << 5)
  803. #define IEEE80211_DTIM_MBCAST 4
  804. #define IEEE80211_DTIM_UCAST 2
  805. #define IEEE80211_DTIM_VALID 1
  806. #define IEEE80211_DTIM_INVALID 0
  807. #define IEEE80211_PS_DISABLED 0
  808. #define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST
  809. #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
  810. //added by David for QoS 2006/6/30
  811. //#define WMM_Hang_8187
  812. #ifdef WMM_Hang_8187
  813. #undef WMM_Hang_8187
  814. #endif
  815. #define WME_AC_BK 0x00
  816. #define WME_AC_BE 0x01
  817. #define WME_AC_VI 0x02
  818. #define WME_AC_VO 0x03
  819. #define WME_ACI_MASK 0x03
  820. #define WME_AIFSN_MASK 0x03
  821. #define WME_AC_PRAM_LEN 16
  822. //UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP
  823. //#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1))
  824. #define UP2AC(up) ( \
  825. ((up) < 1) ? WME_AC_BE : \
  826. ((up) < 3) ? WME_AC_BK : \
  827. ((up) < 4) ? WME_AC_BE : \
  828. ((up) < 6) ? WME_AC_VI : \
  829. WME_AC_VO)
  830. //AC Mapping to UP, using in Tx part for selecting the corresponding TX queue
  831. #define AC2UP(_ac) ( \
  832. ((_ac) == WME_AC_VO) ? 6 : \
  833. ((_ac) == WME_AC_VI) ? 5 : \
  834. ((_ac) == WME_AC_BK) ? 1 : \
  835. 0)
  836. #define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
  837. /* length of two Ethernet address plus ether type */
  838. #define ETHERNET_HEADER_SIZE 14
  839. struct ether_header {
  840. u8 ether_dhost[ETHER_ADDR_LEN];
  841. u8 ether_shost[ETHER_ADDR_LEN];
  842. u16 ether_type;
  843. } __attribute__((packed));
  844. #ifndef ETHERTYPE_PAE
  845. #define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */
  846. #endif
  847. #ifndef ETHERTYPE_IP
  848. #define ETHERTYPE_IP 0x0800 /* IP protocol */
  849. #endif
  850. struct ieee80211_network {
  851. /* These entries are used to identify a unique network */
  852. u8 bssid[ETH_ALEN];
  853. u8 channel;
  854. /* Ensure null-terminated for any debug msgs */
  855. u8 ssid[IW_ESSID_MAX_SIZE + 1];
  856. u8 ssid_len;
  857. struct ieee80211_qos_data qos_data;
  858. /* for LEAP */
  859. bool bWithAironetIE;
  860. bool bCkipSupported;
  861. bool bCcxRmEnable;
  862. u16 CcxRmState[2];
  863. /* CCXv4 S59, MBSSID. */
  864. bool bMBssidValid;
  865. u8 MBssidMask;
  866. u8 MBssid[6];
  867. /* CCX 2 S38, WLAN Device Version Number element. */
  868. bool bWithCcxVerNum;
  869. u8 BssCcxVerNumber;
  870. /* These are network statistics */
  871. struct ieee80211_rx_stats stats;
  872. u16 capability;
  873. u8 rates[MAX_RATES_LENGTH];
  874. u8 rates_len;
  875. u8 rates_ex[MAX_RATES_EX_LENGTH];
  876. u8 rates_ex_len;
  877. unsigned long last_scanned;
  878. u8 mode;
  879. u32 flags;
  880. u32 last_associate;
  881. u32 time_stamp[2];
  882. u16 beacon_interval;
  883. u16 listen_interval;
  884. u16 atim_window;
  885. u8 erp_value;
  886. u8 wpa_ie[MAX_WPA_IE_LEN];
  887. size_t wpa_ie_len;
  888. u8 rsn_ie[MAX_WPA_IE_LEN];
  889. size_t rsn_ie_len;
  890. struct ieee80211_tim_parameters tim;
  891. u8 dtim_period;
  892. u8 dtim_data;
  893. u32 last_dtim_sta_time[2];
  894. //appeded for QoS
  895. u8 wmm_info;
  896. struct ieee80211_wmm_ac_param wmm_param[4];
  897. u8 QoS_Enable;
  898. u8 Turbo_Enable;//enable turbo mode, added by thomas
  899. u16 CountryIeLen;
  900. u8 CountryIeBuf[MAX_IE_LEN];
  901. /* HT Related */
  902. BSS_HT bssht;
  903. /* Added to handle broadcom AP management frame CCK rate. */
  904. bool broadcom_cap_exist;
  905. bool realtek_cap_exit;
  906. bool marvell_cap_exist;
  907. bool ralink_cap_exist;
  908. bool atheros_cap_exist;
  909. bool cisco_cap_exist;
  910. bool unknown_cap_exist;
  911. bool berp_info_valid;
  912. bool buseprotection;
  913. struct list_head list; /* put at the end of the structure */
  914. };
  915. enum ieee80211_state {
  916. /* the card is not linked at all */
  917. IEEE80211_NOLINK = 0,
  918. /* IEEE80211_ASSOCIATING* are for BSS client mode
  919. * the driver shall not perform RX filtering unless
  920. * the state is LINKED.
  921. * The driver shall just check for the state LINKED and
  922. * defaults to NOLINK for ALL the other states (including
  923. * LINKED_SCANNING)
  924. */
  925. /* the association procedure will start (wq scheduling)*/
  926. IEEE80211_ASSOCIATING,
  927. IEEE80211_ASSOCIATING_RETRY,
  928. /* the association procedure is sending AUTH request*/
  929. IEEE80211_ASSOCIATING_AUTHENTICATING,
  930. /* the association procedure has successfully authentcated
  931. * and is sending association request
  932. */
  933. IEEE80211_ASSOCIATING_AUTHENTICATED,
  934. /* the link is ok. the card associated to a BSS or linked
  935. * to a ibss cell or acting as an AP and creating the bss
  936. */
  937. IEEE80211_LINKED,
  938. /* same as LINKED, but the driver shall apply RX filter
  939. * rules as we are in NO_LINK mode. As the card is still
  940. * logically linked, but it is doing a syncro site survey
  941. * then it will be back to LINKED state.
  942. */
  943. IEEE80211_LINKED_SCANNING,
  944. };
  945. #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
  946. #define DEFAULT_FTS 2346
  947. #define CFG_IEEE80211_RESERVE_FCS (1<<0)
  948. #define CFG_IEEE80211_COMPUTE_FCS (1<<1)
  949. #define IEEE80211_24GHZ_MIN_CHANNEL 1
  950. #define IEEE80211_24GHZ_MAX_CHANNEL 14
  951. #define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \
  952. IEEE80211_24GHZ_MIN_CHANNEL + 1)
  953. #define IEEE80211_52GHZ_MIN_CHANNEL 34
  954. #define IEEE80211_52GHZ_MAX_CHANNEL 165
  955. #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
  956. IEEE80211_52GHZ_MIN_CHANNEL + 1)
  957. typedef struct tx_pending_t{
  958. int frag;
  959. struct ieee80211_txb *txb;
  960. }tx_pending_t;
  961. enum {
  962. COUNTRY_CODE_FCC = 0,
  963. COUNTRY_CODE_IC = 1,
  964. COUNTRY_CODE_ETSI = 2,
  965. COUNTRY_CODE_SPAIN = 3,
  966. COUNTRY_CODE_FRANCE = 4,
  967. COUNTRY_CODE_MKK = 5,
  968. COUNTRY_CODE_MKK1 = 6,
  969. COUNTRY_CODE_ISRAEL = 7,
  970. COUNTRY_CODE_TELEC,
  971. COUNTRY_CODE_MIC,
  972. COUNTRY_CODE_GLOBAL_DOMAIN
  973. };
  974. #include "ieee80211_r8192s.h"
  975. struct ieee80211_device {
  976. struct net_device *dev;
  977. struct ieee80211_security sec;
  978. /* hw security related */
  979. u8 hwsec_active;
  980. bool is_silent_reset;
  981. bool is_roaming;
  982. bool ieee_up;
  983. bool bSupportRemoteWakeUp;
  984. RT_PS_MODE dot11PowerSaveMode;
  985. bool actscanning;
  986. bool be_scan_inprogress;
  987. bool beinretry;
  988. RT_RF_POWER_STATE eRFPowerState;
  989. u32 RfOffReason;
  990. bool is_set_key;
  991. /* 11n HT below */
  992. PRT_HIGH_THROUGHPUT pHTInfo;
  993. spinlock_t bw_spinlock;
  994. spinlock_t reorder_spinlock;
  995. /*
  996. * for HT operation rate set, we use this one for HT data rate to
  997. * separate different descriptors the way fill this is the same as
  998. * in the IE
  999. */
  1000. u8 Regdot11HTOperationalRateSet[16]; /* use RATR format */
  1001. u8 dot11HTOperationalRateSet[16]; /* use RATR format */
  1002. u8 RegHTSuppRateSet[16];
  1003. u8 HTCurrentOperaRate;
  1004. u8 HTHighestOperaRate;
  1005. /* for rate operation mode to firmware */
  1006. u8 bTxDisableRateFallBack;
  1007. u8 bTxUseDriverAssingedRate;
  1008. atomic_t atm_chnlop;
  1009. atomic_t atm_swbw;
  1010. /* 802.11e and WMM Traffic Stream Info (TX) */
  1011. struct list_head Tx_TS_Admit_List;
  1012. struct list_head Tx_TS_Pending_List;
  1013. struct list_head Tx_TS_Unused_List;
  1014. TX_TS_RECORD TxTsRecord[TOTAL_TS_NUM];
  1015. /* 802.11e and WMM Traffic Stream Info (RX) */
  1016. struct list_head Rx_TS_Admit_List;
  1017. struct list_head Rx_TS_Pending_List;
  1018. struct list_head Rx_TS_Unused_List;
  1019. RX_TS_RECORD RxTsRecord[TOTAL_TS_NUM];
  1020. RX_REORDER_ENTRY RxReorderEntry[128];
  1021. struct list_head RxReorder_Unused_List;
  1022. /* Qos related */
  1023. /* Force per-packet priority 1~7. (default: 0, not to force it.) */
  1024. u8 ForcedPriority;
  1025. /* Bookkeeping structures */
  1026. struct net_device_stats stats;
  1027. struct ieee80211_stats ieee_stats;
  1028. struct ieee80211_softmac_stats softmac_stats;
  1029. /* Probe / Beacon management */
  1030. struct list_head network_free_list;
  1031. struct list_head network_list;
  1032. struct ieee80211_network *networks;
  1033. int scans;
  1034. int scan_age;
  1035. int iw_mode; /* operating mode (IW_MODE_*) */
  1036. struct iw_spy_data spy_data;
  1037. spinlock_t lock;
  1038. spinlock_t wpax_suitlist_lock;
  1039. int tx_headroom; /* Set to size of any additional room needed at front
  1040. * of allocated Tx SKBs */
  1041. u32 config;
  1042. /* WEP and other encryption related settings at the device level */
  1043. int open_wep; /* Set to 1 to allow unencrypted frames */
  1044. int auth_mode;
  1045. int reset_on_keychange; /* Set to 1 if the HW needs to be reset on
  1046. * WEP key changes */
  1047. /* If the host performs {en,de}cryption, then set to 1 */
  1048. int host_encrypt;
  1049. int host_encrypt_msdu;
  1050. int host_decrypt;
  1051. /* host performs multicast decryption */
  1052. int host_mc_decrypt;
  1053. /* host should strip IV and ICV from protected frames */
  1054. /* meaningful only when hardware decryption is being used */
  1055. int host_strip_iv_icv;
  1056. int host_open_frag;
  1057. int host_build_iv;
  1058. int ieee802_1x; /* is IEEE 802.1X used */
  1059. /* WPA data */
  1060. bool bHalfWirelessN24GMode;
  1061. int wpa_enabled;
  1062. int drop_unencrypted;
  1063. int tkip_countermeasures;
  1064. int privacy_invoked;
  1065. size_t wpa_ie_len;
  1066. u8 *wpa_ie;
  1067. u8 ap_mac_addr[6];
  1068. u16 pairwise_key_type;
  1069. u16 group_key_type;
  1070. struct list_head crypt_deinit_list;
  1071. struct ieee80211_crypt_data *crypt[WEP_KEYS];
  1072. int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
  1073. struct timer_list crypt_deinit_timer;
  1074. int crypt_quiesced;
  1075. int bcrx_sta_key; /* use individual keys to override default keys even
  1076. * with RX of broad/multicast frames */
  1077. /* Fragmentation structures */
  1078. // each streaming contain a entry
  1079. struct ieee80211_frag_entry frag_cache[17][IEEE80211_FRAG_CACHE_LEN];
  1080. unsigned int frag_next_idx[17];
  1081. u16 fts; /* Fragmentation Threshold */
  1082. #define DEFAULT_RTS_THRESHOLD 2346U
  1083. #define MIN_RTS_THRESHOLD 1
  1084. #define MAX_RTS_THRESHOLD 2346U
  1085. u16 rts; /* RTS threshold */
  1086. /* Association info */
  1087. u8 bssid[ETH_ALEN];
  1088. /* This stores infos for the current network.
  1089. * Either the network we are associated in INFRASTRUCTURE
  1090. * or the network that we are creating in MASTER mode.
  1091. * ad-hoc is a mixture ;-).
  1092. * Note that in infrastructure mode, even when not associated,
  1093. * fields bssid and essid may be valid (if wpa_set and essid_set
  1094. * are true) as thy carry the value set by the user via iwconfig
  1095. */
  1096. struct ieee80211_network current_network;
  1097. enum ieee80211_state state;
  1098. int short_slot;
  1099. int reg_mode;
  1100. int mode; /* A, B, G */
  1101. int modulation; /* CCK, OFDM */
  1102. int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */
  1103. int abg_true; /* ABG flag */
  1104. /* used for forcing the ibss workqueue to terminate
  1105. * without wait for the syncro scan to terminate
  1106. */
  1107. short sync_scan_hurryup;
  1108. u16 scan_watch_dog;
  1109. int perfect_rssi;
  1110. int worst_rssi;
  1111. u16 prev_seq_ctl; /* used to drop duplicate frames */
  1112. /*
  1113. * map of allowed channels. 0 is dummy, FIXME: remeber to default to
  1114. * a basic channel plan depending of the PHY type
  1115. */
  1116. void *pDot11dInfo;
  1117. bool bGlobalDomain;
  1118. int rate; /* current rate */
  1119. int basic_rate;
  1120. //FIXME: pleace callback, see if redundant with softmac_features
  1121. short active_scan;
  1122. /* this contains flags for selectively enable softmac support */
  1123. u16 softmac_features;
  1124. /* if the sequence control field is not filled by HW */
  1125. u16 seq_ctrl[5];
  1126. /* association procedure transaction sequence number */
  1127. u16 associate_seq;
  1128. /* AID for RTXed association responses */
  1129. u16 assoc_id;
  1130. /* power save mode related*/
  1131. u8 ack_tx_to_ieee;
  1132. short ps;
  1133. short sta_sleep;
  1134. int ps_timeout;
  1135. int ps_period;
  1136. struct tasklet_struct ps_task;
  1137. u32 ps_th;
  1138. u32 ps_tl;
  1139. short raw_tx;
  1140. /* used if IEEE_SOFTMAC_TX_QUEUE is set */
  1141. short queue_stop;
  1142. short scanning;
  1143. short proto_started;
  1144. struct semaphore wx_sem;
  1145. struct semaphore scan_sem;
  1146. spinlock_t mgmt_tx_lock;
  1147. spinlock_t beacon_lock;
  1148. short beacon_txing;
  1149. short wap_set;
  1150. short ssid_set;
  1151. u8 wpax_type_set; //{added by David, 2006.9.28}
  1152. u32 wpax_type_notify; //{added by David, 2006.9.26}
  1153. /* QoS related flag */
  1154. char init_wmmparam_flag;
  1155. /* set on initialization */
  1156. u8 qos_support;
  1157. /* for discarding duplicated packets in IBSS */
  1158. struct list_head ibss_mac_hash[IEEE_IBSS_MAC_HASH_SIZE];
  1159. /* for discarding duplicated packets in BSS */
  1160. u16 last_rxseq_num[17]; /* rx seq previous per-tid */
  1161. u16 last_rxfrag_num[17];/* tx frag previous per-tid */
  1162. unsigned long last_packet_time[17];
  1163. /* for PS mode */
  1164. unsigned long last_rx_ps_time;
  1165. /* used if IEEE_SOFTMAC_SINGLE_QUEUE is set */
  1166. struct sk_buff *mgmt_queue_ring[MGMT_QUEUE_NUM];
  1167. int mgmt_queue_head;
  1168. int mgmt_queue_tail;
  1169. /* rtl819x start */
  1170. u8 AsocRetryCount;
  1171. unsigned int hw_header;
  1172. struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE];
  1173. struct sk_buff_head skb_aggQ[MAX_QUEUE_SIZE];
  1174. struct sk_buff_head skb_drv_aggQ[MAX_QUEUE_SIZE];
  1175. u32 sta_edca_param[4];
  1176. bool aggregation;
  1177. /* Enable/Disable Rx immediate BA capability. */
  1178. bool enable_rx_imm_BA;
  1179. bool bibsscoordinator;
  1180. /* Dynamic Tx power for near/far range enable/disable. */
  1181. bool bdynamic_txpower_enable;
  1182. bool bCTSToSelfEnable;
  1183. u8 CTSToSelfTH;
  1184. u32 fsync_time_interval;
  1185. u32 fsync_rate_bitmap;
  1186. u8 fsync_rssi_threshold;
  1187. bool bfsync_enable;
  1188. u8 fsync_multiple_timeinterval; /* value * FsyncTimeInterval */
  1189. u32 fsync_firstdiff_ratethreshold; /* low threshold */
  1190. u32 fsync_seconddiff_ratethreshold; /* decrease threshold */
  1191. Fsync_State fsync_state;
  1192. bool bis_any_nonbepkts;
  1193. /* 20Mhz 40Mhz AutoSwitch Threshold */
  1194. struct bandwidth_autoswitch bandwidth_auto_switch;
  1195. /* for txpower tracking */
  1196. bool FwRWRF;
  1197. /* for AP roaming */
  1198. struct rt_link_detect LinkDetectInfo;
  1199. struct rt_power_save_control PowerSaveControl;
  1200. /* rtl819x end */
  1201. /* used if IEEE_SOFTMAC_TX_QUEUE is set */
  1202. struct tx_pending_t tx_pending;
  1203. /* used if IEEE_SOFTMAC_ASSOCIATE is set */
  1204. struct timer_list associate_timer;
  1205. /* used if IEEE_SOFTMAC_BEACONS is set */
  1206. struct timer_list beacon_timer;
  1207. struct work_struct associate_complete_wq;
  1208. struct work_struct associate_procedure_wq;
  1209. struct delayed_work softmac_scan_wq;
  1210. struct delayed_work associate_retry_wq;
  1211. struct delayed_work start_ibss_wq;
  1212. struct delayed_work hw_wakeup_wq;
  1213. struct delayed_work hw_sleep_wq;
  1214. struct delayed_work link_change_wq;
  1215. struct work_struct wx_sync_scan_wq;
  1216. struct workqueue_struct *wq;
  1217. /* Callback functions */
  1218. void (*set_security)(struct net_device *dev,
  1219. struct ieee80211_security *sec);
  1220. /* Used to TX data frame by using txb structs.
  1221. * this is not used if in the softmac_features
  1222. * is set the flag IEEE_SOFTMAC_TX_QUEUE
  1223. */
  1224. int (*hard_start_xmit)(struct ieee80211_txb *txb,
  1225. struct net_device *dev);
  1226. int (*reset_port)(struct net_device *dev);
  1227. int (*is_queue_full)(struct net_device *dev, int pri);
  1228. int (*handle_management)(struct net_device *dev,
  1229. struct ieee80211_network *network, u16 type);
  1230. int (*is_qos_active)(struct net_device *dev, struct sk_buff *skb);
  1231. /* Softmac-generated frames (mamagement) are TXed via this
  1232. * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is
  1233. * not set. As some cards may have different HW queues that
  1234. * one might want to use for data and management frames
  1235. * the option to have two callbacks might be useful.
  1236. * This fucntion can't sleep.
  1237. */
  1238. int (*softmac_hard_start_xmit)(struct sk_buff *skb,
  1239. struct net_device *dev);
  1240. /* used instead of hard_start_xmit (not softmac_hard_start_xmit)
  1241. * if the IEEE_SOFTMAC_TX_QUEUE feature is used to TX data
  1242. * frames. I the option IEEE_SOFTMAC_SINGLE_QUEUE is also set
  1243. * then also management frames are sent via this callback.
  1244. * This function can't sleep.
  1245. */
  1246. void (*softmac_data_hard_start_xmit)(struct sk_buff *skb,
  1247. struct net_device *dev,int rate);
  1248. /* stops the HW queue for DATA frames. Useful to avoid
  1249. * waste time to TX data frame when we are reassociating
  1250. * This function can sleep.
  1251. */
  1252. void (*data_hard_stop)(struct net_device *dev);
  1253. /* OK this is complementar to data_poll_hard_stop */
  1254. void (*data_hard_resume)(struct net_device *dev);
  1255. /* ask to the driver to retune the radio .
  1256. * This function can sleep. the driver should ensure
  1257. * the radio has been swithced before return.
  1258. */
  1259. void (*set_chan)(struct net_device *dev,short ch);
  1260. /* These are not used if the ieee stack takes care of
  1261. * scanning (IEEE_SOFTMAC_SCAN feature set).
  1262. * In this case only the set_chan is used.
  1263. *
  1264. * The syncro version is similar to the start_scan but
  1265. * does not return until all channels has been scanned.
  1266. * this is called in user context and should sleep,
  1267. * it is called in a work_queue when swithcing to ad-hoc mode
  1268. * or in behalf of iwlist scan when the card is associated
  1269. * and root user ask for a scan.
  1270. * the fucntion stop_scan should stop both the syncro and
  1271. * background scanning and can sleep.
  1272. * The fucntion start_scan should initiate the background
  1273. * scanning and can't sleep.
  1274. */
  1275. void (*scan_syncro)(struct net_device *dev);
  1276. void (*start_scan)(struct net_device *dev);
  1277. void (*stop_scan)(struct net_device *dev);
  1278. /* indicate the driver that the link state is changed
  1279. * for example it may indicate the card is associated now.
  1280. * Driver might be interested in this to apply RX filter
  1281. * rules or simply light the LINK led
  1282. */
  1283. void (*link_change)(struct net_device *dev);
  1284. /* these two function indicates to the HW when to start
  1285. * and stop to send beacons. This is used when the
  1286. * IEEE_SOFTMAC_BEACONS is not set. For now the
  1287. * stop_send_bacons is NOT guaranteed to be called only
  1288. * after start_send_beacons.
  1289. */
  1290. void (*start_send_beacons) (struct net_device *dev);
  1291. void (*stop_send_beacons) (struct net_device *dev);
  1292. /* power save mode related */
  1293. void (*sta_wake_up) (struct net_device *dev);
  1294. void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl);
  1295. short (*ps_is_queue_empty) (struct net_device *dev);
  1296. int (*handle_beacon)(struct net_device *dev,
  1297. struct ieee80211_probe_response *beacon,
  1298. struct ieee80211_network *network);
  1299. int (*handle_assoc_response)(struct net_device *dev,
  1300. struct ieee80211_assoc_response_frame *resp,
  1301. struct ieee80211_network *network);
  1302. /* check whether Tx hw resouce available */
  1303. short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
  1304. /* HT related */
  1305. void (*SetBWModeHandler)(struct net_device *dev,
  1306. HT_CHANNEL_WIDTH Bandwidth,
  1307. HT_EXTCHNL_OFFSET Offset);
  1308. bool (*GetNmodeSupportBySecCfg)(struct net_device* dev);
  1309. void (*SetWirelessMode)(struct net_device* dev, u8 wireless_mode);
  1310. bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device* dev);
  1311. bool (*is_ap_in_wep_tkip)(struct net_device* dev);
  1312. void (*InitialGainHandler)(struct net_device *dev, u8 Operation);
  1313. bool (*SetFwCmdHandler)(struct net_device *dev, FW_CMD_IO_TYPE FwCmdIO);
  1314. void (*LedControlHandler)(struct net_device *dev,
  1315. LED_CTL_MODE LedAction);
  1316. /* This must be the last item so that it points to the data
  1317. * allocated beyond this structure by alloc_ieee80211 */
  1318. u8 priv[0];
  1319. };
  1320. #define IEEE_A (1<<0)
  1321. #define IEEE_B (1<<1)
  1322. #define IEEE_G (1<<2)
  1323. #define IEEE_N_24G (1<<4)
  1324. #define IEEE_N_5G (1<<5)
  1325. #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
  1326. /* Generate a 802.11 header */
  1327. /* Uses the channel change callback directly
  1328. * instead of [start/stop] scan callbacks
  1329. */
  1330. #define IEEE_SOFTMAC_SCAN (1<<2)
  1331. /* Perform authentication and association handshake */
  1332. #define IEEE_SOFTMAC_ASSOCIATE (1<<3)
  1333. /* Generate probe requests */
  1334. #define IEEE_SOFTMAC_PROBERQ (1<<4)
  1335. /* Generate respones to probe requests */
  1336. #define IEEE_SOFTMAC_PROBERS (1<<5)
  1337. /* The ieee802.11 stack will manages the netif queue
  1338. * wake/stop for the driver, taking care of 802.11
  1339. * fragmentation. See softmac.c for details. */
  1340. #define IEEE_SOFTMAC_TX_QUEUE (1<<7)
  1341. /* Uses only the softmac_data_hard_start_xmit
  1342. * even for TX management frames.
  1343. */
  1344. #define IEEE_SOFTMAC_SINGLE_QUEUE (1<<8)
  1345. /* Generate beacons. The stack will enqueue beacons
  1346. * to the card
  1347. */
  1348. #define IEEE_SOFTMAC_BEACONS (1<<6)
  1349. static inline void *ieee80211_priv(struct net_device *dev)
  1350. {
  1351. return ((struct ieee80211_device *)netdev_priv(dev))->priv;
  1352. }
  1353. extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
  1354. {
  1355. /* Single white space is for Linksys APs */
  1356. if (essid_len == 1 && essid[0] == ' ')
  1357. return 1;
  1358. /* Otherwise, if the entire essid is 0, we assume it is hidden */
  1359. while (essid_len) {
  1360. essid_len--;
  1361. if (essid[essid_len] != '\0')
  1362. return 0;
  1363. }
  1364. return 1;
  1365. }
  1366. extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
  1367. {
  1368. /*
  1369. * It is possible for both access points and our device to support
  1370. * combinations of modes, so as long as there is one valid combination
  1371. * of ap/device supported modes, then return success
  1372. *
  1373. */
  1374. if ((mode & IEEE_A) &&
  1375. (ieee->modulation & IEEE80211_OFDM_MODULATION) &&
  1376. (ieee->freq_band & IEEE80211_52GHZ_BAND))
  1377. return 1;
  1378. if ((mode & IEEE_G) &&
  1379. (ieee->modulation & IEEE80211_OFDM_MODULATION) &&
  1380. (ieee->freq_band & IEEE80211_24GHZ_BAND))
  1381. return 1;
  1382. if ((mode & IEEE_B) &&
  1383. (ieee->modulation & IEEE80211_CCK_MODULATION) &&
  1384. (ieee->freq_band & IEEE80211_24GHZ_BAND))
  1385. return 1;
  1386. return 0;
  1387. }
  1388. extern inline int ieee80211_get_hdrlen(u16 fc)
  1389. {
  1390. int hdrlen = IEEE80211_3ADDR_LEN;
  1391. switch (WLAN_FC_GET_TYPE(fc)) {
  1392. case IEEE80211_FTYPE_DATA:
  1393. if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
  1394. hdrlen = IEEE80211_4ADDR_LEN; /* Addr4 */
  1395. if(IEEE80211_QOS_HAS_SEQ(fc))
  1396. hdrlen += 2; /* QOS ctrl*/
  1397. break;
  1398. case IEEE80211_FTYPE_CTL:
  1399. switch (WLAN_FC_GET_STYPE(fc)) {
  1400. case IEEE80211_STYPE_CTS:
  1401. case IEEE80211_STYPE_ACK:
  1402. hdrlen = IEEE80211_1ADDR_LEN;
  1403. break;
  1404. default:
  1405. hdrlen = IEEE80211_2ADDR_LEN;
  1406. break;
  1407. }
  1408. break;
  1409. }
  1410. return hdrlen;
  1411. }
  1412. static inline u8 *ieee80211_get_payload(struct rtl_ieee80211_hdr *hdr)
  1413. {
  1414. switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
  1415. case IEEE80211_1ADDR_LEN:
  1416. return ((struct ieee80211_hdr_1addr *)hdr)->payload;
  1417. case IEEE80211_2ADDR_LEN:
  1418. return ((struct ieee80211_hdr_2addr *)hdr)->payload;
  1419. case IEEE80211_3ADDR_LEN:
  1420. return (void *)hdr+sizeof(struct ieee80211_hdr_3addr);
  1421. case IEEE80211_4ADDR_LEN:
  1422. return ((struct ieee80211_hdr_4addr *)hdr)->payload;
  1423. }
  1424. return NULL;
  1425. }
  1426. static inline int ieee80211_is_ofdm_rate(u8 rate)
  1427. {
  1428. switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
  1429. case IEEE80211_OFDM_RATE_6MB:
  1430. case IEEE80211_OFDM_RATE_9MB:
  1431. case IEEE80211_OFDM_RATE_12MB:
  1432. case IEEE80211_OFDM_RATE_18MB:
  1433. case IEEE80211_OFDM_RATE_24MB:
  1434. case IEEE80211_OFDM_RATE_36MB:
  1435. case IEEE80211_OFDM_RATE_48MB:
  1436. case IEEE80211_OFDM_RATE_54MB:
  1437. return 1;
  1438. }
  1439. return 0;
  1440. }
  1441. static inline int ieee80211_is_cck_rate(u8 rate)
  1442. {
  1443. switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
  1444. case IEEE80211_CCK_RATE_1MB:
  1445. case IEEE80211_CCK_RATE_2MB:
  1446. case IEEE80211_CCK_RATE_5MB:
  1447. case IEEE80211_CCK_RATE_11MB:
  1448. return 1;
  1449. }
  1450. return 0;
  1451. }
  1452. /* ieee80211.c */
  1453. extern void free_ieee80211(struct net_device *dev);
  1454. extern struct net_device *alloc_ieee80211(int sizeof_priv);
  1455. extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
  1456. /* ieee80211_tx.c */
  1457. extern int ieee80211_encrypt_fragment(
  1458. struct ieee80211_device *ieee,
  1459. struct sk_buff *frag,
  1460. int hdr_len);
  1461. extern int rtl8192_ieee80211_rtl_xmit(struct sk_buff *skb,
  1462. struct net_device *dev);
  1463. extern void ieee80211_txb_free(struct ieee80211_txb *);
  1464. /* ieee80211_rx.c */
  1465. extern int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
  1466. struct ieee80211_rx_stats *rx_stats);
  1467. extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
  1468. struct ieee80211_hdr_4addr *header,
  1469. struct ieee80211_rx_stats *stats);
  1470. /* ieee80211_wx.c */
  1471. extern int ieee80211_wx_get_scan(struc

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