hostap_wlan.h 30 KB

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