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