blob: ab2b30d30a7e71fda03af24f29ed24dfbbd42416 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -08002 * Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28
Jeff Johnson295189b2012-06-20 16:38:30 -070029
30#if !defined( __RRMGLOBAL_H )
31#define __RRMGLOBAL_H
32
33/**=========================================================================
34
35 \file rrmGlobal.h
36
37 \brief Definitions for SME APIs
38
Kiet Lamaa8e15a2014-02-11 23:30:06 -080039
Jeff Johnson295189b2012-06-20 16:38:30 -070040 ========================================================================*/
41
Jeff Johnson295189b2012-06-20 16:38:30 -070042typedef enum eRrmRetStatus
43{
44 eRRM_SUCCESS,
45 eRRM_INCAPABLE,
46 eRRM_REFUSED,
47 eRRM_FAILURE
48} tRrmRetStatus;
49
Srinivas Girigowda6d1f9062014-02-03 18:15:54 -080050typedef enum eRrmMsgReqSource
51{
Kanchanapally, Vidyullatha5dbeaf22014-03-05 20:18:33 +053052 eRRM_MSG_SOURCE_LEGACY_ESE = 1, /* legacy ese */
53 eRRM_MSG_SOURCE_11K = 2, /* 11k */
54 eRRM_MSG_SOURCE_ESE_UPLOAD = 3 /* ese upload approach */
Srinivas Girigowda6d1f9062014-02-03 18:15:54 -080055} tRrmMsgReqSource;
56
Jeff Johnson295189b2012-06-20 16:38:30 -070057typedef struct sSirChannelInfo
58{
59 tANI_U8 regulatoryClass;
60 tANI_U8 channelNum;
61} tSirChannelInfo, * tpSirChannelInfo;
62
63typedef struct sSirBeaconReportReqInd
64{
65 tANI_U16 messageType; // eWNI_SME_BEACON_REPORT_REQ_IND
66 tANI_U16 length;
67 tSirMacAddr bssId;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080068 tANI_U16 measurementDuration[SIR_ESE_MAX_MEAS_IE_REQS]; //ms
Jeff Johnson295189b2012-06-20 16:38:30 -070069 tANI_U16 randomizationInterval; //ms
70 tSirChannelInfo channelInfo;
71 tSirMacAddr macaddrBssid; //0: wildcard
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080072 tANI_U8 fMeasurementtype[SIR_ESE_MAX_MEAS_IE_REQS]; //0:Passive, 1: Active, 2: table mode
Jeff Johnson295189b2012-06-20 16:38:30 -070073 tAniSSID ssId; //May be wilcard.
74 tANI_U16 uDialogToken;
75 tSirChannelList channelList; //From AP channel report.
Srinivas Girigowda6d1f9062014-02-03 18:15:54 -080076 tRrmMsgReqSource msgSource;
Jeff Johnson295189b2012-06-20 16:38:30 -070077} tSirBeaconReportReqInd, * tpSirBeaconReportReqInd;
78
79
80typedef struct sSirBeaconReportXmitInd
81{
82 tANI_U16 messageType; // eWNI_SME_BEACON_REPORT_RESP_XMIT_IND
83 tANI_U16 length;
84 tSirMacAddr bssId;
85 tANI_U16 uDialogToken;
86 tANI_U8 fMeasureDone;
87 tANI_U16 duration;
88 tANI_U8 regClass;
89 tANI_U8 numBssDesc;
Srinivas Girigowda91ccbe82013-11-10 16:37:38 -080090 tpSirBssDescription pBssDescription[SIR_BCN_REPORT_MAX_BSS_DESC];
Jeff Johnson295189b2012-06-20 16:38:30 -070091} tSirBeaconReportXmitInd, * tpSirBeaconReportXmitInd;
92
93typedef struct sSirNeighborReportReqInd
94{
95 tANI_U16 messageType; // eWNI_SME_NEIGHBOR_REPORT_REQ_IND
96 tANI_U16 length;
97 tSirMacAddr bssId; //For the session.
98 tANI_U16 noSSID; //TRUE - dont include SSID in the request.
99 //FALSE include the SSID. It may be null (wildcard)
100 tSirMacSSid ucSSID;
101} tSirNeighborReportReqInd, * tpSirNeighborReportReqInd;
102
103
104typedef struct sSirNeighborBssDescription
105{
106 tANI_U16 length;
107 tSirMacAddr bssId;
108 tANI_U8 regClass;
109 tANI_U8 channel;
110 tANI_U8 phyType;
111 union sSirNeighborBssidInfo {
112 struct _rrmInfo {
113 tANI_U32 fApPreauthReachable:2; //see IEEE 802.11k Table 7-43a
114 tANI_U32 fSameSecurityMode:1;
115 tANI_U32 fSameAuthenticator:1;
116 tANI_U32 fCapSpectrumMeasurement:1; //see IEEE 802.11k Table 7-95d
117 tANI_U32 fCapQos:1;
118 tANI_U32 fCapApsd:1;
119 tANI_U32 fCapRadioMeasurement:1;
120 tANI_U32 fCapDelayedBlockAck:1;
121 tANI_U32 fCapImmediateBlockAck:1;
122 tANI_U32 fMobilityDomain:1;
123 tANI_U32 reserved:21;
124 } rrmInfo;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800125 struct _eseInfo {
Jeff Johnson295189b2012-06-20 16:38:30 -0700126 tANI_U32 channelBand:8;
127 tANI_U32 minRecvSigPower:8;
128 tANI_U32 apTxPower:8;
129 tANI_U32 roamHysteresis:8;
130 tANI_U32 adaptScanThres:8;
131
132 tANI_U32 transitionTime:8;
133 tANI_U32 tsfOffset:16;
134
135 tANI_U32 beaconInterval:16;
136 tANI_U32 reserved: 16;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800137 } eseInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700138 } bssidInfo;
139
140 //Optional sub IEs....ignoring for now.
141}tSirNeighborBssDescription, *tpSirNeighborBssDescripton;
142
143typedef struct sSirNeighborReportInd
144{
145 tANI_U16 messageType; // eWNI_SME_NEIGHBOR_REPORT_IND
146 tANI_U16 length;
147 tANI_U16 numNeighborReports;
148 tSirMacAddr bssId; //For the session.
149 //tSirResultCodes statusCode;
150 tSirNeighborBssDescription sNeighborBssDescription[1];
151} tSirNeighborReportInd, * tpSirNeighborReportInd;
152
153typedef struct sRRMBeaconReportRequestedIes
154{
155 tANI_U8 num;
156 tANI_U8 *pElementIds;
157}tRRMBeaconReportRequestedIes, *tpRRMBeaconReportRequestedIes;
158
159//Reporting detail defines.
160//Reference - IEEE Std 802.11k-2008 section 7.3.2.21.6 Table 7-29h
161#define BEACON_REPORTING_DETAIL_NO_FF_IE 0
162#define BEACON_REPORTING_DETAIL_ALL_FF_REQ_IE 1
163#define BEACON_REPORTING_DETAIL_ALL_FF_IE 2
164
165
166typedef struct sRRMReq
167{
168 tANI_U8 dialog_token; //In action frame;
169 tANI_U8 token; //Within individual request;
170 tANI_U8 type;
171 union {
172 struct {
173 tANI_U8 reportingDetail;
174 tRRMBeaconReportRequestedIes reqIes;
175 }Beacon;
176 }request;
Kanchanapally, Vidyullathaced2f422014-02-04 20:45:38 +0530177 tANI_U8 sendEmptyBcnRpt;
Jeff Johnson295189b2012-06-20 16:38:30 -0700178}tRRMReq, *tpRRMReq;
179
180typedef struct sRRMCaps
181{
182 tANI_U8 LinkMeasurement: 1;
183 tANI_U8 NeighborRpt: 1;
184 tANI_U8 parallel: 1;
185 tANI_U8 repeated: 1;
186 tANI_U8 BeaconPassive: 1;
187 tANI_U8 BeaconActive: 1;
188 tANI_U8 BeaconTable: 1;
189 tANI_U8 BeaconRepCond: 1;
190 tANI_U8 FrameMeasurement: 1;
191 tANI_U8 ChannelLoad: 1;
192 tANI_U8 NoiseHistogram: 1;
193 tANI_U8 statistics: 1;
194 tANI_U8 LCIMeasurement: 1;
195 tANI_U8 LCIAzimuth: 1;
196 tANI_U8 TCMCapability: 1;
197 tANI_U8 triggeredTCM: 1;
198 tANI_U8 APChanReport: 1;
199 tANI_U8 RRMMIBEnabled: 1;
200 tANI_U8 MeasurementPilotEnabled: 1;
201 tANI_U8 NeighborTSFOffset: 1;
202 tANI_U8 RCPIMeasurement: 1;
203 tANI_U8 RSNIMeasurement: 1;
204 tANI_U8 BssAvgAccessDelay: 1;
205 tANI_U8 BSSAvailAdmission: 1;
206 tANI_U8 AntennaInformation: 1;
207
208 tANI_U8 operatingChanMax;
209 tANI_U8 nonOperatingChanMax;
210 tANI_U8 MeasurementPilot;
211}tRRMCaps, *tpRRMCaps;
212
213typedef struct sRrmPEContext
214{
215 tANI_U8 rrmEnable;
216 //tChannelList APchannelReport;
217 tANI_U32 startTSF[2]; //Used during scan/measurement to store the start TSF. this is not used directly in beacon reports.
218 //This value is stored into bssdescription and beacon report gets it from bss decsription.
219 tRRMCaps rrmEnabledCaps;
220 tPowerdBm txMgmtPower;
221 tANI_U8 DialogToken; //Dialog token for the request initiated from station.
222 tpRRMReq pCurrentReq;
223}tRrmPEContext, *tpRrmPEContext;
224
225// 2008 11k spec reference: 18.4.8.5 RCPI Measurement
226#define RCPI_LOW_RSSI_VALUE (-110)
227#define RCPI_MAX_VALUE (220)
228#define CALCULATE_RCPI(rssi) (((rssi) + 110) * 2)
229
230
231#endif //#if defined __RRMGLOBAL_H