PageRenderTime 45ms CodeModel.GetById 29ms app.highlight 12ms RepoModel.GetById 0ms app.codeStats 0ms

/android-CM7/vendor/ti/wlan/ap/TWD/TWDriver/TWDriverScan.h

https://github.com/quinato/FreeXperia
C Header | 313 lines | 111 code | 34 blank | 168 comment | 0 complexity | 9dabde6b6c66696c31a46ca8dfe5dab2 MD5 | raw file
  1/*
  2 * TWDriverScan.h
  3 *
  4 * Copyright(c) 1998 - 2010 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#ifndef TWDRIVERSCAN_H
 35#define TWDRIVERSCAN_H
 36
 37/** \file  TWDriverScan.h
 38 *  \brief TWDriver Scan APIs
 39 *
 40 *  \see
 41 */
 42
 43#include "tidef.h"
 44#include "TWDriverRate.h"
 45#include "public_commands.h"
 46
 47/*****************************************************************************************
 48                          Scan Definitions
 49                          ---------------
 50This file is included by the TWDriver.h , it should not be included apart. !!!!!!!
 51*****************************************************************************************/
 52
 53
 54/*
 55 ***********************************************************************
 56 *  Constant definitions.
 57 ***********************************************************************
 58 */
 59#define MAX_NUMBER_OF_CHANNELS_PER_SCAN                     16
 60#define SCAN_MAX_NUM_OF_NORMAL_CHANNELS_PER_COMMAND         MAX_NUMBER_OF_CHANNELS_PER_SCAN
 61#define SCAN_MAX_NUM_OF_SPS_CHANNELS_PER_COMMAND            16
 62#define SCAN_DEFAULT_MIN_CHANNEL_DWELL_TIME                 30000
 63#define SCAN_DEFAULT_MAX_CHANNEL_DWELL_TIME                 60000
 64#define SCAN_DEFAULT_EARLY_TERMINATION_EVENT                SCAN_ET_COND_DISABLE
 65#define SCAN_DEFAULT_EARLY_TERMINATION_NUM_OF_FRAMES        0
 66
 67#define PERIODIC_SCAN_MAX_SSID_NUM      					8
 68#define PERIODIC_SCAN_MAX_INTERVAL_NUM  					16
 69#define PERIODIC_SCAN_MAX_CHANNEL_NUM   					37 /* G-14 + A-23 */
 70
 71#define MAX_SSID_LEN  										32
 72
 73/*
 74***********************************************************************
 75*  Enums.
 76***********************************************************************
 77*/
 78/** \enum EScanType
 79 * \brief Scan Type
 80 *
 81 * \par Description
 82 * This Enumeration defines the available scan types.
 83 *
 84 * \sa TFileInfo
 85 */
 86typedef enum {
 87	/*	0	*/	SCAN_TYPE_NORMAL_PASSIVE = 0,   /**< Normal passive scan 	*/
 88	/*	1	*/	SCAN_TYPE_NORMAL_ACTIVE,        /**< Normal active scan 	*/
 89	/*	2	*/	SCAN_TYPE_SPS,                  /**< Scheduled Passive scan */
 90	/*	3	*/	SCAN_TYPE_TRIGGERED_PASSIVE,    /**< Triggered Passive scan */
 91	/*	4	*/	SCAN_TYPE_TRIGGERED_ACTIVE,     /**< Triggered Active scan 	*/
 92	/*	5	*/	SCAN_TYPE_NO_SCAN,              /**< No Scan to perform 	*/
 93	/*	6	*/	SCAN_TYPE_PACTSIVE              /**< Passive + Active Scan (used for DFS - driver internal use only!!!) */
 94
 95} EScanType;
 96
 97/** \enum EScanEtCondition
 98 * \brief Scan Early Termonation Condition
 99 *
100 * \par Description
101 * This Enumeration defines the different early termination causes.
102 *
103 * \sa TFileInfo
104 */
105typedef enum {
106	SCAN_ET_COND_DISABLE     = 0x00,        /**< No early termination is not disabled (Do not perform an early termination scan)*/
107	SCAN_ET_COND_BEACON      = 0x10,        /**< Early termination scan on beacon reception 									*/
108	SCAN_ET_COND_PROBE_RESP  = 0x20,        /**< Early termination scan on probe response reception 							*/
109	SCAN_ET_COND_ANY_FRAME   = 0x30,        /**< Early termination scan on both beacon or probe response reception 				*/
110	SCAN_ET_COND_NUM_OF_CONDS= 0x4          /**< Number of early termination conditions 										*/
111
112} EScanEtCondition;
113
114/** \enum EScanResultTag
115 * \brief Scan Debug Tags
116 *
117 * \par Description
118 * Enumeration of the differnet Scan Result Tags possible
119 *
120 * \sa
121 */
122typedef enum {
123	/*	0	*/	SCAN_RESULT_TAG_CURENT_BSS = 0,			/**< */
124	/*	1	*/	SCAN_RESULT_TAG_APPLICATION_ONE_SHOT,	/**< */
125	/*	2	*/	SCAN_RESULT_TAG_DRIVER_PERIODIC,		/**< */
126	/*	3	*/	SCAN_RESULT_TAG_APPLICATION_PEIODIC,	/**< */
127	/*	4	*/	SCAN_RESULT_TAG_MEASUREMENT,			/**< */
128	/*	5	*/	SCAN_RESULT_TAG_IMMEDIATE,				/**< */
129	/*	6	*/	SCAN_RESULT_TAG_CONTINUOUS,				/**< */
130	/*	7	*/	SCAN_RESULT_TAG_MAX_NUMBER				/**< */
131
132} EScanResultTag;
133
134/** \enum ESsidVisability
135 * \brief SSID Visablility Type
136 *
137 * \par Description
138 *
139 * \sa
140 */
141typedef enum {
142	/*	0	*/	SCAN_SSID_VISABILITY_PUBLIC = 0,		/**< Visible	*/
143	/*	1	*/	SCAN_SSID_VISABILITY_HIDDEN				/**< Hidden		*/
144} ESsidVisability;
145
146/***********************************************************************
147 *  Structure definitions.
148 ***********************************************************************
149 */
150/** \struct TSsid
151 * \brief SSID Parameters
152 *
153 * \par Description
154 *
155 * \sa
156 */
157typedef struct {
158	TI_UINT8    len;		  			/**< SSID Length		*/
159	char        str[ MAX_SSID_LEN ];	/**< SSID string buffer	*/
160
161}  TSsid;
162
163/** \struct TScanNormalChannelEntry
164 * \brief Scan Normal Channel Entry
165 *
166 * \par Description
167 * This structure defines single channel parameters for normal scan operation other than SPS (inc. triggered)
168 *
169 * \sa
170 */
171typedef struct {
172	TMacAddr               bssId;                  	/**< BSSID (MAC address) to filter */
173	TI_UINT32              maxChannelDwellTime;     /**< Maximum time to stay on the channel if some frames were
174													* received but the early termination limit has not been reached (microseconds)
175													*/
176	TI_UINT32              minChannelDwellTime;     /**< Minimum time to stay on the channel if no frames were received (microseconds) */
177	EScanEtCondition       earlyTerminationEvent;   /**< Early termination frame type */
178	TI_UINT8               ETMaxNumOfAPframes;      /**< Number of frames from the early termination frame types according to the early
179													* Termination Event setting, after which scan is stopped on this channel
180													*/
181	TI_UINT8               txPowerDbm;              /**< Power level used to transmit (for active scan only) (0: no change; 1-5: predefined power level */
182	TI_UINT8               channel;                 /**< Channel to scan */
183
184} TScanNormalChannelEntry;
185
186/** \struct TScanSpsChannelEntry
187 * \brief Scan SPS Channel Entry
188 *
189 * \par Description
190 * This structure defines single channel parameters for an SPS scan operation
191 *
192 * \sa
193 */
194typedef struct {
195	TMacAddr               bssId;               	/**< BSSID (source is MAC address) to filter */
196	TI_UINT32              scanDuration;            /**< Length of time to start scanning the channel (TSF lower 4 bytes) */
197	TI_UINT32              scanStartTime;           /**< Exact time to start scanning the channel (TSF lower 4 bytes) */
198	EScanEtCondition       earlyTerminationEvent;   /**< Scan early termination frame type */
199	TI_UINT8               ETMaxNumOfAPframes;      /**< Number of frames from the early termination frame types according to
200													* the early Termination Event setting, after which scan is stopped on this channel
201													*/
202	TI_UINT8               channel;                 /**< Channel to scan */
203
204} TScanSpsChannelEntry;
205
206/** \struct TScanChannelEntry
207 * \brief Scan Channel Entry
208 *
209 * \par Description
210 * Holds single channel parameters single-channel parameters for all scan types,
211 * either for normal scan or for SPS scan
212 *
213 * \sa
214 */
215typedef union {
216	TScanNormalChannelEntry   normalChannelEntry;	/**< Normal scan parameters: channel parameters for all scan types other than SPS 	*/
217	TScanSpsChannelEntry      SPSChannelEntry;      /**< SPS scan parameters: channel parameters for SPS type 	*/
218
219} TScanChannelEntry;
220
221/** \struct TScanParams
222 * \brief scan operation parameters
223 *
224 * \par Description
225 * This structure defines parameters for a scan operation
226 *
227 * \sa
228 */
229typedef struct {
230	TSsid                  desiredSsid;    		/**< The SSID to search (optional) 												*/
231	EScanType              scanType;            /**< Desired scan type (normal - active or passive, SPS, triggered - active or passive)	*/
232	ERadioBand             band;             	/**< Band to scan (A / BG) 														*/
233	TI_UINT8               probeReqNumber;     	/**< Number of probe requests to send on each channel (for active scan) 		*/
234	ERateMask              probeRequestRate;    /**< The rate at which to send the probe requests 								*/
235	TI_UINT8               Tid;                 /**< Time at which to trigger the scan (for triggered scan)						*/
236	TI_UINT64              latestTSFValue;      /**< For SPS scan: the latest TSF at which a frame was received. Used to detect
237												* TSF error (AP recovery).
238												*/
239	TI_UINT32              SPSScanDuration;    	/**< For SPS scan ONLY: the time duration of the scan (in milliseconds), used to
240												* Set timer according to. Used to set scan-complete timer
241												*/
242	TI_UINT8               numOfChannels;       /**< Number of channels to scan 														*/
243	TScanChannelEntry      channelEntry[ MAX_NUMBER_OF_CHANNELS_PER_SCAN ];	/**< Channel data array, actual size according to the above field. */
244
245} TScanParams;
246
247/** \struct TPeriodicScanSsid
248 * \brief Periodic Scan SSID
249 *
250 * \par Description
251 * This structure defines parameters for Periodic scan for SSID
252 *
253 * \sa
254 */
255typedef struct {
256	ESsidVisability eVisability;	/**< Indicates if SSID Visible or not	*/
257	TSsid           tSsid;			/**< The Parameters of Scaned SSID 		*/
258} TPeriodicScanSsid;
259
260/** \struct TPeriodicChannelEntry
261 * \brief Periodic Channel Entry
262 *
263 * \par Description
264 * This structure defines a Channel Entry of Periodic scan
265 * (each scanned channel has its own Channel Entry)
266 *
267 * \sa
268 */
269typedef struct {
270	ERadioBand      eBand;			  	/**< Channel's Radio Band									*/
271	TI_UINT32       uChannel;			/**< Channel's Number										*/
272	EScanType       eScanType;			/**< The Type of Scan Performed on the channel				*/
273	TI_UINT32       uMinDwellTimeMs;	/**< minimum time to dwell on the channel, in microseconds	*/
274	TI_UINT32       uMaxDwellTimeMs;	/**< maximum time to dwell on the channel, in microseconds	*/
275	TI_UINT32       uTxPowerLevelDbm;	/**< Channel's Power Level In Dbm/10 units 		 			*/
276} TPeriodicChannelEntry;
277
278/** \struct TPeriodicScanParams
279 * \brief Periodic Scan Parameters
280 *
281 * \par Description
282 * This structure defines all the parameters of Periodic scan
283 *
284 * \sa
285 */
286typedef struct {
287	TI_UINT32               uSsidNum;												/**< Number of Desired SSID scanned			 					*/
288	TI_UINT8				uSsidListFilterEnabled;										/** 1: eneable filtering according to the list; 0: disable  */
289	TPeriodicScanSsid       tDesiredSsid[ PERIODIC_SCAN_MAX_SSID_NUM ];				/**< Buffer of size of maximum possible Periodic Scanned SSIDs.
290																					* This buffer holds the Parameters of Desired SSIDs (for each SSID:
291																					* visibility, length, string buffer) --> number of init entries in
292																					* buffer: uSsidNum
293																					*/
294	TI_UINT32               uCycleNum;												/**< number of Scan cycles to run 						   		*/
295	TI_UINT32               uCycleIntervalMsec[ PERIODIC_SCAN_MAX_INTERVAL_NUM ];	/**< Intervals (in Msec) between two sequential  scan cycle    	*/
296	TI_INT8                 iRssiThreshold;											/**< RSSI threshold 											*/
297	TI_INT8                 iSnrThreshold;											/**< SNR threshold	 											*/
298	TI_UINT32               uFrameCountReportThreshold;								/**< Report after N results are received 						*/
299	TI_BOOL                 bTerminateOnReport;										/**< Indicates if to Terminate after report 					*/
300	ScanBssType_e           eBssType;												/**< Scan BSS Type												*/
301	TI_UINT32               uProbeRequestNum;										/**< Number of probe requests to transmit per SSID				*/
302	TI_UINT32               uChannelNum;											/**< Number of Scaned Channels									*/
303	TPeriodicChannelEntry   tChannels[ PERIODIC_SCAN_MAX_CHANNEL_NUM ];				/**< Buffer of size of maximum possible Periodic Scanned Channels.
304																					* This buffer holds the Parameters of each Scanned Channel
305																					*/
306} TPeriodicScanParams;
307
308#endif /* TWDRIVERSCAN_H */
309
310
311
312
313