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