blob: aa2c80b06f09037884285ce0ac46b645eb9ed0cf [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 Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
40
41 Qualcomm Confidential and Proprietary.
42
Jeff Johnson295189b2012-06-20 16:38:30 -070043 ========================================================================*/
44
Jeff Johnson295189b2012-06-20 16:38:30 -070045typedef enum eRrmRetStatus
46{
47 eRRM_SUCCESS,
48 eRRM_INCAPABLE,
49 eRRM_REFUSED,
50 eRRM_FAILURE
51} tRrmRetStatus;
52
Srinivas Girigowda6d1f9062014-02-03 18:15:54 -080053typedef enum eRrmMsgReqSource
54{
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080055 eRRM_MSG_SOURCE_DRV = 1, /* for both 11k and legacy ese */
56 eRRM_MSG_SOURCE_ESE_UPLOAD = 2, /* ese upload approach */
Srinivas Girigowda6d1f9062014-02-03 18:15:54 -080057} tRrmMsgReqSource;
58
Jeff Johnson295189b2012-06-20 16:38:30 -070059typedef struct sSirChannelInfo
60{
61 tANI_U8 regulatoryClass;
62 tANI_U8 channelNum;
63} tSirChannelInfo, * tpSirChannelInfo;
64
65typedef struct sSirBeaconReportReqInd
66{
67 tANI_U16 messageType; // eWNI_SME_BEACON_REPORT_REQ_IND
68 tANI_U16 length;
69 tSirMacAddr bssId;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080070 tANI_U16 measurementDuration[SIR_ESE_MAX_MEAS_IE_REQS]; //ms
Jeff Johnson295189b2012-06-20 16:38:30 -070071 tANI_U16 randomizationInterval; //ms
72 tSirChannelInfo channelInfo;
73 tSirMacAddr macaddrBssid; //0: wildcard
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -080074 tANI_U8 fMeasurementtype[SIR_ESE_MAX_MEAS_IE_REQS]; //0:Passive, 1: Active, 2: table mode
Jeff Johnson295189b2012-06-20 16:38:30 -070075 tAniSSID ssId; //May be wilcard.
76 tANI_U16 uDialogToken;
77 tSirChannelList channelList; //From AP channel report.
Srinivas Girigowda6d1f9062014-02-03 18:15:54 -080078 tRrmMsgReqSource msgSource;
Jeff Johnson295189b2012-06-20 16:38:30 -070079} tSirBeaconReportReqInd, * tpSirBeaconReportReqInd;
80
81
82typedef struct sSirBeaconReportXmitInd
83{
84 tANI_U16 messageType; // eWNI_SME_BEACON_REPORT_RESP_XMIT_IND
85 tANI_U16 length;
86 tSirMacAddr bssId;
87 tANI_U16 uDialogToken;
88 tANI_U8 fMeasureDone;
89 tANI_U16 duration;
90 tANI_U8 regClass;
91 tANI_U8 numBssDesc;
Srinivas Girigowda91ccbe82013-11-10 16:37:38 -080092 tpSirBssDescription pBssDescription[SIR_BCN_REPORT_MAX_BSS_DESC];
Jeff Johnson295189b2012-06-20 16:38:30 -070093} tSirBeaconReportXmitInd, * tpSirBeaconReportXmitInd;
94
95typedef struct sSirNeighborReportReqInd
96{
97 tANI_U16 messageType; // eWNI_SME_NEIGHBOR_REPORT_REQ_IND
98 tANI_U16 length;
99 tSirMacAddr bssId; //For the session.
100 tANI_U16 noSSID; //TRUE - dont include SSID in the request.
101 //FALSE include the SSID. It may be null (wildcard)
102 tSirMacSSid ucSSID;
103} tSirNeighborReportReqInd, * tpSirNeighborReportReqInd;
104
105
106typedef struct sSirNeighborBssDescription
107{
108 tANI_U16 length;
109 tSirMacAddr bssId;
110 tANI_U8 regClass;
111 tANI_U8 channel;
112 tANI_U8 phyType;
113 union sSirNeighborBssidInfo {
114 struct _rrmInfo {
115 tANI_U32 fApPreauthReachable:2; //see IEEE 802.11k Table 7-43a
116 tANI_U32 fSameSecurityMode:1;
117 tANI_U32 fSameAuthenticator:1;
118 tANI_U32 fCapSpectrumMeasurement:1; //see IEEE 802.11k Table 7-95d
119 tANI_U32 fCapQos:1;
120 tANI_U32 fCapApsd:1;
121 tANI_U32 fCapRadioMeasurement:1;
122 tANI_U32 fCapDelayedBlockAck:1;
123 tANI_U32 fCapImmediateBlockAck:1;
124 tANI_U32 fMobilityDomain:1;
125 tANI_U32 reserved:21;
126 } rrmInfo;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800127 struct _eseInfo {
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 tANI_U32 channelBand:8;
129 tANI_U32 minRecvSigPower:8;
130 tANI_U32 apTxPower:8;
131 tANI_U32 roamHysteresis:8;
132 tANI_U32 adaptScanThres:8;
133
134 tANI_U32 transitionTime:8;
135 tANI_U32 tsfOffset:16;
136
137 tANI_U32 beaconInterval:16;
138 tANI_U32 reserved: 16;
Varun Reddy Yeturu5d5e2c62014-02-27 13:31:29 -0800139 } eseInfo;
Jeff Johnson295189b2012-06-20 16:38:30 -0700140 } bssidInfo;
141
142 //Optional sub IEs....ignoring for now.
143}tSirNeighborBssDescription, *tpSirNeighborBssDescripton;
144
145typedef struct sSirNeighborReportInd
146{
147 tANI_U16 messageType; // eWNI_SME_NEIGHBOR_REPORT_IND
148 tANI_U16 length;
149 tANI_U16 numNeighborReports;
150 tSirMacAddr bssId; //For the session.
151 //tSirResultCodes statusCode;
152 tSirNeighborBssDescription sNeighborBssDescription[1];
153} tSirNeighborReportInd, * tpSirNeighborReportInd;
154
155typedef struct sRRMBeaconReportRequestedIes
156{
157 tANI_U8 num;
158 tANI_U8 *pElementIds;
159}tRRMBeaconReportRequestedIes, *tpRRMBeaconReportRequestedIes;
160
161//Reporting detail defines.
162//Reference - IEEE Std 802.11k-2008 section 7.3.2.21.6 Table 7-29h
163#define BEACON_REPORTING_DETAIL_NO_FF_IE 0
164#define BEACON_REPORTING_DETAIL_ALL_FF_REQ_IE 1
165#define BEACON_REPORTING_DETAIL_ALL_FF_IE 2
166
167
168typedef struct sRRMReq
169{
170 tANI_U8 dialog_token; //In action frame;
171 tANI_U8 token; //Within individual request;
172 tANI_U8 type;
173 union {
174 struct {
175 tANI_U8 reportingDetail;
176 tRRMBeaconReportRequestedIes reqIes;
177 }Beacon;
178 }request;
Kanchanapally, Vidyullathaced2f422014-02-04 20:45:38 +0530179 tANI_U8 sendEmptyBcnRpt;
Jeff Johnson295189b2012-06-20 16:38:30 -0700180}tRRMReq, *tpRRMReq;
181
182typedef struct sRRMCaps
183{
184 tANI_U8 LinkMeasurement: 1;
185 tANI_U8 NeighborRpt: 1;
186 tANI_U8 parallel: 1;
187 tANI_U8 repeated: 1;
188 tANI_U8 BeaconPassive: 1;
189 tANI_U8 BeaconActive: 1;
190 tANI_U8 BeaconTable: 1;
191 tANI_U8 BeaconRepCond: 1;
192 tANI_U8 FrameMeasurement: 1;
193 tANI_U8 ChannelLoad: 1;
194 tANI_U8 NoiseHistogram: 1;
195 tANI_U8 statistics: 1;
196 tANI_U8 LCIMeasurement: 1;
197 tANI_U8 LCIAzimuth: 1;
198 tANI_U8 TCMCapability: 1;
199 tANI_U8 triggeredTCM: 1;
200 tANI_U8 APChanReport: 1;
201 tANI_U8 RRMMIBEnabled: 1;
202 tANI_U8 MeasurementPilotEnabled: 1;
203 tANI_U8 NeighborTSFOffset: 1;
204 tANI_U8 RCPIMeasurement: 1;
205 tANI_U8 RSNIMeasurement: 1;
206 tANI_U8 BssAvgAccessDelay: 1;
207 tANI_U8 BSSAvailAdmission: 1;
208 tANI_U8 AntennaInformation: 1;
209
210 tANI_U8 operatingChanMax;
211 tANI_U8 nonOperatingChanMax;
212 tANI_U8 MeasurementPilot;
213}tRRMCaps, *tpRRMCaps;
214
215typedef struct sRrmPEContext
216{
217 tANI_U8 rrmEnable;
218 //tChannelList APchannelReport;
219 tANI_U32 startTSF[2]; //Used during scan/measurement to store the start TSF. this is not used directly in beacon reports.
220 //This value is stored into bssdescription and beacon report gets it from bss decsription.
221 tRRMCaps rrmEnabledCaps;
222 tPowerdBm txMgmtPower;
223 tANI_U8 DialogToken; //Dialog token for the request initiated from station.
224 tpRRMReq pCurrentReq;
225}tRrmPEContext, *tpRrmPEContext;
226
227// 2008 11k spec reference: 18.4.8.5 RCPI Measurement
228#define RCPI_LOW_RSSI_VALUE (-110)
229#define RCPI_MAX_VALUE (220)
230#define CALCULATE_RCPI(rssi) (((rssi) + 110) * 2)
231
232
233#endif //#if defined __RRMGLOBAL_H