PageRenderTime 35ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/inc/scanTypes.h

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