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