rayctl.h 25 KB

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