rayctl.h 26 KB

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