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