Home | History | Annotate | Download | only in Export_Inc
      1 /** \file measurementTypes.h
      2  *  \brief This file include data types definitions for the measurment SRV module.
      3  *  \author Ronen Kalish
      4  *  \date 08-November-2005
      5  */
      6  /****************************************************************************
      7 **+-----------------------------------------------------------------------+**
      8 **|                                                                       |**
      9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
     10 **| All rights reserved.                                                  |**
     11 **|                                                                       |**
     12 **| Redistribution and use in source and binary forms, with or without    |**
     13 **| modification, are permitted provided that the following conditions    |**
     14 **| are met:                                                              |**
     15 **|                                                                       |**
     16 **|  * Redistributions of source code must retain the above copyright     |**
     17 **|    notice, this list of conditions and the following disclaimer.      |**
     18 **|  * Redistributions in binary form must reproduce the above copyright  |**
     19 **|    notice, this list of conditions and the following disclaimer in    |**
     20 **|    the documentation and/or other materials provided with the         |**
     21 **|    distribution.                                                      |**
     22 **|  * Neither the name Texas Instruments nor the names of its            |**
     23 **|    contributors may be used to endorse or promote products derived    |**
     24 **|    from this software without specific prior written permission.      |**
     25 **|                                                                       |**
     26 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
     27 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
     28 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
     29 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
     30 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
     31 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
     32 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
     33 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
     34 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
     35 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
     36 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
     37 **|                                                                       |**
     38 **+-----------------------------------------------------------------------+**
     39 ****************************************************************************/
     40 
     41 #ifndef __MEASUREMENT_TYPES_H__
     42 #define __MEASUREMENT_TYPES_H__
     43 
     44 #include "osTIType.h"
     45 #include "ratesTypes.h"
     46 #include "osDot11.h"
     47 
     48 
     49 /*
     50  ***********************************************************************
     51  *  Constant definitions.
     52  ***********************************************************************
     53  */
     54 
     55 #define NOISE_HISTOGRAM_LENGTH              8
     56 #define MAX_NUM_OF_MSR_TYPES_IN_PARALLEL    3
     57 
     58 /* The size of the time frame in which we must start the */
     59 /* measurement request or give up */
     60 #define MSR_START_MAX_DELAY                 50
     61 
     62 /* In non unicast measurement requests a random delay */
     63 /* between 4 and 40 milliseconds */
     64 #define MSR_ACTIVATION_DELAY_RANDOM         36
     65 #define MSR_ACTIVATION_DELAY_OFFSET         4
     66 
     67 
     68 
     69  /*
     70  ***********************************************************************
     71  *  Enums.
     72  ***********************************************************************
     73  */
     74 
     75 /** \enum measurement_type_e
     76  * \brief enumerates the different measurement types
     77  */
     78 typedef enum
     79 {
     80     MSR_TYPE_BASIC_MEASUREMENT              = 0,
     81     MSR_TYPE_CCA_LOAD_MEASUREMENT           = 1,
     82     MSR_TYPE_NOISE_HISTOGRAM_MEASUREMENT    = 2,
     83     MSR_TYPE_BEACON_MEASUREMENT             = 3,
     84     MSR_TYPE_FRAME_MEASUREMENT              = 4,
     85     MSR_TYPE_MAX_NUM_OF_MEASURE_TYPES       = 5
     86 } measurement_type_e;
     87 
     88 
     89 /** \enum measurement_scanMode_e
     90  * \brief enumerates the different scan modes available for beacon measurement
     91  */
     92 typedef enum
     93 {
     94     MSR_SCAN_MODE_PASSIVE               = 0,
     95     MSR_SCAN_MODE_ACTIVE                = 1,
     96     MSR_SCAN_MODE_BEACON_TABLE          = 2,
     97     MSR_SCAN_MODE_MAX_NUM_OF_SCAN_MODES = 3,
     98 } measurement_scanMode_e;
     99 
    100 
    101 typedef enum
    102 {
    103     MSR_FRAME_TYPE_NO_ACTIVE                = 0,
    104     MSR_FRAME_TYPE_BROADCAST                = 1,
    105     MSR_FRAME_TYPE_MULTICAST                = 2,
    106     MSR_FRAME_TYPE_UNICAST                  = 3
    107 } measurement_frameType_e;
    108 
    109 
    110 typedef enum
    111 {
    112     MSR_MODE_NONE                = 0,
    113     MSR_MODE_EXC                 = 1,
    114     MSR_MODE_SPECTRUM_MANAGEMENT = 2,
    115 } measurement_mode_e;
    116 
    117 typedef enum
    118 {
    119     MSR_REJECT_OTHER_REASON = 1,
    120     MSR_REJECT_INVALID_MEASUREMENT_TYPE,
    121     MSR_REJECT_DTIM_OVERLAP,
    122     MSR_REJECT_DURATION_EXCEED_MAX_DURATION,
    123     MSR_REJECT_TRAFFIC_INTENSITY_TOO_HIGH,
    124     MSR_REJECT_SCR_UNAVAILABLE,
    125     MSR_REJECT_MAX_DELAY_PASSED,
    126     MSR_REJECT_INVALID_CHANNEL,
    127     MSR_REJECT_NOISE_HIST_FAIL,
    128     MSR_REJECT_CHANNEL_LOAD_FAIL,
    129     MSR_REJECT_EMPTY_REPORT,
    130 } measurement_rejectReason_e;
    131 
    132  /*
    133  ***********************************************************************
    134  *  Unions.
    135  ***********************************************************************
    136  */
    137 
    138 /** \union measurement_replyValue_u
    139  * \brief enumerates the different measurement types
    140  */
    141 typedef union
    142 {
    143     UINT8                                   CCABusyFraction;
    144     UINT8                                   RPIDensity[ NOISE_HISTOGRAM_LENGTH ];
    145 } measurement_replyValue_u;
    146 
    147 /***********************************************************************
    148  *  Structure definitions.
    149  ***********************************************************************
    150  */
    151 
    152 /** \struct scan_normalChannelEntry_t
    153  * \brief This structure contains single channel parameters for normal scan operation (inc. triggered)
    154  */
    155 typedef struct
    156 {
    157     measurement_type_e                      msrType;
    158     measurement_scanMode_e                  scanMode;
    159     UINT32                                  duration;
    160     UINT8                                   reserved;
    161 } measurement_typeRequest_t;
    162 
    163 typedef struct
    164 {
    165     radioBand_e                             band;
    166     UINT8                                   channel;
    167     UINT64                                  startTime;
    168     UINT8                                   txPowerDbm;
    169     UINT8                                   numberOfTypes;
    170     measurement_typeRequest_t               msrTypes[ MAX_NUM_OF_MSR_TYPES_IN_PARALLEL ];
    171 } measurement_request_t;
    172 
    173 
    174 typedef struct
    175 {
    176     measurement_type_e                      msrType;
    177     UINT8                                   status;
    178     measurement_replyValue_u                replyValue;
    179     UINT8                                   reserved;
    180 } measurement_typeReply_t;
    181 
    182 typedef struct
    183 {
    184     UINT8                                   numberOfTypes;
    185     measurement_typeReply_t                 msrTypes[ MAX_NUM_OF_MSR_TYPES_IN_PARALLEL ];
    186 } measurement_reply_t;
    187 
    188 PACKED_STRUCT( measurement_frameHdr_t ,
    189 
    190     UINT16                                  dialogToken;
    191     UINT8                                   activatioDelay;
    192     UINT8                                   measurementOffset;
    193 );
    194 
    195 PACKED_STRUCT( measurement_frameRequest_t ,
    196 
    197     measurement_frameHdr_t                  *hdr;
    198     measurement_frameType_e                 frameType;
    199     UINT8                                   *requests;
    200     INT32                                   requestsLen;
    201 );
    202 
    203 
    204 
    205 #endif /* __MEASUREMENT_TYPES_H__ */
    206 
    207