hostap_wlan.h 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. #ifndef HOSTAP_WLAN_H
  2. #define HOSTAP_WLAN_H
  3. #include <linux/interrupt.h>
  4. #include <linux/wireless.h>
  5. #include <linux/netdevice.h>
  6. #include <linux/mutex.h>
  7. #include <net/iw_handler.h>
  8. #include <net/ieee80211_radiotap.h>
  9. #include <net/lib80211.h>
  10. #include "hostap_config.h"
  11. #include "hostap_common.h"
  12. #define MAX_PARM_DEVICES 8
  13. #define PARM_MIN_MAX "1-" __MODULE_STRING(MAX_PARM_DEVICES)
  14. #define DEF_INTS -1, -1, -1, -1, -1, -1, -1
  15. #define GET_INT_PARM(var,idx) var[var[idx] < 0 ? 0 : idx]
  16. /* Specific skb->protocol value that indicates that the packet already contains
  17. * txdesc header.
  18. * FIX: This might need own value that would be allocated especially for Prism2
  19. * txdesc; ETH_P_CONTROL is commented as "Card specific control frames".
  20. * However, these skb's should have only minimal path in the kernel side since
  21. * prism2_send_mgmt() sends these with dev_queue_xmit() to prism2_tx(). */
  22. #define ETH_P_HOSTAP ETH_P_CONTROL
  23. /* ARPHRD_IEEE80211_PRISM uses a bloated version of Prism2 RX frame header
  24. * (from linux-wlan-ng) */
  25. struct linux_wlan_ng_val {
  26. u32 did;
  27. u16 status, len;
  28. u32 data;
  29. } __packed;
  30. struct linux_wlan_ng_prism_hdr {
  31. u32 msgcode, msglen;
  32. char devname[16];
  33. struct linux_wlan_ng_val hosttime, mactime, channel, rssi, sq, signal,
  34. noise, rate, istx, frmlen;
  35. } __packed;
  36. struct linux_wlan_ng_cap_hdr {
  37. __be32 version;
  38. __be32 length;
  39. __be64 mactime;
  40. __be64 hosttime;
  41. __be32 phytype;
  42. __be32 channel;
  43. __be32 datarate;
  44. __be32 antenna;
  45. __be32 priority;
  46. __be32 ssi_type;
  47. __be32 ssi_signal;
  48. __be32 ssi_noise;
  49. __be32 preamble;
  50. __be32 encoding;
  51. } __packed;
  52. struct hostap_radiotap_rx {
  53. struct ieee80211_radiotap_header hdr;
  54. __le64 tsft;
  55. u8 rate;
  56. u8 padding;
  57. __le16 chan_freq;
  58. __le16 chan_flags;
  59. s8 dbm_antsignal;
  60. s8 dbm_antnoise;
  61. } __packed;
  62. #define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */
  63. #define LWNG_CAPHDR_VERSION 0x80211001
  64. struct hfa384x_rx_frame {
  65. /* HFA384X RX frame descriptor */
  66. __le16 status; /* HFA384X_RX_STATUS_ flags */
  67. __le32 time; /* timestamp, 1 microsecond resolution */
  68. u8 silence; /* 27 .. 154; seems to be 0 */
  69. u8 signal; /* 27 .. 154 */
  70. u8 rate; /* 10, 20, 55, or 110 */
  71. u8 rxflow;
  72. __le32 reserved;
  73. /* 802.11 */
  74. __le16 frame_control;
  75. __le16 duration_id;
  76. u8 addr1[6];
  77. u8 addr2[6];
  78. u8 addr3[6];
  79. __le16 seq_ctrl;
  80. u8 addr4[6];
  81. __le16 data_len;
  82. /* 802.3 */
  83. u8 dst_addr[6];
  84. u8 src_addr[6];
  85. __be16 len;
  86. /* followed by frame data; max 2304 bytes */
  87. } __packed;
  88. struct hfa384x_tx_frame {
  89. /* HFA384X TX frame descriptor */
  90. __le16 status; /* HFA384X_TX_STATUS_ flags */
  91. __le16 reserved1;
  92. __le16 reserved2;
  93. __le32 sw_support;
  94. u8 retry_count; /* not yet implemented */
  95. u8 tx_rate; /* Host AP only; 0 = firmware, or 10, 20, 55, 110 */
  96. __le16 tx_control; /* HFA384X_TX_CTRL_ flags */
  97. /* 802.11 */
  98. __le16 frame_control; /* parts not used */
  99. __le16 duration_id;
  100. u8 addr1[6];
  101. u8 addr2[6]; /* filled by firmware */
  102. u8 addr3[6];
  103. __le16 seq_ctrl; /* filled by firmware */
  104. u8 addr4[6];
  105. __le16 data_len;
  106. /* 802.3 */
  107. u8 dst_addr[6];
  108. u8 src_addr[6];
  109. __be16 len;
  110. /* followed by frame data; max 2304 bytes */
  111. } __packed;
  112. struct hfa384x_rid_hdr
  113. {
  114. __le16 len;
  115. __le16 rid;
  116. } __packed;
  117. /* Macro for converting signal levels (range 27 .. 154) to wireless ext
  118. * dBm value with some accuracy */
  119. #define HFA384X_LEVEL_TO_dBm(v) 0x100 + (v) * 100 / 255 - 100
  120. #define HFA384X_LEVEL_TO_dBm_sign(v) (v) * 100 / 255 - 100
  121. struct hfa384x_scan_request {
  122. __le16 channel_list;
  123. __le16 txrate; /* HFA384X_RATES_* */
  124. } __packed;
  125. struct hfa384x_hostscan_request {
  126. __le16 channel_list;
  127. __le16 txrate;
  128. __le16 target_ssid_len;
  129. u8 target_ssid[32];
  130. } __packed;
  131. struct hfa384x_join_request {
  132. u8 bssid[6];
  133. __le16 channel;
  134. } __packed;
  135. struct hfa384x_info_frame {
  136. __le16 len;
  137. __le16 type;
  138. } __packed;
  139. struct hfa384x_comm_tallies {
  140. __le16 tx_unicast_frames;
  141. __le16 tx_multicast_frames;
  142. __le16 tx_fragments;
  143. __le16 tx_unicast_octets;
  144. __le16 tx_multicast_octets;
  145. __le16 tx_deferred_transmissions;
  146. __le16 tx_single_retry_frames;
  147. __le16 tx_multiple_retry_frames;
  148. __le16 tx_retry_limit_exceeded;
  149. __le16 tx_discards;
  150. __le16 rx_unicast_frames;
  151. __le16 rx_multicast_frames;
  152. __le16 rx_fragments;
  153. __le16 rx_unicast_octets;
  154. __le16 rx_multicast_octets;
  155. __le16 rx_fcs_errors;
  156. __le16 rx_discards_no_buffer;
  157. __le16 tx_discards_wrong_sa;
  158. __le16 rx_discards_wep_undecryptable;
  159. __le16 rx_message_in_msg_fragments;
  160. __le16 rx_message_in_bad_msg_fragments;
  161. } __packed;
  162. struct hfa384x_comm_tallies32 {
  163. __le32 tx_unicast_frames;
  164. __le32 tx_multicast_frames;
  165. __le32 tx_fragments;
  166. __le32 tx_unicast_octets;
  167. __le32 tx_multicast_octets;
  168. __le32 tx_deferred_transmissions;
  169. __le32 tx_single_retry_frames;
  170. __le32 tx_multiple_retry_frames;
  171. __le32 tx_retry_limit_exceeded;
  172. __le32 tx_discards;
  173. __le32 rx_unicast_frames;
  174. __le32 rx_multicast_frames;
  175. __le32 rx_fragments;
  176. __le32 rx_unicast_octets;
  177. __le32 rx_multicast_octets;
  178. __le32 rx_fcs_errors;
  179. __le32 rx_discards_no_buffer;
  180. __le32 tx_discards_wrong_sa;
  181. __le32 rx_discards_wep_undecryptable;
  182. __le32 rx_message_in_msg_fragments;
  183. __le32 rx_message_in_bad_msg_fragments;
  184. } __packed;
  185. struct hfa384x_scan_result_hdr {
  186. __le16 reserved;
  187. __le16 scan_reason;
  188. #define HFA384X_SCAN_IN_PROGRESS 0 /* no results available yet */
  189. #define HFA384X_SCAN_HOST_INITIATED 1
  190. #define HFA384X_SCAN_FIRMWARE_INITIATED 2
  191. #define HFA384X_SCAN_INQUIRY_FROM_HOST 3
  192. } __packed;
  193. #define HFA384X_SCAN_MAX_RESULTS 32
  194. struct hfa384x_scan_result {
  195. __le16 chid;
  196. __le16 anl;
  197. __le16 sl;
  198. u8 bssid[6];
  199. __le16 beacon_interval;
  200. __le16 capability;
  201. __le16 ssid_len;
  202. u8 ssid[32];
  203. u8 sup_rates[10];
  204. __le16 rate;
  205. } __packed;
  206. struct hfa384x_hostscan_result {
  207. __le16 chid;
  208. __le16 anl;
  209. __le16 sl;
  210. u8 bssid[6];
  211. __le16 beacon_interval;
  212. __le16 capability;
  213. __le16 ssid_len;
  214. u8 ssid[32];
  215. u8 sup_rates[10];
  216. __le16 rate;
  217. __le16 atim;
  218. } __packed;
  219. struct comm_tallies_sums {
  220. unsigned int tx_unicast_frames;
  221. unsigned int tx_multicast_frames;
  222. unsigned int tx_fragments;
  223. unsigned int tx_unicast_octets;
  224. unsigned int tx_multicast_octets;
  225. unsigned int tx_deferred_transmissions;
  226. unsigned int tx_single_retry_frames;
  227. unsigned int tx_multiple_retry_frames;
  228. unsigned int tx_retry_limit_exceeded;
  229. unsigned int tx_discards;
  230. unsigned int rx_unicast_frames;
  231. unsigned int rx_multicast_frames;
  232. unsigned int rx_fragments;
  233. unsigned int rx_unicast_octets;
  234. unsigned int rx_multicast_octets;
  235. unsigned int rx_fcs_errors;
  236. unsigned int rx_discards_no_buffer;
  237. unsigned int tx_discards_wrong_sa;
  238. unsigned int rx_discards_wep_undecryptable;
  239. unsigned int rx_message_in_msg_fragments;
  240. unsigned int rx_message_in_bad_msg_fragments;
  241. };
  242. struct hfa384x_regs {
  243. u16 cmd;
  244. u16 evstat;
  245. u16 offset0;
  246. u16 offset1;
  247. u16 swsupport0;
  248. };
  249. #if defined(PRISM2_PCCARD) || defined(PRISM2_PLX)
  250. /* I/O ports for HFA384X Controller access */
  251. #define HFA384X_CMD_OFF 0x00
  252. #define HFA384X_PARAM0_OFF 0x02
  253. #define HFA384X_PARAM1_OFF 0x04
  254. #define HFA384X_PARAM2_OFF 0x06
  255. #define HFA384X_STATUS_OFF 0x08
  256. #define HFA384X_RESP0_OFF 0x0A
  257. #define HFA384X_RESP1_OFF 0x0C
  258. #define HFA384X_RESP2_OFF 0x0E
  259. #define HFA384X_INFOFID_OFF 0x10
  260. #define HFA384X_CONTROL_OFF 0x14
  261. #define HFA384X_SELECT0_OFF 0x18
  262. #define HFA384X_SELECT1_OFF 0x1A
  263. #define HFA384X_OFFSET0_OFF 0x1C
  264. #define HFA384X_OFFSET1_OFF 0x1E
  265. #define HFA384X_RXFID_OFF 0x20
  266. #define HFA384X_ALLOCFID_OFF 0x22
  267. #define HFA384X_TXCOMPLFID_OFF 0x24
  268. #define HFA384X_SWSUPPORT0_OFF 0x28
  269. #define HFA384X_SWSUPPORT1_OFF 0x2A
  270. #define HFA384X_SWSUPPORT2_OFF 0x2C
  271. #define HFA384X_EVSTAT_OFF 0x30
  272. #define HFA384X_INTEN_OFF 0x32
  273. #define HFA384X_EVACK_OFF 0x34
  274. #define HFA384X_DATA0_OFF 0x36
  275. #define HFA384X_DATA1_OFF 0x38
  276. #define HFA384X_AUXPAGE_OFF 0x3A
  277. #define HFA384X_AUXOFFSET_OFF 0x3C
  278. #define HFA384X_AUXDATA_OFF 0x3E
  279. #endif /* PRISM2_PCCARD || PRISM2_PLX */
  280. #ifdef PRISM2_PCI
  281. /* Memory addresses for ISL3874 controller access */
  282. #define HFA384X_CMD_OFF 0x00
  283. #define HFA384X_PARAM0_OFF 0x04
  284. #define HFA384X_PARAM1_OFF 0x08
  285. #define HFA384X_PARAM2_OFF 0x0C
  286. #define HFA384X_STATUS_OFF 0x10
  287. #define HFA384X_RESP0_OFF 0x14
  288. #define HFA384X_RESP1_OFF 0x18
  289. #define HFA384X_RESP2_OFF 0x1C
  290. #define HFA384X_INFOFID_OFF 0x20
  291. #define HFA384X_CONTROL_OFF 0x28
  292. #define HFA384X_SELECT0_OFF 0x30
  293. #define HFA384X_SELECT1_OFF 0x34
  294. #define HFA384X_OFFSET0_OFF 0x38
  295. #define HFA384X_OFFSET1_OFF 0x3C
  296. #define HFA384X_RXFID_OFF 0x40
  297. #define HFA384X_ALLOCFID_OFF 0x44
  298. #define HFA384X_TXCOMPLFID_OFF 0x48
  299. #define HFA384X_PCICOR_OFF 0x4C
  300. #define HFA384X_SWSUPPORT0_OFF 0x50
  301. #define HFA384X_SWSUPPORT1_OFF 0x54
  302. #define HFA384X_SWSUPPORT2_OFF 0x58
  303. #define HFA384X_PCIHCR_OFF 0x5C
  304. #define HFA384X_EVSTAT_OFF 0x60
  305. #define HFA384X_INTEN_OFF 0x64
  306. #define HFA384X_EVACK_OFF 0x68
  307. #define HFA384X_DATA0_OFF 0x6C
  308. #define HFA384X_DATA1_OFF 0x70
  309. #define HFA384X_AUXPAGE_OFF 0x74
  310. #define HFA384X_AUXOFFSET_OFF 0x78
  311. #define HFA384X_AUXDATA_OFF 0x7C
  312. #define HFA384X_PCI_M0_ADDRH_OFF 0x80
  313. #define HFA384X_PCI_M0_ADDRL_OFF 0x84
  314. #define HFA384X_PCI_M0_LEN_OFF 0x88
  315. #define HFA384X_PCI_M0_CTL_OFF 0x8C
  316. #define HFA384X_PCI_STATUS_OFF 0x98
  317. #define HFA384X_PCI_M1_ADDRH_OFF 0xA0
  318. #define HFA384X_PCI_M1_ADDRL_OFF 0xA4
  319. #define HFA384X_PCI_M1_LEN_OFF 0xA8
  320. #define HFA384X_PCI_M1_CTL_OFF 0xAC
  321. /* PCI bus master control bits (these are undocumented; based on guessing and
  322. * experimenting..) */
  323. #define HFA384X_PCI_CTL_FROM_BAP (BIT(5) | BIT(1) | BIT(0))
  324. #define HFA384X_PCI_CTL_TO_BAP (BIT(5) | BIT(0))
  325. #endif /* PRISM2_PCI */
  326. /* Command codes for CMD reg. */
  327. #define HFA384X_CMDCODE_INIT 0x00
  328. #define HFA384X_CMDCODE_ENABLE 0x01
  329. #define HFA384X_CMDCODE_DISABLE 0x02
  330. #define HFA384X_CMDCODE_ALLOC 0x0A
  331. #define HFA384X_CMDCODE_TRANSMIT 0x0B
  332. #define HFA384X_CMDCODE_INQUIRE 0x11
  333. #define HFA384X_CMDCODE_ACCESS 0x21
  334. #define HFA384X_CMDCODE_ACCESS_WRITE (0x21 | BIT(8))
  335. #define HFA384X_CMDCODE_DOWNLOAD 0x22
  336. #define HFA384X_CMDCODE_READMIF 0x30
  337. #define HFA384X_CMDCODE_WRITEMIF 0x31
  338. #define HFA384X_CMDCODE_TEST 0x38
  339. #define HFA384X_CMDCODE_MASK 0x3F
  340. /* Test mode operations */
  341. #define HFA384X_TEST_CHANGE_CHANNEL 0x08
  342. #define HFA384X_TEST_MONITOR 0x0B
  343. #define HFA384X_TEST_STOP 0x0F
  344. #define HFA384X_TEST_CFG_BITS 0x15
  345. #define HFA384X_TEST_CFG_BIT_ALC BIT(3)
  346. #define HFA384X_CMD_BUSY BIT(15)
  347. #define HFA384X_CMD_TX_RECLAIM BIT(8)
  348. #define HFA384X_OFFSET_ERR BIT(14)
  349. #define HFA384X_OFFSET_BUSY BIT(15)
  350. /* ProgMode for download command */
  351. #define HFA384X_PROGMODE_DISABLE 0
  352. #define HFA384X_PROGMODE_ENABLE_VOLATILE 1
  353. #define HFA384X_PROGMODE_ENABLE_NON_VOLATILE 2
  354. #define HFA384X_PROGMODE_PROGRAM_NON_VOLATILE 3
  355. #define HFA384X_AUX_MAGIC0 0xfe01
  356. #define HFA384X_AUX_MAGIC1 0xdc23
  357. #define HFA384X_AUX_MAGIC2 0xba45
  358. #define HFA384X_AUX_PORT_DISABLED 0
  359. #define HFA384X_AUX_PORT_DISABLE BIT(14)
  360. #define HFA384X_AUX_PORT_ENABLE BIT(15)
  361. #define HFA384X_AUX_PORT_ENABLED (BIT(14) | BIT(15))
  362. #define HFA384X_AUX_PORT_MASK (BIT(14) | BIT(15))
  363. #define PRISM2_PDA_SIZE 1024
  364. /* Events; EvStat, Interrupt mask (IntEn), and acknowledge bits (EvAck) */
  365. #define HFA384X_EV_TICK BIT(15)
  366. #define HFA384X_EV_WTERR BIT(14)
  367. #define HFA384X_EV_INFDROP BIT(13)
  368. #ifdef PRISM2_PCI
  369. #define HFA384X_EV_PCI_M1 BIT(9)
  370. #define HFA384X_EV_PCI_M0 BIT(8)
  371. #endif /* PRISM2_PCI */
  372. #define HFA384X_EV_INFO BIT(7)
  373. #define HFA384X_EV_DTIM BIT(5)
  374. #define HFA384X_EV_CMD BIT(4)
  375. #define HFA384X_EV_ALLOC BIT(3)
  376. #define HFA384X_EV_TXEXC BIT(2)
  377. #define HFA384X_EV_TX BIT(1)
  378. #define HFA384X_EV_RX BIT(0)
  379. /* HFA384X Information frames */
  380. #define HFA384X_INFO_HANDOVERADDR 0xF000 /* AP f/w ? */
  381. #define HFA384X_INFO_HANDOVERDEAUTHADDR 0xF001 /* AP f/w 1.3.7 */
  382. #define HFA384X_INFO_COMMTALLIES 0xF100
  383. #define HFA384X_INFO_SCANRESULTS 0xF101
  384. #define HFA384X_INFO_CHANNELINFORESULTS 0xF102 /* AP f/w only */
  385. #define HFA384X_INFO_HOSTSCANRESULTS 0xF103
  386. #define HFA384X_INFO_LINKSTATUS 0xF200
  387. #define HFA384X_INFO_ASSOCSTATUS 0xF201 /* ? */
  388. #define HFA384X_INFO_AUTHREQ 0xF202 /* ? */
  389. #define HFA384X_INFO_PSUSERCNT 0xF203 /* ? */
  390. #define HFA384X_INFO_KEYIDCHANGED 0xF204 /* ? */
  391. enum { HFA384X_LINKSTATUS_CONNECTED = 1,
  392. HFA384X_LINKSTATUS_DISCONNECTED = 2,
  393. HFA384X_LINKSTATUS_AP_CHANGE = 3,
  394. HFA384X_LINKSTATUS_AP_OUT_OF_RANGE = 4,
  395. HFA384X_LINKSTATUS_AP_IN_RANGE = 5,
  396. HFA384X_LINKSTATUS_ASSOC_FAILED = 6 };
  397. enum { HFA384X_PORTTYPE_BSS = 1, HFA384X_PORTTYPE_WDS = 2,
  398. HFA384X_PORTTYPE_PSEUDO_IBSS = 3, HFA384X_PORTTYPE_IBSS = 0,
  399. HFA384X_PORTTYPE_HOSTAP = 6 };
  400. #define HFA384X_RATES_1MBPS BIT(0)
  401. #define HFA384X_RATES_2MBPS BIT(1)
  402. #define HFA384X_RATES_5MBPS BIT(2)
  403. #define HFA384X_RATES_11MBPS BIT(3)
  404. #define HFA384X_ROAMING_FIRMWARE 1
  405. #define HFA384X_ROAMING_HOST 2
  406. #define HFA384X_ROAMING_DISABLED 3
  407. #define HFA384X_WEPFLAGS_PRIVACYINVOKED BIT(0)
  408. #define HFA384X_WEPFLAGS_EXCLUDEUNENCRYPTED BIT(1)
  409. #define HFA384X_WEPFLAGS_HOSTENCRYPT BIT(4)
  410. #define HFA384X_WEPFLAGS_HOSTDECRYPT BIT(7)
  411. #define HFA384X_RX_STATUS_MSGTYPE (BIT(15) | BIT(14) | BIT(13))
  412. #define HFA384X_RX_STATUS_PCF BIT(12)
  413. #define HFA384X_RX_STATUS_MACPORT (BIT(10) | BIT(9) | BIT(8))
  414. #define HFA384X_RX_STATUS_UNDECR BIT(1)
  415. #define HFA384X_RX_STATUS_FCSERR BIT(0)
  416. #define HFA384X_RX_STATUS_GET_MSGTYPE(s) \
  417. (((s) & HFA384X_RX_STATUS_MSGTYPE) >> 13)
  418. #define HFA384X_RX_STATUS_GET_MACPORT(s) \
  419. (((s) & HFA384X_RX_STATUS_MACPORT) >> 8)
  420. enum { HFA384X_RX_MSGTYPE_NORMAL = 0, HFA384X_RX_MSGTYPE_RFC1042 = 1,
  421. HFA384X_RX_MSGTYPE_BRIDGETUNNEL = 2, HFA384X_RX_MSGTYPE_MGMT = 4 };
  422. #define HFA384X_TX_CTRL_ALT_RTRY BIT(5)
  423. #define HFA384X_TX_CTRL_802_11 BIT(3)
  424. #define HFA384X_TX_CTRL_802_3 0
  425. #define HFA384X_TX_CTRL_TX_EX BIT(2)
  426. #define HFA384X_TX_CTRL_TX_OK BIT(1)
  427. #define HFA384X_TX_STATUS_RETRYERR BIT(0)
  428. #define HFA384X_TX_STATUS_AGEDERR BIT(1)
  429. #define HFA384X_TX_STATUS_DISCON BIT(2)
  430. #define HFA384X_TX_STATUS_FORMERR BIT(3)
  431. /* HFA3861/3863 (BBP) Control Registers */
  432. #define HFA386X_CR_TX_CONFIGURE 0x12 /* CR9 */
  433. #define HFA386X_CR_RX_CONFIGURE 0x14 /* CR10 */
  434. #define HFA386X_CR_A_D_TEST_MODES2 0x1A /* CR13 */
  435. #define HFA386X_CR_MANUAL_TX_POWER 0x3E /* CR31 */
  436. #define HFA386X_CR_MEASURED_TX_POWER 0x74 /* CR58 */
  437. #ifdef __KERNEL__
  438. #define PRISM2_TXFID_COUNT 8
  439. #define PRISM2_DATA_MAXLEN 2304
  440. #define PRISM2_TXFID_LEN (PRISM2_DATA_MAXLEN + sizeof(struct hfa384x_tx_frame))
  441. #define PRISM2_TXFID_EMPTY 0xffff
  442. #define PRISM2_TXFID_RESERVED 0xfffe
  443. #define PRISM2_DUMMY_FID 0xffff
  444. #define MAX_SSID_LEN 32
  445. #define MAX_NAME_LEN 32 /* this is assumed to be equal to MAX_SSID_LEN */
  446. #define PRISM2_DUMP_RX_HDR BIT(0)
  447. #define PRISM2_DUMP_TX_HDR BIT(1)
  448. #define PRISM2_DUMP_TXEXC_HDR BIT(2)
  449. struct hostap_tx_callback_info {
  450. u16 idx;
  451. void (*func)(struct sk_buff *, int ok, void *);
  452. void *data;
  453. struct hostap_tx_callback_info *next;
  454. };
  455. /* IEEE 802.11 requires that STA supports concurrent reception of at least
  456. * three fragmented frames. This define can be increased to support more
  457. * concurrent frames, but it should be noted that each entry can consume about
  458. * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
  459. #define PRISM2_FRAG_CACHE_LEN 4
  460. struct prism2_frag_entry {
  461. unsigned long first_frag_time;
  462. unsigned int seq;
  463. unsigned int last_frag;
  464. struct sk_buff *skb;
  465. u8 src_addr[ETH_ALEN];
  466. u8 dst_addr[ETH_ALEN];
  467. };
  468. struct hostap_cmd_queue {
  469. struct list_head list;
  470. wait_queue_head_t compl;
  471. volatile enum { CMD_SLEEP, CMD_CALLBACK, CMD_COMPLETED } type;
  472. void (*callback)(struct net_device *dev, long context, u16 resp0,
  473. u16 res);
  474. long context;
  475. u16 cmd, param0, param1;
  476. u16 resp0, res;
  477. volatile int issued, issuing;
  478. atomic_t usecnt;
  479. int del_req;
  480. };
  481. /* options for hw_shutdown */
  482. #define HOSTAP_HW_NO_DISABLE BIT(0)
  483. #define HOSTAP_HW_ENABLE_CMDCOMPL BIT(1)
  484. typedef struct local_info local_info_t;
  485. struct prism2_helper_functions {
  486. /* these functions are defined in hardware model specific files
  487. * (hostap_{cs,plx,pci}.c */
  488. int (*card_present)(local_info_t *local);
  489. void (*cor_sreset)(local_info_t *local);
  490. void (*genesis_reset)(local_info_t *local, int hcr);
  491. /* the following functions are from hostap_hw.c, but they may have some
  492. * hardware model specific code */
  493. /* FIX: low-level commands like cmd might disappear at some point to
  494. * make it easier to change them if needed (e.g., cmd would be replaced
  495. * with write_mif/read_mif/testcmd/inquire); at least get_rid and
  496. * set_rid might move to hostap_{cs,plx,pci}.c */
  497. int (*cmd)(struct net_device *dev, u16 cmd, u16 param0, u16 *param1,
  498. u16 *resp0);
  499. void (*read_regs)(struct net_device *dev, struct hfa384x_regs *regs);
  500. int (*get_rid)(struct net_device *dev, u16 rid, void *buf, int len,
  501. int exact_len);
  502. int (*set_rid)(struct net_device *dev, u16 rid, void *buf, int len);
  503. int (*hw_enable)(struct net_device *dev, int initial);
  504. int (*hw_config)(struct net_device *dev, int initial);
  505. void (*hw_reset)(struct net_device *dev);
  506. void (*hw_shutdown)(struct net_device *dev, int no_disable);
  507. int (*reset_port)(struct net_device *dev);
  508. void (*schedule_reset)(local_info_t *local);
  509. int (*download)(local_info_t *local,
  510. struct prism2_download_param *param);
  511. int (*tx)(struct sk_buff *skb, struct net_device *dev);
  512. int (*set_tim)(struct net_device *dev, int aid, int set);
  513. int (*read_aux)(struct net_device *dev, unsigned addr, int len,
  514. u8 *buf);
  515. int need_tx_headroom; /* number of bytes of headroom needed before
  516. * IEEE 802.11 header */
  517. enum { HOSTAP_HW_PCCARD, HOSTAP_HW_PLX, HOSTAP_HW_PCI } hw_type;
  518. };
  519. struct prism2_download_data {
  520. u32 dl_cmd;
  521. u32 start_addr;
  522. u32 num_areas;
  523. struct prism2_download_data_area {
  524. u32 addr; /* wlan card address */
  525. u32 len;
  526. u8 *data; /* allocated data */
  527. } data[0];
  528. };
  529. #define HOSTAP_MAX_BSS_COUNT 64
  530. #define MAX_WPA_IE_LEN 64
  531. struct hostap_bss_info {
  532. struct list_head list;
  533. unsigned long last_update;
  534. unsigned int count;
  535. u8 bssid[ETH_ALEN];
  536. u16 capab_info;
  537. u8 ssid[32];
  538. size_t ssid_len;
  539. u8 wpa_ie[MAX_WPA_IE_LEN];
  540. size_t wpa_ie_len;
  541. u8 rsn_ie[MAX_WPA_IE_LEN];
  542. size_t rsn_ie_len;
  543. int chan;
  544. int included;
  545. };
  546. /* Per radio private Host AP data - shared by all net devices interfaces used
  547. * by each radio (wlan#, wlan#ap, wlan#sta, WDS).
  548. * ((struct hostap_interface *) netdev_priv(dev))->local points to this
  549. * structure. */
  550. struct local_info {
  551. struct module *hw_module;
  552. int card_idx;
  553. int dev_enabled;
  554. int master_dev_auto_open; /* was master device opened automatically */
  555. int num_dev_open; /* number of open devices */
  556. struct net_device *dev; /* master radio device */
  557. struct net_device *ddev; /* main data device */
  558. struct list_head hostap_interfaces; /* Host AP interface list (contains
  559. * struct hostap_interface entries)
  560. */
  561. rwlock_t iface_lock; /* hostap_interfaces read lock; use write lock
  562. * when removing entries from the list.
  563. * TX and RX paths can use read lock. */
  564. spinlock_t cmdlock, baplock, lock, irq_init_lock;
  565. struct mutex rid_bap_mtx;
  566. u16 infofid; /* MAC buffer id for info frame */
  567. /* txfid, intransmitfid, next_txtid, and next_alloc are protected by
  568. * txfidlock */
  569. spinlock_t txfidlock;
  570. int txfid_len; /* length of allocated TX buffers */
  571. u16 txfid[PRISM2_TXFID_COUNT]; /* buffer IDs for TX frames */
  572. /* buffer IDs for intransmit frames or PRISM2_TXFID_EMPTY if
  573. * corresponding txfid is free for next TX frame */
  574. u16 intransmitfid[PRISM2_TXFID_COUNT];
  575. int next_txfid; /* index to the next txfid to be checked for
  576. * availability */
  577. int next_alloc; /* index to the next intransmitfid to be checked for
  578. * allocation events */
  579. /* bitfield for atomic bitops */
  580. #define HOSTAP_BITS_TRANSMIT 0
  581. #define HOSTAP_BITS_BAP_TASKLET 1
  582. #define HOSTAP_BITS_BAP_TASKLET2 2
  583. unsigned long bits;
  584. struct ap_data *ap;
  585. char essid[MAX_SSID_LEN + 1];
  586. char name[MAX_NAME_LEN + 1];
  587. int name_set;
  588. u16 channel_mask; /* mask of allowed channels */
  589. u16 scan_channel_mask; /* mask of channels to be scanned */
  590. struct comm_tallies_sums comm_tallies;
  591. struct proc_dir_entry *proc;
  592. int iw_mode; /* operating mode (IW_MODE_*) */
  593. int pseudo_adhoc; /* 0: IW_MODE_ADHOC is real 802.11 compliant IBSS
  594. * 1: IW_MODE_ADHOC is "pseudo IBSS" */
  595. char bssid[ETH_ALEN];
  596. int channel;
  597. int beacon_int;
  598. int dtim_period;
  599. int mtu;
  600. int frame_dump; /* dump RX/TX frame headers, PRISM2_DUMP_ flags */
  601. int fw_tx_rate_control;
  602. u16 tx_rate_control;
  603. u16 basic_rates;
  604. int hw_resetting;
  605. int hw_ready;
  606. int hw_reset_tries; /* how many times reset has been tried */
  607. int hw_downloading;
  608. int shutdown;
  609. int pri_only;
  610. int no_pri; /* no PRI f/w present */
  611. int sram_type; /* 8 = x8 SRAM, 16 = x16 SRAM, -1 = unknown */
  612. enum {
  613. PRISM2_TXPOWER_AUTO = 0, PRISM2_TXPOWER_OFF,
  614. PRISM2_TXPOWER_FIXED, PRISM2_TXPOWER_UNKNOWN
  615. } txpower_type;
  616. int txpower; /* if txpower_type == PRISM2_TXPOWER_FIXED */
  617. /* command queue for hfa384x_cmd(); protected with cmdlock */
  618. struct list_head cmd_queue;
  619. /* max_len for cmd_queue; in addition, cmd_callback can use two
  620. * additional entries to prevent sleeping commands from stopping
  621. * transmits */
  622. #define HOSTAP_CMD_QUEUE_MAX_LEN 16
  623. int cmd_queue_len; /* number of entries in cmd_queue */
  624. /* if card timeout is detected in interrupt context, reset_queue is
  625. * used to schedule card reseting to be done in user context */
  626. struct work_struct reset_queue;
  627. /* For scheduling a change of the promiscuous mode RID */
  628. int is_promisc;
  629. struct work_struct set_multicast_list_queue;
  630. struct work_struct set_tim_queue;
  631. struct list_head set_tim_list;
  632. spinlock_t set_tim_lock;
  633. int wds_max_connections;
  634. int wds_connections;
  635. #define HOSTAP_WDS_BROADCAST_RA BIT(0)
  636. #define HOSTAP_WDS_AP_CLIENT BIT(1)
  637. #define HOSTAP_WDS_STANDARD_FRAME BIT(2)
  638. u32 wds_type;
  639. u16 tx_control; /* flags to be used in TX description */
  640. int manual_retry_count; /* -1 = use f/w default; otherwise retry count
  641. * to be used with all frames */
  642. struct iw_statistics wstats;
  643. unsigned long scan_timestamp; /* Time started to scan */
  644. enum {
  645. PRISM2_MONITOR_80211 = 0, PRISM2_MONITOR_PRISM = 1,
  646. PRISM2_MONITOR_CAPHDR = 2, PRISM2_MONITOR_RADIOTAP = 3
  647. } monitor_type;
  648. int monitor_allow_fcserr;
  649. int hostapd; /* whether user space daemon, hostapd, is used for AP
  650. * management */
  651. int hostapd_sta; /* whether hostapd is used with an extra STA interface
  652. */
  653. struct net_device *apdev;
  654. struct net_device_stats apdevstats;
  655. char assoc_ap_addr[ETH_ALEN];
  656. struct net_device *stadev;
  657. struct net_device_stats stadevstats;
  658. #define WEP_KEYS 4
  659. #define WEP_KEY_LEN 13
  660. struct lib80211_crypt_info crypt_info;
  661. int open_wep; /* allow unencrypted frames */
  662. int host_encrypt;
  663. int host_decrypt;
  664. int privacy_invoked; /* force privacy invoked flag even if no keys are
  665. * configured */
  666. int fw_encrypt_ok; /* whether firmware-based WEP encrypt is working
  667. * in Host AP mode (STA f/w 1.4.9 or newer) */
  668. int bcrx_sta_key; /* use individual keys to override default keys even
  669. * with RX of broad/multicast frames */
  670. struct prism2_frag_entry frag_cache[PRISM2_FRAG_CACHE_LEN];
  671. unsigned int frag_next_idx;
  672. int ieee_802_1x; /* is IEEE 802.1X used */
  673. int antsel_tx, antsel_rx;
  674. int rts_threshold; /* dot11RTSThreshold */
  675. int fragm_threshold; /* dot11FragmentationThreshold */
  676. int auth_algs; /* PRISM2_AUTH_ flags */
  677. int enh_sec; /* cnfEnhSecurity options (broadcast SSID hide/ignore) */
  678. int tallies32; /* 32-bit tallies in use */
  679. struct prism2_helper_functions *func;
  680. u8 *pda;
  681. int fw_ap;
  682. #define PRISM2_FW_VER(major, minor, variant) \
  683. (((major) << 16) | ((minor) << 8) | variant)
  684. u32 sta_fw_ver;
  685. /* Tasklets for handling hardware IRQ related operations outside hw IRQ
  686. * handler */
  687. struct tasklet_struct bap_tasklet;
  688. struct tasklet_struct info_tasklet;
  689. struct sk_buff_head info_list; /* info frames as skb's for
  690. * info_tasklet */
  691. struct hostap_tx_callback_info *tx_callback; /* registered TX callbacks
  692. */
  693. struct tasklet_struct rx_tasklet;
  694. struct sk_buff_head rx_list;
  695. struct tasklet_struct sta_tx_exc_tasklet;
  696. struct sk_buff_head sta_tx_exc_list;
  697. int host_roaming;
  698. unsigned long last_join_time; /* time of last JoinRequest */
  699. struct hfa384x_hostscan_result *last_scan_results;
  700. int last_scan_results_count;
  701. enum { PRISM2_SCAN, PRISM2_HOSTSCAN } last_scan_type;
  702. struct work_struct info_queue;
  703. unsigned long pending_info; /* bit field of pending info_queue items */
  704. #define PRISM2_INFO_PENDING_LINKSTATUS 0
  705. #define PRISM2_INFO_PENDING_SCANRESULTS 1
  706. int prev_link_status; /* previous received LinkStatus info */
  707. int prev_linkstatus_connected;
  708. u8 preferred_ap[6]; /* use this AP if possible */
  709. #ifdef PRISM2_CALLBACK
  710. void *callback_data; /* Can be used in callbacks; e.g., allocate
  711. * on enable event and free on disable event.
  712. * Host AP driver code does not touch this. */
  713. #endif /* PRISM2_CALLBACK */
  714. wait_queue_head_t hostscan_wq;
  715. /* Passive scan in Host AP mode */
  716. struct timer_list passive_scan_timer;
  717. int passive_scan_interval; /* in seconds, 0 = disabled */
  718. int passive_scan_channel;
  719. enum { PASSIVE_SCAN_WAIT, PASSIVE_SCAN_LISTEN } passive_scan_state;
  720. struct timer_list tick_timer;
  721. unsigned long last_tick_timer;
  722. unsigned int sw_tick_stuck;
  723. /* commsQuality / dBmCommsQuality data from periodic polling; only
  724. * valid for Managed and Ad-hoc modes */
  725. unsigned long last_comms_qual_update;
  726. int comms_qual; /* in some odd unit.. */
  727. int avg_signal; /* in dB (note: negative) */
  728. int avg_noise; /* in dB (note: negative) */
  729. struct work_struct comms_qual_update;
  730. /* RSSI to dBm adjustment (for RX descriptor fields) */
  731. int rssi_to_dBm; /* subtract from RSSI to get approximate dBm value */
  732. /* BSS list / protected by local->lock */
  733. struct list_head bss_list;
  734. int num_bss_info;
  735. int wpa; /* WPA support enabled */
  736. int tkip_countermeasures;
  737. int drop_unencrypted;
  738. /* Generic IEEE 802.11 info element to be added to
  739. * ProbeResp/Beacon/(Re)AssocReq */
  740. u8 *generic_elem;
  741. size_t generic_elem_len;
  742. #ifdef PRISM2_DOWNLOAD_SUPPORT
  743. /* Persistent volatile download data */
  744. struct prism2_download_data *dl_pri;
  745. struct prism2_download_data *dl_sec;
  746. #endif /* PRISM2_DOWNLOAD_SUPPORT */
  747. #ifdef PRISM2_IO_DEBUG
  748. #define PRISM2_IO_DEBUG_SIZE 10000
  749. u32 io_debug[PRISM2_IO_DEBUG_SIZE];
  750. int io_debug_head;
  751. int io_debug_enabled;
  752. #endif /* PRISM2_IO_DEBUG */
  753. /* Pointer to hardware model specific (cs,pci,plx) private data. */
  754. void *hw_priv;
  755. };
  756. /* Per interface private Host AP data
  757. * Allocated for each net device that Host AP uses (wlan#, wlan#ap, wlan#sta,
  758. * WDS) and netdev_priv(dev) points to this structure. */
  759. struct hostap_interface {
  760. struct list_head list; /* list entry in Host AP interface list */
  761. struct net_device *dev; /* pointer to this device */
  762. struct local_info *local; /* pointer to shared private data */
  763. struct net_device_stats stats;
  764. struct iw_spy_data spy_data; /* iwspy support */
  765. struct iw_public_data wireless_data;
  766. enum {
  767. HOSTAP_INTERFACE_MASTER,
  768. HOSTAP_INTERFACE_MAIN,
  769. HOSTAP_INTERFACE_AP,
  770. HOSTAP_INTERFACE_STA,
  771. HOSTAP_INTERFACE_WDS,
  772. } type;
  773. union {
  774. struct hostap_interface_wds {
  775. u8 remote_addr[ETH_ALEN];
  776. } wds;
  777. } u;
  778. };
  779. #define HOSTAP_SKB_TX_DATA_MAGIC 0xf08a36a2
  780. /*
  781. * TX meta data - stored in skb->cb buffer, so this must not be increased over
  782. * the 48-byte limit.
  783. * THE PADDING THIS STARTS WITH IS A HORRIBLE HACK THAT SHOULD NOT LIVE
  784. * TO SEE THE DAY.
  785. */
  786. struct hostap_skb_tx_data {
  787. unsigned int __padding_for_default_qdiscs;
  788. u32 magic; /* HOSTAP_SKB_TX_DATA_MAGIC */
  789. u8 rate; /* transmit rate */
  790. #define HOSTAP_TX_FLAGS_WDS BIT(0)
  791. #define HOSTAP_TX_FLAGS_BUFFERED_FRAME BIT(1)
  792. #define HOSTAP_TX_FLAGS_ADD_MOREDATA BIT(2)
  793. u8 flags; /* HOSTAP_TX_FLAGS_* */
  794. u16 tx_cb_idx;
  795. struct hostap_interface *iface;
  796. unsigned long jiffies; /* queueing timestamp */
  797. unsigned short ethertype;
  798. };
  799. #ifndef PRISM2_NO_DEBUG
  800. #define DEBUG_FID BIT(0)
  801. #define DEBUG_PS BIT(1)
  802. #define DEBUG_FLOW BIT(2)
  803. #define DEBUG_AP BIT(3)
  804. #define DEBUG_HW BIT(4)
  805. #define DEBUG_EXTRA BIT(5)
  806. #define DEBUG_EXTRA2 BIT(6)
  807. #define DEBUG_PS2 BIT(7)
  808. #define DEBUG_MASK (DEBUG_PS | DEBUG_AP | DEBUG_HW | DEBUG_EXTRA)
  809. #define PDEBUG(n, args...) \
  810. do { if ((n) & DEBUG_MASK) printk(KERN_DEBUG args); } while (0)
  811. #define PDEBUG2(n, args...) \
  812. do { if ((n) & DEBUG_MASK) printk(args); } while (0)
  813. #else /* PRISM2_NO_DEBUG */
  814. #define PDEBUG(n, args...)
  815. #define PDEBUG2(n, args...)
  816. #endif /* PRISM2_NO_DEBUG */
  817. enum { BAP0 = 0, BAP1 = 1 };
  818. #define PRISM2_IO_DEBUG_CMD_INB 0
  819. #define PRISM2_IO_DEBUG_CMD_INW 1
  820. #define PRISM2_IO_DEBUG_CMD_INSW 2
  821. #define PRISM2_IO_DEBUG_CMD_OUTB 3
  822. #define PRISM2_IO_DEBUG_CMD_OUTW 4
  823. #define PRISM2_IO_DEBUG_CMD_OUTSW 5
  824. #define PRISM2_IO_DEBUG_CMD_ERROR 6
  825. #define PRISM2_IO_DEBUG_CMD_INTERRUPT 7
  826. #ifdef PRISM2_IO_DEBUG
  827. #define PRISM2_IO_DEBUG_ENTRY(cmd, reg, value) \
  828. (((cmd) << 24) | ((reg) << 16) | value)
  829. static inline void prism2_io_debug_add(struct net_device *dev, int cmd,
  830. int reg, int value)
  831. {
  832. struct hostap_interface *iface = netdev_priv(dev);
  833. local_info_t *local = iface->local;
  834. if (!local->io_debug_enabled)
  835. return;
  836. local->io_debug[local->io_debug_head] = jiffies & 0xffffffff;
  837. if (++local->io_debug_head >= PRISM2_IO_DEBUG_SIZE)
  838. local->io_debug_head = 0;
  839. local->io_debug[local->io_debug_head] =
  840. PRISM2_IO_DEBUG_ENTRY(cmd, reg, value);
  841. if (++local->io_debug_head >= PRISM2_IO_DEBUG_SIZE)
  842. local->io_debug_head = 0;
  843. }
  844. static inline void prism2_io_debug_error(struct net_device *dev, int err)
  845. {
  846. struct hostap_interface *iface = netdev_priv(dev);
  847. local_info_t *local = iface->local;
  848. unsigned long flags;
  849. if (!local->io_debug_enabled)
  850. return;
  851. spin_lock_irqsave(&local->lock, flags);
  852. prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_ERROR, 0, err);
  853. if (local->io_debug_enabled == 1) {
  854. local->io_debug_enabled = 0;
  855. printk(KERN_DEBUG "%s: I/O debug stopped\n", dev->name);
  856. }
  857. spin_unlock_irqrestore(&local->lock, flags);
  858. }
  859. #else /* PRISM2_IO_DEBUG */
  860. static inline void prism2_io_debug_add(struct net_device *dev, int cmd,
  861. int reg, int value)
  862. {
  863. }
  864. static inline void prism2_io_debug_error(struct net_device *dev, int err)
  865. {
  866. }
  867. #endif /* PRISM2_IO_DEBUG */
  868. #ifdef PRISM2_CALLBACK
  869. enum {
  870. /* Called when card is enabled */
  871. PRISM2_CALLBACK_ENABLE,
  872. /* Called when card is disabled */
  873. PRISM2_CALLBACK_DISABLE,
  874. /* Called when RX/TX starts/ends */
  875. PRISM2_CALLBACK_RX_START, PRISM2_CALLBACK_RX_END,
  876. PRISM2_CALLBACK_TX_START, PRISM2_CALLBACK_TX_END
  877. };
  878. void prism2_callback(local_info_t *local, int event);
  879. #else /* PRISM2_CALLBACK */
  880. #define prism2_callback(d, e) do { } while (0)
  881. #endif /* PRISM2_CALLBACK */
  882. #endif /* __KERNEL__ */
  883. #endif /* HOSTAP_WLAN_H */