hostap_wlan.h 30 KB

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