Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _RAYCTL_H_
0003 #define _RAYCTL_H_
0004 
0005 typedef unsigned char UCHAR;
0006 
0007 /****** IEEE 802.11 constants ************************************************/
0008 #define ADDRLEN           6
0009 /* Frame control 1 bit fields */
0010 #define PROTOCOL_VER      0x00
0011 #define DATA_TYPE         0x08
0012 #define ASSOC_REQ_TYPE    0x00
0013 #define ASSOC_RESP_TYPE   0x10
0014 #define REASSOC_REQ_TYPE  0x20
0015 #define REASSOC_RESP_TYPE 0x30
0016 #define NULL_MSG_TYPE     0x48
0017 #define BEACON_TYPE       0x80
0018 #define DISASSOC_TYPE     0xA0
0019 #define PSPOLL_TYPE       0xA4
0020 #define AUTHENTIC_TYPE    0xB0
0021 #define DEAUTHENTIC_TYPE  0xC0
0022 /* Frame control 2 bit fields */
0023 #define FC2_TO_DS         0x01
0024 #define FC2_FROM_DS       0x02
0025 #define FC2_MORE_FRAG     0x04
0026 #define FC2_RETRY         0x08
0027 #define FC2_PSM           0x10
0028 #define FC2_MORE_DATA     0x20
0029 #define FC2_WEP           0x40
0030 #define FC2_ORDER         0x80
0031 /*****************************************************************************/
0032 /* 802.11 element ID's and lengths */
0033 #define C_BP_CAPABILITY_ESS             0x01
0034 #define C_BP_CAPABILITY_IBSS            0x02
0035 #define C_BP_CAPABILITY_CF_POLLABLE     0x04
0036 #define C_BP_CAPABILITY_CF_POLL_REQUEST 0x08
0037 #define C_BP_CAPABILITY_PRIVACY         0x10
0038 
0039 #define C_ESSID_ELEMENT_ID               0
0040 #define C_ESSID_ELEMENT_MAX_LENGTH       32
0041 
0042 #define C_SUPPORTED_RATES_ELEMENT_ID     1
0043 #define C_SUPPORTED_RATES_ELEMENT_LENGTH 2
0044 
0045 #define C_FH_PARAM_SET_ELEMENT_ID        2
0046 #define C_FH_PARAM_SET_ELEMENT_LNGTH     5
0047 
0048 #define C_CF_PARAM_SET_ELEMENT_ID        4
0049 #define C_CF_PARAM_SET_ELEMENT_LNGTH     6
0050 
0051 #define C_TIM_ELEMENT_ID                 5
0052 #define C_TIM_BITMAP_LENGTH            251
0053 #define C_TIM_BMCAST_BIT              0x01
0054 
0055 #define C_IBSS_ELEMENT_ID                6
0056 #define C_IBSS_ELEMENT_LENGTH            2
0057 
0058 #define C_JAPAN_CALL_SIGN_ELEMENT_ID    51
0059 #define C_JAPAN_CALL_SIGN_ELEMENT_LNGTH 12
0060 
0061 #define C_DISASSOC_REASON_CODE_LEN       2
0062 #define C_DISASSOC_REASON_CODE_DEFAULT   8
0063 
0064 #define C_CRC_LEN                        4
0065 #define C_NUM_SUPPORTED_RATES            8 
0066 /****** IEEE 802.11 mac header for type data packets *************************/
0067 struct mac_header {
0068   UCHAR frame_ctl_1;                          
0069   UCHAR frame_ctl_2;
0070   UCHAR duration_lsb;
0071   UCHAR duration_msb;
0072   UCHAR addr_1[ADDRLEN];
0073   UCHAR addr_2[ADDRLEN];
0074   UCHAR addr_3[ADDRLEN];
0075   UCHAR seq_frag_num[2];
0076 /*  UCHAR addr_4[ADDRLEN]; *//* only present for AP to AP (TO DS and FROM DS */
0077 };
0078 /****** IEEE 802.11 frame element structures *********************************/
0079 struct essid_element
0080 {
0081   UCHAR id;
0082   UCHAR length;
0083   UCHAR text[C_ESSID_ELEMENT_MAX_LENGTH];
0084 };
0085 struct rates_element
0086 {
0087   UCHAR id;
0088   UCHAR length;
0089   UCHAR value[8];
0090 };
0091 struct freq_hop_element
0092 {
0093   UCHAR id;
0094   UCHAR length;
0095   UCHAR dwell_time[2];
0096   UCHAR hop_set;
0097   UCHAR hop_pattern;
0098   UCHAR hop_index;
0099 };
0100 struct tim_element
0101 {
0102   UCHAR id;
0103   UCHAR length;
0104   UCHAR dtim_count;
0105   UCHAR dtim_period;    
0106   UCHAR bitmap_control;
0107   UCHAR tim[C_TIM_BITMAP_LENGTH];
0108 };
0109 struct ibss_element
0110 {
0111   UCHAR id;
0112   UCHAR length;
0113   UCHAR atim_window[2];
0114 };
0115 struct japan_call_sign_element
0116 {
0117   UCHAR id;
0118   UCHAR length;
0119   UCHAR call_sign[12];
0120 };
0121 /****** Beacon message structures ********************************************/
0122 /* .elements is a large lump of max size because elements are variable size  */
0123 struct infra_beacon
0124 {
0125     UCHAR timestamp[8];
0126     UCHAR beacon_intvl[2];
0127     UCHAR capability[2];
0128     UCHAR elements[sizeof(struct essid_element) 
0129                   + sizeof(struct rates_element)
0130                   + sizeof(struct freq_hop_element) 
0131                   + sizeof(struct japan_call_sign_element)
0132                   + sizeof(struct tim_element)];
0133 };
0134 struct adhoc_beacon
0135 {
0136     UCHAR timestamp[8];
0137     UCHAR beacon_intvl[2];
0138     UCHAR capability[2];
0139     UCHAR elements[sizeof(struct essid_element) 
0140                   + sizeof(struct rates_element)
0141                   + sizeof(struct freq_hop_element) 
0142                   + sizeof(struct japan_call_sign_element)
0143                   + sizeof(struct ibss_element)];
0144 };
0145 /*****************************************************************************/
0146 /*****************************************************************************/
0147 /* #define C_MAC_HDR_2_WEP 0x40 */
0148 /* TX/RX CCS constants */
0149 #define TX_HEADER_LENGTH 0x1C
0150 #define RX_MAC_HEADER_LENGTH 0x18
0151 #define TX_AUTHENTICATE_LENGTH (TX_HEADER_LENGTH + 6)
0152 #define TX_AUTHENTICATE_LENGTH_MSB (TX_AUTHENTICATE_LENGTH >> 8)
0153 #define TX_AUTHENTICATE_LENGTH_LSB (TX_AUTHENTICATE_LENGTH & 0xff)
0154 #define TX_DEAUTHENTICATE_LENGTH (TX_HEADER_LENGTH + 2)
0155 #define TX_DEAUTHENTICATE_LENGTH_MSB (TX_AUTHENTICATE_LENGTH >> 8)
0156 #define TX_DEAUTHENTICATE_LENGTH_LSB (TX_AUTHENTICATE_LENGTH & 0xff)
0157 #define FCS_LEN           4
0158 
0159 #define ADHOC                 0
0160 #define INFRA                 1
0161 
0162 #define TYPE_STA              0
0163 #define TYPE_AP               1
0164 
0165 #define PASSIVE_SCAN          1
0166 #define ACTIVE_SCAN           1
0167 
0168 #define PSM_CAM               0
0169 
0170 /* Country codes */
0171 #define USA                   1
0172 #define EUROPE                2
0173 #define JAPAN                 3
0174 #define KOREA                 4
0175 #define SPAIN                 5
0176 #define FRANCE                6
0177 #define ISRAEL                7
0178 #define AUSTRALIA             8
0179 #define JAPAN_TEST            9
0180 
0181 /* Hop pattern lengths */
0182 #define USA_HOP_MOD          79 
0183 #define EUROPE_HOP_MOD       79 
0184 #define JAPAN_HOP_MOD        23
0185 #define KOREA_HOP_MOD        23
0186 #define SPAIN_HOP_MOD        27
0187 #define FRANCE_HOP_MOD       35
0188 #define ISRAEL_HOP_MOD       35
0189 #define AUSTRALIA_HOP_MOD    47
0190 #define JAPAN_TEST_HOP_MOD   23
0191 
0192 #define ESSID_SIZE           32
0193 /**********************************************************************/
0194 /* CIS Register Constants */
0195 #define CIS_OFFSET             0x0f00
0196 /* Configuration Option Register (0x0F00) */
0197 #define COR_OFFSET             0x00
0198 #define COR_SOFT_RESET         0x80
0199 #define COR_LEVEL_IRQ          0x40
0200 #define COR_CONFIG_NUM         0x01
0201 #define COR_DEFAULT            (COR_LEVEL_IRQ | COR_CONFIG_NUM)
0202 
0203 /* Card Configuration and Status Register (0x0F01) */
0204 #define CCSR_OFFSET            0x01
0205 #define CCSR_HOST_INTR_PENDING 0x01
0206 #define CCSR_POWER_DOWN        0x04
0207 
0208 /* HCS Interrupt Register (0x0F05) */
0209 #define HCS_INTR_OFFSET        0x05
0210 /* #define HCS_INTR_OFFSET        0x0A */
0211 #define HCS_INTR_CLEAR         0x00
0212 
0213 /* ECF Interrupt Register (0x0F06) */
0214 #define ECF_INTR_OFFSET        0x06
0215 /* #define ECF_INTR_OFFSET        0x0C */
0216 #define ECF_INTR_SET           0x01
0217 
0218 /* Authorization Register 0 (0x0F08) */
0219 #define AUTH_0_ON              0x57
0220 
0221 /* Authorization Register 1 (0x0F09) */
0222 #define AUTH_1_ON              0x82
0223 
0224 /* Program Mode Register (0x0F0A) */
0225 #define PC2PM                  0x02
0226 #define PC2CAL                 0x10
0227 #define PC2MLSE                0x20
0228 
0229 /* PC Test Mode Register (0x0F0B) */
0230 #define PC_TEST_MODE           0x08
0231 
0232 /* Frequency Control Word (0x0F10) */
0233 /* Range 0x02 - 0xA6 */
0234 
0235 /* Test Mode Control 1-4 (0x0F14 - 0x0F17) */
0236 
0237 /**********************************************************************/
0238 
0239 /* Shared RAM Area */
0240 #define SCB_BASE               0x0000
0241 #define STATUS_BASE            0x0100
0242 #define HOST_TO_ECF_BASE       0x0200
0243 #define ECF_TO_HOST_BASE       0x0300
0244 #define CCS_BASE               0x0400
0245 #define RCS_BASE               0x0800
0246 #define INFRA_TIM_BASE         0x0C00
0247 #define SSID_LIST_BASE         0x0D00
0248 #define TX_BUF_BASE            0x1000
0249 #define RX_BUF_BASE            0x8000
0250 
0251 #define NUMBER_OF_CCS    64
0252 #define NUMBER_OF_RCS    64
0253 /*#define NUMBER_OF_TX_CCS 14 */
0254 #define NUMBER_OF_TX_CCS 14
0255 
0256 #define TX_BUF_SIZE      (2048 - sizeof(struct tx_msg))
0257 #define RX_BUFF_END      0x3FFF
0258 /* Values for buffer_status */
0259 #define CCS_BUFFER_FREE       0
0260 #define CCS_BUFFER_BUSY       1
0261 #define CCS_COMMAND_COMPLETE  2
0262 #define CCS_COMMAND_FAILED    3
0263 
0264 /* Values for cmd */
0265 #define CCS_DOWNLOAD_STARTUP_PARAMS    1
0266 #define CCS_UPDATE_PARAMS              2
0267 #define CCS_REPORT_PARAMS              3
0268 #define CCS_UPDATE_MULTICAST_LIST      4
0269 #define CCS_UPDATE_POWER_SAVINGS_MODE  5
0270 #define CCS_START_NETWORK              6
0271 #define CCS_JOIN_NETWORK               7
0272 #define CCS_START_ASSOCIATION          8
0273 #define CCS_TX_REQUEST                 9
0274 #define CCS_TEST_MEMORY              0xa
0275 #define CCS_SHUTDOWN                 0xb
0276 #define CCS_DUMP_MEMORY              0xc
0277 #define CCS_START_TIMER              0xe
0278 #define CCS_LAST_CMD                 CCS_START_TIMER
0279 
0280 /* Values for link field */
0281 #define CCS_END_LIST                 0xff
0282 
0283 /* values for buffer_status field */
0284 #define RCS_BUFFER_FREE       0
0285 #define RCS_BUFFER_BUSY       1
0286 #define RCS_COMPLETE          2
0287 #define RCS_FAILED            3
0288 #define RCS_BUFFER_RELEASE    0xFF
0289 
0290 /* values for interrupt_id field */
0291 #define PROCESS_RX_PACKET           0x80 /* */
0292 #define REJOIN_NET_COMPLETE         0x81 /* RCS ID: Rejoin Net Complete */
0293 #define ROAMING_INITIATED           0x82 /* RCS ID: Roaming Initiated   */
0294 #define JAPAN_CALL_SIGN_RXD         0x83 /* RCS ID: New Japan Call Sign */
0295 
0296 /*****************************************************************************/
0297 /* Memory types for dump memory command */
0298 #define C_MEM_PROG  0
0299 #define C_MEM_XDATA 1
0300 #define C_MEM_SFR   2
0301 #define C_MEM_IDATA 3
0302 
0303 /*** Return values for hw_xmit **********/
0304 #define XMIT_OK        (0)
0305 #define XMIT_MSG_BAD   (-1)
0306 #define XMIT_NO_CCS    (-2)
0307 #define XMIT_NO_INTR   (-3)
0308 #define XMIT_NEED_AUTH (-4)
0309 
0310 /*** Values for card status */
0311 #define CARD_INSERTED       (0)
0312 
0313 #define CARD_AWAITING_PARAM (1)
0314 #define CARD_INIT_ERROR     (11)
0315 
0316 #define CARD_DL_PARAM       (2)
0317 #define CARD_DL_PARAM_ERROR (12)
0318 
0319 #define CARD_DOING_ACQ      (3)
0320 
0321 #define CARD_ACQ_COMPLETE   (4)
0322 #define CARD_ACQ_FAILED     (14)
0323 
0324 #define CARD_AUTH_COMPLETE  (5)
0325 #define CARD_AUTH_REFUSED   (15)
0326 
0327 #define CARD_ASSOC_COMPLETE (6)
0328 #define CARD_ASSOC_FAILED   (16)
0329 
0330 /*** Values for authentication_state ***********************************/
0331 #define UNAUTHENTICATED     (0)
0332 #define AWAITING_RESPONSE   (1)
0333 #define AUTHENTICATED       (2)
0334 #define NEED_TO_AUTH        (3)
0335 
0336 /*** Values for authentication type ************************************/
0337 #define OPEN_AUTH_REQUEST   (1)
0338 #define OPEN_AUTH_RESPONSE  (2)
0339 #define BROADCAST_DEAUTH    (0xc0)
0340 /*** Values for timer functions ****************************************/
0341 #define TODO_NOTHING              (0)
0342 #define TODO_VERIFY_DL_START      (-1)
0343 #define TODO_START_NET            (-2)
0344 #define TODO_JOIN_NET             (-3)
0345 #define TODO_AUTHENTICATE_TIMEOUT (-4)
0346 #define TODO_SEND_CCS             (-5)
0347 /***********************************************************************/
0348 /* Parameter passing structure for update/report parameter CCS's */
0349 struct object_id {
0350     void          *object_addr;
0351     unsigned char object_length;
0352 };
0353 
0354 #define OBJID_network_type            0
0355 #define OBJID_acting_as_ap_status     1
0356 #define OBJID_current_ess_id          2
0357 #define OBJID_scanning_mode           3
0358 #define OBJID_power_mgt_state         4
0359 #define OBJID_mac_address             5
0360 #define OBJID_frag_threshold          6
0361 #define OBJID_hop_time                7
0362 #define OBJID_beacon_period           8
0363 #define OBJID_dtim_period             9
0364 #define OBJID_retry_max              10
0365 #define OBJID_ack_timeout            11
0366 #define OBJID_sifs                   12
0367 #define OBJID_difs                   13
0368 #define OBJID_pifs                   14
0369 #define OBJID_rts_threshold          15
0370 #define OBJID_scan_dwell_time        16
0371 #define OBJID_max_scan_dwell_time    17
0372 #define OBJID_assoc_resp_timeout     18
0373 #define OBJID_adhoc_scan_cycle_max   19
0374 #define OBJID_infra_scan_cycle_max   20
0375 #define OBJID_infra_super_cycle_max  21
0376 #define OBJID_promiscuous_mode       22
0377 #define OBJID_unique_word            23
0378 #define OBJID_slot_time              24
0379 #define OBJID_roaming_low_snr        25
0380 #define OBJID_low_snr_count_thresh   26
0381 #define OBJID_infra_missed_bcn       27
0382 #define OBJID_adhoc_missed_bcn       28
0383 #define OBJID_curr_country_code      29
0384 #define OBJID_hop_pattern            30
0385 #define OBJID_reserved               31
0386 #define OBJID_cw_max_msb             32
0387 #define OBJID_cw_min_msb             33
0388 #define OBJID_noise_filter_gain      34
0389 #define OBJID_noise_limit_offset     35
0390 #define OBJID_det_rssi_thresh_offset 36
0391 #define OBJID_med_busy_thresh_offset 37
0392 #define OBJID_det_sync_thresh        38
0393 #define OBJID_test_mode              39
0394 #define OBJID_test_min_chan_num      40
0395 #define OBJID_test_max_chan_num      41
0396 #define OBJID_allow_bcast_ID_prbrsp  42
0397 #define OBJID_privacy_must_start     43
0398 #define OBJID_privacy_can_join       44
0399 #define OBJID_basic_rate_set         45
0400 
0401 /**** Configuration/Status/Control Area ***************************/
0402 /*    System Control Block (SCB) Area
0403  *    Located at Shared RAM offset 0
0404  */
0405 struct scb {
0406     UCHAR ccs_index;
0407     UCHAR rcs_index;
0408 };
0409 
0410 /****** Status area at Shared RAM offset 0x0100 ******************************/
0411 struct status {
0412     UCHAR mrx_overflow_for_host;         /* 0=ECF may write, 1=host may write*/
0413     UCHAR mrx_checksum_error_for_host;   /* 0=ECF may write, 1=host may write*/
0414     UCHAR rx_hec_error_for_host;         /* 0=ECF may write, 1=host may write*/
0415     UCHAR reserved1;
0416     short mrx_overflow;                  /* ECF increments on rx overflow    */
0417     short mrx_checksum_error;            /* ECF increments on rx CRC error   */
0418     short rx_hec_error;                  /* ECF incs on mac header CRC error */
0419     UCHAR rxnoise;                       /* Average RSL measurement          */
0420 };
0421 
0422 /****** Host-to-ECF Data Area at Shared RAM offset 0x200 *********************/
0423 struct host_to_ecf_area {
0424     
0425 };
0426 
0427 /****** ECF-to-Host Data Area at Shared RAM offset 0x0300 ********************/
0428 struct startup_res_518 {
0429     UCHAR startup_word;
0430     UCHAR station_addr[ADDRLEN];
0431     UCHAR calc_prog_chksum;
0432     UCHAR calc_cis_chksum;
0433     UCHAR ecf_spare[7];
0434     UCHAR japan_call_sign[12];
0435 };
0436 
0437 struct startup_res_6 {
0438     UCHAR startup_word;
0439     UCHAR station_addr[ADDRLEN];
0440     UCHAR reserved;
0441     UCHAR supp_rates[8];
0442     UCHAR japan_call_sign[12];
0443     UCHAR calc_prog_chksum;
0444     UCHAR calc_cis_chksum;
0445     UCHAR firmware_version[3];
0446     UCHAR asic_version;
0447     UCHAR tib_length;
0448 };
0449 
0450 struct start_join_net_params {
0451     UCHAR net_type;
0452     UCHAR ssid[ESSID_SIZE];
0453     UCHAR reserved;
0454     UCHAR privacy_can_join;
0455 };
0456 
0457 /****** Command Control Structure area at Shared ram offset 0x0400 ***********/
0458 /* Structures for command specific parameters (ccs.var) */
0459 struct update_param_cmd {
0460     UCHAR object_id;
0461     UCHAR number_objects;
0462     UCHAR failure_cause;
0463 };
0464 struct report_param_cmd {
0465     UCHAR object_id;
0466     UCHAR number_objects;
0467     UCHAR failure_cause;
0468     UCHAR length;
0469 };
0470 struct start_network_cmd {
0471     UCHAR update_param;
0472     UCHAR bssid[ADDRLEN];
0473     UCHAR net_initiated;
0474     UCHAR net_default_tx_rate;
0475     UCHAR encryption;
0476 };
0477 struct join_network_cmd {
0478     UCHAR update_param;
0479     UCHAR bssid[ADDRLEN];
0480     UCHAR net_initiated;
0481     UCHAR net_default_tx_rate;
0482     UCHAR encryption;
0483 };
0484 struct tx_requested_cmd {
0485  
0486     UCHAR tx_data_ptr[2];
0487     UCHAR tx_data_length[2];
0488     UCHAR host_reserved[2];
0489     UCHAR reserved[3];
0490     UCHAR tx_rate;
0491     UCHAR pow_sav_mode;
0492     UCHAR retries;
0493     UCHAR antenna;
0494 };
0495 struct tx_requested_cmd_4 {
0496  
0497     UCHAR tx_data_ptr[2];
0498     UCHAR tx_data_length[2];
0499     UCHAR dest_addr[ADDRLEN];
0500     UCHAR pow_sav_mode;
0501     UCHAR retries;
0502     UCHAR station_id;
0503 };
0504 struct memory_dump_cmd {
0505     UCHAR memory_type;
0506     UCHAR memory_ptr[2];
0507     UCHAR length;
0508 };
0509 struct update_association_cmd {
0510     UCHAR status;
0511     UCHAR aid[2];
0512 };
0513 struct start_timer_cmd {
0514     UCHAR duration[2];
0515 };
0516 
0517 struct ccs {
0518     UCHAR buffer_status;                 /* 0 = buffer free, 1 = buffer busy */
0519                                          /* 2 = command complete, 3 = failed */
0520     UCHAR cmd;                           /* command to ECF                   */
0521     UCHAR link;                          /* link to next CCS, FF=end of list */
0522     /* command specific parameters      */
0523     union {
0524         char reserved[13];
0525         struct update_param_cmd update_param;
0526         struct report_param_cmd report_param;
0527         UCHAR nummulticast;
0528         UCHAR mode;
0529         struct start_network_cmd start_network;
0530         struct join_network_cmd join_network;
0531         struct tx_requested_cmd tx_request;
0532         struct memory_dump_cmd memory_dump;
0533         struct update_association_cmd update_assoc;
0534         struct start_timer_cmd start_timer;
0535     } var;
0536 };
0537 
0538 /*****************************************************************************/
0539 /* Transmit buffer structures */
0540 struct tib_structure {
0541     UCHAR ccs_index;
0542     UCHAR psm;
0543     UCHAR pass_fail;
0544     UCHAR retry_count;
0545     UCHAR max_retries;
0546     UCHAR frags_remaining;
0547     UCHAR no_rb;
0548     UCHAR rts_reqd;
0549     UCHAR csma_tx_cntrl_2;
0550     UCHAR sifs_tx_cntrl_2;
0551     UCHAR tx_dma_addr_1[2];
0552     UCHAR tx_dma_addr_2[2];
0553     UCHAR var_dur_2mhz[2];
0554     UCHAR var_dur_1mhz[2];
0555     UCHAR max_dur_2mhz[2];
0556     UCHAR max_dur_1mhz[2];
0557     UCHAR hdr_len;
0558     UCHAR max_frag_len[2];
0559     UCHAR var_len[2];
0560     UCHAR phy_hdr_4;
0561     UCHAR mac_hdr_1;
0562     UCHAR mac_hdr_2;
0563     UCHAR sid[2];
0564 };
0565 
0566 struct phy_header {
0567     UCHAR sfd[2];
0568     UCHAR hdr_3;
0569     UCHAR hdr_4;
0570 };
0571 struct ray_rx_msg {
0572     struct mac_header mac;
0573     UCHAR   var[];
0574 };
0575 
0576 struct tx_msg {
0577     struct tib_structure tib;
0578     struct phy_header phy;
0579     struct mac_header mac;
0580     UCHAR  var[1];
0581 };
0582 
0583 /****** ECF Receive Control Structure (RCS) Area at Shared RAM offset 0x0800  */
0584 /* Structures for command specific parameters (rcs.var) */
0585 struct rx_packet_cmd {
0586     UCHAR rx_data_ptr[2];
0587     UCHAR rx_data_length[2];
0588     UCHAR rx_sig_lev;
0589     UCHAR next_frag_rcs_index;
0590     UCHAR totalpacketlength[2];
0591 };
0592 struct rejoin_net_cmplt_cmd {
0593     UCHAR reserved;
0594     UCHAR bssid[ADDRLEN];
0595 };
0596 struct japan_call_sign_rxd {
0597     UCHAR rxd_call_sign[8];
0598     UCHAR reserved[5];
0599 };
0600 
0601 struct rcs {
0602     UCHAR buffer_status;
0603     UCHAR interrupt_id;
0604     UCHAR link_field;
0605     /* command specific parameters      */
0606     union {
0607         UCHAR reserved[13]; 
0608         struct rx_packet_cmd rx_packet;
0609         struct rejoin_net_cmplt_cmd rejoin_net_complete;
0610         struct japan_call_sign_rxd japan_call_sign;
0611     } var;
0612 };
0613 
0614 /****** Startup parameter structures for both versions of firmware ***********/
0615 struct b4_startup_params {
0616     UCHAR a_network_type;                /* C_ADHOC, C_INFRA                 */
0617     UCHAR a_acting_as_ap_status;         /* C_TYPE_STA, C_TYPE_AP            */
0618     UCHAR a_current_ess_id[ESSID_SIZE];  /* Null terminated unless 32 long   */
0619     UCHAR a_scanning_mode;               /* passive 0, active 1              */
0620     UCHAR a_power_mgt_state;             /* CAM 0,                           */
0621     UCHAR a_mac_addr[ADDRLEN];           /*                                  */
0622     UCHAR a_frag_threshold[2];           /* 512                              */
0623     UCHAR a_hop_time[2];                 /* 16k * 2**n, n=0-4 in Kus         */
0624     UCHAR a_beacon_period[2];            /* n * a_hop_time  in Kus           */
0625     UCHAR a_dtim_period;                 /* in beacons                       */
0626     UCHAR a_retry_max;                   /*                                  */
0627     UCHAR a_ack_timeout;                 /*                                  */
0628     UCHAR a_sifs;                        /*                                  */
0629     UCHAR a_difs;                        /*                                  */
0630     UCHAR a_pifs;                        /*                                  */
0631     UCHAR a_rts_threshold[2];            /*                                  */
0632     UCHAR a_scan_dwell_time[2];          /*                                  */
0633     UCHAR a_max_scan_dwell_time[2];      /*                                  */
0634     UCHAR a_assoc_resp_timeout_thresh;   /*                                  */
0635     UCHAR a_adhoc_scan_cycle_max;        /*                                  */
0636     UCHAR a_infra_scan_cycle_max;        /*                                  */
0637     UCHAR a_infra_super_scan_cycle_max;  /*                                  */
0638     UCHAR a_promiscuous_mode;            /*                                  */
0639     UCHAR a_unique_word[2];              /*                                  */
0640     UCHAR a_slot_time;                   /*                                  */
0641     UCHAR a_roaming_low_snr_thresh;      /*                                  */
0642     UCHAR a_low_snr_count_thresh;        /*                                  */
0643     UCHAR a_infra_missed_bcn_thresh;     /*                                  */
0644     UCHAR a_adhoc_missed_bcn_thresh;     /*                                  */
0645     UCHAR a_curr_country_code;           /* C_USA                            */
0646     UCHAR a_hop_pattern;                 /*                                  */
0647     UCHAR a_hop_pattern_length;          /*                                  */
0648 /* b4 - b5 differences start here */
0649     UCHAR a_cw_max;                      /*                                  */
0650     UCHAR a_cw_min;                      /*                                  */
0651     UCHAR a_noise_filter_gain;           /*                                  */
0652     UCHAR a_noise_limit_offset;          /*                                  */
0653     UCHAR a_det_rssi_thresh_offset;      /*                                  */
0654     UCHAR a_med_busy_thresh_offset;      /*                                  */
0655     UCHAR a_det_sync_thresh;             /*                                  */
0656     UCHAR a_test_mode;                   /*                                  */
0657     UCHAR a_test_min_chan_num;           /*                                  */
0658     UCHAR a_test_max_chan_num;           /*                                  */
0659     UCHAR a_rx_tx_delay;                 /*                                  */
0660     UCHAR a_current_bss_id[ADDRLEN];     /*                                  */
0661     UCHAR a_hop_set;                     /*                                  */
0662 };
0663 struct b5_startup_params {
0664     UCHAR a_network_type;                /* C_ADHOC, C_INFRA                 */
0665     UCHAR a_acting_as_ap_status;         /* C_TYPE_STA, C_TYPE_AP            */
0666     UCHAR a_current_ess_id[ESSID_SIZE];  /* Null terminated unless 32 long   */
0667     UCHAR a_scanning_mode;               /* passive 0, active 1              */
0668     UCHAR a_power_mgt_state;             /* CAM 0,                           */
0669     UCHAR a_mac_addr[ADDRLEN];           /*                                  */
0670     UCHAR a_frag_threshold[2];           /* 512                              */
0671     UCHAR a_hop_time[2];                 /* 16k * 2**n, n=0-4 in Kus         */
0672     UCHAR a_beacon_period[2];            /* n * a_hop_time  in Kus           */
0673     UCHAR a_dtim_period;                 /* in beacons                       */
0674     UCHAR a_retry_max;                   /* 4                                */
0675     UCHAR a_ack_timeout;                 /*                                  */
0676     UCHAR a_sifs;                        /*                                  */
0677     UCHAR a_difs;                        /*                                  */
0678     UCHAR a_pifs;                        /*                                  */
0679     UCHAR a_rts_threshold[2];            /*                                  */
0680     UCHAR a_scan_dwell_time[2];          /*                                  */
0681     UCHAR a_max_scan_dwell_time[2];      /*                                  */
0682     UCHAR a_assoc_resp_timeout_thresh;   /*                                  */
0683     UCHAR a_adhoc_scan_cycle_max;        /*                                  */
0684     UCHAR a_infra_scan_cycle_max;        /*                                  */
0685     UCHAR a_infra_super_scan_cycle_max;  /*                                  */
0686     UCHAR a_promiscuous_mode;            /*                                  */
0687     UCHAR a_unique_word[2];              /*                                  */
0688     UCHAR a_slot_time;                   /*                                  */
0689     UCHAR a_roaming_low_snr_thresh;      /*                                  */
0690     UCHAR a_low_snr_count_thresh;        /*                                  */
0691     UCHAR a_infra_missed_bcn_thresh;     /*                                  */
0692     UCHAR a_adhoc_missed_bcn_thresh;     /*                                  */
0693     UCHAR a_curr_country_code;           /* C_USA                            */
0694     UCHAR a_hop_pattern;                 /*                                  */
0695     UCHAR a_hop_pattern_length;          /*                                  */
0696 /* b4 - b5 differences start here */
0697     UCHAR a_cw_max[2];                   /*                                  */
0698     UCHAR a_cw_min[2];                   /*                                  */
0699     UCHAR a_noise_filter_gain;           /*                                  */
0700     UCHAR a_noise_limit_offset;          /*                                  */
0701     UCHAR a_det_rssi_thresh_offset;      /*                                  */
0702     UCHAR a_med_busy_thresh_offset;      /*                                  */
0703     UCHAR a_det_sync_thresh;             /*                                  */
0704     UCHAR a_test_mode;                   /*                                  */
0705     UCHAR a_test_min_chan_num;           /*                                  */
0706     UCHAR a_test_max_chan_num;           /*                                  */
0707     UCHAR a_allow_bcast_SSID_probe_rsp;
0708     UCHAR a_privacy_must_start;
0709     UCHAR a_privacy_can_join;
0710     UCHAR a_basic_rate_set[8];
0711 };
0712 
0713 /*****************************************************************************/
0714 #define RAY_IOCG_PARMS (SIOCDEVPRIVATE)
0715 #define RAY_IOCS_PARMS (SIOCDEVPRIVATE + 1)
0716 #define RAY_DO_CMD     (SIOCDEVPRIVATE + 2)
0717 
0718 /****** ethernet <-> 802.11 translation **************************************/
0719 typedef struct snaphdr_t
0720 {
0721   UCHAR   dsap;
0722   UCHAR   ssap;
0723   UCHAR   ctrl;
0724   UCHAR   org[3];
0725   UCHAR   ethertype[2];
0726 } snaphdr_t;
0727 
0728 #define BRIDGE_ENCAP  0xf80000
0729 #define RFC1042_ENCAP 0
0730 #define SNAP_ID       0x0003aaaa
0731 #define RAY_IPX_TYPE  0x8137
0732 #define APPLEARP_TYPE 0x80f3
0733 /*****************************************************************************/
0734 #endif /* _RAYCTL_H_ */