hostap_wlan.h 30 KB

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