1 /**************************************************************************** 2 **+-----------------------------------------------------------------------+** 3 **| |** 4 **| Copyright(c) 1998 - 2008 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 #ifndef _SCAN_TYPES_H 37 #define _SCAN_TYPES_H 38 39 #include "osTIType.h" 40 #include "ratesTypes.h" 41 #include "osDot11.h" 42 #include "commonTypes.h" 43 44 /***************************************************************************************** 45 Scan Definitions 46 --------------- 47 This file is included by the whalCtrl_api.h , it should not be included apart. !!!!!!! 48 *****************************************************************************************/ 49 50 51 /* 52 *********************************************************************** 53 * Constant definitions. 54 *********************************************************************** 55 */ 56 #define MAX_NUMBER_OF_CHANNELS_PER_SCAN 16 57 #define SCAN_MAX_NUM_OF_NORMAL_CHANNELS_PER_COMMAND MAX_NUMBER_OF_CHANNELS_PER_SCAN 58 #define SCAN_MAX_NUM_OF_SPS_CHANNELS_PER_COMMAND 16 59 #define SCAN_DEFAULT_MIN_CHANNEL_DWELL_TIME 30000 60 #define SCAN_DEFAULT_MAX_CHANNEL_DWELL_TIME 60000 61 #define SCAN_DEFAULT_EARLY_TERMINATION_EVENT SCAN_ET_COND_DISABLE 62 #define SCAN_DEFAULT_EARLY_TERMINATION_NUM_OF_FRAMES 0 63 64 /* 65 *********************************************************************** 66 * Enums. 67 *********************************************************************** 68 */ 69 70 71 /** \enum scan_Type_e 72 * \brief enumerates the different scan types 73 */ 74 typedef enum 75 { 76 SCAN_TYPE_NORMAL_PASSIVE = 0, /**< normal passive scan */ 77 SCAN_TYPE_NORMAL_ACTIVE, /**< normal active scan */ 78 SCAN_TYPE_SPS, /**< scheduled passive scan */ 79 SCAN_TYPE_TRIGGERED_PASSIVE, /**< triggered passive scan */ 80 SCAN_TYPE_TRIGGERED_ACTIVE, /**< triggered active scan */ 81 SCAN_TYPE_NO_SCAN /**< no scan to perform */ 82 } scan_Type_e; 83 84 /** \enum scan_ETCondition_e 85 * \brief enumerates the different early termination conditions 86 */ 87 typedef enum 88 { 89 SCAN_ET_COND_DISABLE = 0x00, /**< no early termination */ 90 SCAN_ET_COND_BEACON = 0x10, /**< early termination on beacons */ 91 SCAN_ET_COND_PROBE_RESP = 0x20, /**< early termination on probe responses */ 92 SCAN_ET_COND_ANY_FRAME = 0x30, /**< early termination on beacons and probe responses */ 93 SCAN_ET_COND_NUM_OF_CONDS= 0x4 /**< number of early termination conditions */ 94 } scan_ETCondition_e; 95 96 /*********************************************************************** 97 * Structure definitions. 98 *********************************************************************** 99 */ 100 101 /** \struct scan_normalChannelEntry_t 102 * \brief This structure contains single channel parameters for normal scan operation (inc. triggered) 103 */ 104 typedef struct 105 { 106 macAddress_t bssId; /**< BSS Id to filter with */ 107 UINT32 maxChannelDwellTime; /**< 108 * maximum time to dwell on the channel, in microseconds 109 * (if something was received) 110 */ 111 UINT32 minChannelDwellTime; /**< 112 * minimum time to dwell on the channel, in microseconds 113 * (if nothing was received) 114 */ 115 scan_ETCondition_e earlyTerminationEvent; /**< the event triggering early termination */ 116 UINT8 ETMaxNumOfAPframes; /**< 117 * the number of frames to receive 118 * to activate early termination 119 */ 120 121 UINT8 txPowerDbm ; /**< 122 * the tx power to use for probe requests (for active scan) 123 */ 124 UINT8 channel; /**< the channel to scan */ 125 } scan_normalChannelEntry_t; 126 127 /** \struct scan_SPSChannelEntry_t 128 * \brief This structure contains single channel parameters for an SPS scan operation 129 */ 130 typedef struct 131 { 132 macAddress_t bssId; /**< BSS Id to filter with */ 133 UINT32 scanDuration; /**< time to dwell on the channel in microseconds */ 134 UINT32 scanStartTime; /**< exact time to start scan in 4 lower bytes of the TSF */ 135 scan_ETCondition_e earlyTerminationEvent; /**< the event triggering early termination */ 136 UINT8 ETMaxNumOfAPframes; /**< 137 * the number of frames to receive 138 * to activate early termination 139 */ 140 UINT8 channel; /**< the channel to scan */ 141 } scan_SPSChannelEntry_t; 142 143 /** \union scan_channelEntry_u 144 * \brief This union holds single channel parameters either for normal scan or for SPS scan 145 */ 146 typedef union 147 { 148 scan_normalChannelEntry_t normalChannelEntry; /**< normal scan parameters */ 149 scan_SPSChannelEntry_t SPSChannelEntry; /**< SPS scan parameters */ 150 } scan_channelEntry_u; 151 152 /** \struct scan_Params_t 153 * \brief This structure contains parameters for a scan operation 154 */ 155 typedef struct 156 { 157 ssid_t desiredSsid; /**< the SSID to search (optional) */ 158 scan_Type_e scanType; /**< 159 * scan type (normal - active or passive, 160 * SPS, triggered - active or passive) 161 */ 162 radioBand_e band; /**< band to scan (A / BG) */ 163 UINT8 probeReqNumber; /**< number of probe requests to send (for active scan) */ 164 rateMask_e probeRequestRate; /**< the rate at which to send the probe requests */ 165 UINT8 Tid; /**< the Tid triggering the scan (for triggered scan) */ 166 UINT64 latestTSFValue; /**< 167 * for SPS scan - the latest TSF at which a frame was 168 * received. Used to detect TSF error (AP recovery). 169 */ 170 UINT32 SPSScanDuration; /**< 171 * for SPS scan ONLY - the time duration of the scan (in 172 * milliseconds), used to set timer according to. 173 */ 174 UINT8 numOfChannels; /**< number of channels */ 175 176 scan_channelEntry_u channelEntry[ MAX_NUMBER_OF_CHANNELS_PER_SCAN ]; /**< channels array */ 177 } scan_Params_t; 178 179 #endif 180 181