• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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     TEMPLATE_ARP_RSP, /* Template for Automatic ARP reply by FW */
920 
921     MAX_NUM_OF_TEMPLATES = 0xff
922 } TemplateType_enum;
923 
924 #ifdef HOST_COMPILE
925 typedef uint8 TemplateType_e;
926 #else
927 typedef TemplateType_enum TemplateType_e;
928 #endif
929 
930 #define MAX_TEMPLATES_SIZE 252  /* according to max size of FW memblock */
931 #define RATE_MASK_UNSPECIFIED   0    /* Let the FW select the rates mask internally */
932 
933 /*
934 aflag definition:
935 bit field       description
936 =========       ===========
937 0               Truncate - If set, then attempts to send a frame stop when the total
938                 valid per-rate attempts have been exhausted;
939                 otherwise transmissions will continue at the lowest available rate
940                 until the appropriate one of the Short Retry Limit, Long Retry Limit,
941                 dot11MaxTransmitMsduLifetime, or MAX TX Life Time (in ACXTIDConfig),
942                 if supported and supplied, is exhausted.
943 1               Preamble Override - Indicates if the preamble type should be used in TX.
944 2               Preamble Type - The type of the preamble to be used by the policy.
945                 0 - long preamble,
946                 1 - short preamble.
947 3-7             Reserved
948 */
949 
950 /* definition of single rate policy*/
951 typedef struct
952 {
953 
954     uint32              enabledRates;  				  /* A Bit Mask which indicates which Rates are enabled */
955                                                       /* The rates bitmap is defined in EHwBitRate. */
956                                                       /* If set to RATE_MASK_UNSPECIFIED, the FW sets it internally */
957 
958     uint8               shortRetryLimit;              /* The dot11ShortRetryLimit used */
959                                                       /* for Tx retries.*/
960 
961     uint8               longRetryLimit;               /* The dot11LongRetryLimit used */
962                                                       /* for Tx retries.  */
963 
964     uint8               aflags;                       /* Flags controlling attributes */
965                                                       /* of the transmission. */
966                                                       /* see above description for the */
967                                                       /* structure of this field.*/
968 
969     uint8               reserved;
970 }txAttrClass_t;
971 
972 /* Template command data structure.*/
973 typedef struct
974 {
975     uint16 len;
976     TemplateType_e templateType;
977     uint8 index;    /* relevant only for KLV_TEMPLATE type */
978     txAttrClass_t templateTxAttribute;
979     uint8  templateStart[MAX_TEMPLATES_SIZE];
980 } PktTemplate_t;
981 
982 
983 /******************************************************************************
984 
985     ID:       CMD_NOISE_HIST
986     Desc:     This command starts/stops the noise histogram measurements.
987     Params:   NoiseHistRequest_t - see below.
988 
989 ******************************************************************************/
990 #define NOISE_HIST_LEN 8
991 
992 typedef enum
993 {
994     NOISE_HIST_STOP,
995     NOISE_HIST_START,
996     NOISE_HIST_INVALID = MAX_POSITIVE16 /* Force to be 16 bits enum*/
997 } NoiseHistMode_enum;
998 
999 #ifdef HOST_COMPILE
1000 typedef uint16 NoiseHistMode_e;
1001 #else
1002 typedef NoiseHistMode_enum NoiseHistMode_e;
1003 #endif
1004 
1005 typedef struct
1006 {
1007     NoiseHistMode_e mode;             /* Start or stop the FW engine. */
1008                                       /* Possible values are 1 (Start) and 0 (Stop).*/
1009 
1010     uint16 sampleIntervalUSec;        /* The time interval in usec between measurements.*/
1011                                       /* Valid values are between 100us (default) and */
1012                                       /* 2ms (with 100us jumps). This parameter is */
1013                                       /* relevant only when Mode is Start (1).*/
1014 
1015     uint8  thresholds[NOISE_HIST_LEN];/* An array of eight 8 bit thresholds. The FW */
1016                                       /* takes noise measurements, once every */
1017                                       /* SampleIntervalUSec interval. If the measured */
1018                                       /* noise level is between the threshold[X] and */
1019                                       /* threshold[X 1], then the FW increments the */
1020                                       /* noise histogram counter[X]. */
1021                                       /* The counters are read via the */
1022                                       /* ACXNoiseHistogramResults IE. This parameter is */
1023                                       /* relevant only when Mode is Start (1).*/
1024 } NoiseHistRequest_t;
1025 
1026 
1027 /******************************************************************************
1028 
1029     ID:       CMD_LNA_CONTROL
1030     Desc:     This command controls the LNA state.
1031     Params:   LNAControl_t - see below.
1032 
1033 ******************************************************************************/
1034 
1035 typedef enum
1036 {
1037     LNA_MODE_MANUAL,    /* 0: The LNA is set to manual mode and is turned off.*/
1038     LNA_MODE_AUTO,      /* 1: The LNA is set to automatic mode.*/
1039     LNA_MODE_INVALID = 0xFF
1040 } LnaMode_enum;
1041 
1042 #ifdef HOST_COMPILE
1043 typedef uint8 LnaMode_e;
1044 #else
1045 typedef LnaMode_enum LnaMode_e;
1046 #endif
1047 
1048 typedef struct
1049 {
1050     LnaMode_e LNAControlField; /* refer to LnaMode_enum*/
1051     uint8     padding[3];      /* for alignment to 32 bits boundry*/
1052 } LNAControl_t;
1053 
1054 
1055 /******************************************************************************
1056 
1057     ID:       CMD_MEASUREMENT
1058     Desc:     This command instructs the WiLink device to begin a basic channel
1059               load measurement on the specified channel. When the measurement
1060               process actually starts running the WilLink device will raise the
1061               Measurement Started event. When the measurement process completes as
1062               a result of the end of the measurement duration or a STOP_MEASUREMENT
1063               command, the WilLink device will raise a Measurement Complete event.
1064     Params:   MeasurementParameters_t - see below.
1065 
1066 ******************************************************************************/
1067 typedef struct
1068 {
1069     ACXRxConfigStruct rxFilter; /* This field is the Rx filter configuration for the */
1070                                 /* device while the measurement process is running. */
1071                                 /* When the process ends the previous Rx filter */
1072                                 /* configuration is reset. The filter configuration is*/
1073                                 /* composed of two 32 bit registers. When they are set*/
1074                                 /* to 0xFFFFFFFF the Rx filter configuration is not*/
1075                                 /* changed.*/
1076 
1077     uint32 duration;            /* Specifies the measurement process duration in */
1078                                 /* microseconds. The value of 0 means infinite duration*/
1079                                 /* in which only a STOP_MEASUREMENT command can*/
1080                                 /* stop the measurement process.*/
1081 
1082     Channel_e channel;          /* Channel number on which the measurement is performed,*/
1083                                 /* valid range 0-255 (1-14 for 802.11b).*/
1084 
1085     RadioBand_e band;           /* Specifies the band to which the channel belongs. */
1086                                 /* 0 - 2.4GHz */
1087                                 /* 1 - 5GHz , */
1088                                 /* 0xFF - Current band.*/
1089 
1090     uint8 scanTag;              /* results tag */
1091 
1092     uint8 padding[1];           /* for alignment to 32 bits boundry*/
1093 } MeasurementParameters_t;
1094 
1095 /******************************************************************************
1096 
1097     ID:       CMD_STOP_MEASUREMENT
1098     Desc:     This command instructs the WiLink to terminate any measurement in
1099               progress. After processing this command, the WiLink returns to its
1100               previous state (the state before the measurement was started) and
1101               generates the Measurment Complete event.
1102     Params:   None.
1103 
1104 ******************************************************************************/
1105 
1106 /******************************************************************************
1107 
1108     ID:       CMD_DISCONNECT
1109     Desc:     This command instructs the WiLink device to stop all BSS or IBSS activity.
1110               The device will cancel all of its TSF dependent events and activities.
1111               Power Save dependent activities are an exception to this, therefore
1112               the host must exit Power Save mode by issuing the SET_PS_MODE command
1113               before calling this command. When this command is complete the Disconnect
1114               Complete event is raised to the host and the WiLink device is allowed
1115               to enter the configured low power state.
1116     Params:   DisconnectParameters_t - see below.
1117 
1118 ******************************************************************************/
1119 
1120 typedef enum
1121 {
1122     DISCONNECT_IMMEDIATE,    /* Disconnect without sending any frame */
1123     DISCONNECT_DE_AUTH,      /* Send deauthentication frame upon disconnecting */
1124     DISCONNECT_DIS_ASSOC     /* Send disassociation frame upon disconnecting */
1125 } DisconnectType_enum;
1126 
1127 #ifdef HOST_COMPILE
1128 typedef uint8 DisconnectType_e;
1129 #else
1130 typedef DisconnectType_enum DisconnectType_e;
1131 #endif
1132 
1133 
1134 
1135 typedef struct
1136 {
1137     ACXRxConfigStruct rxFilter;
1138     uint16 disconnectReason;
1139     DisconnectType_e   disconnectType;
1140     uint8 padding[1];  /* for alignment to 32 bits boundry */
1141 } DisconnectParameters_t;
1142 
1143 
1144 
1145 
1146 /******************************************************************************
1147 
1148     ID:       CMD_SET_PS_MODE
1149     Desc:     This command turns ON/OFF Power save protocol on the WiLink.
1150               After HW configuration, FW sends Null data packet to the AP with Power
1151               Management bit set accordingly to the field "Mode" of this command
1152               structure. After processing this command, the FW generates the
1153               PS_COMPLETE event.
1154     Params:   PSModeParameters_t - see below.
1155 
1156 ******************************************************************************/
1157 
1158 typedef enum
1159 {
1160     STATION_ACTIVE_MODE,
1161     STATION_POWER_SAVE_MODE
1162 } StationPSMode_enum;
1163 
1164 #ifdef HOST_COMPILE
1165 typedef uint8 StationPowerSaveMode_e;
1166 #else
1167 typedef StationPSMode_enum StationPowerSaveMode_e;
1168 #endif
1169 
1170 
1171 typedef struct
1172 {
1173     StationPowerSaveMode_e mode;         /* This field specifies the future Power save*/
1174                                          /* protocol mode of the system. */
1175                                          /* When set, Power save protocol is enabled. */
1176                                          /* When cleared, Power save protocol is */
1177                                          /* disabled (refer to StationPSMode_enum).*/
1178 
1179     uint8                  needToSendNullData;
1180     uint8 numberOfRetries;               /* This field specifies the maximum allowed */
1181                                          /* number of retries of the Null data packet */
1182                                          /* that FW will send after switching the */
1183                                          /* Power Save Protocol mode.*/
1184 
1185     uint8 hangOverPeriod;                /* This field specifies the hangover period, */
1186                                          /* which is the time in TUs during which the */
1187                                          /* WiLink remains awake after sending an MPDU */
1188                                          /* with the Power Save bit set, indicating that*/
1189                                          /* the station is to go into Power Save mode. */
1190                                          /* Setting bit 0 does not affect the hangover */
1191                                          /* period.*/
1192 
1193     EHwRateBitFiled rateToTransmitNullData; /* This EHwBitRate format field specifies the rate and */
1194                                          /* modulation to transmit the Null data packet*/
1195 	                                     /* to the AP. */
1196 
1197 } PSModeParameters_t;
1198 
1199 /******************************************************************************
1200 
1201     ID:       CMD_CHANNEL_SWITCH
1202     Desc:     This command instructs the WiLink to switch serving channel at the given
1203               time. Once the channel switch is performed, the Channel Switch Complete
1204               event is raised to the host.
1205     Params:   ChannelSwitchParameters_t - see below.
1206 
1207 ******************************************************************************/
1208 typedef struct
1209 {
1210     Channel_e channel;  /* The new serving channel.*/
1211     uint8 switchTime;   /* Relative time of the serving channel switch in TBTT units.*/
1212     Bool_e txSuspend;   /* 1: Suspend TX till switch time; */
1213                         /* 0: Do not suspend TX*/
1214     Bool_e flush;       /* 1: Flush TX at switch time; */
1215                         /* 0: Do not flush*/
1216 
1217 } ChannelSwitchParameters_t;
1218 
1219 /******************************************************************************
1220 
1221     ID:       CMD_STOP_CHANNEL_SWICTH
1222     Desc:     This command instructs the WiLink device to cancel performing a
1223               pending channel switch event command.
1224     Params:   None.
1225 
1226 ******************************************************************************/
1227 
1228 /******************************************************************************
1229 
1230     ID:       CMD_AP_DISCOVERY
1231     Desc:     This command instructs the WiLink device to perform an AP discovery
1232               measurement on a single channel. This command can only be issued after
1233               a measurement process has been started by the WiLink device as a result
1234               of a previous Measurement command. The Measurement command specifies the
1235               channel on which the AP discovery is performed. Once the "AP discovery"
1236               measurement is completed either by a STOP_AP_DISCOVERY command or when
1237               the duration has expired, it will send an "AP discovery complete event"
1238               to the host.
1239     Params:   ApDiscoveryParameters_t - see below.
1240 
1241 ******************************************************************************/
1242 
1243 
1244 typedef struct
1245 {
1246     ACXRxConfigStruct rxFilter; /* This field is the Rx filter configuration for the */
1247                                 /* device while the AP Discovery process is running. */
1248                                 /* When the process ends the previous Rx filter */
1249                                 /* configuration is reset. The filter configuration is*/
1250                                 /* composed of two 32 bit registers. When they are set */
1251                                 /* to 0xFFFFFFFF the Rx filter configuration is not */
1252                                 /* changed.*/
1253 
1254     uint32 scanDuration;        /* This field specifies the amount of time, in time*/
1255                                 /* units (TUs), to perform the AP discovery. The value*/
1256                                 /* can range from 0 to 65535 TUs (67.1 seconds). */
1257 
1258     uint16 scanOptions;         /* This field specifies whether the AP discovery is */
1259                                 /* performed by an active scan or a passive scan. */
1260                                 /* 0 - ACTIVE, 1 - PASSIVE.*/
1261 
1262     uint8  numOfProbRqst;       /* This field indicates the number of probe requests to*/
1263                                 /* send per channel, when active scan is specified. */
1264                                 /* Note: for XCC measurement this value should be set */
1265                                 /*       to 1.*/
1266 
1267     uint8 txPowerAttenuation;   /* TX power level to be used for sending probe requests*/
1268                                 /* when active scan is specified. */
1269                                 /* If 0, leave normal TX power level for this channel. */
1270 
1271     EHwRateBitFiled txdRateSet; /* This EHwBitRate format field specifies the rate and modulation*/
1272                                 /* to transmit the probe request when an active scan is*/
1273 	                            /* specified. */
1274 
1275 } ApDiscoveryParameters_t;
1276 
1277 /******************************************************************************
1278 
1279     ID:       CMD_STOP_AP_DISCOVERY
1280     Desc:     This command instructs the WiLink to terminate the AP Discovery
1281               measurement in progress. After processing this command, the WiLink
1282               returns to its previous state  and generates the AP Discovery Complete
1283               Event.
1284     Params:   None.
1285 
1286 ******************************************************************************/
1287 
1288 /******************************************************************************
1289 
1290     ID:       CMD_SPS_SCAN
1291     Desc:     This command instructs the WiLink to perform a scheduled passive
1292               scan for BSS/IBSSs. The WiLink monitors the specified channel(s)
1293               for beacons. The WiLink sends Scheduled Scan Complete event to notify
1294               the host when it has completed a scan.
1295     Params:   InfoElement_t - see below.
1296 
1297 ******************************************************************************/
1298 /* Scheduled - General scan parameters.*/
1299 typedef struct
1300 {
1301     ACXRxConfigStruct rxCfg;         /* Rx filter to be used for each channel scan. */
1302                                      /* The BSSID filter enable will be set (by the scan*/
1303                                      /* process) to ON for a specific channel if the*/
1304                                      /* BSSID of this channel is a unicast address. */
1305                                      /* Otherwise it will be set to OFF (Refer to */
1306                                      /* ACXRxConfigStruct).*/
1307 
1308     uint32            scanCmdTime_h; /* This filed is the latest 32 MSBits of TSF known*/
1309                                      /* at the time the SPS command was issued. When the*/
1310                                      /* scan process is about to begin, this value is */
1311                                      /* used to determine if the AP has performed a */
1312                                      /* recovery by comparing this value to the current*/
1313                                      /* TSF. (An AP that has performed a recovery should*/
1314                                      /* have a lower TSF then the one that was saved).*/
1315 
1316     uint32            scanCmdTime_l; /* This filed is the latest 32 LSBits of TSF known*/
1317                                      /* at the time the SPS command was issued. */
1318 
1319     uint16            scanOptions;   /* This bitwise field indicates the scan options. */
1320                                      /* 0 - ACTIVE, 1 - PASSIVE.*/
1321 
1322     uint8             numChannels;   /* Number of scan channels in the list (minimum */
1323                                      /* (minimumis 1, maximum is 30).*/
1324 
1325     RadioBand_e       band;          /* Band to scan */
1326     uint8             scanTag;       /* results tag */
1327 } ScheduledGeneralParameters_t;
1328 
1329 
1330 /* Scheduled - Per-Channel scan parameters.*/
1331 typedef struct
1332 {
1333     uint32 scanStartTime;      /* Duration in microseconds of the scan on this channel */
1334                                /* (Scan could be aborted before this duration in case of*/
1335                                /* early termination condition met on the channel). */
1336 
1337     uint32 scanMaxDuration;    /* Lower 4 bytes of TSF time in microseconds when the */
1338                                /* scan should start listening on the desired channel. */
1339 
1340     uint32 bssIdL;             /* 32 LSBits of BSSID of the AP to scan for. If scanning */
1341                                /* on this  channel any BSSID, this field shall be set */
1342                                /* to broadcast BSSID. */
1343 
1344     uint16 bssIdH;             /* 16 MSBits of BSSID of the AP to scan for. */
1345 
1346     ETCondCount_t ETCondCount; /* bit 0-3: Early Termination count - This field */
1347                                /*          defines the maximum number of beacons*/
1348                                /*          or probe responses or both (according*/
1349                                /*          to condition) to collect before ending*/
1350                                /*          a scan.*/
1351 
1352                                /* Bit 4-5: Early Termination Condition (refer */
1353                                /*          to ETCondition_enum).*/
1354     Channel_e     channel;     /* Channel number to scan, valid range 0-255 */
1355                                /* (1-14 for 802.11b).*/
1356 } ScheduledChannelParameters_t;
1357 
1358 
1359 /* The Scheduled Scan command structure.*/
1360 typedef struct
1361 {
1362     ScheduledGeneralParameters_t scheduledGeneralParameters;
1363     ScheduledChannelParameters_t scheduledChannelParameters[SCAN_MAX_NUM_OF_CHANNELS];
1364 } ScheduledScanParameters_t;
1365 
1366 /******************************************************************************
1367 
1368     ID:       CMD_STOP_SPS_SCAN
1369     Desc:     This command instructs the WiLink to terminate a currently running
1370               SPS or a pending SPS.. After processing this command, the WiLink
1371               returns to its previous state and generates the Scheduled Scan
1372               Complete Event.
1373     Params:   None.
1374 
1375 ******************************************************************************/
1376 
1377 /******************************************************************************
1378 
1379     ID:       CMD_HEALTH_CHECK
1380     Desc:     This command instructs the WiLink to raise a MAC status event
1381               which contains the current FCS Error counter.
1382     Params:   None.
1383 
1384 ******************************************************************************/
1385 
1386 /******************************************************************************
1387 
1388     ID:       CMD_DEBUG
1389     Desc:
1390     Params:   debugCommnad_t - see below.
1391 
1392 ******************************************************************************/
1393 #define MAX_DEBUG_PARAMETERS 10
1394 
1395 typedef struct
1396 {
1397     uint32  id;
1398     uint32  params[MAX_DEBUG_PARAMETERS];
1399 } debugCommnad_t;
1400 
1401 
1402 /******************************************************************************
1403 
1404     ID:       CMD_CONNECTION_SCAN_CFG
1405     Desc:     This command configures the periodic connection scan feature
1406     Params:   ConnectionScanParameters_t followed by active and passive channel
1407               lists (variable size structure)
1408 
1409 ******************************************************************************/
1410 
1411 typedef enum
1412 {
1413     BSS_INDEPENDENT                     = 0,
1414     BSS_INFRASTRUCTURE                  = 1,
1415     BSS_ANY                             = 2,
1416     BSS_MAX = 0xFF
1417 } ScanBssType_enum;
1418 
1419 #ifdef HOST_COMPILE
1420 typedef uint8 ScanBssType_e;
1421 #else
1422 typedef ScanBssType_enum ScanBssType_e;
1423 #endif
1424 
1425 typedef enum
1426 {
1427     SCAN_SSID_FILTER_TYPE_ANY = 0,
1428     SCAN_SSID_FILTER_TYPE_SPECIFIC = 1,
1429     SCAN_SSID_FILTER_TYPE_LIST = 2,
1430     SCAN_SSID_FILTER_TYPE_LIST_FILTER_DISABLED = 3,
1431     MAX_SCAN_SSID_FILTER_TYPE = 0xFF
1432 } ScanSsidFilterType_enum;
1433 
1434 #ifdef HOST_COMPILE
1435 typedef uint8 ScanSsidFilterType_e;
1436 #else
1437 typedef ScanSsidFilterType_enum ScanSsidFilterType_e;
1438 #endif
1439 
1440 #define CONN_SCAN_MAX_CHANNELS_BG  14
1441 #define CONN_SCAN_MAX_CHANNELS_J    4
1442 #define CONN_SCAN_MAX_CHANNELS_A   23
1443 #define CONN_SCAN_MAX_CHANNELS_ALL_BANDS        ((CONN_SCAN_MAX_CHANNELS_BG) + (CONN_SCAN_MAX_CHANNELS_A) + (CONN_SCAN_MAX_CHANNELS_J))
1444 #define CONN_SCAN_MAX_NUM_OF_CYCLES_INTERVALS   (16)        /* Maximum number of configured inter-cycle intervals */
1445 
1446 #define CONN_SCAN_MAX_BAND                      (3)         /* Maximum number of bands in scan configuration */
1447 
1448 #define CONN_SCAN_DFS_CANDIDATE_CHANNEL     BIT_0
1449 #define CONN_SCAN_DFS_ENABLED_CHANNEL       BIT_1
1450 
1451 typedef struct
1452 {
1453     uint16       scanMinDuration;     /* Min duration (in ms)*/
1454     uint16       scanMaxDuration;     /* Max duration (in ms)*/
1455     uint16       passiveScanDuration; /* Duration to use for passive scans (in ms)*/
1456     uint8        channel;             /* channel number (channel_e) */
1457     uint8        txPowerLevelDbm;    /* TX power level in dbm */
1458     uint8        channelFlags;        /* BIT 0: DFS channel */
1459                                       /* BIT 1: DFS enabled (to be included in active scan) */
1460     uint8        padding[3];
1461 } ConnScanChannelInfo_t;
1462 
1463 typedef struct
1464 {
1465     uint32                  cycleIntervals[CONN_SCAN_MAX_NUM_OF_CYCLES_INTERVALS];      /* Intervals between each scan cycle */
1466     int8                    rssiThreshold;          /* RSSI threshold */
1467     int8                    snrThreshold;           /* SNR threshold */
1468     uint8                   maxNumOfCycles;         /* number of cycles to run */
1469     uint8                   reportThreshold;        /* Report after N results are received */
1470     uint8                   terminateOnReport;      /* Terminate after report */
1471     uint8                   resultsTag;             /* Tag for filtered scan results */
1472     ScanBssType_e           bssType;                /* BSS type to filter (0 - Infra, 1 - IBSS, 2 - Any) */
1473     ScanSsidFilterType_e    ssidFilterType;         /* SSID filter Type (0 - Any, 1 - specified in command, 2 - use SSID list, 3 - use SSID list no filter) */
1474     uint8                   ssidLength;             /* SSID Length (if ssidType is specified in command) */
1475     uint8                   ssid[32];               /* SSID (if ssidType is specified in command) */
1476     uint8                   numProbe;               /* Number of probe requests to transmit per (hidden) SSID per channel */
1477 
1478     uint8                   numOfPassive[CONN_SCAN_MAX_BAND];
1479     uint8                   numOfActive[CONN_SCAN_MAX_BAND];
1480     uint8                   numOfDfs;
1481     uint8                   padding[ 3 ];
1482     ConnScanChannelInfo_t   channelList[CONN_SCAN_MAX_CHANNELS_ALL_BANDS];
1483 } ConnScanParameters_t;
1484 
1485 /******************************************************************************
1486 
1487     ID:       CMD_CONNECTION_SCAN_SSID_CFG
1488     Desc:     This command configures the SSID filter list to be used in the
1489               periodic connection scan
1490     Params:   None.
1491 
1492 ******************************************************************************/
1493 
1494 #define CONN_SCAN_MAX_NUMBER_OF_SSID_ENTRIES        (8)
1495 
1496 typedef enum
1497 {
1498     SCAN_SSID_TYPE_PUBLIC = 0,
1499     SCAN_SSID_TYPE_HIDDEN = 1,
1500     MAX_SCAN_SSID_TYPE = 0xFF
1501 } ScanSsidType_enum;
1502 
1503 #ifdef HOST_COMPILE
1504 typedef uint8 ScanSsidType_e;
1505 #else
1506 typedef ScanSsidType_enum ScanSsidType_e;
1507 #endif
1508 
1509 typedef struct
1510 {
1511     ScanSsidType_e      ssidType;
1512     uint8               ssidLength;
1513     uint8               ssid[32];
1514 } ConnScanSSID_t;
1515 
1516 
1517 typedef struct
1518 {
1519     uint8               numOfSSIDEntries;
1520     ConnScanSSID_t      SSIDList[CONN_SCAN_MAX_NUMBER_OF_SSID_ENTRIES];
1521 } ConnScanSSIDList_t;
1522 
1523 
1524 /******************************************************************************
1525 
1526     ID:       CMD_START_PERIODIC_SCAN
1527     Desc:     This command instructs the WiLink to start a periodic scan
1528               process (either connection-scan or discovery)
1529     Params:   None.
1530 
1531 ******************************************************************************/
1532 
1533 typedef struct
1534 {
1535     uint8   scanTag;
1536     uint8   uReserved[3];
1537 } PeriodicScanTag;
1538 
1539 /******************************************************************************
1540 
1541     ID:       CMD_STOP_PERIODIC_SCAN
1542     Desc:     This command instructs the WiLink to stop a periodic scan
1543               process (either connection-scan or discovery)
1544     Params:   None.
1545 
1546 ******************************************************************************/
1547 
1548 /******************************************************************************
1549 
1550     ID:       CMD_SET_STATUS
1551     Desc:     This command instructs the station state
1552     Params:   None.
1553 
1554 ******************************************************************************/
1555 
1556 #define STA_STATE_CONNECTED 1
1557 
1558 typedef struct
1559 {
1560     uint8   staState;
1561     uint8   pad[3];
1562 } SetStaState_t;
1563 
1564 /* PLT public definitions*/
1565 #define TEST_CONTINUOUS 0x04       /* transmit frames contimuously */
1566 
1567 
1568 /*This typedef corresponds to the Fig 1 Frame Format for PER test given in PER test doc.*/
1569 #define PER_MODE_TX 1
1570 #define PER_MODE_RX 2
1571 #define INFRA   0x2         /* BSS is in Infrastructure mode */
1572 #define LOCAL_MEM_LAST      0x02000000
1573 #define PBCC_MODULATION_MASK 0x80
1574 #define OFDM_MODULATION_MASK 0x40
1575 #define BAND_SELECT_5GHZ     0x10
1576 #define CTL_PREAMBLE         0x01
1577 
1578 
1579 
1580 #endif /* PUBLIC_COMMANDS_H*/
1581