Home | History | Annotate | Download | only in FirmwareApi
      1 /*
      2  * public_commands.h
      3  *
      4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  *
     11  *  * Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  *  * Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in
     15  *    the documentation and/or other materials provided with the
     16  *    distribution.
     17  *  * Neither the name Texas Instruments nor the names of its
     18  *    contributors may be used to endorse or promote products derived
     19  *    from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  */
     33 
     34 /**********************************************************************************************************************
     35 
     36   FILENAME:       public_commands.h
     37 
     38   DESCRIPTION:    Command definitions shared with host
     39 
     40 
     41 
     42 ***********************************************************************************************************************/
     43 #ifndef PUBLIC_COMMANDS_H
     44 #define PUBLIC_COMMANDS_H
     45 
     46 
     47 #include "public_types.h"
     48 #include "public_radio.h"
     49 
     50 typedef enum
     51 {
     52     CMD_INTERROGATE     = 1,    /*use this to read information elements*/
     53     CMD_CONFIGURE       = 2,    /*use this to write information elements*/
     54     CMD_ENABLE_RX       = 3,
     55     CMD_ENABLE_TX       = 4,
     56     CMD_DISABLE_RX      = 5,
     57     CMD_DISABLE_TX      = 6,
     58     CMD_SCAN            = 8,
     59     CMD_STOP_SCAN       = 9,
     60 
     61     CMD_START_JOIN      = 11,
     62     CMD_SET_KEYS        = 12,
     63     CMD_READ_MEMORY     = 13,
     64     CMD_WRITE_MEMORY    = 14,
     65 
     66     CMD_SET_TEMPLATE    = 19,
     67     CMD_TEST            = 23,
     68 
     69     CMD_NOISE_HIST      = 28,
     70 
     71     CMD_LNA_CONTROL     = 32,
     72     CMD_SET_BCN_MODE    = 33,
     73 
     74     CMD_MEASUREMENT      = 34,
     75     CMD_STOP_MEASUREMENT = 35,
     76     CMD_DISCONNECT       = 36,
     77     CMD_SET_PS_MODE      = 37,
     78 
     79     CMD_CHANNEL_SWITCH   = 38,
     80     CMD_STOP_CHANNEL_SWICTH = 39,
     81 
     82     CMD_AP_DISCOVERY     = 40,
     83     CMD_STOP_AP_DISCOVERY = 41,
     84 
     85     CMD_SPS_SCAN = 42,
     86     CMD_STOP_SPS_SCAN = 43,
     87 
     88     CMD_HEALTH_CHECK     = 45,
     89     CMD_DEBUG            = 46,
     90     CMD_TRIGGER_SCAN_TO  = 47,
     91 
     92     CMD_CONNECTION_SCAN_CFG        = 48,
     93     CMD_CONNECTION_SCAN_SSID_CFG   = 49,
     94     CMD_START_PERIODIC_SCAN        = 50,
     95     CMD_STOP_PERIODIC_SCAN         = 51,
     96     CMD_SET_STA_STATE              = 52,
     97 
     98 NUM_COMMANDS,
     99     MAX_COMMAND_ID = 0xFFFF
    100 } Command_enum;
    101 
    102 #ifdef HOST_COMPILE
    103 typedef uint16 Command_e;
    104 #else
    105 typedef Command_enum Command_e;
    106 #endif
    107 
    108 
    109 #ifdef HOST_COMPILE
    110 
    111 #define     CMD_MAILBOX_IDLE               0
    112 #define     CMD_STATUS_SUCCESS             1
    113 #define     CMD_STATUS_UNKNOWN_CMD         2
    114 #define     CMD_STATUS_UNKNOWN_IE          3
    115 #define     CMD_STATUS_REJECT_MEAS_SG_ACTIVE    11
    116 #define     CMD_STATUS_RX_BUSY             13
    117 #define     CMD_STATUS_INVALID_PARAM       14
    118 #define     CMD_STATUS_TEMPLATE_TOO_LARGE  15
    119 #define     CMD_STATUS_OUT_OF_MEMORY       16
    120 #define     CMD_STATUS_STA_TABLE_FULL      17
    121 #define     CMD_STATUS_RADIO_ERROR         18
    122 #define     CMD_STATUS_WRONG_NESTING       19
    123 #define     CMD_STATUS_TIMEOUT             21 /* Driver internal use.*/
    124 #define     CMD_STATUS_FW_RESET            22 /* Driver internal use.*/
    125 #define     MAX_COMMAND_STATUS             MAX_POSITIVE16
    126 
    127 #else
    128 
    129 typedef enum
    130 {
    131     CMD_MAILBOX_IDLE              =  0,
    132     CMD_STATUS_SUCCESS            =  1,
    133     CMD_STATUS_UNKNOWN_CMD        =  2,
    134     CMD_STATUS_UNKNOWN_IE         =  3,
    135     CMD_STATUS_REJECT_MEAS_SG_ACTIVE =  11,
    136     CMD_STATUS_RX_BUSY            = 13,
    137     CMD_STATUS_INVALID_PARAM      = 14,
    138     CMD_STATUS_TEMPLATE_TOO_LARGE = 15,
    139     CMD_STATUS_OUT_OF_MEMORY      = 16,
    140     CMD_STATUS_STA_TABLE_FULL     = 17,
    141     CMD_STATUS_RADIO_ERROR        = 18,
    142     CMD_STATUS_WRONG_NESTING      = 19,
    143     CMD_STATUS_TIMEOUT            = 21, /* Driver internal use.*/
    144     CMD_STATUS_FW_RESET           = 22, /* Driver internal use.*/
    145     MAX_COMMAND_STATUS            = MAX_POSITIVE16
    146 } CommandStatus_enum;
    147 
    148 #endif
    149 
    150 #ifdef HOST_COMPILE
    151 typedef uint16 CommandStatus_e;
    152 #else
    153 typedef CommandStatus_enum CommandStatus_e;
    154 #endif
    155 
    156 #define MAX_CMD_PARAMS 610
    157 
    158 #define DEBUG_INDICATOR      0x8000
    159 
    160 typedef struct
    161 {
    162     Command_e cmdID;
    163     CommandStatus_e cmdStatus;
    164     uint8 parameters[MAX_CMD_PARAMS];
    165 } Command_t;
    166 
    167 
    168 /******************************************************************************
    169 
    170     ID:       CMD_INTERROGATE
    171     Desc:     This command requests an information element from the WiLink. The
    172               interface for this command is somewhat different from other commands
    173               since the interface is bi-directional and asymmetric.
    174               The host structure consists of the Command ID, a Command Status
    175               (returned by WiLink) place holder, and the Information Element Heading
    176               (ID and expected length).
    177               The response to that command is a buffer of the information element's
    178               actual values returned by the WiLink just after the command is issued.
    179               The response to that command is a buffer of the information element's
    180               actual values returned by the WiLink just after the command is issued.
    181     Params:   InfoElement_t - see below.
    182 
    183 
    184 ******************************************************************************/
    185 /*
    186 Description of InfoElement structure - defined in "public_infoele.h"
    187 offset  length  source  description
    188 ======  ======  ======  ===========
    189 0       2       host    Information Element ID - contains the ID of the requested
    190                         information element (refer to InfoElement_enum in
    191                         pblic_infoele.h). In response to this command, the WiLink
    192                         writes the requested information element to the response area
    193                         for the command mailbox.
    194 2       4       wilink  Length - the length of the response (different for each IE
    195                         according to definitions in public_infoele.h).
    196 4       Length  wilink  IE payload according to definition in public_infoele.h.
    197 */
    198 
    199 
    200 
    201 /******************************************************************************
    202 
    203     ID:       CMD_CONFIGURE
    204     Desc:     This command configures an information element in the WiLink.
    205     Params:   InfoElement_t - see below.
    206 
    207 ******************************************************************************/
    208 /*
    209 Description of InfoElement structure - defined in "public_infoele.h"
    210 offset  length  source  description
    211 ======  ======  ======  ===========
    212 0       2       host    Information Element ID - contains the ID of the requested
    213                         information element (refer to InfoElement_enum in
    214                         pblic_infoele.h). In response to this command, the WiLink
    215                         writes the requested information element to the response area
    216                         for the command mailbox.
    217 2       4       host    Length - the length of the response (different for each IE
    218                         according to definitions in public_infoele.h).
    219 4       Length  host    IE payload according to definition in public_infoele.h.
    220 */
    221 
    222 
    223 /******************************************************************************
    224 
    225     ID:       CMD_ENABLE_RX
    226     Desc:     This command enables the normal reception of frames.
    227     Params:   Channel Number - this field indicates the radio channel on which to
    228                                receive data. This parameter also sets the channel on
    229                                which to transmit. The last channel number used,
    230                                regardless of the order in which the ENABLE_RX and
    231                                ENABLE_TX commands are issued, is the channel number
    232                                for both RX and TX. This command must be issued after
    233                                the host has set all necessary configuration elements
    234                                appropriately.
    235 
    236 ******************************************************************************/
    237 
    238 
    239 
    240 /******************************************************************************
    241 
    242     ID:       CMD_ENABLE_TX
    243     Desc:     This command enables the normal transmission of frames.
    244     Params:   Channel Number - this field indicates the radio channel on which to
    245                                transmit data. This parameter also sets the channel on
    246                                which to receive. The last channel number used,
    247                                regardless of the order in which the ENABLE_RX and
    248                                ENABLE_TX commands are issued, is the channel number
    249                                for both RX and TX. This command must be issued after
    250                                the host has set all necessary configuration elements
    251                                appropriately.
    252 
    253 ******************************************************************************/
    254 
    255 /******************************************************************************
    256 
    257     ID:       CMD_DISABLE_RX
    258     Desc:     This command disables the normal reception of packets over the
    259               Baseband interface.
    260     Params:   None
    261 
    262 ******************************************************************************/
    263 
    264 /******************************************************************************
    265 
    266     ID:       CMD_DISABLE_TX
    267     Desc:     This command disables the normal transmission of frames.
    268     Params:   None.
    269 
    270 ******************************************************************************/
    271 
    272 /******************************************************************************
    273 
    274     ID:       CMD_SCAN
    275     Desc:     This command instructs the WiLink to scan for BSS/IBSSs. The host
    276               may perform either an active scan or a passive scan. During an active
    277               scan, the WiLink transmits a probe request on the specified channel(s)
    278               and then listens for beacon/probe responses. During a passive scan, the
    279               WiLink monitors the specified channel(s) for beacons.
    280               The WiLink sends SCAN_COMPLETE event to notify the host when it has
    281               completed a scan.
    282     Params:   ScanParameters_t - see below
    283 
    284 ******************************************************************************/
    285 /*
    286 Offset  Length  Definition
    287 0       8       RX filters for Scan (refer to ACXRxConfigStruct)
    288 8       2       Scan options (Band select, Voice mode and Scan type = Active/Passive)
    289 10      1       NumChannels
    290 11      1       Number of Probe requests (used for Active scan)
    291 12      2       Probe request rate & modulation
    292 14      1       AC trigger (for Voice mode only)
    293 15      1       SSID length
    294 16      32      SSID string (Null terminated)
    295 48      2       Channel [0] ScanMinDuration
    296 50      2       Channel [0] ScanMaxDuration
    297 52      6       Channel [0] BSSID (4 bytes LOW and 2 bytes HIGH)
    298 58      1       Channel [0].bit0-3: Early Termination count. Bit 4-5: Condition
    299 59      1       Channel [0] TX power level for Scan (0 means do not change - other values:1-5)
    300 60      1       Channel [0] Channel
    301 61      3       Channel [0] Reserved
    302 64-404  340     Optional Channel [1] - Channel [15] - same format as Channel [0] fields above.
    303 */
    304 
    305 /* Defines for Rx "ConfigOptions".*/
    306 /* Only bits 2-10 can be configured by the Driver".*/
    307 #define CFG_RX_SERIAL           BIT_0    /* 0 = use parallel interface,         1 = use serial interface from ACX101- not valid.*/
    308 #define CFG_RX_RAW              BIT_1    /* 1 = write all data from baseband to frame buffer including PHY header.*/
    309 #define CFG_RX_FCS              BIT_2    /* 1 = write FCS to end of frame in memory, 0 = do not write FCS to memory.*/
    310 #define CFG_RX_ALL_GOOD         BIT_3    /* promiscuous mode, receive all good frames.*/
    311 #define CFG_UNI_FILTER_EN       BIT_4    /* local MAC address filter enable.*/
    312 #define CFG_BSSID_FILTER_EN     BIT_5    /* BSSID filter enable.*/
    313 #define CFG_MC_FILTER_EN        BIT_6    /* 0 = receive all multicast,          1 = use one or both multicast address filters.*/
    314 #define CFG_MC_ADDR0_EN         BIT_7    /* 1 = receive frames from mc_addr0,   0 = do not use this filter.*/
    315 #define CFG_MC_ADDR1_EN         BIT_8    /* 1 = receive frames from mc_addr1,   0 = do not use this filter .*/
    316 #define CFG_BC_REJECT_EN        BIT_9    /* 0 = receive all broadcast,          1 = filter all broadcast.*/
    317 #define CFG_SSID_FILTER_EN      BIT_10   /* SSID Filter Enable.*/
    318 #define CFG_RX_INT_FCS_ERROR    BIT_11   /* 1 = give rx complete interrupt for FCS errors.*/
    319 #define CFG_RX_INT_ENCRYPTED    BIT_12   /* 1 = only give rx header interrupt if frame is encrypted.*/
    320 #define CFG_RX_WR_RX_STATUS     BIT_13   /* 0 = do not write three status words, 1 = write three receive status words to top of rx'd MPDU.*/
    321 #define CFG_RX_FILTER_NULTI     BIT_14   /* 1 = filter multicast/broadcast frame if SA matchs local MAC addr->.*/
    322 #define CFG_RX_RESERVE          BIT_15   /* reserve.*/
    323 #define CFG_RX_TIMESTAMP_TSF    BIT_16   /* 1 = sample frame's' arrival time in 32bits TSF, 0 = write it in MAC time stamp.*/
    324 
    325 
    326 /* Defines for Rx "FilterOptions".*/
    327 /* The rx filter enables control what type of receive frames will be rejected or received by the rx hardware*/
    328 /* 1 = frame is written to memory,*/
    329 /* 0 = not written to memory, rejected.*/
    330 #define CFG_RX_RSV_EN       BIT_0  /* reserved types and subtypes.*/
    331 #define CFG_RX_RCTS_ACK     BIT_1  /* rts, cts, ack frames.*/
    332 #define CFG_RX_PRSP_EN      BIT_2  /* probe response.*/
    333 #define CFG_RX_PREQ_EN      BIT_3  /* probe request.*/
    334 #define CFG_RX_MGMT_EN      BIT_4  /* type = management.*/
    335 #define CFG_RX_FCS_ERROR    BIT_5  /* frames with FCS errors.*/
    336 #define CFG_RX_DATA_EN      BIT_6  /* type = data.*/
    337 #define CFG_RX_CTL_EN       BIT_7  /* type = control.*/
    338 #define CFG_RX_CF_EN        BIT_8  /* contention free frames.*/
    339 #define CFG_RX_BCN_EN       BIT_9  /* beacons.*/
    340 #define CFG_RX_AUTH_EN      BIT_10 /* authentication, deauthentication.*/
    341 #define CFG_RX_ASSOC_EN     BIT_11 /* association related frames (all 5 subtypes  assoc req/resp,*/
    342 
    343 
    344 typedef struct
    345 {
    346     uint32          ConfigOptions;
    347     uint32          FilterOptions;
    348 } ACXRxConfigStruct;
    349 
    350 
    351 /* ScanOptions bit mask field.*/
    352 #define SCAN_ACTIVE         0
    353 #define SCAN_PASSIVE        1   /* 1 = passive scan, 0 = active scan*/
    354 /* #define SCAN_5GHZ_BAND      2  */  /* 1 = scan channel list in 5 Ghz band, 0 = scan channel list in 2.4 Ghz band*/
    355 #define TRIGGERED_SCAN      2   /* 1 = Triggered scan, 0 = Normal scan*/
    356 #define SCAN_PRIORITY_HIGH  4   /* 1 = High priority scan, 0 = Low priority scan*/
    357 
    358 typedef uint8 TidTrigger_t;
    359 
    360 /* General scan parameters.*/
    361 typedef struct
    362 {
    363     ACXRxConfigStruct  rxCfg;         /* Rx filter to be used for each channel scan. */
    364                                       /* The BSSID filter enable will be set (by the */
    365                                       /* scan process) to ON for a specific channel if*/
    366                                       /* the BSSID of this channel is a unicast address.*/
    367                                       /* Otherwise it will be set to OFF (Refer to */
    368                                       /* ACXRxConfig IE in public_infoele.h).*/
    369 
    370     uint16             scanOptions;   /* This bitwise field indicates the scan options. */
    371                                       /* Bits [4:15] are reserved. */
    372                                       /* Bits [0:3] are defined as follows: */
    373                                       /* Scan Type (bit 0) - When this bit is set, the */
    374                                       /*  WiLink performs a passive scan. When this bit*/
    375                                       /*  is cleared, the WiLink performs an active scan. */
    376                                       /* Band Select (bit 1) - When this bit is set, the*/
    377                                       /*  WiLink scans the specified channels in the */
    378                                       /*  5GHz band. When this bit is cleared, the */
    379                                       /*  WiLink scans the specified channels in the */
    380                                       /*  2.4GHz band. */
    381                                       /* Voice mode (bit 2) - When this bit is set, */
    382                                       /*  the request is for a voice scan. When this bit*/
    383                                       /*  is cleared, the request is for a normal scan. */
    384                                       /* Scan priority (bit 3) - When this bit is set, */
    385                                       /*  the request is for a high priority scan. When*/
    386                                       /*  this bit is cleared, the request is for a low*/
    387                                       /*  priority scan.*/
    388 
    389     uint8              numChannels;   /* Number of scan channels in the list (minimum is*/
    390                                       /* 1, maximum is 30).*/
    391 
    392     uint8              numOfProbRqst; /* This field indicates the number of probe */
    393                                       /* requests to send per channel, in active scan. */
    394 
    395     EHwRateBitFiled    txdRateSet;    /* This EHwRateBitFiled format field specifies the rate and */
    396                                       /* modulation to transmit the probe request during*/
    397 	                                  /* an active scan. It is not used for passive scans.*/
    398 
    399     TidTrigger_t       tidTrigger;    /* used for TidTriggered scan only.*/
    400 
    401     uint8              ssidLength;    /* This field specifies the size of the SSID, */
    402                                       /* which can be up to 32 bytes long. If this field*/
    403                                       /* equals to zero, SSID filter is not applied. */
    404 
    405     uint8              padding1[2];    /* in order to align */
    406 
    407 
    408     uint32             ssidStr[8];    /* This field specifies the SSID packets from that*/
    409                                       /* are relevant for the Scan result. The WiLink*/
    410                                       /* uses this information to filter beacon, probe*/
    411                                       /* response frames (if the SSID length field of */
    412                                       /* this command structure is not zero) */
    413 
    414     RadioBand_e         band;         /* Band to scan */
    415 
    416     uint8               useSsidList;  /* Whether to use SSID list (configured seperately)
    417                                          when transmitting probe-requests */
    418 
    419     uint8               scanTag;      /* Scan results tag */
    420 
    421     uint8               padding2;     /* in order to align */
    422 
    423 } BasicScanParameters_t;
    424 
    425 
    426 
    427 #define SCAN_ET_COND_MASK  0x30
    428 #define SCAN_ET_COUNT_MASK 0x0F
    429 
    430 #define SCAN_MAX_NUM_OF_CHANNELS 24
    431 
    432 /* Early Termination condition (bits 4-5) - This field can have one of the following */
    433 /* values (note that bits 0-3 indicates Early Termination count): */
    434 typedef enum
    435 {
    436     ET_COND_DISABLE = 0x00,          /* Disable - No early termination condition.*/
    437 
    438     ET_COND_BEACON  = 0x10,          /* Beacon only. When this value is selected, the */
    439                                      /* Early Termination count field specifies the */
    440                                      /* maximum number of beacons to collect before */
    441                                      /* ending a scan. */
    442 
    443     ET_COND_PROBE_RESP = 0x20,       /* Probe responses only. When this value is */
    444                                      /* selected, the Early Termination count field */
    445                                      /* specifies the maximum number of probe responses*/
    446                                      /* to collect before ending a scan. */
    447 
    448     ET_COND_BEACON_PROBE_RESP = 0x30,/* Beacon/probe response. When this value is */
    449                                      /* selected, the Early Termination count field */
    450                                      /* specifies the maximum number of beacons or probe*/
    451                                      /* responses to collect before ending a scan. */
    452 
    453     ET_COND_INVALID = 0xFF
    454 } ETCondition_enum;
    455 
    456 #ifdef HOST_COMPILE
    457 typedef uint8 ETCondition_e;
    458 #else
    459 typedef ETCondition_enum ETCondition_e;
    460 #endif
    461 
    462 
    463 typedef uint8 ETCondCount_t;
    464 
    465 
    466 
    467 #define PROCESS_SCAN_IS_HIGH(pScanParameters) ((pScanParameters)->basicScanParameters.scanOptions & SCAN_PRIORITY_HIGH)
    468 #define PROCESS_SCAN_IS_LOW(pScanParameters) ((PROCESS_SCAN_IS_HIGH(pScanParameters)) == 0)
    469 
    470 
    471 /* Per-Channel scan parameters.*/
    472 typedef struct
    473 {
    474 
    475     uint32        scanMinDuration;    /* For active scans, this field specifies the */
    476                                       /* minimum amount of time, in time units (TUs), */
    477                                       /* to wait for a frame on a channel. This */
    478                                       /* parameter is not used for passive scans. The*/
    479                                       /*  value can range from 0 to 65535 TUs */
    480                                       /* (67.1 seconds). */
    481 
    482     uint32        scanMaxDuration;    /* For active scans, this field specifies the */
    483                                       /* maximum amount of time, in time units (TUs), */
    484                                       /* to wait for a probe response on a channel.*/
    485                                       /* For passive scans, this field specifies the */
    486                                       /* amount of time, in time units (TUs), to listen*/
    487                                       /* on a channel. The value can range from 0 to */
    488                                       /* 65535 TUs (67.1 seconds). */
    489 
    490 
    491     uint32        bssIdL;             /* 32 LSBits of BSSID of the AP to scan for. */
    492                                       /* If scanning on this channel any BSSID, this */
    493                                       /* field shall be set to broadcast BSSID. */
    494 
    495     uint16        bssIdH;             /* 16 MSBits of BSSID of the AP to scan for.*/
    496 
    497     ETCondCount_t ETCondCount;        /* bit 0-3: Early Termination count - This field */
    498                                       /*          defines the maximum number of beacons*/
    499                                       /*          or probe responses or both (according*/
    500                                       /*          to condition) to collect before ending*/
    501                                       /*          a scan.*/
    502 
    503                                       /* Bit 4-5: Early Termination Condition (refer */
    504                                       /*          to ETCondition_enum).*/
    505 
    506     uint8         txPowerAttenuation; /* TX power level to be used per channel scanned. */
    507                                       /* If 0, leave normal TX power level for this */
    508                                       /* channel. Range: 0 - 20 [dB].*/
    509 
    510     Channel_e     channel;            /* Channel number to scan, valid range 0-255 */
    511                                       /* (1-14 for 802.11b). */
    512 
    513     Bool_e        dfsCandidate;       /* FW internal use only! */
    514     Bool_e        activityDetected;   /* FW internal use only! */
    515 
    516     uint8         padding[1];             /* for alignment to 32 bits boundry*/
    517 } BasicScanChannelParameters_t;
    518 
    519 /* The Scan command structure.*/
    520 typedef struct
    521 {
    522     BasicScanParameters_t basicScanParameters; /* refer to BasicScanParameters_t */
    523                                                /* definition*/
    524 
    525     BasicScanChannelParameters_t basicScanChannelParameters[SCAN_MAX_NUM_OF_CHANNELS];
    526 } ScanParameters_t;
    527 
    528 /*****************************************************************************
    529 
    530     ID:       CMD_TRIGGER_SCAN_TO
    531     Desc:     This Command will configure the enhanced Trigger Scan Timeout
    532                 information.
    533               To use legacy Trigger Scan, configure the parameter to 0
    534     Params:   None
    535 
    536 ******************************************************************************/
    537 typedef struct
    538 {
    539     uint32  slicedScanTimeOut;          /* 0 - Split Scan Disable
    540                                            any other value will represent the timeout
    541                                            for each channel "mini scan" in uSec */
    542 }enhancedTriggerTO_t;
    543 
    544 
    545 
    546 /*****************************************************************************
    547 
    548     ID:       CMD_STOP_SCAN
    549     Desc:     This command instructs the WiLink to terminate any scan in progress.
    550               After processing this command, the WiLink returns to its previous state
    551               (the state before the scan was started) and generates the SCAN_COMPLETE
    552               information message.
    553     Params:   None
    554 
    555 ******************************************************************************/
    556 
    557 
    558 
    559 /******************************************************************************
    560 
    561     ID:       CMD_START_JOIN
    562     Desc:     This command instructs the WiLink to either join a BSS or IBSS, or
    563               start an IBSS. When the device has joined the BSS or IBSS the Join
    564               Complete event is raised to the host.
    565     Params:   StartJoinRequest_t - see below.
    566 
    567 ******************************************************************************/
    568 
    569 /*
    570  * Join command  control bit mask field:
    571  */
    572 
    573 
    574 
    575 /* Cyclic counter in range 1-7, advanced on every Join command to enable the FW distinguish
    576      between connection sessions and drop obsolete Tx packets. */
    577 #define JOIN_CMD_CTRL_TX_SESSION       (BIT_3 | BIT_2 | BIT_1)
    578 
    579 /* When this bit is set,the firmware will flush all Tx frames in the pipe and will not transmit them. */
    580 #define JOIN_CMD_CTRL_TX_FLUSH         BIT_7
    581 
    582 /* Offsets of the above fields */
    583 #define JOIN_CMD_CTRL_OFFSET_TX_SESSION             1
    584 #define JOIN_CMD_CTRL_OFFSET_TX_FLUSH                      7
    585 
    586 
    587 typedef enum
    588 {
    589     BSS_TYPE_IBSS = 0,
    590     BSS_TYPE_STA_BSS = 2,
    591     BSS_TYPE_AP_BSS = 3,
    592     MAX_BSS_TYPE = 0xFF
    593 } BssType_enum;
    594 
    595 #ifdef HOST_COMPILE
    596 typedef uint8 BSS_e;
    597 #else
    598 typedef BssType_enum BSS_e;
    599 #endif
    600 
    601 #define MAX_SSID_STR_LEN_BYTESX4 8
    602 
    603 typedef struct
    604 {
    605     uint32            bssIdL;        /* This field indicates the 32 LSBits of the MAC*/
    606                                      /* address of the BSS to join. */
    607                                      /* Note: To correctly generate beacon frames, the */
    608                                      /* byte order of the BSS ID field must be */
    609                                      /* reversed. for example, if the MAC address of */
    610                                      /* the AP is 00 7E 99 11 22 33, program the BSS */
    611                                      /* ID field as 33 22 11 99 7E 00.*/
    612 
    613     uint16            bssIdH;        /* This field indicates the 16 MSBits of the MAC*/
    614                                      /* address of the BSS to join. */
    615 
    616     uint16            beaconInterval;/* This field specifies the time between target */
    617                                      /* beacon transmission times (TBTTs), in time */
    618                                      /* units (TUs). Valid values are 1 to 1024.*/
    619 
    620     ACXRxConfigStruct rxFilter;      /* This filed is the Rx filter configuration for*/
    621                                      /* the device while connected to the BSS or IBSS.*/
    622                                      /* This setting is overridden in case of a */
    623                                      /* measurement or a scan activity and is reset */
    624                                      /* after these activities end.*/
    625 
    626     EHwRateBitFiled   basicRateSet;  /* For 802.11b, this field specifies the control*/
    627                                      /* response frame rate for the BSS or IBSS (that*/
    628                                      /* is, the BSSBasicRateSet parameter in the */
    629                                      /* 802.11 Specification). The WiLink uses this */
    630                                      /* field to determine the rate at which to */
    631                                      /* transmit control frame responses (such as ACK */
    632 	                                 /* or CTS frames). */
    633 
    634     uint8             dtimInterval;  /* This field specifies the number of beacon */
    635                                      /* intervals between DTIM beacon frames. The host*/
    636                                      /* is only required to set this field when the */
    637                                      /* BSS Type is infrastructure BSS (STA) or AP. */
    638                                      /* For an independent BSS, the host should set */
    639                                      /* this field to 1.*/
    640 
    641     BSS_e             bssType;       /* bits 0-2: This bitwise field specifies the type */
    642                                      /*  of BSS to start or join (Refer to BssType_enum). */
    643                                      /* bit 4: Band - The radio band in which to join*/
    644                                      /*  or start.*/
    645                                      /*  0 - 2.4GHz band    */
    646                                      /*  1 - 5GHz band*/
    647                                      /* bits 3, 5-7: Reserved*/
    648 
    649     Channel_e         channelNumber; /* This field specifies the channel number of the*/
    650                                      /* BSS to join or start. Valid values are 1 to 14. */
    651                                      /* If the specified channel is not allowed in the*/
    652                                      /* regulatory domain, the command is rejected and*/
    653                                      /* the status code 0x0005 is returned in the */
    654                                      /* Command Status field.*/
    655 
    656     uint8             ssidLength;    /* This field specifies the size of the SSID, which*/
    657                                      /* can be up to 32 bytes long.*/
    658 
    659     uint32              ssidStr[MAX_SSID_STR_LEN_BYTESX4];
    660                                      /* This field specifies the SSID of the BSS to */
    661                                      /* start or join. The WiLink uses this information*/
    662                                      /* to filter beacon, probe response and probe */
    663                                      /* request frames (if configured to do so in bit 10*/
    664                                      /* in the Receive Configuration field of the */
    665                                      /* ACXRxConfig information element). */
    666                                      /* It also uses this information to determine if a*/
    667                                      /* probe response should be transmitted in */
    668                                      /* response to a received probe request.*/
    669 
    670     uint8             ctrl;          /* Join command control field (refer to */
    671                                      /* the JOIN_CMD_CTRL... specified above).*/
    672 
    673     uint8             reserved[3];
    674 } StartJoinRequest_t;
    675 
    676 
    677 /******************************************************************************
    678 
    679     ID:       CMD_SET_KEYS
    680     Desc:     The host issues this command to manage the WEP key cache in the WiLink.
    681               The host can issue this command during the configuration or operation
    682               phase.
    683     Params:   SetKey_t - see below.
    684 
    685 ******************************************************************************/
    686 
    687 #define NUM_ACCESS_CATEGORIES_COPY 4
    688 
    689 #define MAX_KEY_SIZE 32
    690 
    691 typedef enum
    692 {
    693     KEY_ADD_OR_REPLACE = 1,             /* Add or replace a key in the WEP cache*/
    694     KEY_REMOVE         = 2,             /* Remove a key from the WEP cache*/
    695     KEY_SET_ID         = 3,             /* Set Key ID*/
    696     MAX_KEY_ACTION     = MAX_POSITIVE16 /* force this enum to be uint16*/
    697 } KeyAction_enum;
    698 
    699 #ifdef HOST_COMPILE
    700 typedef uint16 KeyAction_e;
    701 #else
    702 typedef KeyAction_enum KeyAction_e;
    703 #endif
    704 
    705 
    706 /*
    707 Key Size+Key Data table (valid value)
    708 KeyType_enum  Key Type                    Valid Key Size    Key Data Field Format
    709 ============  ========                    ==============    =====================
    710 0x00          WEP default key             5, 13, 29         Key Size bytes of key data
    711 
    712 0x01          WEP key mapping key         5, 13, 29         Key Size bytes of key data
    713 
    714 0x04          AES Group Key               16                16 bytes of key data
    715 
    716 0x05          AES Pairwise Key            16                16 bytes of key data
    717 
    718 0x0A          TKIP and MIC Group Key      32                16 bytes of TKIP key data
    719                                                         8 bytes of Rx MIC key data
    720                                                         8 bytes of Tx MIC key data
    721 
    722 0x0B          TKIP and MIC Pairwise Key   32                16 bytes of TKIP key data
    723                                                         8 bytes of Rx MIC key data
    724                                                         8 bytes of Tx MIC key data
    725 
    726 0x0C          GEM and MIC Group Key      32                 16 bytes of GEM key data
    727                                                             16 bytes of MIC key data
    728 
    729 0x0D          GEM and MIC Pairwise Key   32                 16 bytes of GEM key data
    730                                                             16 bytes of MIC key data
    731 
    732 */
    733 
    734 
    735 typedef enum
    736 {
    737   CIPHER_SUITE_NONE = 0,
    738   CIPHER_SUITE_WEP  = 1,
    739   CIPHER_SUITE_TKIP = 2,
    740   CIPHER_SUITE_AES  = 3,
    741   CIPHER_SUITE_GEM  = 4,
    742   MAX_KEY_TYPE
    743 } CipherSuite_enum;
    744 
    745 #ifdef HOST_COMPILE
    746 typedef uint8 CipherSuite_e;
    747 #else
    748 typedef CipherSuite_enum CipherSuite_e;
    749 #endif
    750 
    751 typedef enum
    752 {
    753     NO_KEY            =  0,
    754     KEY_SIZE_WEP_64   =  5,
    755     KEY_SIZE_WEP_128  = 13,
    756     KEY_SIZE_WEP_256  = 29,
    757     KEY_SIZE_TKIP     = MAX_KEY_SIZE
    758 } KeySize_enum;                      /* WEP keysizes reflect 3 bytes appended from IV.*/
    759 
    760 #ifdef HOST_COMPILE
    761 typedef uint8 KeySize_e;
    762 #else
    763 typedef KeySize_enum KeySize_e;
    764 #endif
    765 
    766 
    767 typedef struct
    768 {
    769     uint8 addr[MAC_ADDR_SIZE]; /* This field specifies the MAC address of the station to*/
    770                                /* add or remove from the WEP key cache. This field is */
    771                                /* ignored if a WEP default key is being added or removed.*/
    772 
    773     KeyAction_e action;        /* This field specifies the action to be performed.*/
    774                                /* Refer to KeyAction_enum.*/
    775 
    776     uint16      reserved;
    777     KeySize_e   keySize;       /* This field indicates the size of the key in bytes */
    778                                /* being added. Valid values are listed in the Valid Key */
    779                                /* Size column in the above "Key Size+Key Data table". */
    780 
    781     CipherSuite_e   type;          /* This field indicates the type of key being added.*/
    782                                /* Valid values are listed in the Value column in the*/
    783                                /* KeyType_enum.*/
    784 
    785     uint8       ssidProfile;   /* This field indicates the SSID profile for which the */
    786                                /* key is set.*/
    787     uint8       id;            /* Key ID - For TKIP and AES key types, this field */
    788                                /* indicates the value that should be inserted into the*/
    789                                /* KeyID field of frames transmitted using this key */
    790                                /* entry. For WEP default key types, this field indicates*/
    791                                /* the ID of the key to add or remove. */
    792                                /* For WEP key mapping key types, this field is ignored.*/
    793                                /* Valid values for this field are 0 to 3.*/
    794 
    795     uint8       reserved2[6];
    796     uint8       key[MAX_KEY_SIZE];
    797                                /* This field holds the security key data to add to the*/
    798                                /* STA table. The format of this field varies depending*/
    799                                /* on the type field. The format of this field for each*/
    800                                /* key type is described in the Key Data Field Format */
    801                                /* column in the "Key Size+Key Data table", above.*/
    802 
    803     uint16      AcSeqNum16[NUM_ACCESS_CATEGORIES_COPY];
    804                                /* This field indicates the lower part of the PN\IV */
    805                                /* sequence number that is used, for the four Access*/
    806                                /* Categories.*/
    807 
    808     uint32      AcSeqNum32[NUM_ACCESS_CATEGORIES_COPY];
    809                                /* This field indicates the higher part of the PN\IV */
    810                                /* sequence number that is used, for four Access */
    811                                /* Categories.*/
    812 
    813 } SetKey_t;
    814 
    815 
    816 /******************************************************************************
    817 
    818     ID:       CMD_READ_MEMORY
    819     Desc:     The host issues this command to read the WiLink device
    820               memory/registers.
    821     Params:   ReadWriteCommand_t - see below.
    822     Note:     The Base Band address has special handling (16 bits registers and
    823               addresses). For more information, see the hardware specification.
    824 
    825 ******************************************************************************/
    826 /******************************************************************************
    827 
    828     ID:       CMD_WRITE_MEMORY
    829     Desc:     The host issues this command to write the WiLink device memory/registers.
    830     Params:   ReadWriteCommand_t - see below.
    831     Note:     The Base Band address has special handling (16 bits registers and
    832               addresses). For more information, see the hardware specification.
    833 
    834 ******************************************************************************/
    835 
    836 #define MAX_READ_SIZE 256
    837 
    838 typedef struct
    839 {
    840     uint32 addr;                 /* The address of the memory to read from or write to.*/
    841     uint32 size;                 /* The amount of data in bytes to read from or write */
    842                                  /* to the WiLink device.*/
    843     uint8  value[MAX_READ_SIZE]; /* The actual value read from or written to the Wilink.*/
    844                                  /* The source of this field is the Host in WRITE */
    845                                  /* command or the Wilink in READ command.*/
    846 } ReadWriteCommand_t;
    847 
    848 
    849 /******************************************************************************
    850 
    851     ID:       CMD_BEACON
    852     Desc:     This command specifies the contents of the beacon template stored in
    853               the WiLink.
    854     Params:   PktTemplate_t - see below.
    855 
    856 ******************************************************************************/
    857 
    858 /******************************************************************************
    859 
    860     ID:       CMD_PROBE_RESP
    861     Desc:     This command specifies the contents of the probe response template
    862               stored in the WiLink.
    863     Params:   PktTemplate_t - see below.
    864 
    865 ******************************************************************************/
    866 
    867 /******************************************************************************
    868 
    869     ID:       CMD_NULL_DATA
    870     Desc:     This command specifies the contents of the Null data template
    871               stored in the WiLink.
    872     Params:   PktTemplate_t - see below.
    873 
    874 ******************************************************************************/
    875 
    876 /******************************************************************************
    877 
    878     ID:       CMD_PROBE_REQ
    879     Desc:     This command specifies the contents of the probe request template
    880               stored in the WiLink.
    881     Params:   PktTemplate_t - see below.
    882 
    883 ******************************************************************************/
    884 
    885 /******************************************************************************
    886 
    887     ID:       CMD_PS_POLL
    888     Desc:     This command specifies the contents of the PS-poll template
    889               stored in the WiLink.
    890     Params:   PktTemplate_t - see below.
    891 
    892 ******************************************************************************/
    893 
    894 
    895 /******************************************************************************
    896 
    897     ID:       CMD_QOS_NULL_DATA
    898     Desc:     This command specifies the contents of the QOS-Null template
    899               stored in the WiLink.
    900     Params:   PktTemplate_t - see below.
    901 
    902 ******************************************************************************/
    903 /* Template command data structure.*/
    904 typedef enum
    905 {
    906     TEMPLATE_NULL_DATA = 0,
    907     TEMPLATE_BEACON,
    908     CFG_TEMPLATE_PROBE_REQ_2_4,
    909     CFG_TEMPLATE_PROBE_REQ_5,
    910     TEMPLATE_PROBE_RESPONSE,
    911     TEMPLATE_QOS_NULL_DATA,
    912     TEMPLATE_PS_POLL,
    913     TEMPLATE_KLV,
    914 	TEMPLATE_DISCONNECT,
    915     TEMPLATE_PROBE_REQ_2_4, /*for firmware internal use only*/
    916     TEMPLATE_PROBE_REQ_5, /*for firmware internal use only*/
    917 	TEMPLATE_BAR, /*for firmware internal use only*/
    918     TEMPLATE_CTS, /* For CTS-to-self (FastCTS) mechanism for BT/WLAN coexistence (SoftGemini). */
    919 
    920     MAX_NUM_OF_TEMPLATES = 0xff
    921 } TemplateType_enum;
    922 
    923 #ifdef HOST_COMPILE
    924 typedef uint8 TemplateType_e;
    925 #else
    926 typedef TemplateType_enum TemplateType_e;
    927 #endif
    928 
    929 #define MAX_TEMPLATES_SIZE 252  /* according to max size of FW memblock */
    930 #define RATE_MASK_UNSPECIFIED   0    /* Let the FW select the rates mask internally */
    931 
    932 /*
    933 aflag definition:
    934 bit field       description
    935 =========       ===========
    936 0               Truncate - If set, then attempts to send a frame stop when the total
    937                 valid per-rate attempts have been exhausted;
    938                 otherwise transmissions will continue at the lowest available rate
    939                 until the appropriate one of the Short Retry Limit, Long Retry Limit,
    940                 dot11MaxTransmitMsduLifetime, or MAX TX Life Time (in ACXTIDConfig),
    941                 if supported and supplied, is exhausted.
    942 1               Preamble Override - Indicates if the preamble type should be used in TX.
    943 2               Preamble Type - The type of the preamble to be used by the policy.
    944                 0 - long preamble,
    945                 1 - short preamble.
    946 3-7             Reserved
    947 */
    948 
    949 /* definition of single rate policy*/
    950 typedef struct
    951 {
    952 
    953     uint32              enabledRates;  				  /* A Bit Mask which indicates which Rates are enabled */
    954                                                       /* The rates bitmap is defined in EHwBitRate. */
    955                                                       /* If set to RATE_MASK_UNSPECIFIED, the FW sets it internally */
    956 
    957     uint8               shortRetryLimit;              /* The dot11ShortRetryLimit used */
    958                                                       /* for Tx retries.*/
    959 
    960     uint8               longRetryLimit;               /* The dot11LongRetryLimit used */
    961                                                       /* for Tx retries.  */
    962 
    963     uint8               aflags;                       /* Flags controlling attributes */
    964                                                       /* of the transmission. */
    965                                                       /* see above description for the */
    966                                                       /* structure of this field.*/
    967 
    968     uint8               reserved;
    969 }txAttrClass_t;
    970 
    971 /* Template command data structure.*/
    972 typedef struct
    973 {
    974     uint16 len;
    975     TemplateType_e templateType;
    976     uint8 index;    /* relevant only for KLV_TEMPLATE type */
    977     txAttrClass_t templateTxAttribute;
    978     uint8  templateStart[MAX_TEMPLATES_SIZE];
    979 } PktTemplate_t;
    980 
    981 
    982 /******************************************************************************
    983 
    984     ID:       CMD_NOISE_HIST
    985     Desc:     This command starts/stops the noise histogram measurements.
    986     Params:   NoiseHistRequest_t - see below.
    987 
    988 ******************************************************************************/
    989 #define NOISE_HIST_LEN 8
    990 
    991 typedef enum
    992 {
    993     NOISE_HIST_STOP,
    994     NOISE_HIST_START,
    995     NOISE_HIST_INVALID = MAX_POSITIVE16 /* Force to be 16 bits enum*/
    996 } NoiseHistMode_enum;
    997 
    998 #ifdef HOST_COMPILE
    999 typedef uint16 NoiseHistMode_e;
   1000 #else
   1001 typedef NoiseHistMode_enum NoiseHistMode_e;
   1002 #endif
   1003 
   1004 typedef struct
   1005 {
   1006     NoiseHistMode_e mode;             /* Start or stop the FW engine. */
   1007                                       /* Possible values are 1 (Start) and 0 (Stop).*/
   1008 
   1009     uint16 sampleIntervalUSec;        /* The time interval in usec between measurements.*/
   1010                                       /* Valid values are between 100us (default) and */
   1011                                       /* 2ms (with 100us jumps). This parameter is */
   1012                                       /* relevant only when Mode is Start (1).*/
   1013 
   1014     uint8  thresholds[NOISE_HIST_LEN];/* An array of eight 8 bit thresholds. The FW */
   1015                                       /* takes noise measurements, once every */
   1016                                       /* SampleIntervalUSec interval. If the measured */
   1017                                       /* noise level is between the threshold[X] and */
   1018                                       /* threshold[X 1], then the FW increments the */
   1019                                       /* noise histogram counter[X]. */
   1020                                       /* The counters are read via the */
   1021                                       /* ACXNoiseHistogramResults IE. This parameter is */
   1022                                       /* relevant only when Mode is Start (1).*/
   1023 } NoiseHistRequest_t;
   1024 
   1025 
   1026 /******************************************************************************
   1027 
   1028     ID:       CMD_LNA_CONTROL
   1029     Desc:     This command controls the LNA state.
   1030     Params:   LNAControl_t - see below.
   1031 
   1032 ******************************************************************************/
   1033 
   1034 typedef enum
   1035 {
   1036     LNA_MODE_MANUAL,    /* 0: The LNA is set to manual mode and is turned off.*/
   1037     LNA_MODE_AUTO,      /* 1: The LNA is set to automatic mode.*/
   1038     LNA_MODE_INVALID = 0xFF
   1039 } LnaMode_enum;
   1040 
   1041 #ifdef HOST_COMPILE
   1042 typedef uint8 LnaMode_e;
   1043 #else
   1044 typedef LnaMode_enum LnaMode_e;
   1045 #endif
   1046 
   1047 typedef struct
   1048 {
   1049     LnaMode_e LNAControlField; /* refer to LnaMode_enum*/
   1050     uint8     padding[3];      /* for alignment to 32 bits boundry*/
   1051 } LNAControl_t;
   1052 
   1053 
   1054 /******************************************************************************
   1055 
   1056     ID:       CMD_MEASUREMENT
   1057     Desc:     This command instructs the WiLink device to begin a basic channel
   1058               load measurement on the specified channel. When the measurement
   1059               process actually starts running the WilLink device will raise the
   1060               Measurement Started event. When the measurement process completes as
   1061               a result of the end of the measurement duration or a STOP_MEASUREMENT
   1062               command, the WilLink device will raise a Measurement Complete event.
   1063     Params:   MeasurementParameters_t - see below.
   1064 
   1065 ******************************************************************************/
   1066 typedef struct
   1067 {
   1068     ACXRxConfigStruct rxFilter; /* This field is the Rx filter configuration for the */
   1069                                 /* device while the measurement process is running. */
   1070                                 /* When the process ends the previous Rx filter */
   1071                                 /* configuration is reset. The filter configuration is*/
   1072                                 /* composed of two 32 bit registers. When they are set*/
   1073                                 /* to 0xFFFFFFFF the Rx filter configuration is not*/
   1074                                 /* changed.*/
   1075 
   1076     uint32 duration;            /* Specifies the measurement process duration in */
   1077                                 /* microseconds. The value of 0 means infinite duration*/
   1078                                 /* in which only a STOP_MEASUREMENT command can*/
   1079                                 /* stop the measurement process.*/
   1080 
   1081     Channel_e channel;          /* Channel number on which the measurement is performed,*/
   1082                                 /* valid range 0-255 (1-14 for 802.11b).*/
   1083 
   1084     RadioBand_e band;           /* Specifies the band to which the channel belongs. */
   1085                                 /* 0 - 2.4GHz */
   1086                                 /* 1 - 5GHz , */
   1087                                 /* 0xFF - Current band.*/
   1088 
   1089     uint8 scanTag;              /* results tag */
   1090 
   1091     uint8 padding[1];           /* for alignment to 32 bits boundry*/
   1092 } MeasurementParameters_t;
   1093 
   1094 /******************************************************************************
   1095 
   1096     ID:       CMD_STOP_MEASUREMENT
   1097     Desc:     This command instructs the WiLink to terminate any measurement in
   1098               progress. After processing this command, the WiLink returns to its
   1099               previous state (the state before the measurement was started) and
   1100               generates the Measurment Complete event.
   1101     Params:   None.
   1102 
   1103 ******************************************************************************/
   1104 
   1105 /******************************************************************************
   1106 
   1107     ID:       CMD_DISCONNECT
   1108     Desc:     This command instructs the WiLink device to stop all BSS or IBSS activity.
   1109               The device will cancel all of its TSF dependent events and activities.
   1110               Power Save dependent activities are an exception to this, therefore
   1111               the host must exit Power Save mode by issuing the SET_PS_MODE command
   1112               before calling this command. When this command is complete the Disconnect
   1113               Complete event is raised to the host and the WiLink device is allowed
   1114               to enter the configured low power state.
   1115     Params:   DisconnectParameters_t - see below.
   1116 
   1117 ******************************************************************************/
   1118 
   1119 typedef enum
   1120 {
   1121     DISCONNECT_IMMEDIATE,    /* Disconnect without sending any frame */
   1122     DISCONNECT_DE_AUTH,      /* Send deauthentication frame upon disconnecting */
   1123     DISCONNECT_DIS_ASSOC     /* Send disassociation frame upon disconnecting */
   1124 } DisconnectType_enum;
   1125 
   1126 #ifdef HOST_COMPILE
   1127 typedef uint8 DisconnectType_e;
   1128 #else
   1129 typedef DisconnectType_enum DisconnectType_e;
   1130 #endif
   1131 
   1132 
   1133 
   1134 typedef struct
   1135 {
   1136     ACXRxConfigStruct rxFilter;
   1137     uint16 disconnectReason;
   1138     DisconnectType_e   disconnectType;
   1139     uint8 padding[1];  /* for alignment to 32 bits boundry */
   1140 } DisconnectParameters_t;
   1141 
   1142 
   1143 
   1144 
   1145 /******************************************************************************
   1146 
   1147     ID:       CMD_SET_PS_MODE
   1148     Desc:     This command turns ON/OFF Power save protocol on the WiLink.
   1149               After HW configuration, FW sends Null data packet to the AP with Power
   1150               Management bit set accordingly to the field "Mode" of this command
   1151               structure. After processing this command, the FW generates the
   1152               PS_COMPLETE event.
   1153     Params:   PSModeParameters_t - see below.
   1154 
   1155 ******************************************************************************/
   1156 
   1157 typedef enum
   1158 {
   1159     STATION_ACTIVE_MODE,
   1160     STATION_POWER_SAVE_MODE
   1161 } StationPSMode_enum;
   1162 
   1163 #ifdef HOST_COMPILE
   1164 typedef uint8 StationPowerSaveMode_e;
   1165 #else
   1166 typedef StationPSMode_enum StationPowerSaveMode_e;
   1167 #endif
   1168 
   1169 
   1170 typedef struct
   1171 {
   1172     StationPowerSaveMode_e mode;         /* This field specifies the future Power save*/
   1173                                          /* protocol mode of the system. */
   1174                                          /* When set, Power save protocol is enabled. */
   1175                                          /* When cleared, Power save protocol is */
   1176                                          /* disabled (refer to StationPSMode_enum).*/
   1177 
   1178     uint8                  needToSendNullData;
   1179     uint8 numberOfRetries;               /* This field specifies the maximum allowed */
   1180                                          /* number of retries of the Null data packet */
   1181                                          /* that FW will send after switching the */
   1182                                          /* Power Save Protocol mode.*/
   1183 
   1184     uint8 hangOverPeriod;                /* This field specifies the hangover period, */
   1185                                          /* which is the time in TUs during which the */
   1186                                          /* WiLink remains awake after sending an MPDU */
   1187                                          /* with the Power Save bit set, indicating that*/
   1188                                          /* the station is to go into Power Save mode. */
   1189                                          /* Setting bit 0 does not affect the hangover */
   1190                                          /* period.*/
   1191 
   1192     EHwRateBitFiled rateToTransmitNullData; /* This EHwBitRate format field specifies the rate and */
   1193                                          /* modulation to transmit the Null data packet*/
   1194 	                                     /* to the AP. */
   1195 
   1196 } PSModeParameters_t;
   1197 
   1198 /******************************************************************************
   1199 
   1200     ID:       CMD_CHANNEL_SWITCH
   1201     Desc:     This command instructs the WiLink to switch serving channel at the given
   1202               time. Once the channel switch is performed, the Channel Switch Complete
   1203               event is raised to the host.
   1204     Params:   ChannelSwitchParameters_t - see below.
   1205 
   1206 ******************************************************************************/
   1207 typedef struct
   1208 {
   1209     Channel_e channel;  /* The new serving channel.*/
   1210     uint8 switchTime;   /* Relative time of the serving channel switch in TBTT units.*/
   1211     Bool_e txSuspend;   /* 1: Suspend TX till switch time; */
   1212                         /* 0: Do not suspend TX*/
   1213     Bool_e flush;       /* 1: Flush TX at switch time; */
   1214                         /* 0: Do not flush*/
   1215 
   1216 } ChannelSwitchParameters_t;
   1217 
   1218 /******************************************************************************
   1219 
   1220     ID:       CMD_STOP_CHANNEL_SWICTH
   1221     Desc:     This command instructs the WiLink device to cancel performing a
   1222               pending channel switch event command.
   1223     Params:   None.
   1224 
   1225 ******************************************************************************/
   1226 
   1227 /******************************************************************************
   1228 
   1229     ID:       CMD_AP_DISCOVERY
   1230     Desc:     This command instructs the WiLink device to perform an AP discovery
   1231               measurement on a single channel. This command can only be issued after
   1232               a measurement process has been started by the WiLink device as a result
   1233               of a previous Measurement command. The Measurement command specifies the
   1234               channel on which the AP discovery is performed. Once the "AP discovery"
   1235               measurement is completed either by a STOP_AP_DISCOVERY command or when
   1236               the duration has expired, it will send an "AP discovery complete event"
   1237               to the host.
   1238     Params:   ApDiscoveryParameters_t - see below.
   1239 
   1240 ******************************************************************************/
   1241 
   1242 
   1243 typedef struct
   1244 {
   1245     ACXRxConfigStruct rxFilter; /* This field is the Rx filter configuration for the */
   1246                                 /* device while the AP Discovery process is running. */
   1247                                 /* When the process ends the previous Rx filter */
   1248                                 /* configuration is reset. The filter configuration is*/
   1249                                 /* composed of two 32 bit registers. When they are set */
   1250                                 /* to 0xFFFFFFFF the Rx filter configuration is not */
   1251                                 /* changed.*/
   1252 
   1253     uint32 scanDuration;        /* This field specifies the amount of time, in time*/
   1254                                 /* units (TUs), to perform the AP discovery. The value*/
   1255                                 /* can range from 0 to 65535 TUs (67.1 seconds). */
   1256 
   1257     uint16 scanOptions;         /* This field specifies whether the AP discovery is */
   1258                                 /* performed by an active scan or a passive scan. */
   1259                                 /* 0 - ACTIVE, 1 - PASSIVE.*/
   1260 
   1261     uint8  numOfProbRqst;       /* This field indicates the number of probe requests to*/
   1262                                 /* send per channel, when active scan is specified. */
   1263                                 /* Note: for XCC measurement this value should be set */
   1264                                 /*       to 1.*/
   1265 
   1266     uint8 txPowerAttenuation;   /* TX power level to be used for sending probe requests*/
   1267                                 /* when active scan is specified. */
   1268                                 /* If 0, leave normal TX power level for this channel. */
   1269 
   1270     EHwRateBitFiled txdRateSet; /* This EHwBitRate format field specifies the rate and modulation*/
   1271                                 /* to transmit the probe request when an active scan is*/
   1272 	                            /* specified. */
   1273 
   1274 } ApDiscoveryParameters_t;
   1275 
   1276 /******************************************************************************
   1277 
   1278     ID:       CMD_STOP_AP_DISCOVERY
   1279     Desc:     This command instructs the WiLink to terminate the AP Discovery
   1280               measurement in progress. After processing this command, the WiLink
   1281               returns to its previous state  and generates the AP Discovery Complete
   1282               Event.
   1283     Params:   None.
   1284 
   1285 ******************************************************************************/
   1286 
   1287 /******************************************************************************
   1288 
   1289     ID:       CMD_SPS_SCAN
   1290     Desc:     This command instructs the WiLink to perform a scheduled passive
   1291               scan for BSS/IBSSs. The WiLink monitors the specified channel(s)
   1292               for beacons. The WiLink sends Scheduled Scan Complete event to notify
   1293               the host when it has completed a scan.
   1294     Params:   InfoElement_t - see below.
   1295 
   1296 ******************************************************************************/
   1297 /* Scheduled - General scan parameters.*/
   1298 typedef struct
   1299 {
   1300     ACXRxConfigStruct rxCfg;         /* Rx filter to be used for each channel scan. */
   1301                                      /* The BSSID filter enable will be set (by the scan*/
   1302                                      /* process) to ON for a specific channel if the*/
   1303                                      /* BSSID of this channel is a unicast address. */
   1304                                      /* Otherwise it will be set to OFF (Refer to */
   1305                                      /* ACXRxConfigStruct).*/
   1306 
   1307     uint32            scanCmdTime_h; /* This filed is the latest 32 MSBits of TSF known*/
   1308                                      /* at the time the SPS command was issued. When the*/
   1309                                      /* scan process is about to begin, this value is */
   1310                                      /* used to determine if the AP has performed a */
   1311                                      /* recovery by comparing this value to the current*/
   1312                                      /* TSF. (An AP that has performed a recovery should*/
   1313                                      /* have a lower TSF then the one that was saved).*/
   1314 
   1315     uint32            scanCmdTime_l; /* This filed is the latest 32 LSBits of TSF known*/
   1316                                      /* at the time the SPS command was issued. */
   1317 
   1318     uint16            scanOptions;   /* This bitwise field indicates the scan options. */
   1319                                      /* 0 - ACTIVE, 1 - PASSIVE.*/
   1320 
   1321     uint8             numChannels;   /* Number of scan channels in the list (minimum */
   1322                                      /* (minimumis 1, maximum is 30).*/
   1323 
   1324     RadioBand_e       band;          /* Band to scan */
   1325     uint8             scanTag;       /* results tag */
   1326 } ScheduledGeneralParameters_t;
   1327 
   1328 
   1329 /* Scheduled - Per-Channel scan parameters.*/
   1330 typedef struct
   1331 {
   1332     uint32 scanStartTime;      /* Duration in microseconds of the scan on this channel */
   1333                                /* (Scan could be aborted before this duration in case of*/
   1334                                /* early termination condition met on the channel). */
   1335 
   1336     uint32 scanMaxDuration;    /* Lower 4 bytes of TSF time in microseconds when the */
   1337                                /* scan should start listening on the desired channel. */
   1338 
   1339     uint32 bssIdL;             /* 32 LSBits of BSSID of the AP to scan for. If scanning */
   1340                                /* on this  channel any BSSID, this field shall be set */
   1341                                /* to broadcast BSSID. */
   1342 
   1343     uint16 bssIdH;             /* 16 MSBits of BSSID of the AP to scan for. */
   1344 
   1345     ETCondCount_t ETCondCount; /* bit 0-3: Early Termination count - This field */
   1346                                /*          defines the maximum number of beacons*/
   1347                                /*          or probe responses or both (according*/
   1348                                /*          to condition) to collect before ending*/
   1349                                /*          a scan.*/
   1350 
   1351                                /* Bit 4-5: Early Termination Condition (refer */
   1352                                /*          to ETCondition_enum).*/
   1353     Channel_e     channel;     /* Channel number to scan, valid range 0-255 */
   1354                                /* (1-14 for 802.11b).*/
   1355 } ScheduledChannelParameters_t;
   1356 
   1357 
   1358 /* The Scheduled Scan command structure.*/
   1359 typedef struct
   1360 {
   1361     ScheduledGeneralParameters_t scheduledGeneralParameters;
   1362     ScheduledChannelParameters_t scheduledChannelParameters[SCAN_MAX_NUM_OF_CHANNELS];
   1363 } ScheduledScanParameters_t;
   1364 
   1365 /******************************************************************************
   1366 
   1367     ID:       CMD_STOP_SPS_SCAN
   1368     Desc:     This command instructs the WiLink to terminate a currently running
   1369               SPS or a pending SPS.. After processing this command, the WiLink
   1370               returns to its previous state and generates the Scheduled Scan
   1371               Complete Event.
   1372     Params:   None.
   1373 
   1374 ******************************************************************************/
   1375 
   1376 /******************************************************************************
   1377 
   1378     ID:       CMD_HEALTH_CHECK
   1379     Desc:     This command instructs the WiLink to raise a MAC status event
   1380               which contains the current FCS Error counter.
   1381     Params:   None.
   1382 
   1383 ******************************************************************************/
   1384 
   1385 /******************************************************************************
   1386 
   1387     ID:       CMD_DEBUG
   1388     Desc:
   1389     Params:   debugCommnad_t - see below.
   1390 
   1391 ******************************************************************************/
   1392 #define MAX_DEBUG_PARAMETERS 10
   1393 
   1394 typedef struct
   1395 {
   1396     uint32  id;
   1397     uint32  params[MAX_DEBUG_PARAMETERS];
   1398 } debugCommnad_t;
   1399 
   1400 
   1401 /******************************************************************************
   1402 
   1403     ID:       CMD_CONNECTION_SCAN_CFG
   1404     Desc:     This command configures the periodic connection scan feature
   1405     Params:   ConnectionScanParameters_t followed by active and passive channel
   1406               lists (variable size structure)
   1407 
   1408 ******************************************************************************/
   1409 
   1410 typedef enum
   1411 {
   1412     BSS_INDEPENDENT                     = 0,
   1413     BSS_INFRASTRUCTURE                  = 1,
   1414     BSS_ANY                             = 2,
   1415     BSS_MAX = 0xFF
   1416 } ScanBssType_enum;
   1417 
   1418 #ifdef HOST_COMPILE
   1419 typedef uint8 ScanBssType_e;
   1420 #else
   1421 typedef ScanBssType_enum ScanBssType_e;
   1422 #endif
   1423 
   1424 typedef enum
   1425 {
   1426     SCAN_SSID_FILTER_TYPE_ANY = 0,
   1427     SCAN_SSID_FILTER_TYPE_SPECIFIC = 1,
   1428     SCAN_SSID_FILTER_TYPE_LIST = 2,
   1429     SCAN_SSID_FILTER_TYPE_LIST_FILTER_DISABLED = 3,
   1430     MAX_SCAN_SSID_FILTER_TYPE = 0xFF
   1431 } ScanSsidFilterType_enum;
   1432 
   1433 #ifdef HOST_COMPILE
   1434 typedef uint8 ScanSsidFilterType_e;
   1435 #else
   1436 typedef ScanSsidFilterType_enum ScanSsidFilterType_e;
   1437 #endif
   1438 
   1439 #define CONN_SCAN_MAX_CHANNELS_BG  14
   1440 #define CONN_SCAN_MAX_CHANNELS_J    4
   1441 #define CONN_SCAN_MAX_CHANNELS_A   23
   1442 #define CONN_SCAN_MAX_CHANNELS_ALL_BANDS        ((CONN_SCAN_MAX_CHANNELS_BG) + (CONN_SCAN_MAX_CHANNELS_A) + (CONN_SCAN_MAX_CHANNELS_J))
   1443 #define CONN_SCAN_MAX_NUM_OF_CYCLES_INTERVALS   (16)        /* Maximum number of configured inter-cycle intervals */
   1444 
   1445 #define CONN_SCAN_MAX_BAND                      (3)         /* Maximum number of bands in scan configuration */
   1446 
   1447 #define CONN_SCAN_DFS_CANDIDATE_CHANNEL     BIT_0
   1448 #define CONN_SCAN_DFS_ENABLED_CHANNEL       BIT_1
   1449 
   1450 typedef struct
   1451 {
   1452     uint16       scanMinDuration;     /* Min duration (in ms)*/
   1453     uint16       scanMaxDuration;     /* Max duration (in ms)*/
   1454     uint16       passiveScanDuration; /* Duration to use for passive scans (in ms)*/
   1455     uint8        channel;             /* channel number (channel_e) */
   1456     uint8        txPowerLevelDbm;    /* TX power level in dbm */
   1457     uint8        channelFlags;        /* BIT 0: DFS channel */
   1458                                       /* BIT 1: DFS enabled (to be included in active scan) */
   1459     uint8        padding[3];
   1460 } ConnScanChannelInfo_t;
   1461 
   1462 typedef struct
   1463 {
   1464     uint32                  cycleIntervals[CONN_SCAN_MAX_NUM_OF_CYCLES_INTERVALS];      /* Intervals between each scan cycle */
   1465     int8                    rssiThreshold;          /* RSSI threshold */
   1466     int8                    snrThreshold;           /* SNR threshold */
   1467     uint8                   maxNumOfCycles;         /* number of cycles to run */
   1468     uint8                   reportThreshold;        /* Report after N results are received */
   1469     uint8                   terminateOnReport;      /* Terminate after report */
   1470     uint8                   resultsTag;             /* Tag for filtered scan results */
   1471     ScanBssType_e           bssType;                /* BSS type to filter (0 - Infra, 1 - IBSS, 2 - Any) */
   1472     ScanSsidFilterType_e    ssidFilterType;         /* SSID filter Type (0 - Any, 1 - specified in command, 2 - use SSID list, 3 - use SSID list no filter) */
   1473     uint8                   ssidLength;             /* SSID Length (if ssidType is specified in command) */
   1474     uint8                   ssid[32];               /* SSID (if ssidType is specified in command) */
   1475     uint8                   numProbe;               /* Number of probe requests to transmit per (hidden) SSID per channel */
   1476 
   1477     uint8                   numOfPassive[CONN_SCAN_MAX_BAND];
   1478     uint8                   numOfActive[CONN_SCAN_MAX_BAND];
   1479     uint8                   numOfDfs;
   1480     uint8                   padding[ 3 ];
   1481     ConnScanChannelInfo_t   channelList[CONN_SCAN_MAX_CHANNELS_ALL_BANDS];
   1482 } ConnScanParameters_t;
   1483 
   1484 /******************************************************************************
   1485 
   1486     ID:       CMD_CONNECTION_SCAN_SSID_CFG
   1487     Desc:     This command configures the SSID filter list to be used in the
   1488               periodic connection scan
   1489     Params:   None.
   1490 
   1491 ******************************************************************************/
   1492 
   1493 #define CONN_SCAN_MAX_NUMBER_OF_SSID_ENTRIES        (8)
   1494 
   1495 typedef enum
   1496 {
   1497     SCAN_SSID_TYPE_PUBLIC = 0,
   1498     SCAN_SSID_TYPE_HIDDEN = 1,
   1499     MAX_SCAN_SSID_TYPE = 0xFF
   1500 } ScanSsidType_enum;
   1501 
   1502 #ifdef HOST_COMPILE
   1503 typedef uint8 ScanSsidType_e;
   1504 #else
   1505 typedef ScanSsidType_enum ScanSsidType_e;
   1506 #endif
   1507 
   1508 typedef struct
   1509 {
   1510     ScanSsidType_e      ssidType;
   1511     uint8               ssidLength;
   1512     uint8               ssid[32];
   1513 } ConnScanSSID_t;
   1514 
   1515 
   1516 typedef struct
   1517 {
   1518     uint8               numOfSSIDEntries;
   1519     ConnScanSSID_t      SSIDList[CONN_SCAN_MAX_NUMBER_OF_SSID_ENTRIES];
   1520 } ConnScanSSIDList_t;
   1521 
   1522 
   1523 /******************************************************************************
   1524 
   1525     ID:       CMD_START_PERIODIC_SCAN
   1526     Desc:     This command instructs the WiLink to start a periodic scan
   1527               process (either connection-scan or discovery)
   1528     Params:   None.
   1529 
   1530 ******************************************************************************/
   1531 
   1532 typedef struct
   1533 {
   1534     uint8   scanTag;
   1535     uint8   uReserved[3];
   1536 } PeriodicScanTag;
   1537 
   1538 /******************************************************************************
   1539 
   1540     ID:       CMD_STOP_PERIODIC_SCAN
   1541     Desc:     This command instructs the WiLink to stop a periodic scan
   1542               process (either connection-scan or discovery)
   1543     Params:   None.
   1544 
   1545 ******************************************************************************/
   1546 
   1547 /******************************************************************************
   1548 
   1549     ID:       CMD_SET_STATUS
   1550     Desc:     This command instructs the station state
   1551     Params:   None.
   1552 
   1553 ******************************************************************************/
   1554 
   1555 #define STA_STATE_CONNECTED 1
   1556 
   1557 typedef struct
   1558 {
   1559     uint8   staState;
   1560     uint8   pad[3];
   1561 } SetStaState_t;
   1562 
   1563 /* PLT public definitions*/
   1564 #define TEST_CONTINUOUS 0x04       /* transmit frames contimuously */
   1565 
   1566 
   1567 /*This typedef corresponds to the Fig 1 Frame Format for PER test given in PER test doc.*/
   1568 #define PER_MODE_TX 1
   1569 #define PER_MODE_RX 2
   1570 #define INFRA   0x2         /* BSS is in Infrastructure mode */
   1571 #define LOCAL_MEM_LAST      0x02000000
   1572 #define PBCC_MODULATION_MASK 0x80
   1573 #define OFDM_MODULATION_MASK 0x40
   1574 #define BAND_SELECT_5GHZ     0x10
   1575 #define CTL_PREAMBLE         0x01
   1576 
   1577 
   1578 
   1579 #endif /* PUBLIC_COMMANDS_H*/
   1580