blob: 053848d1f0c5b00865cea2b126fc6eba2b38d5a4 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2011-2012, 2014-2015 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#if !defined(__RRMGLOBAL_H)
29#define __RRMGLOBAL_H
30
31/**=========================================================================
32
33 \file rrm_global.h
34
35 \brief Definitions for SME APIs
36
37 ========================================================================*/
38
39typedef enum eRrmRetStatus {
40 eRRM_SUCCESS,
41 eRRM_INCAPABLE,
42 eRRM_REFUSED,
43 eRRM_FAILURE
44} tRrmRetStatus;
45
46typedef enum eRrmMsgReqSource {
47 eRRM_MSG_SOURCE_LEGACY_ESE = 1, /* legacy ese */
48 eRRM_MSG_SOURCE_11K = 2, /* 11k */
49 eRRM_MSG_SOURCE_ESE_UPLOAD = 3, /* ese upload approach */
50} tRrmMsgReqSource;
51
52typedef struct sSirChannelInfo {
53 uint8_t regulatoryClass;
54 uint8_t channelNum;
55} tSirChannelInfo, *tpSirChannelInfo;
56
57typedef struct sSirBeaconReportReqInd {
58 uint16_t messageType; /* eWNI_SME_BEACON_REPORT_REQ_IND */
59 uint16_t length;
60 tSirMacAddr bssId;
61 uint16_t measurementDuration[SIR_ESE_MAX_MEAS_IE_REQS]; /* ms */
62 uint16_t randomizationInterval; /* ms */
63 tSirChannelInfo channelInfo;
64 /* 0: wildcard */
65 tSirMacAddr macaddrBssid;
66 /* 0:Passive, 1: Active, 2: table mode */
67 uint8_t fMeasurementtype[SIR_ESE_MAX_MEAS_IE_REQS];
68 tAniSSID ssId; /* May be wilcard. */
69 uint16_t uDialogToken;
70 tSirChannelList channelList; /* From AP channel report. */
71 tRrmMsgReqSource msgSource;
72} tSirBeaconReportReqInd, *tpSirBeaconReportReqInd;
73
74typedef struct sSirBeaconReportXmitInd {
75 uint16_t messageType; /* eWNI_SME_BEACON_REPORT_RESP_XMIT_IND */
76 uint16_t length;
77 tSirMacAddr bssId;
78 uint16_t uDialogToken;
79 uint8_t fMeasureDone;
80 uint16_t duration;
81 uint8_t regClass;
82 uint8_t numBssDesc;
83 tpSirBssDescription pBssDescription[SIR_BCN_REPORT_MAX_BSS_DESC];
84} tSirBeaconReportXmitInd, *tpSirBeaconReportXmitInd;
85
86typedef struct sSirNeighborReportReqInd {
87 /* eWNI_SME_NEIGHBOR_REPORT_REQ_IND */
88 uint16_t messageType;
89 uint16_t length;
90 /* For the session. */
91 tSirMacAddr bssId;
92 /* true - dont include SSID in the request. */
93 uint16_t noSSID;
94 /* false include the SSID. It may be null (wildcard) */
95 tSirMacSSid ucSSID;
96} tSirNeighborReportReqInd, *tpSirNeighborReportReqInd;
97
98typedef struct sSirNeighborBssDescription {
99 uint16_t length;
100 tSirMacAddr bssId;
101 uint8_t regClass;
102 uint8_t channel;
103 uint8_t phyType;
104 union sSirNeighborBssidInfo {
105 struct _rrmInfo {
106 /* see IEEE 802.11k Table 7-43a */
107 uint32_t fApPreauthReachable:2;
108 uint32_t fSameSecurityMode:1;
109 uint32_t fSameAuthenticator:1;
110 /* see IEEE 802.11k Table 7-95d */
111 uint32_t fCapSpectrumMeasurement:1;
112 uint32_t fCapQos:1;
113 uint32_t fCapApsd:1;
114 uint32_t fCapRadioMeasurement:1;
115 uint32_t fCapDelayedBlockAck:1;
116 uint32_t fCapImmediateBlockAck:1;
117 uint32_t fMobilityDomain:1;
118 uint32_t reserved:21;
119 } rrmInfo;
120 struct _eseInfo {
121 uint32_t channelBand:8;
122 uint32_t minRecvSigPower:8;
123 uint32_t apTxPower:8;
124 uint32_t roamHysteresis:8;
125 uint32_t adaptScanThres:8;
126
127 uint32_t transitionTime:8;
128 uint32_t tsfOffset:16;
129
130 uint32_t beaconInterval:16;
131 uint32_t reserved:16;
132 } eseInfo;
133 } bssidInfo;
134
135 /* Optional sub IEs....ignoring for now. */
136} tSirNeighborBssDescription, *tpSirNeighborBssDescripton;
137
138typedef struct sSirNeighborReportInd {
139 uint16_t messageType; /* eWNI_SME_NEIGHBOR_REPORT_IND */
140 uint16_t length;
141 uint8_t sessionId;
142 uint16_t numNeighborReports;
143 tSirMacAddr bssId; /* For the session. */
144 tSirNeighborBssDescription sNeighborBssDescription[1];
145} tSirNeighborReportInd, *tpSirNeighborReportInd;
146
147typedef struct sRRMBeaconReportRequestedIes {
148 uint8_t num;
149 uint8_t *pElementIds;
150} tRRMBeaconReportRequestedIes, *tpRRMBeaconReportRequestedIes;
151
152/* Reporting detail defines. */
153/* Reference - IEEE Std 802.11k-2008 section 7.3.2.21.6 Table 7-29h */
154#define BEACON_REPORTING_DETAIL_NO_FF_IE 0
155#define BEACON_REPORTING_DETAIL_ALL_FF_REQ_IE 1
156#define BEACON_REPORTING_DETAIL_ALL_FF_IE 2
157
158typedef struct sRRMReq {
159 uint8_t dialog_token; /* In action frame; */
160 uint8_t token; /* Within individual request; */
161 uint8_t type;
162 union {
163 struct {
164 uint8_t reportingDetail;
165 tRRMBeaconReportRequestedIes reqIes;
166 } Beacon;
167 } request;
168 uint8_t sendEmptyBcnRpt;
169} tRRMReq, *tpRRMReq;
170
171typedef struct sRRMCaps {
172 uint8_t LinkMeasurement:1;
173 uint8_t NeighborRpt:1;
174 uint8_t parallel:1;
175 uint8_t repeated:1;
176 uint8_t BeaconPassive:1;
177 uint8_t BeaconActive:1;
178 uint8_t BeaconTable:1;
179 uint8_t BeaconRepCond:1;
180 uint8_t FrameMeasurement:1;
181 uint8_t ChannelLoad:1;
182 uint8_t NoiseHistogram:1;
183 uint8_t statistics:1;
184 uint8_t LCIMeasurement:1;
185 uint8_t LCIAzimuth:1;
186 uint8_t TCMCapability:1;
187 uint8_t triggeredTCM:1;
188 uint8_t APChanReport:1;
189 uint8_t RRMMIBEnabled:1;
190 uint8_t operatingChanMax:3;
191 uint8_t nonOperatingChanMax:3;
192 uint8_t MeasurementPilot:3;
193 uint8_t MeasurementPilotEnabled:1;
194 uint8_t NeighborTSFOffset:1;
195 uint8_t RCPIMeasurement:1;
196 uint8_t RSNIMeasurement:1;
197 uint8_t BssAvgAccessDelay:1;
198 uint8_t BSSAvailAdmission:1;
199 uint8_t AntennaInformation:1;
200 uint8_t fine_time_meas_rpt:1;
201 uint8_t lci_capability:1;
202 uint8_t reserved:4;
203} tRRMCaps, *tpRRMCaps;
204
205typedef struct sRrmPEContext {
206 uint8_t rrmEnable;
207 /*
208 * Used during scan/measurement to store the start TSF.
209 * this is not used directly in beacon reports.
210 */
211 uint32_t startTSF[2];
212 /*
213 * This value is stored into bssdescription and beacon report
214 * gets it from bss decsription.
215 */
216 tRRMCaps rrmEnabledCaps;
217 tPowerdBm txMgmtPower;
218 /* Dialog token for the request initiated from station. */
219 uint8_t DialogToken;
220 tpRRMReq pCurrentReq;
221} tRrmPEContext, *tpRrmPEContext;
222
223/* 2008 11k spec reference: 18.4.8.5 RCPI Measurement */
224#define RCPI_LOW_RSSI_VALUE (-110)
225#define RCPI_MAX_VALUE (220)
226#define CALCULATE_RCPI(rssi) (((rssi) + 110) * 2)
227
228#endif /* #if defined __RRMGLOBAL_H */