rayctl.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. #ifndef _RAYCTL_H_
  2. #define _RAYCTL_H_
  3. typedef unsigned char UCHAR;
  4. /****** IEEE 802.11 constants ************************************************/
  5. #define ADDRLEN 6
  6. /* Frame control 1 bit fields */
  7. #define PROTOCOL_VER 0x00
  8. #define DATA_TYPE 0x08
  9. #define ASSOC_REQ_TYPE 0x00
  10. #define ASSOC_RESP_TYPE 0x10
  11. #define REASSOC_REQ_TYPE 0x20
  12. #define REASSOC_RESP_TYPE 0x30
  13. #define NULL_MSG_TYPE 0x48
  14. #define BEACON_TYPE 0x80
  15. #define DISASSOC_TYPE 0xA0
  16. #define PSPOLL_TYPE 0xA4
  17. #define AUTHENTIC_TYPE 0xB0
  18. #define DEAUTHENTIC_TYPE 0xC0
  19. /* Frame control 2 bit fields */
  20. #define FC2_TO_DS 0x01
  21. #define FC2_FROM_DS 0x02
  22. #define FC2_MORE_FRAG 0x04
  23. #define FC2_RETRY 0x08
  24. #define FC2_PSM 0x10
  25. #define FC2_MORE_DATA 0x20
  26. #define FC2_WEP 0x40
  27. #define FC2_ORDER 0x80
  28. /*****************************************************************************/
  29. /* 802.11 element ID's and lengths */
  30. #define C_BP_CAPABILITY_ESS 0x01
  31. #define C_BP_CAPABILITY_IBSS 0x02
  32. #define C_BP_CAPABILITY_CF_POLLABLE 0x04
  33. #define C_BP_CAPABILITY_CF_POLL_REQUEST 0x08
  34. #define C_BP_CAPABILITY_PRIVACY 0x10
  35. #define C_ESSID_ELEMENT_ID 0
  36. #define C_ESSID_ELEMENT_MAX_LENGTH 32
  37. #define C_SUPPORTED_RATES_ELEMENT_ID 1
  38. #define C_SUPPORTED_RATES_ELEMENT_LENGTH 2
  39. #define C_FH_PARAM_SET_ELEMENT_ID 2
  40. #define C_FH_PARAM_SET_ELEMENT_LNGTH 5
  41. #define C_CF_PARAM_SET_ELEMENT_ID 4
  42. #define C_CF_PARAM_SET_ELEMENT_LNGTH 6
  43. #define C_TIM_ELEMENT_ID 5
  44. #define C_TIM_BITMAP_LENGTH 251
  45. #define C_TIM_BMCAST_BIT 0x01
  46. #define C_IBSS_ELEMENT_ID 6
  47. #define C_IBSS_ELEMENT_LENGTH 2
  48. #define C_JAPAN_CALL_SIGN_ELEMENT_ID 51
  49. #define C_JAPAN_CALL_SIGN_ELEMENT_LNGTH 12
  50. #define C_DISASSOC_REASON_CODE_LEN 2
  51. #define C_DISASSOC_REASON_CODE_DEFAULT 8
  52. #define C_CRC_LEN 4
  53. #define C_NUM_SUPPORTED_RATES 8
  54. /****** IEEE 802.11 mac header for type data packets *************************/
  55. struct mac_header {
  56. UCHAR frame_ctl_1;
  57. UCHAR frame_ctl_2;
  58. UCHAR duration_lsb;
  59. UCHAR duration_msb;
  60. UCHAR addr_1[ADDRLEN];
  61. UCHAR addr_2[ADDRLEN];
  62. UCHAR addr_3[ADDRLEN];
  63. UCHAR seq_frag_num[2];
  64. /* UCHAR addr_4[ADDRLEN]; *//* only present for AP to AP (TO DS and FROM DS */
  65. };
  66. /****** IEEE 802.11 frame element structures *********************************/
  67. struct essid_element
  68. {
  69. UCHAR id;
  70. UCHAR length;
  71. UCHAR text[C_ESSID_ELEMENT_MAX_LENGTH];
  72. };
  73. struct rates_element
  74. {
  75. UCHAR id;
  76. UCHAR length;
  77. UCHAR value[8];
  78. };
  79. struct freq_hop_element
  80. {
  81. UCHAR id;
  82. UCHAR length;
  83. UCHAR dwell_time[2];
  84. UCHAR hop_set;
  85. UCHAR hop_pattern;
  86. UCHAR hop_index;
  87. };
  88. struct tim_element
  89. {
  90. UCHAR id;
  91. UCHAR length;
  92. UCHAR dtim_count;
  93. UCHAR dtim_period;
  94. UCHAR bitmap_control;
  95. UCHAR tim[C_TIM_BITMAP_LENGTH];
  96. };
  97. struct ibss_element
  98. {
  99. UCHAR id;
  100. UCHAR length;
  101. UCHAR atim_window[2];
  102. };
  103. struct japan_call_sign_element
  104. {
  105. UCHAR id;
  106. UCHAR length;
  107. UCHAR call_sign[12];
  108. };
  109. /****** Beacon message structures ********************************************/
  110. /* .elements is a large lump of max size because elements are variable size */
  111. struct infra_beacon
  112. {
  113. UCHAR timestamp[8];
  114. UCHAR beacon_intvl[2];
  115. UCHAR capability[2];
  116. UCHAR elements[sizeof(struct essid_element)
  117. + sizeof(struct rates_element)
  118. + sizeof(struct freq_hop_element)
  119. + sizeof(struct japan_call_sign_element)
  120. + sizeof(struct tim_element)];
  121. };
  122. struct adhoc_beacon
  123. {
  124. UCHAR timestamp[8];
  125. UCHAR beacon_intvl[2];
  126. UCHAR capability[2];
  127. UCHAR elements[sizeof(struct essid_element)
  128. + sizeof(struct rates_element)
  129. + sizeof(struct freq_hop_element)
  130. + sizeof(struct japan_call_sign_element)
  131. + sizeof(struct ibss_element)];
  132. };
  133. /*****************************************************************************/
  134. /*****************************************************************************/
  135. /* #define C_MAC_HDR_2_WEP 0x40 */
  136. /* TX/RX CCS constants */
  137. #define TX_HEADER_LENGTH 0x1C
  138. #define RX_MAC_HEADER_LENGTH 0x18
  139. #define TX_AUTHENTICATE_LENGTH (TX_HEADER_LENGTH + 6)
  140. #define TX_AUTHENTICATE_LENGTH_MSB (TX_AUTHENTICATE_LENGTH >> 8)
  141. #define TX_AUTHENTICATE_LENGTH_LSB (TX_AUTHENTICATE_LENGTH & 0xff)
  142. #define TX_DEAUTHENTICATE_LENGTH (TX_HEADER_LENGTH + 2)
  143. #define TX_DEAUTHENTICATE_LENGTH_MSB (TX_AUTHENTICATE_LENGTH >> 8)
  144. #define TX_DEAUTHENTICATE_LENGTH_LSB (TX_AUTHENTICATE_LENGTH & 0xff)
  145. #define FCS_LEN 4
  146. #define ADHOC 0
  147. #define INFRA 1
  148. #define TYPE_STA 0
  149. #define TYPE_AP 1
  150. #define PASSIVE_SCAN 1
  151. #define ACTIVE_SCAN 1
  152. #define PSM_CAM 0
  153. /* Country codes */
  154. #define USA 1
  155. #define EUROPE 2
  156. #define JAPAN 3
  157. #define KOREA 4
  158. #define SPAIN 5
  159. #define FRANCE 6
  160. #define ISRAEL 7
  161. #define AUSTRALIA 8
  162. #define JAPAN_TEST 9
  163. /* Hop pattern lengths */
  164. #define USA_HOP_MOD 79
  165. #define EUROPE_HOP_MOD 79
  166. #define JAPAN_HOP_MOD 23
  167. #define KOREA_HOP_MOD 23
  168. #define SPAIN_HOP_MOD 27
  169. #define FRANCE_HOP_MOD 35
  170. #define ISRAEL_HOP_MOD 35
  171. #define AUSTRALIA_HOP_MOD 47
  172. #define JAPAN_TEST_HOP_MOD 23
  173. #define ESSID_SIZE 32
  174. /**********************************************************************/
  175. /* CIS Register Constants */
  176. #define CIS_OFFSET 0x0f00
  177. /* Configuration Option Register (0x0F00) */
  178. #define COR_OFFSET 0x00
  179. #define COR_SOFT_RESET 0x80
  180. #define COR_LEVEL_IRQ 0x40
  181. #define COR_CONFIG_NUM 0x01
  182. #define COR_DEFAULT (COR_LEVEL_IRQ | COR_CONFIG_NUM)
  183. /* Card Configuration and Status Register (0x0F01) */
  184. #define CCSR_OFFSET 0x01
  185. #define CCSR_HOST_INTR_PENDING 0x01
  186. #define CCSR_POWER_DOWN 0x04
  187. /* HCS Interrupt Register (0x0F05) */
  188. #define HCS_INTR_OFFSET 0x05
  189. /* #define HCS_INTR_OFFSET 0x0A */
  190. #define HCS_INTR_CLEAR 0x00
  191. /* ECF Interrupt Register (0x0F06) */
  192. #define ECF_INTR_OFFSET 0x06
  193. /* #define ECF_INTR_OFFSET 0x0C */
  194. #define ECF_INTR_SET 0x01
  195. /* Authorization Register 0 (0x0F08) */
  196. #define AUTH_0_ON 0x57
  197. /* Authorization Register 1 (0x0F09) */
  198. #define AUTH_1_ON 0x82
  199. /* Program Mode Register (0x0F0A) */
  200. #define PC2PM 0x02
  201. #define PC2CAL 0x10
  202. #define PC2MLSE 0x20
  203. /* PC Test Mode Register (0x0F0B) */
  204. #define PC_TEST_MODE 0x08
  205. /* Frequency Control Word (0x0F10) */
  206. /* Range 0x02 - 0xA6 */
  207. /* Test Mode Control 1-4 (0x0F14 - 0x0F17) */
  208. /**********************************************************************/
  209. /* Shared RAM Area */
  210. #define SCB_BASE 0x0000
  211. #define STATUS_BASE 0x0100
  212. #define HOST_TO_ECF_BASE 0x0200
  213. #define ECF_TO_HOST_BASE 0x0300
  214. #define CCS_BASE 0x0400
  215. #define RCS_BASE 0x0800
  216. #define INFRA_TIM_BASE 0x0C00
  217. #define SSID_LIST_BASE 0x0D00
  218. #define TX_BUF_BASE 0x1000
  219. #define RX_BUF_BASE 0x8000
  220. #define NUMBER_OF_CCS 64
  221. #define NUMBER_OF_RCS 64
  222. /*#define NUMBER_OF_TX_CCS 14 */
  223. #define NUMBER_OF_TX_CCS 14
  224. #define TX_BUF_SIZE (2048 - sizeof(struct tx_msg))
  225. #define RX_BUFF_END 0x3FFF
  226. /* Values for buffer_status */
  227. #define CCS_BUFFER_FREE 0
  228. #define CCS_BUFFER_BUSY 1
  229. #define CCS_COMMAND_COMPLETE 2
  230. #define CCS_COMMAND_FAILED 3
  231. /* Values for cmd */
  232. #define CCS_DOWNLOAD_STARTUP_PARAMS 1
  233. #define CCS_UPDATE_PARAMS 2
  234. #define CCS_REPORT_PARAMS 3
  235. #define CCS_UPDATE_MULTICAST_LIST 4
  236. #define CCS_UPDATE_POWER_SAVINGS_MODE 5
  237. #define CCS_START_NETWORK 6
  238. #define CCS_JOIN_NETWORK 7
  239. #define CCS_START_ASSOCIATION 8
  240. #define CCS_TX_REQUEST 9
  241. #define CCS_TEST_MEMORY 0xa
  242. #define CCS_SHUTDOWN 0xb
  243. #define CCS_DUMP_MEMORY 0xc
  244. #define CCS_START_TIMER 0xe
  245. #define CCS_LAST_CMD CCS_START_TIMER
  246. /* Values for link field */
  247. #define CCS_END_LIST 0xff
  248. /* values for buffer_status field */
  249. #define RCS_BUFFER_FREE 0
  250. #define RCS_BUFFER_BUSY 1
  251. #define RCS_COMPLETE 2
  252. #define RCS_FAILED 3
  253. #define RCS_BUFFER_RELEASE 0xFF
  254. /* values for interrupt_id field */
  255. #define PROCESS_RX_PACKET 0x80 /* */
  256. #define REJOIN_NET_COMPLETE 0x81 /* RCS ID: Rejoin Net Complete */
  257. #define ROAMING_INITIATED 0x82 /* RCS ID: Roaming Initiated */
  258. #define JAPAN_CALL_SIGN_RXD 0x83 /* RCS ID: New Japan Call Sign */
  259. /*****************************************************************************/
  260. /* Memory types for dump memory command */
  261. #define C_MEM_PROG 0
  262. #define C_MEM_XDATA 1
  263. #define C_MEM_SFR 2
  264. #define C_MEM_IDATA 3
  265. /*** Return values for hw_xmit **********/
  266. #define XMIT_OK (0)
  267. #define XMIT_MSG_BAD (-1)
  268. #define XMIT_NO_CCS (-2)
  269. #define XMIT_NO_INTR (-3)
  270. #define XMIT_NEED_AUTH (-4)
  271. /*** Values for card status */
  272. #define CARD_INSERTED (0)
  273. #define CARD_AWAITING_PARAM (1)
  274. #define CARD_INIT_ERROR (11)
  275. #define CARD_DL_PARAM (2)
  276. #define CARD_DL_PARAM_ERROR (12)
  277. #define CARD_DOING_ACQ (3)
  278. #define CARD_ACQ_COMPLETE (4)
  279. #define CARD_ACQ_FAILED (14)
  280. #define CARD_AUTH_COMPLETE (5)
  281. #define CARD_AUTH_REFUSED (15)
  282. #define CARD_ASSOC_COMPLETE (6)
  283. #define CARD_ASSOC_FAILED (16)
  284. /*** Values for authentication_state ***********************************/
  285. #define UNAUTHENTICATED (0)
  286. #define AWAITING_RESPONSE (1)
  287. #define AUTHENTICATED (2)
  288. #define NEED_TO_AUTH (3)
  289. /*** Values for authentication type ************************************/
  290. #define OPEN_AUTH_REQUEST (1)
  291. #define OPEN_AUTH_RESPONSE (2)
  292. #define BROADCAST_DEAUTH (0xc0)
  293. /*** Values for timer functions ****************************************/
  294. #define TODO_NOTHING (0)
  295. #define TODO_VERIFY_DL_START (-1)
  296. #define TODO_START_NET (-2)
  297. #define TODO_JOIN_NET (-3)
  298. #define TODO_AUTHENTICATE_TIMEOUT (-4)
  299. #define TODO_SEND_CCS (-5)
  300. /***********************************************************************/
  301. /* Parameter passing structure for update/report parameter CCS's */
  302. struct object_id {
  303. void *object_addr;
  304. unsigned char object_length;
  305. };
  306. #define OBJID_network_type 0
  307. #define OBJID_acting_as_ap_status 1
  308. #define OBJID_current_ess_id 2
  309. #define OBJID_scanning_mode 3
  310. #define OBJID_power_mgt_state 4
  311. #define OBJID_mac_address 5
  312. #define OBJID_frag_threshold 6
  313. #define OBJID_hop_time 7
  314. #define OBJID_beacon_period 8
  315. #define OBJID_dtim_period 9
  316. #define OBJID_retry_max 10
  317. #define OBJID_ack_timeout 11
  318. #define OBJID_sifs 12
  319. #define OBJID_difs 13
  320. #define OBJID_pifs 14
  321. #define OBJID_rts_threshold 15
  322. #define OBJID_scan_dwell_time 16
  323. #define OBJID_max_scan_dwell_time 17
  324. #define OBJID_assoc_resp_timeout 18
  325. #define OBJID_adhoc_scan_cycle_max 19
  326. #define OBJID_infra_scan_cycle_max 20
  327. #define OBJID_infra_super_cycle_max 21
  328. #define OBJID_promiscuous_mode 22
  329. #define OBJID_unique_word 23
  330. #define OBJID_slot_time 24
  331. #define OBJID_roaming_low_snr 25
  332. #define OBJID_low_snr_count_thresh 26
  333. #define OBJID_infra_missed_bcn 27
  334. #define OBJID_adhoc_missed_bcn 28
  335. #define OBJID_curr_country_code 29
  336. #define OBJID_hop_pattern 30
  337. #define OBJID_reserved 31
  338. #define OBJID_cw_max_msb 32
  339. #define OBJID_cw_min_msb 33
  340. #define OBJID_noise_filter_gain 34
  341. #define OBJID_noise_limit_offset 35
  342. #define OBJID_det_rssi_thresh_offset 36
  343. #define OBJID_med_busy_thresh_offset 37
  344. #define OBJID_det_sync_thresh 38
  345. #define OBJID_test_mode 39
  346. #define OBJID_test_min_chan_num 40
  347. #define OBJID_test_max_chan_num 41
  348. #define OBJID_allow_bcast_ID_prbrsp 42
  349. #define OBJID_privacy_must_start 43
  350. #define OBJID_privacy_can_join 44
  351. #define OBJID_basic_rate_set 45
  352. /**** Configuration/Status/Control Area ***************************/
  353. /* System Control Block (SCB) Area
  354. * Located at Shared RAM offset 0
  355. */
  356. struct scb {
  357. UCHAR ccs_index;
  358. UCHAR rcs_index;
  359. };
  360. /****** Status area at Shared RAM offset 0x0100 ******************************/
  361. struct status {
  362. UCHAR mrx_overflow_for_host; /* 0=ECF may write, 1=host may write*/
  363. UCHAR mrx_checksum_error_for_host; /* 0=ECF may write, 1=host may write*/
  364. UCHAR rx_hec_error_for_host; /* 0=ECF may write, 1=host may write*/
  365. UCHAR reserved1;
  366. short mrx_overflow; /* ECF increments on rx overflow */
  367. short mrx_checksum_error; /* ECF increments on rx CRC error */
  368. short rx_hec_error; /* ECF incs on mac header CRC error */
  369. UCHAR rxnoise; /* Average RSL measurement */
  370. };
  371. /****** Host-to-ECF Data Area at Shared RAM offset 0x200 *********************/
  372. struct host_to_ecf_area {
  373. };
  374. /****** ECF-to-Host Data Area at Shared RAM offset 0x0300 ********************/
  375. struct startup_res_518 {
  376. UCHAR startup_word;
  377. UCHAR station_addr[ADDRLEN];
  378. UCHAR calc_prog_chksum;
  379. UCHAR calc_cis_chksum;
  380. UCHAR ecf_spare[7];
  381. UCHAR japan_call_sign[12];
  382. };
  383. struct startup_res_6 {
  384. UCHAR startup_word;
  385. UCHAR station_addr[ADDRLEN];
  386. UCHAR reserved;
  387. UCHAR supp_rates[8];
  388. UCHAR japan_call_sign[12];
  389. UCHAR calc_prog_chksum;
  390. UCHAR calc_cis_chksum;
  391. UCHAR firmware_version[3];
  392. UCHAR asic_version;
  393. UCHAR tib_length;
  394. };
  395. struct start_join_net_params {
  396. UCHAR net_type;
  397. UCHAR ssid[ESSID_SIZE];
  398. UCHAR reserved;
  399. UCHAR privacy_can_join;
  400. };
  401. /****** Command Control Structure area at Shared ram offset 0x0400 ***********/
  402. /* Structures for command specific parameters (ccs.var) */
  403. struct update_param_cmd {
  404. UCHAR object_id;
  405. UCHAR number_objects;
  406. UCHAR failure_cause;
  407. };
  408. struct report_param_cmd {
  409. UCHAR object_id;
  410. UCHAR number_objects;
  411. UCHAR failure_cause;
  412. UCHAR length;
  413. };
  414. struct start_network_cmd {
  415. UCHAR update_param;
  416. UCHAR bssid[ADDRLEN];
  417. UCHAR net_initiated;
  418. UCHAR net_default_tx_rate;
  419. UCHAR encryption;
  420. };
  421. struct join_network_cmd {
  422. UCHAR update_param;
  423. UCHAR bssid[ADDRLEN];
  424. UCHAR net_initiated;
  425. UCHAR net_default_tx_rate;
  426. UCHAR encryption;
  427. };
  428. struct tx_requested_cmd {
  429. UCHAR tx_data_ptr[2];
  430. UCHAR tx_data_length[2];
  431. UCHAR host_reserved[2];
  432. UCHAR reserved[3];
  433. UCHAR tx_rate;
  434. UCHAR pow_sav_mode;
  435. UCHAR retries;
  436. UCHAR antenna;
  437. };
  438. struct tx_requested_cmd_4 {
  439. UCHAR tx_data_ptr[2];
  440. UCHAR tx_data_length[2];
  441. UCHAR dest_addr[ADDRLEN];
  442. UCHAR pow_sav_mode;
  443. UCHAR retries;
  444. UCHAR station_id;
  445. };
  446. struct memory_dump_cmd {
  447. UCHAR memory_type;
  448. UCHAR memory_ptr[2];
  449. UCHAR length;
  450. };
  451. struct update_association_cmd {
  452. UCHAR status;
  453. UCHAR aid[2];
  454. };
  455. struct start_timer_cmd {
  456. UCHAR duration[2];
  457. };
  458. struct ccs {
  459. UCHAR buffer_status; /* 0 = buffer free, 1 = buffer busy */
  460. /* 2 = command complete, 3 = failed */
  461. UCHAR cmd; /* command to ECF */
  462. UCHAR link; /* link to next CCS, FF=end of list */
  463. /* command specific parameters */
  464. union {
  465. char reserved[13];
  466. struct update_param_cmd update_param;
  467. struct report_param_cmd report_param;
  468. UCHAR nummulticast;
  469. UCHAR mode;
  470. struct start_network_cmd start_network;
  471. struct join_network_cmd join_network;
  472. struct tx_requested_cmd tx_request;
  473. struct memory_dump_cmd memory_dump;
  474. struct update_association_cmd update_assoc;
  475. struct start_timer_cmd start_timer;
  476. } var;
  477. };
  478. /*****************************************************************************/
  479. /* Transmit buffer structures */
  480. struct tib_structure {
  481. UCHAR ccs_index;
  482. UCHAR psm;
  483. UCHAR pass_fail;
  484. UCHAR retry_count;
  485. UCHAR max_retries;
  486. UCHAR frags_remaining;
  487. UCHAR no_rb;
  488. UCHAR rts_reqd;
  489. UCHAR csma_tx_cntrl_2;
  490. UCHAR sifs_tx_cntrl_2;
  491. UCHAR tx_dma_addr_1[2];
  492. UCHAR tx_dma_addr_2[2];
  493. UCHAR var_dur_2mhz[2];
  494. UCHAR var_dur_1mhz[2];
  495. UCHAR max_dur_2mhz[2];
  496. UCHAR max_dur_1mhz[2];
  497. UCHAR hdr_len;
  498. UCHAR max_frag_len[2];
  499. UCHAR var_len[2];
  500. UCHAR phy_hdr_4;
  501. UCHAR mac_hdr_1;
  502. UCHAR mac_hdr_2;
  503. UCHAR sid[2];
  504. };
  505. struct phy_header {
  506. UCHAR sfd[2];
  507. UCHAR hdr_3;
  508. UCHAR hdr_4;
  509. };
  510. struct ray_rx_msg {
  511. struct mac_header mac;
  512. UCHAR var[0];
  513. };
  514. struct tx_msg {
  515. struct tib_structure tib;
  516. struct phy_header phy;
  517. struct mac_header mac;
  518. UCHAR var[1];
  519. };
  520. /****** ECF Receive Control Structure (RCS) Area at Shared RAM offset 0x0800 */
  521. /* Structures for command specific parameters (rcs.var) */
  522. struct rx_packet_cmd {
  523. UCHAR rx_data_ptr[2];
  524. UCHAR rx_data_length[2];
  525. UCHAR rx_sig_lev;
  526. UCHAR next_frag_rcs_index;
  527. UCHAR totalpacketlength[2];
  528. };
  529. struct rejoin_net_cmplt_cmd {
  530. UCHAR reserved;
  531. UCHAR bssid[ADDRLEN];
  532. };
  533. struct japan_call_sign_rxd {
  534. UCHAR rxd_call_sign[8];
  535. UCHAR reserved[5];
  536. };
  537. struct rcs {
  538. UCHAR buffer_status;
  539. UCHAR interrupt_id;
  540. UCHAR link_field;
  541. /* command specific parameters */
  542. union {
  543. UCHAR reserved[13];
  544. struct rx_packet_cmd rx_packet;
  545. struct rejoin_net_cmplt_cmd rejoin_net_complete;
  546. struct japan_call_sign_rxd japan_call_sign;
  547. } var;
  548. };
  549. /****** Startup parameter structures for both versions of firmware ***********/
  550. struct b4_startup_params {
  551. UCHAR a_network_type; /* C_ADHOC, C_INFRA */
  552. UCHAR a_acting_as_ap_status; /* C_TYPE_STA, C_TYPE_AP */
  553. UCHAR a_current_ess_id[ESSID_SIZE]; /* Null terminated unless 32 long */
  554. UCHAR a_scanning_mode; /* passive 0, active 1 */
  555. UCHAR a_power_mgt_state; /* CAM 0, */
  556. UCHAR a_mac_addr[ADDRLEN]; /* */
  557. UCHAR a_frag_threshold[2]; /* 512 */
  558. UCHAR a_hop_time[2]; /* 16k * 2**n, n=0-4 in Kus */
  559. UCHAR a_beacon_period[2]; /* n * a_hop_time in Kus */
  560. UCHAR a_dtim_period; /* in beacons */
  561. UCHAR a_retry_max; /* */
  562. UCHAR a_ack_timeout; /* */
  563. UCHAR a_sifs; /* */
  564. UCHAR a_difs; /* */
  565. UCHAR a_pifs; /* */
  566. UCHAR a_rts_threshold[2]; /* */
  567. UCHAR a_scan_dwell_time[2]; /* */
  568. UCHAR a_max_scan_dwell_time[2]; /* */
  569. UCHAR a_assoc_resp_timeout_thresh; /* */
  570. UCHAR a_adhoc_scan_cycle_max; /* */
  571. UCHAR a_infra_scan_cycle_max; /* */
  572. UCHAR a_infra_super_scan_cycle_max; /* */
  573. UCHAR a_promiscuous_mode; /* */
  574. UCHAR a_unique_word[2]; /* */
  575. UCHAR a_slot_time; /* */
  576. UCHAR a_roaming_low_snr_thresh; /* */
  577. UCHAR a_low_snr_count_thresh; /* */
  578. UCHAR a_infra_missed_bcn_thresh; /* */
  579. UCHAR a_adhoc_missed_bcn_thresh; /* */
  580. UCHAR a_curr_country_code; /* C_USA */
  581. UCHAR a_hop_pattern; /* */
  582. UCHAR a_hop_pattern_length; /* */
  583. /* b4 - b5 differences start here */
  584. UCHAR a_cw_max; /* */
  585. UCHAR a_cw_min; /* */
  586. UCHAR a_noise_filter_gain; /* */
  587. UCHAR a_noise_limit_offset; /* */
  588. UCHAR a_det_rssi_thresh_offset; /* */
  589. UCHAR a_med_busy_thresh_offset; /* */
  590. UCHAR a_det_sync_thresh; /* */
  591. UCHAR a_test_mode; /* */
  592. UCHAR a_test_min_chan_num; /* */
  593. UCHAR a_test_max_chan_num; /* */
  594. UCHAR a_rx_tx_delay; /* */
  595. UCHAR a_current_bss_id[ADDRLEN]; /* */
  596. UCHAR a_hop_set; /* */
  597. };
  598. struct b5_startup_params {
  599. UCHAR a_network_type; /* C_ADHOC, C_INFRA */
  600. UCHAR a_acting_as_ap_status; /* C_TYPE_STA, C_TYPE_AP */
  601. UCHAR a_current_ess_id[ESSID_SIZE]; /* Null terminated unless 32 long */
  602. UCHAR a_scanning_mode; /* passive 0, active 1 */
  603. UCHAR a_power_mgt_state; /* CAM 0, */
  604. UCHAR a_mac_addr[ADDRLEN]; /* */
  605. UCHAR a_frag_threshold[2]; /* 512 */
  606. UCHAR a_hop_time[2]; /* 16k * 2**n, n=0-4 in Kus */
  607. UCHAR a_beacon_period[2]; /* n * a_hop_time in Kus */
  608. UCHAR a_dtim_period; /* in beacons */
  609. UCHAR a_retry_max; /* 4 */
  610. UCHAR a_ack_timeout; /* */
  611. UCHAR a_sifs; /* */
  612. UCHAR a_difs; /* */
  613. UCHAR a_pifs; /* */
  614. UCHAR a_rts_threshold[2]; /* */
  615. UCHAR a_scan_dwell_time[2]; /* */
  616. UCHAR a_max_scan_dwell_time[2]; /* */
  617. UCHAR a_assoc_resp_timeout_thresh; /* */
  618. UCHAR a_adhoc_scan_cycle_max; /* */
  619. UCHAR a_infra_scan_cycle_max; /* */
  620. UCHAR a_infra_super_scan_cycle_max; /* */
  621. UCHAR a_promiscuous_mode; /* */
  622. UCHAR a_unique_word[2]; /* */
  623. UCHAR a_slot_time; /* */
  624. UCHAR a_roaming_low_snr_thresh; /* */
  625. UCHAR a_low_snr_count_thresh; /* */
  626. UCHAR a_infra_missed_bcn_thresh; /* */
  627. UCHAR a_adhoc_missed_bcn_thresh; /* */
  628. UCHAR a_curr_country_code; /* C_USA */
  629. UCHAR a_hop_pattern; /* */
  630. UCHAR a_hop_pattern_length; /* */
  631. /* b4 - b5 differences start here */
  632. UCHAR a_cw_max[2]; /* */
  633. UCHAR a_cw_min[2]; /* */
  634. UCHAR a_noise_filter_gain; /* */
  635. UCHAR a_noise_limit_offset; /* */
  636. UCHAR a_det_rssi_thresh_offset; /* */
  637. UCHAR a_med_busy_thresh_offset; /* */
  638. UCHAR a_det_sync_thresh; /* */
  639. UCHAR a_test_mode; /* */
  640. UCHAR a_test_min_chan_num; /* */
  641. UCHAR a_test_max_chan_num; /* */
  642. UCHAR a_allow_bcast_SSID_probe_rsp;
  643. UCHAR a_privacy_must_start;
  644. UCHAR a_privacy_can_join;
  645. UCHAR a_basic_rate_set[8];
  646. };
  647. /*****************************************************************************/
  648. #define RAY_IOCG_PARMS (SIOCDEVPRIVATE)
  649. #define RAY_IOCS_PARMS (SIOCDEVPRIVATE + 1)
  650. #define RAY_DO_CMD (SIOCDEVPRIVATE + 2)
  651. /****** ethernet <-> 802.11 translation **************************************/
  652. typedef struct snaphdr_t
  653. {
  654. UCHAR dsap;
  655. UCHAR ssap;
  656. UCHAR ctrl;
  657. UCHAR org[3];
  658. UCHAR ethertype[2];
  659. } snaphdr_t;
  660. #define BRIDGE_ENCAP 0xf80000
  661. #define RFC1042_ENCAP 0
  662. #define SNAP_ID 0x0003aaaa
  663. #define RAY_IPX_TYPE 0x8137
  664. #define APPLEARP_TYPE 0x80f3
  665. /*****************************************************************************/
  666. #endif /* _RAYCTL_H_ */