162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef _RAYCTL_H_
362306a36Sopenharmony_ci#define _RAYCTL_H_
462306a36Sopenharmony_ci
562306a36Sopenharmony_citypedef unsigned char UCHAR;
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci/****** IEEE 802.11 constants ************************************************/
862306a36Sopenharmony_ci#define ADDRLEN           6
962306a36Sopenharmony_ci/* Frame control 1 bit fields */
1062306a36Sopenharmony_ci#define PROTOCOL_VER      0x00
1162306a36Sopenharmony_ci#define DATA_TYPE         0x08
1262306a36Sopenharmony_ci#define ASSOC_REQ_TYPE    0x00
1362306a36Sopenharmony_ci#define ASSOC_RESP_TYPE   0x10
1462306a36Sopenharmony_ci#define REASSOC_REQ_TYPE  0x20
1562306a36Sopenharmony_ci#define REASSOC_RESP_TYPE 0x30
1662306a36Sopenharmony_ci#define NULL_MSG_TYPE     0x48
1762306a36Sopenharmony_ci#define BEACON_TYPE       0x80
1862306a36Sopenharmony_ci#define DISASSOC_TYPE     0xA0
1962306a36Sopenharmony_ci#define PSPOLL_TYPE       0xA4
2062306a36Sopenharmony_ci#define AUTHENTIC_TYPE    0xB0
2162306a36Sopenharmony_ci#define DEAUTHENTIC_TYPE  0xC0
2262306a36Sopenharmony_ci/* Frame control 2 bit fields */
2362306a36Sopenharmony_ci#define FC2_TO_DS         0x01
2462306a36Sopenharmony_ci#define FC2_FROM_DS       0x02
2562306a36Sopenharmony_ci#define FC2_MORE_FRAG     0x04
2662306a36Sopenharmony_ci#define FC2_RETRY         0x08
2762306a36Sopenharmony_ci#define FC2_PSM           0x10
2862306a36Sopenharmony_ci#define FC2_MORE_DATA     0x20
2962306a36Sopenharmony_ci#define FC2_WEP           0x40
3062306a36Sopenharmony_ci#define FC2_ORDER         0x80
3162306a36Sopenharmony_ci/*****************************************************************************/
3262306a36Sopenharmony_ci/* 802.11 element ID's and lengths */
3362306a36Sopenharmony_ci#define C_BP_CAPABILITY_ESS             0x01
3462306a36Sopenharmony_ci#define C_BP_CAPABILITY_IBSS            0x02
3562306a36Sopenharmony_ci#define C_BP_CAPABILITY_CF_POLLABLE     0x04
3662306a36Sopenharmony_ci#define C_BP_CAPABILITY_CF_POLL_REQUEST 0x08
3762306a36Sopenharmony_ci#define C_BP_CAPABILITY_PRIVACY         0x10
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#define C_ESSID_ELEMENT_ID               0
4062306a36Sopenharmony_ci#define C_ESSID_ELEMENT_MAX_LENGTH       32
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci#define C_SUPPORTED_RATES_ELEMENT_ID     1
4362306a36Sopenharmony_ci#define C_SUPPORTED_RATES_ELEMENT_LENGTH 2
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define C_FH_PARAM_SET_ELEMENT_ID        2
4662306a36Sopenharmony_ci#define C_FH_PARAM_SET_ELEMENT_LNGTH     5
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci#define C_CF_PARAM_SET_ELEMENT_ID        4
4962306a36Sopenharmony_ci#define C_CF_PARAM_SET_ELEMENT_LNGTH     6
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci#define C_TIM_ELEMENT_ID                 5
5262306a36Sopenharmony_ci#define C_TIM_BITMAP_LENGTH            251
5362306a36Sopenharmony_ci#define C_TIM_BMCAST_BIT              0x01
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci#define C_IBSS_ELEMENT_ID                6
5662306a36Sopenharmony_ci#define C_IBSS_ELEMENT_LENGTH            2
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define C_JAPAN_CALL_SIGN_ELEMENT_ID    51
5962306a36Sopenharmony_ci#define C_JAPAN_CALL_SIGN_ELEMENT_LNGTH 12
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#define C_DISASSOC_REASON_CODE_LEN       2
6262306a36Sopenharmony_ci#define C_DISASSOC_REASON_CODE_DEFAULT   8
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci#define C_CRC_LEN                        4
6562306a36Sopenharmony_ci#define C_NUM_SUPPORTED_RATES            8
6662306a36Sopenharmony_ci/****** IEEE 802.11 mac header for type data packets *************************/
6762306a36Sopenharmony_cistruct mac_header {
6862306a36Sopenharmony_ci  UCHAR frame_ctl_1;
6962306a36Sopenharmony_ci  UCHAR frame_ctl_2;
7062306a36Sopenharmony_ci  UCHAR duration_lsb;
7162306a36Sopenharmony_ci  UCHAR duration_msb;
7262306a36Sopenharmony_ci  UCHAR addr_1[ADDRLEN];
7362306a36Sopenharmony_ci  UCHAR addr_2[ADDRLEN];
7462306a36Sopenharmony_ci  UCHAR addr_3[ADDRLEN];
7562306a36Sopenharmony_ci  UCHAR seq_frag_num[2];
7662306a36Sopenharmony_ci/*  UCHAR addr_4[ADDRLEN]; *//* only present for AP to AP (TO DS and FROM DS */
7762306a36Sopenharmony_ci};
7862306a36Sopenharmony_ci/****** IEEE 802.11 frame element structures *********************************/
7962306a36Sopenharmony_cistruct essid_element
8062306a36Sopenharmony_ci{
8162306a36Sopenharmony_ci  UCHAR id;
8262306a36Sopenharmony_ci  UCHAR length;
8362306a36Sopenharmony_ci  UCHAR text[C_ESSID_ELEMENT_MAX_LENGTH];
8462306a36Sopenharmony_ci};
8562306a36Sopenharmony_cistruct rates_element
8662306a36Sopenharmony_ci{
8762306a36Sopenharmony_ci  UCHAR id;
8862306a36Sopenharmony_ci  UCHAR length;
8962306a36Sopenharmony_ci  UCHAR value[8];
9062306a36Sopenharmony_ci};
9162306a36Sopenharmony_cistruct freq_hop_element
9262306a36Sopenharmony_ci{
9362306a36Sopenharmony_ci  UCHAR id;
9462306a36Sopenharmony_ci  UCHAR length;
9562306a36Sopenharmony_ci  UCHAR dwell_time[2];
9662306a36Sopenharmony_ci  UCHAR hop_set;
9762306a36Sopenharmony_ci  UCHAR hop_pattern;
9862306a36Sopenharmony_ci  UCHAR hop_index;
9962306a36Sopenharmony_ci};
10062306a36Sopenharmony_cistruct tim_element
10162306a36Sopenharmony_ci{
10262306a36Sopenharmony_ci  UCHAR id;
10362306a36Sopenharmony_ci  UCHAR length;
10462306a36Sopenharmony_ci  UCHAR dtim_count;
10562306a36Sopenharmony_ci  UCHAR dtim_period;
10662306a36Sopenharmony_ci  UCHAR bitmap_control;
10762306a36Sopenharmony_ci  UCHAR tim[C_TIM_BITMAP_LENGTH];
10862306a36Sopenharmony_ci};
10962306a36Sopenharmony_cistruct ibss_element
11062306a36Sopenharmony_ci{
11162306a36Sopenharmony_ci  UCHAR id;
11262306a36Sopenharmony_ci  UCHAR length;
11362306a36Sopenharmony_ci  UCHAR atim_window[2];
11462306a36Sopenharmony_ci};
11562306a36Sopenharmony_cistruct japan_call_sign_element
11662306a36Sopenharmony_ci{
11762306a36Sopenharmony_ci  UCHAR id;
11862306a36Sopenharmony_ci  UCHAR length;
11962306a36Sopenharmony_ci  UCHAR call_sign[12];
12062306a36Sopenharmony_ci};
12162306a36Sopenharmony_ci/****** Beacon message structures ********************************************/
12262306a36Sopenharmony_ci/* .elements is a large lump of max size because elements are variable size  */
12362306a36Sopenharmony_cistruct infra_beacon
12462306a36Sopenharmony_ci{
12562306a36Sopenharmony_ci    UCHAR timestamp[8];
12662306a36Sopenharmony_ci    UCHAR beacon_intvl[2];
12762306a36Sopenharmony_ci    UCHAR capability[2];
12862306a36Sopenharmony_ci    UCHAR elements[sizeof(struct essid_element)
12962306a36Sopenharmony_ci                  + sizeof(struct rates_element)
13062306a36Sopenharmony_ci                  + sizeof(struct freq_hop_element)
13162306a36Sopenharmony_ci                  + sizeof(struct japan_call_sign_element)
13262306a36Sopenharmony_ci                  + sizeof(struct tim_element)];
13362306a36Sopenharmony_ci};
13462306a36Sopenharmony_cistruct adhoc_beacon
13562306a36Sopenharmony_ci{
13662306a36Sopenharmony_ci    UCHAR timestamp[8];
13762306a36Sopenharmony_ci    UCHAR beacon_intvl[2];
13862306a36Sopenharmony_ci    UCHAR capability[2];
13962306a36Sopenharmony_ci    UCHAR elements[sizeof(struct essid_element)
14062306a36Sopenharmony_ci                  + sizeof(struct rates_element)
14162306a36Sopenharmony_ci                  + sizeof(struct freq_hop_element)
14262306a36Sopenharmony_ci                  + sizeof(struct japan_call_sign_element)
14362306a36Sopenharmony_ci                  + sizeof(struct ibss_element)];
14462306a36Sopenharmony_ci};
14562306a36Sopenharmony_ci/*****************************************************************************/
14662306a36Sopenharmony_ci/*****************************************************************************/
14762306a36Sopenharmony_ci/* #define C_MAC_HDR_2_WEP 0x40 */
14862306a36Sopenharmony_ci/* TX/RX CCS constants */
14962306a36Sopenharmony_ci#define TX_HEADER_LENGTH 0x1C
15062306a36Sopenharmony_ci#define RX_MAC_HEADER_LENGTH 0x18
15162306a36Sopenharmony_ci#define TX_AUTHENTICATE_LENGTH (TX_HEADER_LENGTH + 6)
15262306a36Sopenharmony_ci#define TX_AUTHENTICATE_LENGTH_MSB (TX_AUTHENTICATE_LENGTH >> 8)
15362306a36Sopenharmony_ci#define TX_AUTHENTICATE_LENGTH_LSB (TX_AUTHENTICATE_LENGTH & 0xff)
15462306a36Sopenharmony_ci#define TX_DEAUTHENTICATE_LENGTH (TX_HEADER_LENGTH + 2)
15562306a36Sopenharmony_ci#define TX_DEAUTHENTICATE_LENGTH_MSB (TX_AUTHENTICATE_LENGTH >> 8)
15662306a36Sopenharmony_ci#define TX_DEAUTHENTICATE_LENGTH_LSB (TX_AUTHENTICATE_LENGTH & 0xff)
15762306a36Sopenharmony_ci#define FCS_LEN           4
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ci#define ADHOC                 0
16062306a36Sopenharmony_ci#define INFRA                 1
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ci#define TYPE_STA              0
16362306a36Sopenharmony_ci#define TYPE_AP               1
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci#define PASSIVE_SCAN          1
16662306a36Sopenharmony_ci#define ACTIVE_SCAN           1
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci#define PSM_CAM               0
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci/* Country codes */
17162306a36Sopenharmony_ci#define USA                   1
17262306a36Sopenharmony_ci#define EUROPE                2
17362306a36Sopenharmony_ci#define JAPAN                 3
17462306a36Sopenharmony_ci#define KOREA                 4
17562306a36Sopenharmony_ci#define SPAIN                 5
17662306a36Sopenharmony_ci#define FRANCE                6
17762306a36Sopenharmony_ci#define ISRAEL                7
17862306a36Sopenharmony_ci#define AUSTRALIA             8
17962306a36Sopenharmony_ci#define JAPAN_TEST            9
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci/* Hop pattern lengths */
18262306a36Sopenharmony_ci#define USA_HOP_MOD          79
18362306a36Sopenharmony_ci#define EUROPE_HOP_MOD       79
18462306a36Sopenharmony_ci#define JAPAN_HOP_MOD        23
18562306a36Sopenharmony_ci#define KOREA_HOP_MOD        23
18662306a36Sopenharmony_ci#define SPAIN_HOP_MOD        27
18762306a36Sopenharmony_ci#define FRANCE_HOP_MOD       35
18862306a36Sopenharmony_ci#define ISRAEL_HOP_MOD       35
18962306a36Sopenharmony_ci#define AUSTRALIA_HOP_MOD    47
19062306a36Sopenharmony_ci#define JAPAN_TEST_HOP_MOD   23
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_ci#define ESSID_SIZE           32
19362306a36Sopenharmony_ci/**********************************************************************/
19462306a36Sopenharmony_ci/* CIS Register Constants */
19562306a36Sopenharmony_ci#define CIS_OFFSET             0x0f00
19662306a36Sopenharmony_ci/* Configuration Option Register (0x0F00) */
19762306a36Sopenharmony_ci#define COR_OFFSET             0x00
19862306a36Sopenharmony_ci#define COR_SOFT_RESET         0x80
19962306a36Sopenharmony_ci#define COR_LEVEL_IRQ          0x40
20062306a36Sopenharmony_ci#define COR_CONFIG_NUM         0x01
20162306a36Sopenharmony_ci#define COR_DEFAULT            (COR_LEVEL_IRQ | COR_CONFIG_NUM)
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci/* Card Configuration and Status Register (0x0F01) */
20462306a36Sopenharmony_ci#define CCSR_OFFSET            0x01
20562306a36Sopenharmony_ci#define CCSR_HOST_INTR_PENDING 0x01
20662306a36Sopenharmony_ci#define CCSR_POWER_DOWN        0x04
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_ci/* HCS Interrupt Register (0x0F05) */
20962306a36Sopenharmony_ci#define HCS_INTR_OFFSET        0x05
21062306a36Sopenharmony_ci/* #define HCS_INTR_OFFSET        0x0A */
21162306a36Sopenharmony_ci#define HCS_INTR_CLEAR         0x00
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ci/* ECF Interrupt Register (0x0F06) */
21462306a36Sopenharmony_ci#define ECF_INTR_OFFSET        0x06
21562306a36Sopenharmony_ci/* #define ECF_INTR_OFFSET        0x0C */
21662306a36Sopenharmony_ci#define ECF_INTR_SET           0x01
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_ci/* Authorization Register 0 (0x0F08) */
21962306a36Sopenharmony_ci#define AUTH_0_ON              0x57
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_ci/* Authorization Register 1 (0x0F09) */
22262306a36Sopenharmony_ci#define AUTH_1_ON              0x82
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci/* Program Mode Register (0x0F0A) */
22562306a36Sopenharmony_ci#define PC2PM                  0x02
22662306a36Sopenharmony_ci#define PC2CAL                 0x10
22762306a36Sopenharmony_ci#define PC2MLSE                0x20
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci/* PC Test Mode Register (0x0F0B) */
23062306a36Sopenharmony_ci#define PC_TEST_MODE           0x08
23162306a36Sopenharmony_ci
23262306a36Sopenharmony_ci/* Frequency Control Word (0x0F10) */
23362306a36Sopenharmony_ci/* Range 0x02 - 0xA6 */
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ci/* Test Mode Control 1-4 (0x0F14 - 0x0F17) */
23662306a36Sopenharmony_ci
23762306a36Sopenharmony_ci/**********************************************************************/
23862306a36Sopenharmony_ci
23962306a36Sopenharmony_ci/* Shared RAM Area */
24062306a36Sopenharmony_ci#define SCB_BASE               0x0000
24162306a36Sopenharmony_ci#define STATUS_BASE            0x0100
24262306a36Sopenharmony_ci#define HOST_TO_ECF_BASE       0x0200
24362306a36Sopenharmony_ci#define ECF_TO_HOST_BASE       0x0300
24462306a36Sopenharmony_ci#define CCS_BASE               0x0400
24562306a36Sopenharmony_ci#define RCS_BASE               0x0800
24662306a36Sopenharmony_ci#define INFRA_TIM_BASE         0x0C00
24762306a36Sopenharmony_ci#define SSID_LIST_BASE         0x0D00
24862306a36Sopenharmony_ci#define TX_BUF_BASE            0x1000
24962306a36Sopenharmony_ci#define RX_BUF_BASE            0x8000
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci#define NUMBER_OF_CCS    64
25262306a36Sopenharmony_ci#define NUMBER_OF_RCS    64
25362306a36Sopenharmony_ci/*#define NUMBER_OF_TX_CCS 14 */
25462306a36Sopenharmony_ci#define NUMBER_OF_TX_CCS 14
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci#define TX_BUF_SIZE      (2048 - sizeof(struct tx_msg))
25762306a36Sopenharmony_ci#define RX_BUFF_END      0x3FFF
25862306a36Sopenharmony_ci/* Values for buffer_status */
25962306a36Sopenharmony_ci#define CCS_BUFFER_FREE       0
26062306a36Sopenharmony_ci#define CCS_BUFFER_BUSY       1
26162306a36Sopenharmony_ci#define CCS_COMMAND_COMPLETE  2
26262306a36Sopenharmony_ci#define CCS_COMMAND_FAILED    3
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci/* Values for cmd */
26562306a36Sopenharmony_ci#define CCS_DOWNLOAD_STARTUP_PARAMS    1
26662306a36Sopenharmony_ci#define CCS_UPDATE_PARAMS              2
26762306a36Sopenharmony_ci#define CCS_REPORT_PARAMS              3
26862306a36Sopenharmony_ci#define CCS_UPDATE_MULTICAST_LIST      4
26962306a36Sopenharmony_ci#define CCS_UPDATE_POWER_SAVINGS_MODE  5
27062306a36Sopenharmony_ci#define CCS_START_NETWORK              6
27162306a36Sopenharmony_ci#define CCS_JOIN_NETWORK               7
27262306a36Sopenharmony_ci#define CCS_START_ASSOCIATION          8
27362306a36Sopenharmony_ci#define CCS_TX_REQUEST                 9
27462306a36Sopenharmony_ci#define CCS_TEST_MEMORY              0xa
27562306a36Sopenharmony_ci#define CCS_SHUTDOWN                 0xb
27662306a36Sopenharmony_ci#define CCS_DUMP_MEMORY              0xc
27762306a36Sopenharmony_ci#define CCS_START_TIMER              0xe
27862306a36Sopenharmony_ci#define CCS_LAST_CMD                 CCS_START_TIMER
27962306a36Sopenharmony_ci
28062306a36Sopenharmony_ci/* Values for link field */
28162306a36Sopenharmony_ci#define CCS_END_LIST                 0xff
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_ci/* values for buffer_status field */
28462306a36Sopenharmony_ci#define RCS_BUFFER_FREE       0
28562306a36Sopenharmony_ci#define RCS_BUFFER_BUSY       1
28662306a36Sopenharmony_ci#define RCS_COMPLETE          2
28762306a36Sopenharmony_ci#define RCS_FAILED            3
28862306a36Sopenharmony_ci#define RCS_BUFFER_RELEASE    0xFF
28962306a36Sopenharmony_ci
29062306a36Sopenharmony_ci/* values for interrupt_id field */
29162306a36Sopenharmony_ci#define PROCESS_RX_PACKET           0x80 /* */
29262306a36Sopenharmony_ci#define REJOIN_NET_COMPLETE         0x81 /* RCS ID: Rejoin Net Complete */
29362306a36Sopenharmony_ci#define ROAMING_INITIATED           0x82 /* RCS ID: Roaming Initiated   */
29462306a36Sopenharmony_ci#define JAPAN_CALL_SIGN_RXD         0x83 /* RCS ID: New Japan Call Sign */
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ci/*****************************************************************************/
29762306a36Sopenharmony_ci/* Memory types for dump memory command */
29862306a36Sopenharmony_ci#define C_MEM_PROG  0
29962306a36Sopenharmony_ci#define C_MEM_XDATA 1
30062306a36Sopenharmony_ci#define C_MEM_SFR   2
30162306a36Sopenharmony_ci#define C_MEM_IDATA 3
30262306a36Sopenharmony_ci
30362306a36Sopenharmony_ci/*** Return values for hw_xmit **********/
30462306a36Sopenharmony_ci#define XMIT_OK        (0)
30562306a36Sopenharmony_ci#define XMIT_MSG_BAD   (-1)
30662306a36Sopenharmony_ci#define XMIT_NO_CCS    (-2)
30762306a36Sopenharmony_ci#define XMIT_NO_INTR   (-3)
30862306a36Sopenharmony_ci#define XMIT_NEED_AUTH (-4)
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci/*** Values for card status */
31162306a36Sopenharmony_ci#define CARD_INSERTED       (0)
31262306a36Sopenharmony_ci
31362306a36Sopenharmony_ci#define CARD_AWAITING_PARAM (1)
31462306a36Sopenharmony_ci#define CARD_INIT_ERROR     (11)
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci#define CARD_DL_PARAM       (2)
31762306a36Sopenharmony_ci#define CARD_DL_PARAM_ERROR (12)
31862306a36Sopenharmony_ci
31962306a36Sopenharmony_ci#define CARD_DOING_ACQ      (3)
32062306a36Sopenharmony_ci
32162306a36Sopenharmony_ci#define CARD_ACQ_COMPLETE   (4)
32262306a36Sopenharmony_ci#define CARD_ACQ_FAILED     (14)
32362306a36Sopenharmony_ci
32462306a36Sopenharmony_ci#define CARD_AUTH_COMPLETE  (5)
32562306a36Sopenharmony_ci#define CARD_AUTH_REFUSED   (15)
32662306a36Sopenharmony_ci
32762306a36Sopenharmony_ci#define CARD_ASSOC_COMPLETE (6)
32862306a36Sopenharmony_ci#define CARD_ASSOC_FAILED   (16)
32962306a36Sopenharmony_ci
33062306a36Sopenharmony_ci/*** Values for authentication_state ***********************************/
33162306a36Sopenharmony_ci#define UNAUTHENTICATED     (0)
33262306a36Sopenharmony_ci#define AWAITING_RESPONSE   (1)
33362306a36Sopenharmony_ci#define AUTHENTICATED       (2)
33462306a36Sopenharmony_ci#define NEED_TO_AUTH        (3)
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_ci/*** Values for authentication type ************************************/
33762306a36Sopenharmony_ci#define OPEN_AUTH_REQUEST   (1)
33862306a36Sopenharmony_ci#define OPEN_AUTH_RESPONSE  (2)
33962306a36Sopenharmony_ci#define BROADCAST_DEAUTH    (0xc0)
34062306a36Sopenharmony_ci/*** Values for timer functions ****************************************/
34162306a36Sopenharmony_ci#define TODO_NOTHING              (0)
34262306a36Sopenharmony_ci#define TODO_VERIFY_DL_START      (-1)
34362306a36Sopenharmony_ci#define TODO_START_NET            (-2)
34462306a36Sopenharmony_ci#define TODO_JOIN_NET             (-3)
34562306a36Sopenharmony_ci#define TODO_AUTHENTICATE_TIMEOUT (-4)
34662306a36Sopenharmony_ci#define TODO_SEND_CCS             (-5)
34762306a36Sopenharmony_ci/***********************************************************************/
34862306a36Sopenharmony_ci/* Parameter passing structure for update/report parameter CCS's */
34962306a36Sopenharmony_cistruct object_id {
35062306a36Sopenharmony_ci    void          *object_addr;
35162306a36Sopenharmony_ci    unsigned char object_length;
35262306a36Sopenharmony_ci};
35362306a36Sopenharmony_ci
35462306a36Sopenharmony_ci#define OBJID_network_type            0
35562306a36Sopenharmony_ci#define OBJID_acting_as_ap_status     1
35662306a36Sopenharmony_ci#define OBJID_current_ess_id          2
35762306a36Sopenharmony_ci#define OBJID_scanning_mode           3
35862306a36Sopenharmony_ci#define OBJID_power_mgt_state         4
35962306a36Sopenharmony_ci#define OBJID_mac_address             5
36062306a36Sopenharmony_ci#define OBJID_frag_threshold          6
36162306a36Sopenharmony_ci#define OBJID_hop_time                7
36262306a36Sopenharmony_ci#define OBJID_beacon_period           8
36362306a36Sopenharmony_ci#define OBJID_dtim_period             9
36462306a36Sopenharmony_ci#define OBJID_retry_max              10
36562306a36Sopenharmony_ci#define OBJID_ack_timeout            11
36662306a36Sopenharmony_ci#define OBJID_sifs                   12
36762306a36Sopenharmony_ci#define OBJID_difs                   13
36862306a36Sopenharmony_ci#define OBJID_pifs                   14
36962306a36Sopenharmony_ci#define OBJID_rts_threshold          15
37062306a36Sopenharmony_ci#define OBJID_scan_dwell_time        16
37162306a36Sopenharmony_ci#define OBJID_max_scan_dwell_time    17
37262306a36Sopenharmony_ci#define OBJID_assoc_resp_timeout     18
37362306a36Sopenharmony_ci#define OBJID_adhoc_scan_cycle_max   19
37462306a36Sopenharmony_ci#define OBJID_infra_scan_cycle_max   20
37562306a36Sopenharmony_ci#define OBJID_infra_super_cycle_max  21
37662306a36Sopenharmony_ci#define OBJID_promiscuous_mode       22
37762306a36Sopenharmony_ci#define OBJID_unique_word            23
37862306a36Sopenharmony_ci#define OBJID_slot_time              24
37962306a36Sopenharmony_ci#define OBJID_roaming_low_snr        25
38062306a36Sopenharmony_ci#define OBJID_low_snr_count_thresh   26
38162306a36Sopenharmony_ci#define OBJID_infra_missed_bcn       27
38262306a36Sopenharmony_ci#define OBJID_adhoc_missed_bcn       28
38362306a36Sopenharmony_ci#define OBJID_curr_country_code      29
38462306a36Sopenharmony_ci#define OBJID_hop_pattern            30
38562306a36Sopenharmony_ci#define OBJID_reserved               31
38662306a36Sopenharmony_ci#define OBJID_cw_max_msb             32
38762306a36Sopenharmony_ci#define OBJID_cw_min_msb             33
38862306a36Sopenharmony_ci#define OBJID_noise_filter_gain      34
38962306a36Sopenharmony_ci#define OBJID_noise_limit_offset     35
39062306a36Sopenharmony_ci#define OBJID_det_rssi_thresh_offset 36
39162306a36Sopenharmony_ci#define OBJID_med_busy_thresh_offset 37
39262306a36Sopenharmony_ci#define OBJID_det_sync_thresh        38
39362306a36Sopenharmony_ci#define OBJID_test_mode              39
39462306a36Sopenharmony_ci#define OBJID_test_min_chan_num      40
39562306a36Sopenharmony_ci#define OBJID_test_max_chan_num      41
39662306a36Sopenharmony_ci#define OBJID_allow_bcast_ID_prbrsp  42
39762306a36Sopenharmony_ci#define OBJID_privacy_must_start     43
39862306a36Sopenharmony_ci#define OBJID_privacy_can_join       44
39962306a36Sopenharmony_ci#define OBJID_basic_rate_set         45
40062306a36Sopenharmony_ci
40162306a36Sopenharmony_ci/**** Configuration/Status/Control Area ***************************/
40262306a36Sopenharmony_ci/*    System Control Block (SCB) Area
40362306a36Sopenharmony_ci *    Located at Shared RAM offset 0
40462306a36Sopenharmony_ci */
40562306a36Sopenharmony_cistruct scb {
40662306a36Sopenharmony_ci    UCHAR ccs_index;
40762306a36Sopenharmony_ci    UCHAR rcs_index;
40862306a36Sopenharmony_ci};
40962306a36Sopenharmony_ci
41062306a36Sopenharmony_ci/****** Status area at Shared RAM offset 0x0100 ******************************/
41162306a36Sopenharmony_cistruct status {
41262306a36Sopenharmony_ci    UCHAR mrx_overflow_for_host;         /* 0=ECF may write, 1=host may write*/
41362306a36Sopenharmony_ci    UCHAR mrx_checksum_error_for_host;   /* 0=ECF may write, 1=host may write*/
41462306a36Sopenharmony_ci    UCHAR rx_hec_error_for_host;         /* 0=ECF may write, 1=host may write*/
41562306a36Sopenharmony_ci    UCHAR reserved1;
41662306a36Sopenharmony_ci    short mrx_overflow;                  /* ECF increments on rx overflow    */
41762306a36Sopenharmony_ci    short mrx_checksum_error;            /* ECF increments on rx CRC error   */
41862306a36Sopenharmony_ci    short rx_hec_error;                  /* ECF incs on mac header CRC error */
41962306a36Sopenharmony_ci    UCHAR rxnoise;                       /* Average RSL measurement          */
42062306a36Sopenharmony_ci};
42162306a36Sopenharmony_ci
42262306a36Sopenharmony_ci/****** Host-to-ECF Data Area at Shared RAM offset 0x200 *********************/
42362306a36Sopenharmony_cistruct host_to_ecf_area {
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci};
42662306a36Sopenharmony_ci
42762306a36Sopenharmony_ci/****** ECF-to-Host Data Area at Shared RAM offset 0x0300 ********************/
42862306a36Sopenharmony_cistruct startup_res_518 {
42962306a36Sopenharmony_ci    UCHAR startup_word;
43062306a36Sopenharmony_ci    UCHAR station_addr[ADDRLEN];
43162306a36Sopenharmony_ci    UCHAR calc_prog_chksum;
43262306a36Sopenharmony_ci    UCHAR calc_cis_chksum;
43362306a36Sopenharmony_ci    UCHAR ecf_spare[7];
43462306a36Sopenharmony_ci    UCHAR japan_call_sign[12];
43562306a36Sopenharmony_ci};
43662306a36Sopenharmony_ci
43762306a36Sopenharmony_cistruct startup_res_6 {
43862306a36Sopenharmony_ci    UCHAR startup_word;
43962306a36Sopenharmony_ci    UCHAR station_addr[ADDRLEN];
44062306a36Sopenharmony_ci    UCHAR reserved;
44162306a36Sopenharmony_ci    UCHAR supp_rates[8];
44262306a36Sopenharmony_ci    UCHAR japan_call_sign[12];
44362306a36Sopenharmony_ci    UCHAR calc_prog_chksum;
44462306a36Sopenharmony_ci    UCHAR calc_cis_chksum;
44562306a36Sopenharmony_ci    UCHAR firmware_version[3];
44662306a36Sopenharmony_ci    UCHAR asic_version;
44762306a36Sopenharmony_ci    UCHAR tib_length;
44862306a36Sopenharmony_ci};
44962306a36Sopenharmony_ci
45062306a36Sopenharmony_cistruct start_join_net_params {
45162306a36Sopenharmony_ci    UCHAR net_type;
45262306a36Sopenharmony_ci    UCHAR ssid[ESSID_SIZE];
45362306a36Sopenharmony_ci    UCHAR reserved;
45462306a36Sopenharmony_ci    UCHAR privacy_can_join;
45562306a36Sopenharmony_ci};
45662306a36Sopenharmony_ci
45762306a36Sopenharmony_ci/****** Command Control Structure area at Shared ram offset 0x0400 ***********/
45862306a36Sopenharmony_ci/* Structures for command specific parameters (ccs.var) */
45962306a36Sopenharmony_cistruct update_param_cmd {
46062306a36Sopenharmony_ci    UCHAR object_id;
46162306a36Sopenharmony_ci    UCHAR number_objects;
46262306a36Sopenharmony_ci    UCHAR failure_cause;
46362306a36Sopenharmony_ci};
46462306a36Sopenharmony_cistruct report_param_cmd {
46562306a36Sopenharmony_ci    UCHAR object_id;
46662306a36Sopenharmony_ci    UCHAR number_objects;
46762306a36Sopenharmony_ci    UCHAR failure_cause;
46862306a36Sopenharmony_ci    UCHAR length;
46962306a36Sopenharmony_ci};
47062306a36Sopenharmony_cistruct start_network_cmd {
47162306a36Sopenharmony_ci    UCHAR update_param;
47262306a36Sopenharmony_ci    UCHAR bssid[ADDRLEN];
47362306a36Sopenharmony_ci    UCHAR net_initiated;
47462306a36Sopenharmony_ci    UCHAR net_default_tx_rate;
47562306a36Sopenharmony_ci    UCHAR encryption;
47662306a36Sopenharmony_ci};
47762306a36Sopenharmony_cistruct join_network_cmd {
47862306a36Sopenharmony_ci    UCHAR update_param;
47962306a36Sopenharmony_ci    UCHAR bssid[ADDRLEN];
48062306a36Sopenharmony_ci    UCHAR net_initiated;
48162306a36Sopenharmony_ci    UCHAR net_default_tx_rate;
48262306a36Sopenharmony_ci    UCHAR encryption;
48362306a36Sopenharmony_ci};
48462306a36Sopenharmony_cistruct tx_requested_cmd {
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci    UCHAR tx_data_ptr[2];
48762306a36Sopenharmony_ci    UCHAR tx_data_length[2];
48862306a36Sopenharmony_ci    UCHAR host_reserved[2];
48962306a36Sopenharmony_ci    UCHAR reserved[3];
49062306a36Sopenharmony_ci    UCHAR tx_rate;
49162306a36Sopenharmony_ci    UCHAR pow_sav_mode;
49262306a36Sopenharmony_ci    UCHAR retries;
49362306a36Sopenharmony_ci    UCHAR antenna;
49462306a36Sopenharmony_ci};
49562306a36Sopenharmony_cistruct tx_requested_cmd_4 {
49662306a36Sopenharmony_ci
49762306a36Sopenharmony_ci    UCHAR tx_data_ptr[2];
49862306a36Sopenharmony_ci    UCHAR tx_data_length[2];
49962306a36Sopenharmony_ci    UCHAR dest_addr[ADDRLEN];
50062306a36Sopenharmony_ci    UCHAR pow_sav_mode;
50162306a36Sopenharmony_ci    UCHAR retries;
50262306a36Sopenharmony_ci    UCHAR station_id;
50362306a36Sopenharmony_ci};
50462306a36Sopenharmony_cistruct memory_dump_cmd {
50562306a36Sopenharmony_ci    UCHAR memory_type;
50662306a36Sopenharmony_ci    UCHAR memory_ptr[2];
50762306a36Sopenharmony_ci    UCHAR length;
50862306a36Sopenharmony_ci};
50962306a36Sopenharmony_cistruct update_association_cmd {
51062306a36Sopenharmony_ci    UCHAR status;
51162306a36Sopenharmony_ci    UCHAR aid[2];
51262306a36Sopenharmony_ci};
51362306a36Sopenharmony_cistruct start_timer_cmd {
51462306a36Sopenharmony_ci    UCHAR duration[2];
51562306a36Sopenharmony_ci};
51662306a36Sopenharmony_ci
51762306a36Sopenharmony_cistruct ccs {
51862306a36Sopenharmony_ci    UCHAR buffer_status;                 /* 0 = buffer free, 1 = buffer busy */
51962306a36Sopenharmony_ci                                         /* 2 = command complete, 3 = failed */
52062306a36Sopenharmony_ci    UCHAR cmd;                           /* command to ECF                   */
52162306a36Sopenharmony_ci    UCHAR link;                          /* link to next CCS, FF=end of list */
52262306a36Sopenharmony_ci    /* command specific parameters      */
52362306a36Sopenharmony_ci    union {
52462306a36Sopenharmony_ci        char reserved[13];
52562306a36Sopenharmony_ci        struct update_param_cmd update_param;
52662306a36Sopenharmony_ci        struct report_param_cmd report_param;
52762306a36Sopenharmony_ci        UCHAR nummulticast;
52862306a36Sopenharmony_ci        UCHAR mode;
52962306a36Sopenharmony_ci        struct start_network_cmd start_network;
53062306a36Sopenharmony_ci        struct join_network_cmd join_network;
53162306a36Sopenharmony_ci        struct tx_requested_cmd tx_request;
53262306a36Sopenharmony_ci        struct memory_dump_cmd memory_dump;
53362306a36Sopenharmony_ci        struct update_association_cmd update_assoc;
53462306a36Sopenharmony_ci        struct start_timer_cmd start_timer;
53562306a36Sopenharmony_ci    } var;
53662306a36Sopenharmony_ci};
53762306a36Sopenharmony_ci
53862306a36Sopenharmony_ci/*****************************************************************************/
53962306a36Sopenharmony_ci/* Transmit buffer structures */
54062306a36Sopenharmony_cistruct tib_structure {
54162306a36Sopenharmony_ci    UCHAR ccs_index;
54262306a36Sopenharmony_ci    UCHAR psm;
54362306a36Sopenharmony_ci    UCHAR pass_fail;
54462306a36Sopenharmony_ci    UCHAR retry_count;
54562306a36Sopenharmony_ci    UCHAR max_retries;
54662306a36Sopenharmony_ci    UCHAR frags_remaining;
54762306a36Sopenharmony_ci    UCHAR no_rb;
54862306a36Sopenharmony_ci    UCHAR rts_reqd;
54962306a36Sopenharmony_ci    UCHAR csma_tx_cntrl_2;
55062306a36Sopenharmony_ci    UCHAR sifs_tx_cntrl_2;
55162306a36Sopenharmony_ci    UCHAR tx_dma_addr_1[2];
55262306a36Sopenharmony_ci    UCHAR tx_dma_addr_2[2];
55362306a36Sopenharmony_ci    UCHAR var_dur_2mhz[2];
55462306a36Sopenharmony_ci    UCHAR var_dur_1mhz[2];
55562306a36Sopenharmony_ci    UCHAR max_dur_2mhz[2];
55662306a36Sopenharmony_ci    UCHAR max_dur_1mhz[2];
55762306a36Sopenharmony_ci    UCHAR hdr_len;
55862306a36Sopenharmony_ci    UCHAR max_frag_len[2];
55962306a36Sopenharmony_ci    UCHAR var_len[2];
56062306a36Sopenharmony_ci    UCHAR phy_hdr_4;
56162306a36Sopenharmony_ci    UCHAR mac_hdr_1;
56262306a36Sopenharmony_ci    UCHAR mac_hdr_2;
56362306a36Sopenharmony_ci    UCHAR sid[2];
56462306a36Sopenharmony_ci};
56562306a36Sopenharmony_ci
56662306a36Sopenharmony_cistruct phy_header {
56762306a36Sopenharmony_ci    UCHAR sfd[2];
56862306a36Sopenharmony_ci    UCHAR hdr_3;
56962306a36Sopenharmony_ci    UCHAR hdr_4;
57062306a36Sopenharmony_ci};
57162306a36Sopenharmony_cistruct ray_rx_msg {
57262306a36Sopenharmony_ci    struct mac_header mac;
57362306a36Sopenharmony_ci	UCHAR	var[];
57462306a36Sopenharmony_ci};
57562306a36Sopenharmony_ci
57662306a36Sopenharmony_cistruct tx_msg {
57762306a36Sopenharmony_ci    struct tib_structure tib;
57862306a36Sopenharmony_ci    struct phy_header phy;
57962306a36Sopenharmony_ci    struct mac_header mac;
58062306a36Sopenharmony_ci    UCHAR  var[];
58162306a36Sopenharmony_ci};
58262306a36Sopenharmony_ci
58362306a36Sopenharmony_ci/****** ECF Receive Control Structure (RCS) Area at Shared RAM offset 0x0800  */
58462306a36Sopenharmony_ci/* Structures for command specific parameters (rcs.var) */
58562306a36Sopenharmony_cistruct rx_packet_cmd {
58662306a36Sopenharmony_ci    UCHAR rx_data_ptr[2];
58762306a36Sopenharmony_ci    UCHAR rx_data_length[2];
58862306a36Sopenharmony_ci    UCHAR rx_sig_lev;
58962306a36Sopenharmony_ci    UCHAR next_frag_rcs_index;
59062306a36Sopenharmony_ci    UCHAR totalpacketlength[2];
59162306a36Sopenharmony_ci};
59262306a36Sopenharmony_cistruct rejoin_net_cmplt_cmd {
59362306a36Sopenharmony_ci    UCHAR reserved;
59462306a36Sopenharmony_ci    UCHAR bssid[ADDRLEN];
59562306a36Sopenharmony_ci};
59662306a36Sopenharmony_cistruct japan_call_sign_rxd {
59762306a36Sopenharmony_ci    UCHAR rxd_call_sign[8];
59862306a36Sopenharmony_ci    UCHAR reserved[5];
59962306a36Sopenharmony_ci};
60062306a36Sopenharmony_ci
60162306a36Sopenharmony_cistruct rcs {
60262306a36Sopenharmony_ci    UCHAR buffer_status;
60362306a36Sopenharmony_ci    UCHAR interrupt_id;
60462306a36Sopenharmony_ci    UCHAR link_field;
60562306a36Sopenharmony_ci    /* command specific parameters      */
60662306a36Sopenharmony_ci    union {
60762306a36Sopenharmony_ci        UCHAR reserved[13];
60862306a36Sopenharmony_ci        struct rx_packet_cmd rx_packet;
60962306a36Sopenharmony_ci        struct rejoin_net_cmplt_cmd rejoin_net_complete;
61062306a36Sopenharmony_ci        struct japan_call_sign_rxd japan_call_sign;
61162306a36Sopenharmony_ci    } var;
61262306a36Sopenharmony_ci};
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci/****** Startup parameter structures for both versions of firmware ***********/
61562306a36Sopenharmony_cistruct b4_startup_params {
61662306a36Sopenharmony_ci    UCHAR a_network_type;                /* C_ADHOC, C_INFRA                 */
61762306a36Sopenharmony_ci    UCHAR a_acting_as_ap_status;         /* C_TYPE_STA, C_TYPE_AP            */
61862306a36Sopenharmony_ci    UCHAR a_current_ess_id[ESSID_SIZE];  /* Null terminated unless 32 long   */
61962306a36Sopenharmony_ci    UCHAR a_scanning_mode;               /* passive 0, active 1              */
62062306a36Sopenharmony_ci    UCHAR a_power_mgt_state;             /* CAM 0,                           */
62162306a36Sopenharmony_ci    UCHAR a_mac_addr[ADDRLEN];           /*                                  */
62262306a36Sopenharmony_ci    UCHAR a_frag_threshold[2];           /* 512                              */
62362306a36Sopenharmony_ci    UCHAR a_hop_time[2];                 /* 16k * 2**n, n=0-4 in Kus         */
62462306a36Sopenharmony_ci    UCHAR a_beacon_period[2];            /* n * a_hop_time  in Kus           */
62562306a36Sopenharmony_ci    UCHAR a_dtim_period;                 /* in beacons                       */
62662306a36Sopenharmony_ci    UCHAR a_retry_max;                   /*                                  */
62762306a36Sopenharmony_ci    UCHAR a_ack_timeout;                 /*                                  */
62862306a36Sopenharmony_ci    UCHAR a_sifs;                        /*                                  */
62962306a36Sopenharmony_ci    UCHAR a_difs;                        /*                                  */
63062306a36Sopenharmony_ci    UCHAR a_pifs;                        /*                                  */
63162306a36Sopenharmony_ci    UCHAR a_rts_threshold[2];            /*                                  */
63262306a36Sopenharmony_ci    UCHAR a_scan_dwell_time[2];          /*                                  */
63362306a36Sopenharmony_ci    UCHAR a_max_scan_dwell_time[2];      /*                                  */
63462306a36Sopenharmony_ci    UCHAR a_assoc_resp_timeout_thresh;   /*                                  */
63562306a36Sopenharmony_ci    UCHAR a_adhoc_scan_cycle_max;        /*                                  */
63662306a36Sopenharmony_ci    UCHAR a_infra_scan_cycle_max;        /*                                  */
63762306a36Sopenharmony_ci    UCHAR a_infra_super_scan_cycle_max;  /*                                  */
63862306a36Sopenharmony_ci    UCHAR a_promiscuous_mode;            /*                                  */
63962306a36Sopenharmony_ci    UCHAR a_unique_word[2];              /*                                  */
64062306a36Sopenharmony_ci    UCHAR a_slot_time;                   /*                                  */
64162306a36Sopenharmony_ci    UCHAR a_roaming_low_snr_thresh;      /*                                  */
64262306a36Sopenharmony_ci    UCHAR a_low_snr_count_thresh;        /*                                  */
64362306a36Sopenharmony_ci    UCHAR a_infra_missed_bcn_thresh;     /*                                  */
64462306a36Sopenharmony_ci    UCHAR a_adhoc_missed_bcn_thresh;     /*                                  */
64562306a36Sopenharmony_ci    UCHAR a_curr_country_code;           /* C_USA                            */
64662306a36Sopenharmony_ci    UCHAR a_hop_pattern;                 /*                                  */
64762306a36Sopenharmony_ci    UCHAR a_hop_pattern_length;          /*                                  */
64862306a36Sopenharmony_ci/* b4 - b5 differences start here */
64962306a36Sopenharmony_ci    UCHAR a_cw_max;                      /*                                  */
65062306a36Sopenharmony_ci    UCHAR a_cw_min;                      /*                                  */
65162306a36Sopenharmony_ci    UCHAR a_noise_filter_gain;           /*                                  */
65262306a36Sopenharmony_ci    UCHAR a_noise_limit_offset;          /*                                  */
65362306a36Sopenharmony_ci    UCHAR a_det_rssi_thresh_offset;      /*                                  */
65462306a36Sopenharmony_ci    UCHAR a_med_busy_thresh_offset;      /*                                  */
65562306a36Sopenharmony_ci    UCHAR a_det_sync_thresh;             /*                                  */
65662306a36Sopenharmony_ci    UCHAR a_test_mode;                   /*                                  */
65762306a36Sopenharmony_ci    UCHAR a_test_min_chan_num;           /*                                  */
65862306a36Sopenharmony_ci    UCHAR a_test_max_chan_num;           /*                                  */
65962306a36Sopenharmony_ci    UCHAR a_rx_tx_delay;                 /*                                  */
66062306a36Sopenharmony_ci    UCHAR a_current_bss_id[ADDRLEN];     /*                                  */
66162306a36Sopenharmony_ci    UCHAR a_hop_set;                     /*                                  */
66262306a36Sopenharmony_ci};
66362306a36Sopenharmony_cistruct b5_startup_params {
66462306a36Sopenharmony_ci    UCHAR a_network_type;                /* C_ADHOC, C_INFRA                 */
66562306a36Sopenharmony_ci    UCHAR a_acting_as_ap_status;         /* C_TYPE_STA, C_TYPE_AP            */
66662306a36Sopenharmony_ci    UCHAR a_current_ess_id[ESSID_SIZE];  /* Null terminated unless 32 long   */
66762306a36Sopenharmony_ci    UCHAR a_scanning_mode;               /* passive 0, active 1              */
66862306a36Sopenharmony_ci    UCHAR a_power_mgt_state;             /* CAM 0,                           */
66962306a36Sopenharmony_ci    UCHAR a_mac_addr[ADDRLEN];           /*                                  */
67062306a36Sopenharmony_ci    UCHAR a_frag_threshold[2];           /* 512                              */
67162306a36Sopenharmony_ci    UCHAR a_hop_time[2];                 /* 16k * 2**n, n=0-4 in Kus         */
67262306a36Sopenharmony_ci    UCHAR a_beacon_period[2];            /* n * a_hop_time  in Kus           */
67362306a36Sopenharmony_ci    UCHAR a_dtim_period;                 /* in beacons                       */
67462306a36Sopenharmony_ci    UCHAR a_retry_max;                   /* 4                                */
67562306a36Sopenharmony_ci    UCHAR a_ack_timeout;                 /*                                  */
67662306a36Sopenharmony_ci    UCHAR a_sifs;                        /*                                  */
67762306a36Sopenharmony_ci    UCHAR a_difs;                        /*                                  */
67862306a36Sopenharmony_ci    UCHAR a_pifs;                        /*                                  */
67962306a36Sopenharmony_ci    UCHAR a_rts_threshold[2];            /*                                  */
68062306a36Sopenharmony_ci    UCHAR a_scan_dwell_time[2];          /*                                  */
68162306a36Sopenharmony_ci    UCHAR a_max_scan_dwell_time[2];      /*                                  */
68262306a36Sopenharmony_ci    UCHAR a_assoc_resp_timeout_thresh;   /*                                  */
68362306a36Sopenharmony_ci    UCHAR a_adhoc_scan_cycle_max;        /*                                  */
68462306a36Sopenharmony_ci    UCHAR a_infra_scan_cycle_max;        /*                                  */
68562306a36Sopenharmony_ci    UCHAR a_infra_super_scan_cycle_max;  /*                                  */
68662306a36Sopenharmony_ci    UCHAR a_promiscuous_mode;            /*                                  */
68762306a36Sopenharmony_ci    UCHAR a_unique_word[2];              /*                                  */
68862306a36Sopenharmony_ci    UCHAR a_slot_time;                   /*                                  */
68962306a36Sopenharmony_ci    UCHAR a_roaming_low_snr_thresh;      /*                                  */
69062306a36Sopenharmony_ci    UCHAR a_low_snr_count_thresh;        /*                                  */
69162306a36Sopenharmony_ci    UCHAR a_infra_missed_bcn_thresh;     /*                                  */
69262306a36Sopenharmony_ci    UCHAR a_adhoc_missed_bcn_thresh;     /*                                  */
69362306a36Sopenharmony_ci    UCHAR a_curr_country_code;           /* C_USA                            */
69462306a36Sopenharmony_ci    UCHAR a_hop_pattern;                 /*                                  */
69562306a36Sopenharmony_ci    UCHAR a_hop_pattern_length;          /*                                  */
69662306a36Sopenharmony_ci/* b4 - b5 differences start here */
69762306a36Sopenharmony_ci    UCHAR a_cw_max[2];                   /*                                  */
69862306a36Sopenharmony_ci    UCHAR a_cw_min[2];                   /*                                  */
69962306a36Sopenharmony_ci    UCHAR a_noise_filter_gain;           /*                                  */
70062306a36Sopenharmony_ci    UCHAR a_noise_limit_offset;          /*                                  */
70162306a36Sopenharmony_ci    UCHAR a_det_rssi_thresh_offset;      /*                                  */
70262306a36Sopenharmony_ci    UCHAR a_med_busy_thresh_offset;      /*                                  */
70362306a36Sopenharmony_ci    UCHAR a_det_sync_thresh;             /*                                  */
70462306a36Sopenharmony_ci    UCHAR a_test_mode;                   /*                                  */
70562306a36Sopenharmony_ci    UCHAR a_test_min_chan_num;           /*                                  */
70662306a36Sopenharmony_ci    UCHAR a_test_max_chan_num;           /*                                  */
70762306a36Sopenharmony_ci    UCHAR a_allow_bcast_SSID_probe_rsp;
70862306a36Sopenharmony_ci    UCHAR a_privacy_must_start;
70962306a36Sopenharmony_ci    UCHAR a_privacy_can_join;
71062306a36Sopenharmony_ci    UCHAR a_basic_rate_set[8];
71162306a36Sopenharmony_ci};
71262306a36Sopenharmony_ci
71362306a36Sopenharmony_ci/*****************************************************************************/
71462306a36Sopenharmony_ci#define RAY_IOCG_PARMS (SIOCDEVPRIVATE)
71562306a36Sopenharmony_ci#define RAY_IOCS_PARMS (SIOCDEVPRIVATE + 1)
71662306a36Sopenharmony_ci#define RAY_DO_CMD     (SIOCDEVPRIVATE + 2)
71762306a36Sopenharmony_ci
71862306a36Sopenharmony_ci/****** ethernet <-> 802.11 translation **************************************/
71962306a36Sopenharmony_citypedef struct snaphdr_t
72062306a36Sopenharmony_ci{
72162306a36Sopenharmony_ci  UCHAR   dsap;
72262306a36Sopenharmony_ci  UCHAR   ssap;
72362306a36Sopenharmony_ci  UCHAR   ctrl;
72462306a36Sopenharmony_ci  UCHAR   org[3];
72562306a36Sopenharmony_ci  UCHAR   ethertype[2];
72662306a36Sopenharmony_ci} snaphdr_t;
72762306a36Sopenharmony_ci
72862306a36Sopenharmony_ci#define BRIDGE_ENCAP  0xf80000
72962306a36Sopenharmony_ci#define RFC1042_ENCAP 0
73062306a36Sopenharmony_ci#define SNAP_ID       0x0003aaaa
73162306a36Sopenharmony_ci#define RAY_IPX_TYPE  0x8137
73262306a36Sopenharmony_ci#define APPLEARP_TYPE 0x80f3
73362306a36Sopenharmony_ci/*****************************************************************************/
73462306a36Sopenharmony_ci#endif /* _RAYCTL_H_ */
735