4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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
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.
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.
34 #ifndef TWDDRIVERMSR_H
35 #define TWDDRIVERMSR_H
37 /** \file TWDriverMsr.h
38 * \brief TWDriver Measurement APIs
43 #include "TWDriverScan.h"
45 #include "public_radio.h"
47 #define NOISE_HISTOGRAM_LENGTH 8
48 #define MAX_NUM_OF_MSR_TYPES_IN_PARALLEL 3
50 /* The size of the time frame in which we must start the */
51 /* measurement request or give up */
52 #define MSR_START_MAX_DELAY 50
54 /* In non unicast measurement requests a random delay */
55 /* between 4 and 40 milliseconds */
56 #define MSR_ACTIVATION_DELAY_RANDOM 36
57 #define MSR_ACTIVATION_DELAY_OFFSET 4
60 /** \enum EMeasurementType
61 * \brief different measurement types
69 /* 0 */ MSR_TYPE_BASIC_MEASUREMENT = 0, /**< */
70 /* 1 */ MSR_TYPE_CCA_LOAD_MEASUREMENT, /**< */
71 /* 2 */ MSR_TYPE_NOISE_HISTOGRAM_MEASUREMENT, /**< */
72 /* 3 */ MSR_TYPE_BEACON_MEASUREMENT, /**< */
73 /* 4 */ MSR_TYPE_FRAME_MEASUREMENT, /**< */
74 /* 5 */ MSR_TYPE_MAX_NUM_OF_MEASURE_TYPES /**< */
78 /** \enum EMeasurementScanMode
79 * \brief Measurement Scan Modes
82 * enumerates the different scan modes available for beacon measurement
88 /* 0 */ MSR_SCAN_MODE_PASSIVE = 0, /**< Passive Scan Mode */
89 /* 1 */ MSR_SCAN_MODE_ACTIVE, /**< Active Scan Mode */
90 /* 2 */ MSR_SCAN_MODE_BEACON_TABLE, /**< Beacon Table Scan Mode */
91 /* 3 */ MSR_SCAN_MODE_MAX_NUM_OF_SCAN_MODES /**< Max number of Scan Modes */
93 } EMeasurementScanMode;
95 /** \enum EMeasurementFrameType
96 * \brief Measurement Frame Types
104 /* 0 */ MSR_FRAME_TYPE_NO_ACTIVE = 0, /**< */
105 /* 1 */ MSR_FRAME_TYPE_BROADCAST, /**< */
106 /* 2 */ MSR_FRAME_TYPE_MULTICAST, /**< */
107 /* 3 */ MSR_FRAME_TYPE_UNICAST /**< */
109 } EMeasurementFrameType;
111 /** \enum EMeasurementMode
112 * \brief Measurement Modes
120 /* 0 */ MSR_MODE_NONE = 0, /**< */
121 /* 1 */ MSR_MODE_XCC, /**< */
122 /* 2 */ MSR_MODE_SPECTRUM_MANAGEMENT /**< */
126 /** \enum EMeasurementRejectReason
127 * \brief Measurement Reject Reason
135 /* 1 */ MSR_REJECT_OTHER_REASON = 1, /**< */
136 /* 2 */ MSR_REJECT_INVALID_MEASUREMENT_TYPE, /**< */
137 /* 3 */ MSR_REJECT_DTIM_OVERLAP, /**< */
138 /* 4 */ MSR_REJECT_DURATION_EXCEED_MAX_DURATION, /**< */
139 /* 5 */ MSR_REJECT_TRAFFIC_INTENSITY_TOO_HIGH, /**< */
140 /* 6 */ MSR_REJECT_SCR_UNAVAILABLE, /**< */
141 /* 7 */ MSR_REJECT_MAX_DELAY_PASSED, /**< */
142 /* 8 */ MSR_REJECT_INVALID_CHANNEL, /**< */
143 /* 9 */ MSR_REJECT_NOISE_HIST_FAIL, /**< */
144 /* 10 */ MSR_REJECT_CHANNEL_LOAD_FAIL, /**< */
145 /* 11 */ MSR_REJECT_EMPTY_REPORT /**< */
147 } EMeasurementRejectReason;
150 ***********************************************************************
152 ***********************************************************************
154 /** \union TMeasurementReplyValue
155 * \brief Measurement possible Reply Values
163 TI_UINT8 CCABusyFraction; /**< */
164 TI_UINT8 RPIDensity[ NOISE_HISTOGRAM_LENGTH ]; /**< */
166 } TMeasurementReplyValue;
168 /***********************************************************************
169 * Structure definitions.
170 ***********************************************************************
172 /** \struct TMeasurementTypeRequest
173 * \brief Measurement Type Request
176 * This structure defines single channel parameters for normal scan operation (inc. triggered)
182 EMeasurementType msrType; /**< */
183 EMeasurementScanMode scanMode; /**< */
184 TI_UINT32 duration; /**< */
185 TI_UINT8 reserved; /**< */
187 } TMeasurementTypeRequest;
189 /** \struct TMeasurementRequest
190 * \brief Measurement Request
193 * This structure defines measurement parameters of several measurement request types
200 ERadioBand band; /**< */
201 TI_UINT8 channel; /**< */
202 TI_UINT64 startTime; /**< */
203 TI_UINT8 txPowerDbm; /**< */
204 EScanResultTag eTag; /**< */
205 TI_UINT8 numberOfTypes; /**< */
206 TMeasurementTypeRequest msrTypes[ MAX_NUM_OF_MSR_TYPES_IN_PARALLEL ]; /**< */
208 } TMeasurementRequest;
210 /** \struct TMeasurementTypeReply
211 * \brief Measurement Type Reply
214 * This structure defines the reply parameters for measurement of specific type performed
215 * (the type is indicated in the msrType field)
221 EMeasurementType msrType; /**< The type of performed measurement the reply reffer to */
222 TI_UINT8 status; /**< The status of measurement performed */
223 TMeasurementReplyValue replyValue; /**< The Reply Value of performed measurement */
224 TI_UINT8 reserved; /**< */
226 } TMeasurementTypeReply;
228 /** \struct TMeasurementReply
229 * \brief Measurement Reply
232 * This structure defines the reply parameters for some measurements of some types performed
238 TI_UINT8 numberOfTypes; /**< Number of measurements types (equal to number of measurement replys) */
239 TMeasurementTypeReply msrTypes[ MAX_NUM_OF_MSR_TYPES_IN_PARALLEL ]; /**< Measurements Replys buffer. One Reply per type */
243 /** \struct TMeasurementFrameHdr
244 * \brief Measurement Frame Header
247 * This structure defines a Header of a measurement
253 TI_UINT16 dialogToken; /**< Indicates if the received Measurement is the same as the one that is being processed */
254 TI_UINT8 activatioDelay; /**< */
255 TI_UINT8 measurementOffset; /**< */
257 } TMeasurementFrameHdr;
259 /** \struct TMeasurementFrameRequest
260 * \brief Measurement Frame Request
268 TMeasurementFrameHdr *hdr; /**< */
269 EMeasurementFrameType frameType; /**< */
270 TI_UINT8 *requests; /**< */
271 TI_INT32 requestsLen; /**< */
273 } TMeasurementFrameRequest;
276 #endif /* #define TWDDRIVERMSR_H */