Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, 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 | /* |
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 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | /* |
| 42 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 43 | * This file limProcessActionFrame.cc contains the code |
| 44 | * for processing Action Frame. |
| 45 | * Author: Michael Lui |
| 46 | * Date: 05/23/03 |
| 47 | * History:- |
| 48 | * Date Modified by Modification Information |
| 49 | * -------------------------------------------------------------------- |
| 50 | * |
| 51 | */ |
| 52 | #include "palTypes.h" |
| 53 | #include "wniApi.h" |
| 54 | #include "sirApi.h" |
| 55 | #include "aniGlobal.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 56 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 57 | #include "schApi.h" |
| 58 | #include "utilsApi.h" |
| 59 | #include "limTypes.h" |
| 60 | #include "limUtils.h" |
| 61 | #include "limAssocUtils.h" |
| 62 | #include "limSecurityUtils.h" |
| 63 | #include "limSerDesUtils.h" |
| 64 | #include "limSendSmeRspMessages.h" |
| 65 | #include "parserApi.h" |
| 66 | #include "limAdmitControl.h" |
| 67 | #include "wmmApsd.h" |
| 68 | #include "limSendMessages.h" |
| 69 | #if defined WLAN_FEATURE_VOWIFI |
| 70 | #include "rrmApi.h" |
| 71 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 72 | #include "limSessionUtils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 73 | |
| 74 | #if defined FEATURE_WLAN_CCX |
| 75 | #include "ccxApi.h" |
| 76 | #endif |
| 77 | #include "wlan_qct_wda.h" |
| 78 | |
| 79 | |
| 80 | #define BA_DEFAULT_TX_BUFFER_SIZE 64 |
| 81 | |
| 82 | typedef enum |
| 83 | { |
| 84 | LIM_ADDBA_RSP = 0, |
| 85 | LIM_ADDBA_REQ = 1 |
| 86 | }tLimAddBaValidationReqType; |
| 87 | |
| 88 | /* Note: The test passes if the STAUT stops sending any frames, and no further |
| 89 | frames are transmitted on this channel by the station when the AP has sent |
| 90 | the last 6 beacons, with the channel switch information elements as seen |
| 91 | with the sniffer.*/ |
| 92 | #define SIR_CHANSW_TX_STOP_MAX_COUNT 6 |
| 93 | /**----------------------------------------------------------------- |
| 94 | \fn limStopTxAndSwitchChannel |
| 95 | \brief Stops the transmission if channel switch mode is silent and |
| 96 | starts the channel switch timer. |
| 97 | |
| 98 | \param pMac |
| 99 | \return NONE |
| 100 | -----------------------------------------------------------------*/ |
| 101 | void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId) |
| 102 | { |
| 103 | tANI_U8 isFullPowerRequested = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 104 | tpPESession psessionEntry; |
| 105 | |
| 106 | psessionEntry = peFindSessionBySessionId( pMac , sessionId ); |
| 107 | |
| 108 | if( NULL == psessionEntry ) |
| 109 | { |
| 110 | limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId); |
| 111 | return; |
| 112 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 113 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 114 | PELOG1(limLog(pMac, LOG1, FL("Channel switch Mode == %d"), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 115 | psessionEntry->gLimChannelSwitch.switchMode);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 117 | if (psessionEntry->gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT || |
| 118 | psessionEntry->gLimChannelSwitch.switchCount <= SIR_CHANSW_TX_STOP_MAX_COUNT) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 119 | { |
| 120 | /* Freeze the transmission */ |
| 121 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_STOP_TX); |
| 122 | |
| 123 | /*Request for Full power only if the device is in powersave*/ |
| 124 | if(!limIsSystemInActiveState(pMac)) |
| 125 | { |
| 126 | /* Request Full Power */ |
| 127 | limSendSmePreChannelSwitchInd(pMac); |
| 128 | isFullPowerRequested = 1; |
| 129 | } |
| 130 | } |
| 131 | else |
| 132 | { |
| 133 | /* Resume the transmission */ |
| 134 | limFrameTransmissionControl(pMac, eLIM_TX_ALL, eLIM_RESUME_TX); |
| 135 | } |
| 136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 137 | pMac->lim.limTimers.gLimChannelSwitchTimer.sessionId = sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 138 | /* change the channel immediatly only if the channel switch count is 0 and the |
| 139 | * device is not in powersave |
| 140 | * If the device is in powersave channel switch should happen only after the |
| 141 | * device comes out of the powersave */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 142 | if (psessionEntry->gLimChannelSwitch.switchCount == 0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 143 | { |
| 144 | if(limIsSystemInActiveState(pMac)) |
| 145 | { |
| 146 | limProcessChannelSwitchTimeout(pMac); |
| 147 | } |
| 148 | else if(!isFullPowerRequested) |
| 149 | { |
| 150 | /* If the Full power is already not requested |
| 151 | * Request Full Power so the channel switch happens |
| 152 | * after device comes to full power */ |
| 153 | limSendSmePreChannelSwitchInd(pMac); |
| 154 | } |
| 155 | return; |
| 156 | } |
Leela V Kiran Kumar Reddy Chirala | c3b9d38 | 2013-01-31 20:49:53 -0800 | [diff] [blame] | 157 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, sessionId, eLIM_CHANNEL_SWITCH_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 159 | |
| 160 | if (tx_timer_activate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != TX_SUCCESS) |
| 161 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 162 | limLog(pMac, LOGP, FL("tx_timer_activate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 163 | } |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | /**------------------------------------------------------------ |
| 168 | \fn limStartChannelSwitch |
| 169 | \brief Switches the channel if switch count == 0, otherwise |
| 170 | starts the timer for channel switch and stops BG scan |
| 171 | and heartbeat timer tempororily. |
| 172 | |
| 173 | \param pMac |
| 174 | \param psessionEntry |
| 175 | \return NONE |
| 176 | ------------------------------------------------------------*/ |
| 177 | tSirRetStatus limStartChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) |
| 178 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 179 | PELOG1(limLog(pMac, LOG1, FL("Starting the channel switch"));) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 180 | |
| 181 | /*If channel switch is already running and it is on a different session, just return*/ |
| 182 | /*This need to be removed for MCC */ |
| 183 | if( limIsChanSwitchRunning (pMac) && |
| 184 | psessionEntry->gLimSpecMgmt.dot11hChanSwState != eLIM_11H_CHANSW_RUNNING ) |
| 185 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 186 | limLog(pMac, LOGW, FL("Ignoring channel switch on session %d"), psessionEntry->peSessionId); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 187 | return eSIR_SUCCESS; |
| 188 | } |
| 189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 190 | /* Deactivate and change reconfigure the timeout value */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 191 | //limDeactivateAndChangeTimer(pMac, eLIM_CHANNEL_SWITCH_TIMER); |
Varun Reddy Yeturu | e3bbf6e | 2013-02-08 18:50:55 -0800 | [diff] [blame] | 192 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_CHANNEL_SWITCH_TIMER)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 193 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) |
| 194 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 195 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed!")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 196 | return eSIR_FAILURE; |
| 197 | } |
| 198 | |
| 199 | if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer, |
| 200 | psessionEntry->gLimChannelSwitch.switchTimeoutValue, |
| 201 | 0) != TX_SUCCESS) |
| 202 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 203 | limLog(pMac, LOGP, FL("tx_timer_change failed ")); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 204 | return eSIR_FAILURE; |
| 205 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 206 | |
| 207 | /* Follow the channel switch, forget about the previous quiet. */ |
| 208 | //If quiet is running, chance is there to resume tx on its timeout. |
| 209 | //so stop timer for a safer side. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 210 | if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 211 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 212 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 213 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer) != TX_SUCCESS) |
| 214 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 215 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 216 | return eSIR_FAILURE; |
| 217 | } |
| 218 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 219 | else if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 220 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 221 | MTRACE(macTrace(pMac, TRACE_CODE_TIMER_DEACTIVATE, psessionEntry->peSessionId, eLIM_QUIET_BSS_TIMER)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 222 | if (tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer) != TX_SUCCESS) |
| 223 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 224 | limLog(pMac, LOGP, FL("tx_timer_deactivate failed")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 225 | return eSIR_FAILURE; |
| 226 | } |
| 227 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 228 | psessionEntry->gLimSpecMgmt.quietState = eLIM_QUIET_INIT; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 229 | |
| 230 | /* Prepare for 11h channel switch */ |
| 231 | limPrepareFor11hChannelSwitch(pMac, psessionEntry); |
| 232 | |
| 233 | /** Dont add any more statements here as we posted finish scan request |
| 234 | * to HAL, wait till we get the response |
| 235 | */ |
| 236 | return eSIR_SUCCESS; |
| 237 | } |
| 238 | |
| 239 | |
| 240 | /** |
| 241 | * __limProcessChannelSwitchActionFrame |
| 242 | * |
| 243 | *FUNCTION: |
| 244 | * |
| 245 | *LOGIC: |
| 246 | * |
| 247 | *ASSUMPTIONS: |
| 248 | * |
| 249 | *NOTE: |
| 250 | * |
| 251 | * @param pMac - Pointer to Global MAC structure |
| 252 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 253 | * @return None |
| 254 | */ |
| 255 | |
| 256 | static void |
| 257 | |
| 258 | __limProcessChannelSwitchActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 259 | { |
| 260 | |
| 261 | tpSirMacMgmtHdr pHdr; |
| 262 | tANI_U8 *pBody; |
| 263 | tDot11fChannelSwitch *pChannelSwitchFrame; |
| 264 | tANI_U16 beaconPeriod; |
| 265 | tANI_U32 val; |
| 266 | tANI_U32 frameLen; |
| 267 | tANI_U32 nStatus; |
| 268 | eHalStatus status; |
| 269 | |
| 270 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 271 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 272 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 273 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 274 | PELOG3(limLog(pMac, LOG3, FL("Received Channel switch action frame"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 275 | if (!psessionEntry->lim11hEnable) |
| 276 | return; |
| 277 | |
| 278 | status = palAllocateMemory( pMac->hHdd, (void **)&pChannelSwitchFrame, sizeof(*pChannelSwitchFrame)); |
| 279 | if (eHAL_STATUS_SUCCESS != status) |
| 280 | { |
| 281 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 282 | FL("palAllocateMemory failed, status = %d "), status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 283 | return; |
| 284 | } |
| 285 | |
| 286 | /* Unpack channel switch frame */ |
| 287 | nStatus = dot11fUnpackChannelSwitch(pMac, pBody, frameLen, pChannelSwitchFrame); |
| 288 | |
| 289 | if( DOT11F_FAILED( nStatus )) |
| 290 | { |
| 291 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 292 | FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 293 | nStatus, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 294 | frameLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 295 | palFreeMemory(pMac->hHdd, pChannelSwitchFrame); |
| 296 | return; |
| 297 | } |
| 298 | else if(DOT11F_WARNED( nStatus )) |
| 299 | { |
| 300 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 301 | FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 302 | nStatus, |
| 303 | frameLen); |
| 304 | } |
| 305 | |
| 306 | if (palEqualMemory( pMac->hHdd,(tANI_U8 *) &psessionEntry->bssId, |
| 307 | (tANI_U8 *) &pHdr->sa, |
| 308 | sizeof(tSirMacAddr))) |
| 309 | { |
| 310 | #if 0 |
| 311 | if (wlan_cfgGetInt(pMac, WNI_CFG_BEACON_INTERVAL, &val) != eSIR_SUCCESS) |
| 312 | { |
| 313 | palFreeMemory(pMac->hHdd, pChannelSwitchFrame); |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 314 | limLog(pMac, LOGP, FL("could not retrieve Beacon interval")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 315 | return; |
| 316 | } |
| 317 | #endif// TO SUPPORT BT-AMP |
| 318 | |
| 319 | /* copy the beacon interval from psessionEntry*/ |
| 320 | val = psessionEntry->beaconParams.beaconInterval; |
| 321 | |
| 322 | beaconPeriod = (tANI_U16) val; |
| 323 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 324 | psessionEntry->gLimChannelSwitch.primaryChannel = pChannelSwitchFrame->ChanSwitchAnn.newChannel; |
| 325 | psessionEntry->gLimChannelSwitch.switchCount = pChannelSwitchFrame->ChanSwitchAnn.switchCount; |
| 326 | psessionEntry->gLimChannelSwitch.switchTimeoutValue = SYS_MS_TO_TICKS(beaconPeriod) * |
| 327 | psessionEntry->gLimChannelSwitch.switchCount; |
| 328 | psessionEntry->gLimChannelSwitch.switchMode = pChannelSwitchFrame->ChanSwitchAnn.switchMode; |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 329 | #ifdef WLAN_FEATURE_11AC |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 330 | if ( pChannelSwitchFrame->WiderBWChanSwitchAnn.present && psessionEntry->vhtCapability) |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 331 | { |
| 332 | psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth; |
| 333 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0; |
| 334 | psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq1; |
| 335 | } |
| 336 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 337 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 338 | PELOG3(limLog(pMac, LOG3, FL("Rcv Chnl Swtch Frame: Timeout in %d ticks"), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 339 | psessionEntry->gLimChannelSwitch.switchTimeoutValue);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 340 | |
| 341 | /* Only primary channel switch element is present */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 342 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_ONLY; |
| 343 | psessionEntry->gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 344 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 345 | if (psessionEntry->htSupportedChannelWidthSet) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 346 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 347 | if ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 348 | (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 350 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
| 351 | psessionEntry->gLimChannelSwitch.secondarySubBand = pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | } |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 353 | #ifdef WLAN_FEATURE_11AC |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 354 | if(psessionEntry->vhtCapability && pChannelSwitchFrame->WiderBWChanSwitchAnn.present) |
| 355 | { |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 356 | if (pChannelSwitchFrame->WiderBWChanSwitchAnn.newChanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) |
| 357 | { |
| 358 | if (pChannelSwitchFrame->ExtChanSwitchAnn.present && ((pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_LOW_PRIMARY) || |
| 359 | (pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY))) |
| 360 | { |
| 361 | psessionEntry->gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 362 | psessionEntry->gLimChannelSwitch.secondarySubBand = |
| 363 | limGet11ACPhyCBState(pMac, |
| 364 | psessionEntry->gLimChannelSwitch.primaryChannel, |
| 365 | pChannelSwitchFrame->ExtChanSwitchAnn.secondaryChannelOffset, |
| 366 | pChannelSwitchFrame->WiderBWChanSwitchAnn.newCenterChanFreq0, |
| 367 | psessionEntry); |
Madan Mohan Koyyalamudi | c6226de | 2012-09-18 16:33:31 -0700 | [diff] [blame] | 368 | } |
| 369 | } |
| 370 | } |
| 371 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | } |
| 375 | else |
| 376 | { |
| 377 | PELOG1(limLog(pMac, LOG1, FL("LIM: Received action frame not from our BSS, dropping..."));) |
| 378 | } |
| 379 | |
| 380 | if (eSIR_SUCCESS != limStartChannelSwitch(pMac, psessionEntry)) |
| 381 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 382 | PELOG1(limLog(pMac, LOG1, FL("Could not start channel switch"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | } |
| 384 | |
| 385 | palFreeMemory(pMac->hHdd, pChannelSwitchFrame); |
| 386 | return; |
| 387 | } /*** end limProcessChannelSwitchActionFrame() ***/ |
| 388 | |
| 389 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 390 | #ifdef WLAN_FEATURE_11AC |
| 391 | static void |
| 392 | __limProcessOperatingModeActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 393 | { |
| 394 | |
| 395 | tpSirMacMgmtHdr pHdr; |
| 396 | tANI_U8 *pBody; |
| 397 | tDot11fOperatingMode *pOperatingModeframe; |
| 398 | tANI_U32 frameLen; |
| 399 | tANI_U32 nStatus; |
| 400 | eHalStatus status; |
| 401 | tpDphHashNode pSta; |
| 402 | tANI_U16 aid; |
| 403 | tANI_U8 operMode; |
| 404 | |
| 405 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 406 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 407 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 408 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 409 | PELOG3(limLog(pMac, LOG3, FL("Received Operating Mode action frame"));) |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 410 | status = palAllocateMemory( pMac->hHdd, (void **)&pOperatingModeframe, sizeof(*pOperatingModeframe)); |
| 411 | if (eHAL_STATUS_SUCCESS != status) |
| 412 | { |
| 413 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 414 | FL("palAllocateMemory failed, status = %d "), status); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 415 | return; |
| 416 | } |
| 417 | |
| 418 | /* Unpack channel switch frame */ |
| 419 | nStatus = dot11fUnpackOperatingMode(pMac, pBody, frameLen, pOperatingModeframe); |
| 420 | |
| 421 | if( DOT11F_FAILED( nStatus )) |
| 422 | { |
| 423 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 424 | FL( "Failed to unpack and parse an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 425 | nStatus, |
| 426 | frameLen); |
| 427 | palFreeMemory(pMac->hHdd, pOperatingModeframe); |
| 428 | return; |
| 429 | } |
| 430 | else if(DOT11F_WARNED( nStatus )) |
| 431 | { |
| 432 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 433 | FL( "There were warnings while unpacking an 11h-CHANSW Request (0x%08x, %d bytes):"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 434 | nStatus, |
| 435 | frameLen); |
| 436 | } |
| 437 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 438 | |
| 439 | operMode = pSta->vhtSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_80MHZ : pSta->htSupportedChannelWidthSet ? eHT_CHANNEL_WIDTH_40MHZ: eHT_CHANNEL_WIDTH_20MHZ; |
| 440 | if( operMode != pOperatingModeframe->OperatingMode.chanWidth) |
| 441 | { |
| 442 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 443 | FL(" received Chanwidth %d, staIdx = %d"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 444 | (pOperatingModeframe->OperatingMode.chanWidth ), |
| 445 | pSta->staIndex); |
| 446 | |
| 447 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 448 | FL(" MAC - %0x:%0x:%0x:%0x:%0x:%0x"), |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 449 | pHdr->sa[0], |
| 450 | pHdr->sa[1], |
| 451 | pHdr->sa[2], |
| 452 | pHdr->sa[3], |
| 453 | pHdr->sa[4], |
| 454 | pHdr->sa[5]); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 455 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 456 | if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_80MHZ) |
| 457 | { |
| 458 | pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ; |
| 459 | pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 460 | } |
| 461 | else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_40MHZ) |
| 462 | { |
| 463 | pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 464 | pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_40MHZ; |
| 465 | } |
| 466 | else if(pOperatingModeframe->OperatingMode.chanWidth == eHT_CHANNEL_WIDTH_20MHZ) |
| 467 | { |
| 468 | pSta->vhtSupportedChannelWidthSet = WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ; |
| 469 | pSta->htSupportedChannelWidthSet = eHT_CHANNEL_WIDTH_20MHZ; |
| 470 | } |
| 471 | limCheckVHTOpModeChange( pMac, psessionEntry, |
| 472 | (pOperatingModeframe->OperatingMode.chanWidth), pSta->staIndex);\ |
| 473 | } |
| 474 | palFreeMemory(pMac->hHdd, pOperatingModeframe); |
| 475 | return; |
| 476 | } |
| 477 | #endif |
| 478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 479 | static void |
| 480 | __limProcessAddTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 481 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | |
| 485 | static void |
| 486 | __limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 487 | { |
| 488 | tSirAddtsRspInfo addts; |
| 489 | tSirRetStatus retval; |
| 490 | tpSirMacMgmtHdr pHdr; |
| 491 | tpDphHashNode pSta; |
| 492 | tANI_U16 aid; |
| 493 | tANI_U32 frameLen; |
| 494 | tANI_U8 *pBody; |
| 495 | tpLimTspecInfo tspecInfo; |
| 496 | tANI_U8 ac; |
| 497 | tpDphHashNode pStaDs = NULL; |
| 498 | tANI_U8 rspReqd = 1; |
| 499 | tANI_U32 cfgLen; |
| 500 | tSirMacAddr peerMacAddr; |
| 501 | |
| 502 | |
| 503 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 504 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 505 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 506 | |
| 507 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 508 | PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 509 | if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) |
| 510 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 511 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 512 | return; |
| 513 | } |
| 514 | |
| 515 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 516 | if (pSta == NULL) |
| 517 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 518 | PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 519 | return; |
| 520 | } |
| 521 | |
| 522 | retval = sirConvertAddtsRsp2Struct(pMac, pBody, frameLen, &addts); |
| 523 | if (retval != eSIR_SUCCESS) |
| 524 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 525 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp parsing failed (error %d)"), retval);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 526 | return; |
| 527 | } |
| 528 | |
| 529 | // don't have to check for qos/wme capabilities since we wouldn't have this |
| 530 | // flag set otherwise |
| 531 | if (! pMac->lim.gLimAddtsSent) |
| 532 | { |
| 533 | // we never sent an addts request! |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 534 | PELOGW(limLog(pMac, LOGW, "Recvd AddTsRsp but no request was ever sent - ignoring");) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 535 | return; |
| 536 | } |
| 537 | |
| 538 | if (pMac->lim.gLimAddtsReq.req.dialogToken != addts.dialogToken) |
| 539 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 540 | limLog(pMac, LOGW, "AddTsRsp: token mismatch (got %d, exp %d) - ignoring", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 541 | addts.dialogToken, pMac->lim.gLimAddtsReq.req.dialogToken); |
| 542 | return; |
| 543 | } |
| 544 | |
| 545 | /* |
| 546 | * for successful addts reponse, try to add the classifier. |
| 547 | * if this fails for any reason, we should send a delts request to the ap |
| 548 | * for now, its ok not to send a delts since we are going to add support for |
| 549 | * multiple tclas soon and until then we won't send any addts requests with |
| 550 | * multiple tclas elements anyway. |
| 551 | * In case of addClassifier failure, we just let the addts timer run out |
| 552 | */ |
| 553 | if (((addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 554 | (addts.tspec.tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) && |
| 555 | (addts.status == eSIR_MAC_SUCCESS_STATUS)) |
| 556 | { |
| 557 | // add the classifier - this should always succeed |
| 558 | if (addts.numTclas > 1) // currently no support for multiple tclas elements |
| 559 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 560 | limLog(pMac, LOGE, FL("Sta %d: Too many Tclas (%d), only 1 supported"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 561 | aid, addts.numTclas); |
| 562 | return; |
| 563 | } |
| 564 | else if (addts.numTclas == 1) |
| 565 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 566 | limLog(pMac, LOGW, "AddTs Response from STA %d: tsid %d, UP %d, OK!", aid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 567 | addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio); |
| 568 | } |
| 569 | } |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 570 | limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 571 | addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio, |
| 572 | addts.status); |
| 573 | |
| 574 | // deactivate the response timer |
| 575 | limDeactivateAndChangeTimer(pMac, eLIM_ADDTS_RSP_TIMER); |
| 576 | |
| 577 | if (addts.status != eSIR_MAC_SUCCESS_STATUS) |
| 578 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 579 | limLog(pMac, LOGW, "Recv AddTsRsp: tsid %d, UP %d, status %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 580 | addts.tspec.tsinfo.traffic.tsid, addts.tspec.tsinfo.traffic.userPrio, |
| 581 | addts.status); |
| 582 | limSendSmeAddtsRsp(pMac, true, addts.status, psessionEntry, addts.tspec, |
| 583 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 584 | |
| 585 | // clear the addts flag |
| 586 | pMac->lim.gLimAddtsSent = false; |
| 587 | |
| 588 | return; |
| 589 | } |
| 590 | #ifdef FEATURE_WLAN_CCX |
| 591 | if (addts.tsmPresent) |
| 592 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 593 | limLog(pMac, LOGW, "TSM IE Present"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 594 | psessionEntry->ccxContext.tsm.tid = addts.tspec.tsinfo.traffic.userPrio; |
| 595 | vos_mem_copy(&psessionEntry->ccxContext.tsm.tsmInfo, |
| 596 | &addts.tsmIE,sizeof(tSirMacCCXTSMIE)); |
| 597 | limActivateTSMStatsTimer(pMac, psessionEntry); |
| 598 | } |
| 599 | #endif |
| 600 | /* Since AddTS response was successful, check for the PSB flag |
| 601 | * and directional flag inside the TS Info field. |
| 602 | * An AC is trigger enabled AC if the PSB subfield is set to 1 |
| 603 | * in the uplink direction. |
| 604 | * An AC is delivery enabled AC if the PSB subfield is set to 1 |
| 605 | * in the downlink direction. |
| 606 | * An AC is trigger and delivery enabled AC if the PSB subfield |
| 607 | * is set to 1 in the bi-direction field. |
| 608 | */ |
| 609 | if (addts.tspec.tsinfo.traffic.psb == 1) |
| 610 | limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, SET_UAPSD_MASK); |
| 611 | else |
| 612 | limSetTspecUapsdMask(pMac, &addts.tspec.tsinfo, CLEAR_UAPSD_MASK); |
| 613 | |
| 614 | |
| 615 | /* ADDTS success, so AC is now admitted. We shall now use the default |
| 616 | * EDCA parameters as advertised by AP and send the updated EDCA params |
| 617 | * to HAL. |
| 618 | */ |
| 619 | ac = upToAc(addts.tspec.tsinfo.traffic.userPrio); |
| 620 | if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 621 | { |
| 622 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 623 | } |
| 624 | else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 625 | { |
| 626 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 627 | } |
| 628 | else if(addts.tspec.tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 629 | { |
| 630 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); |
| 631 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); |
| 632 | } |
| 633 | |
| 634 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 635 | |
| 636 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 637 | if (pStaDs != NULL) |
| 638 | { |
| 639 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 640 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 641 | else |
| 642 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 643 | } |
| 644 | else |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 645 | limLog(pMac, LOGE, FL("Self entry missing in Hash Table ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 646 | |
| 647 | |
| 648 | sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); |
| 649 | |
| 650 | //if schedule is not present then add TSPEC with svcInterval as 0. |
| 651 | if(!addts.schedulePresent) |
| 652 | addts.schedule.svcInterval = 0; |
| 653 | if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, &addts.tspec, addts.schedule.svcInterval, &tspecInfo)) |
| 654 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 655 | PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 656 | limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec, |
| 657 | psessionEntry); |
| 658 | pMac->lim.gLimAddtsSent = false; |
| 659 | return; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status. |
| 660 | } |
| 661 | if((addts.tspec.tsinfo.traffic.accessPolicy != SIR_MAC_ACCESSPOLICY_EDCA) || |
| 662 | ((upToAc(addts.tspec.tsinfo.traffic.userPrio) < MAX_NUM_AC) && |
| 663 | (psessionEntry->gLimEdcaParams[upToAc(addts.tspec.tsinfo.traffic.userPrio)].aci.acm))) |
| 664 | { |
| 665 | retval = limSendHalMsgAddTs(pMac, pSta->staIndex, tspecInfo->idx, addts.tspec, psessionEntry->peSessionId); |
| 666 | if(eSIR_SUCCESS != retval) |
| 667 | { |
| 668 | limAdmitControlDeleteTS(pMac, pSta->assocId, &addts.tspec.tsinfo, NULL, &tspecInfo->idx); |
| 669 | |
| 670 | // Send DELTS action frame to AP |
| 671 | cfgLen = sizeof(tSirMacAddr); |
| 672 | limSendDeltsReqActionFrame(pMac, peerMacAddr, rspReqd, &addts.tspec.tsinfo, &addts.tspec, |
| 673 | psessionEntry); |
| 674 | limSendSmeAddtsRsp(pMac, true, retval, psessionEntry, addts.tspec, |
| 675 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 676 | pMac->lim.gLimAddtsSent = false; |
| 677 | return; |
| 678 | } |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 679 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 680 | addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);) |
| 681 | } |
| 682 | else |
| 683 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 684 | PELOGW(limLog(pMac, LOGW, FL("AddTsRsp received successfully(UP %d, TSID %d)"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | addts.tspec.tsinfo.traffic.userPrio, addts.tspec.tsinfo.traffic.tsid);) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 686 | PELOGW(limLog(pMac, LOGW, FL("no ACM: Bypass sending WDA_ADD_TS_REQ to HAL "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 687 | // Use the smesessionId and smetransactionId from the PE session context |
| 688 | limSendSmeAddtsRsp(pMac, true, eSIR_SME_SUCCESS, psessionEntry, addts.tspec, |
| 689 | psessionEntry->smeSessionId, psessionEntry->transactionId); |
| 690 | } |
| 691 | |
| 692 | // clear the addts flag |
| 693 | pMac->lim.gLimAddtsSent = false; |
| 694 | return; |
| 695 | } |
| 696 | |
| 697 | |
| 698 | static void |
| 699 | __limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 700 | { |
| 701 | tSirRetStatus retval; |
| 702 | tSirDeltsReqInfo delts; |
| 703 | tpSirMacMgmtHdr pHdr; |
| 704 | tpDphHashNode pSta; |
| 705 | tANI_U32 frameLen; |
| 706 | tANI_U16 aid; |
| 707 | tANI_U8 *pBody; |
| 708 | tANI_U8 tsStatus; |
| 709 | tSirMacTSInfo *tsinfo; |
| 710 | tANI_U8 tspecIdx; |
| 711 | tANI_U8 ac; |
| 712 | tpDphHashNode pStaDs = NULL; |
| 713 | |
| 714 | |
| 715 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 716 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 717 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 718 | |
| 719 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); |
| 720 | if (pSta == NULL) |
| 721 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 722 | PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring DelTs"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 723 | return; |
| 724 | } |
| 725 | |
| 726 | // parse the delts request |
| 727 | retval = sirConvertDeltsReq2Struct(pMac, pBody, frameLen, &delts); |
| 728 | if (retval != eSIR_SUCCESS) |
| 729 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 730 | PELOGW(limLog(pMac, LOGW, FL("DelTs parsing failed (error %d)"), retval);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 731 | return; |
| 732 | } |
| 733 | |
| 734 | if (delts.wmeTspecPresent) |
| 735 | { |
| 736 | if ((!psessionEntry->limWmeEnabled) || (! pSta->wmeEnabled)) |
| 737 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 738 | PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: wme not enabled/capable"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 739 | return; |
| 740 | } |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 741 | PELOG2(limLog(pMac, LOG2, FL("WME Delts received"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | } |
| 743 | else if ((psessionEntry->limQosEnabled) && pSta->lleEnabled) |
| 744 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 745 | PELOG2(limLog(pMac, LOG2, FL("11e QoS Delts received"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 746 | } |
| 747 | else if ((psessionEntry->limWsmEnabled) && pSta->wsmEnabled) |
| 748 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 749 | PELOG2(limLog(pMac, LOG2, FL("WSM Delts received"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 750 | } |
| 751 | else |
| 752 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 753 | PELOGW(limLog(pMac, LOGW, FL("Ignoring delts request: qos not enabled/capable"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | return; |
| 755 | } |
| 756 | |
| 757 | tsinfo = delts.wmeTspecPresent ? &delts.tspec.tsinfo : &delts.tsinfo; |
| 758 | |
| 759 | // if no Admit Control, ignore the request |
| 760 | if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA)) |
| 761 | { |
| 762 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 763 | if ((upToAc(tsinfo->traffic.userPrio) >= MAX_NUM_AC) || (! psessionEntry->gLimEdcaParams[upToAc(tsinfo->traffic.userPrio)].aci.acm)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 765 | limLog(pMac, LOGW, FL("DelTs with UP %d has no AC - ignoring request"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 766 | tsinfo->traffic.userPrio); |
| 767 | return; |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | // try to delete the TS |
| 772 | if (eSIR_SUCCESS != limAdmitControlDeleteTS(pMac, pSta->assocId, tsinfo, &tsStatus, &tspecIdx)) |
| 773 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 774 | PELOGW(limLog(pMac, LOGW, FL("Unable to Delete TS"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 775 | return; |
| 776 | } |
| 777 | |
| 778 | else if ((tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_HCCA) || |
| 779 | (tsinfo->traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_BOTH)) |
| 780 | { |
| 781 | //Edca only for now. |
| 782 | } |
| 783 | else |
| 784 | { |
| 785 | //send message to HAL to delete TS |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 786 | if(eSIR_SUCCESS != limSendHalMsgDelTs(pMac, pSta->staIndex, tspecIdx, delts, psessionEntry->peSessionId)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 787 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 788 | limLog(pMac, LOGW, FL("DelTs with UP %d failed in limSendHalMsgDelTs - ignoring request"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 789 | tsinfo->traffic.userPrio); |
| 790 | return; |
| 791 | } |
| 792 | } |
| 793 | |
| 794 | /* We successfully deleted the TSPEC. Update the dynamic UAPSD Mask. |
| 795 | * The AC for this TSPEC is no longer trigger enabled if this Tspec |
| 796 | * was set-up in uplink direction only. |
| 797 | * The AC for this TSPEC is no longer delivery enabled if this Tspec |
| 798 | * was set-up in downlink direction only. |
| 799 | * The AC for this TSPEC is no longer triiger enabled and delivery |
| 800 | * enabled if this Tspec was a bidirectional TSPEC. |
| 801 | */ |
| 802 | limSetTspecUapsdMask(pMac, tsinfo, CLEAR_UAPSD_MASK); |
| 803 | |
| 804 | |
| 805 | /* We're deleting the TSPEC. |
| 806 | * The AC for this TSPEC is no longer admitted in uplink/downlink direction |
| 807 | * if this TSPEC was set-up in uplink/downlink direction only. |
| 808 | * The AC for this TSPEC is no longer admitted in both uplink and downlink |
| 809 | * directions if this TSPEC was a bi-directional TSPEC. |
| 810 | * If ACM is set for this AC and this AC is admitted only in downlink |
| 811 | * direction, PE needs to downgrade the EDCA parameter |
| 812 | * (for the AC for which TS is being deleted) to the |
| 813 | * next best AC for which ACM is not enabled, and send the |
| 814 | * updated values to HAL. |
| 815 | */ |
| 816 | ac = upToAc(tsinfo->traffic.userPrio); |
| 817 | |
| 818 | if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_UPLINK) |
| 819 | { |
| 820 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac); |
| 821 | } |
| 822 | else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_DNLINK) |
| 823 | { |
| 824 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac); |
| 825 | } |
| 826 | else if(tsinfo->traffic.direction == SIR_MAC_DIRECTION_BIDIR) |
| 827 | { |
| 828 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] &= ~(1 << ac); |
| 829 | pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] &= ~(1 << ac); |
| 830 | } |
| 831 | |
| 832 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 833 | |
| 834 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 835 | if (pStaDs != NULL) |
| 836 | { |
| 837 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 838 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 839 | else |
| 840 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 841 | } |
| 842 | else |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 843 | limLog(pMac, LOGE, FL("Self entry missing in Hash Table ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 844 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 845 | PELOG1(limLog(pMac, LOG1, FL("DeleteTS succeeded"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 846 | if((psessionEntry->limSystemRole != eLIM_AP_ROLE)&&(psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) |
| 847 | limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry); |
| 848 | |
| 849 | #ifdef FEATURE_WLAN_CCX |
| 850 | limDeactivateAndChangeTimer(pMac,eLIM_TSM_TIMER); |
| 851 | #endif |
| 852 | |
| 853 | } |
| 854 | |
| 855 | |
| 856 | #ifdef ANI_SUPPORT_11H |
| 857 | /** |
| 858 | * limProcessBasicMeasReq |
| 859 | * |
| 860 | *FUNCTION: |
| 861 | * This function is called by limProcessMeasurementRequestFrame() |
| 862 | * when it received a Basic measurement Request action frame. |
| 863 | * Station/BP receiving this should perform basic measurements |
| 864 | * and then send Basic Measurement Report. AP should not perform |
| 865 | * any measurements, and send report indicating refusal. |
| 866 | * |
| 867 | *LOGIC: |
| 868 | * |
| 869 | *ASSUMPTIONS: |
| 870 | * |
| 871 | *NOTE: |
| 872 | * |
| 873 | * @param pMac - Pointer to Global MAC structure |
| 874 | * @param pMeasReqFrame - A pointer to Basic Meas. Req structure |
| 875 | * @return None |
| 876 | */ |
| 877 | static void |
| 878 | __limProcessBasicMeasReq(tpAniSirGlobal pMac, |
| 879 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 880 | tSirMacAddr peerMacAddr) |
| 881 | { |
| 882 | // TBD - Station shall perform basic measurements |
| 883 | |
| 884 | if (limSendMeasReportFrame(pMac, |
| 885 | pMeasReqFrame, |
| 886 | peerMacAddr) != eSIR_SUCCESS) |
| 887 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 888 | PELOGE(limLog(pMac, LOGE, FL("fail to send Basic Meas report "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 889 | return; |
| 890 | } |
| 891 | } |
| 892 | |
| 893 | |
| 894 | /** |
| 895 | * limProcessCcaMeasReq |
| 896 | * |
| 897 | *FUNCTION: |
| 898 | * This function is called by limProcessMeasurementRequestFrame() |
| 899 | * when it received a CCA measurement Request action frame. |
| 900 | * Station/BP receiving this should perform CCA measurements |
| 901 | * and then send CCA Measurement Report. AP should not perform |
| 902 | * any measurements, and send report indicating refusal. |
| 903 | * |
| 904 | *LOGIC: |
| 905 | * |
| 906 | *ASSUMPTIONS: |
| 907 | * |
| 908 | *NOTE: |
| 909 | * |
| 910 | * @param pMac - Pointer to Global MAC structure |
| 911 | * @param pMeasReqFrame - A pointer to CCA Meas. Req structure |
| 912 | * @return None |
| 913 | */ |
| 914 | static void |
| 915 | __limProcessCcaMeasReq(tpAniSirGlobal pMac, |
| 916 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 917 | tSirMacAddr peerMacAddr) |
| 918 | { |
| 919 | // TBD - Station shall perform cca measurements |
| 920 | |
| 921 | if (limSendMeasReportFrame(pMac, |
| 922 | pMeasReqFrame, |
| 923 | peerMacAddr) != eSIR_SUCCESS) |
| 924 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 925 | PELOGE(limLog(pMac, LOGE, FL("fail to send CCA Meas report "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 926 | return; |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | |
| 931 | /** |
| 932 | * __limProcessRpiMeasReq |
| 933 | * |
| 934 | *FUNCTION: |
| 935 | * This function is called by limProcessMeasurementRequestFrame() |
| 936 | * when it received a RPI measurement Request action frame. |
| 937 | * Station/BP/AP receiving this shall not perform any measurements, |
| 938 | * and send report indicating refusal. |
| 939 | * |
| 940 | *LOGIC: |
| 941 | * |
| 942 | *ASSUMPTIONS: |
| 943 | * |
| 944 | *NOTE: |
| 945 | * |
| 946 | * @param pMac - Pointer to Global MAC structure |
| 947 | * @param pMeasReqFrame - A pointer to RPI Meas. Req structure |
| 948 | * @return None |
| 949 | */ |
| 950 | static void |
| 951 | __limProcessRpiMeasReq(tpAniSirGlobal pMac, |
| 952 | tpSirMacMeasReqActionFrame pMeasReqFrame, |
| 953 | tSirMacAddr peerMacAddr) |
| 954 | { |
| 955 | if (limSendMeasReportFrame(pMac, |
| 956 | pMeasReqFrame, |
| 957 | peerMacAddr) != eSIR_SUCCESS) |
| 958 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 959 | PELOGE(limLog(pMac, LOGE, FL("fail to send RPI Meas report "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 960 | return; |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | |
| 965 | /** |
| 966 | * __limProcessMeasurementRequestFrame |
| 967 | * |
| 968 | *FUNCTION: |
| 969 | * |
| 970 | *LOGIC: |
| 971 | * |
| 972 | *ASSUMPTIONS: |
| 973 | * |
| 974 | *NOTE: |
| 975 | * |
| 976 | * @param pMac - Pointer to Global MAC structure |
| 977 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 978 | * @return None |
| 979 | */ |
| 980 | |
| 981 | static void |
| 982 | __limProcessMeasurementRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 983 | { |
| 984 | tpSirMacMgmtHdr pHdr; |
| 985 | tANI_U8 *pBody; |
| 986 | tpSirMacMeasReqActionFrame pMeasReqFrame; |
| 987 | tANI_U32 frameLen; |
| 988 | |
| 989 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 990 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 991 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 992 | |
| 993 | if ( eHAL_STATUS_SUCCESS != |
| 994 | palAllocateMemory( pMac->hHdd, (void **)&pMeasReqFrame, sizeof( tSirMacMeasReqActionFrame ) ) ) |
| 995 | { |
| 996 | limLog(pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 997 | FL("limProcessMeasurementRequestFrame: palAllocateMemory failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 998 | return; |
| 999 | } |
| 1000 | |
| 1001 | if (sirConvertMeasReqFrame2Struct(pMac, pBody, pMeasReqFrame, frameLen) != |
| 1002 | eSIR_SUCCESS) |
| 1003 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1004 | PELOGW(limLog(pMac, LOGW, FL("Rcv invalid Measurement Request Action Frame "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | return; |
| 1006 | } |
| 1007 | |
| 1008 | |
| 1009 | switch(pMeasReqFrame->measReqIE.measType) |
| 1010 | { |
| 1011 | case SIR_MAC_BASIC_MEASUREMENT_TYPE: |
| 1012 | __limProcessBasicMeasReq(pMac, pMeasReqFrame, pHdr->sa); |
| 1013 | break; |
| 1014 | |
| 1015 | case SIR_MAC_CCA_MEASUREMENT_TYPE: |
| 1016 | __limProcessCcaMeasReq(pMac, pMeasReqFrame, pHdr->sa); |
| 1017 | break; |
| 1018 | |
| 1019 | case SIR_MAC_RPI_MEASUREMENT_TYPE: |
| 1020 | __limProcessRpiMeasReq(pMac, pMeasReqFrame, pHdr->sa); |
| 1021 | break; |
| 1022 | |
| 1023 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1024 | PELOG1(limLog(pMac, LOG1, FL("Unknown Measurement Type %d "), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1025 | pMeasReqFrame->measReqIE.measType);) |
| 1026 | break; |
| 1027 | } |
| 1028 | |
| 1029 | } /*** end limProcessMeasurementRequestFrame ***/ |
| 1030 | |
| 1031 | |
| 1032 | /** |
| 1033 | * limProcessTpcRequestFrame |
| 1034 | * |
| 1035 | *FUNCTION: |
| 1036 | * This function is called upon receiving Tpc Request frame. |
| 1037 | * |
| 1038 | *NOTE: |
| 1039 | * |
| 1040 | * @param pMac - Pointer to Global MAC structure |
| 1041 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 1042 | * @return None |
| 1043 | */ |
| 1044 | |
| 1045 | static void |
| 1046 | __limProcessTpcRequestFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 1047 | { |
| 1048 | tpSirMacMgmtHdr pHdr; |
| 1049 | tANI_U8 *pBody; |
| 1050 | tpSirMacTpcReqActionFrame pTpcReqFrame; |
| 1051 | tANI_U32 frameLen; |
| 1052 | |
| 1053 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1054 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 1055 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 1056 | |
| 1057 | PELOG1(limLog(pMac, LOG1, FL("****LIM: Processing TPC Request from peer ****"));) |
| 1058 | |
| 1059 | if ( eHAL_STATUS_SUCCESS != |
| 1060 | palAllocateMemory( pMac->hHdd, (void **)&pTpcReqFrame, sizeof( tSirMacTpcReqActionFrame ) ) ) |
| 1061 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1062 | PELOGE(limLog(pMac, LOGE, FL("palAllocateMemory failed "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1063 | return; |
| 1064 | } |
| 1065 | |
| 1066 | if (sirConvertTpcReqFrame2Struct(pMac, pBody, pTpcReqFrame, frameLen) != |
| 1067 | eSIR_SUCCESS) |
| 1068 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1069 | PELOGW(limLog(pMac, LOGW, FL("Rcv invalid TPC Req Action Frame "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1070 | return; |
| 1071 | } |
| 1072 | |
| 1073 | if (limSendTpcReportFrame(pMac, |
| 1074 | pTpcReqFrame, |
| 1075 | pHdr->sa) != eSIR_SUCCESS) |
| 1076 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1077 | PELOGE(limLog(pMac, LOGE, FL("fail to send TPC Report Frame. "));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | return; |
| 1079 | } |
| 1080 | } |
| 1081 | #endif |
| 1082 | |
| 1083 | |
| 1084 | /** |
| 1085 | * \brief Validate an ADDBA Req from peer with respect |
| 1086 | * to our own BA configuration |
| 1087 | * |
| 1088 | * \sa __limValidateAddBAParameterSet |
| 1089 | * |
| 1090 | * \param pMac The global tpAniSirGlobal object |
| 1091 | * |
| 1092 | * \param baParameterSet The ADDBA Parameter Set. |
| 1093 | * |
| 1094 | * \param pDelBAFlag this parameter is NULL except for call from processAddBAReq |
| 1095 | * delBAFlag is set when entry already exists. |
| 1096 | * |
| 1097 | * \param reqType ADDBA Req v/s ADDBA Rsp |
| 1098 | * 1 - ADDBA Req |
| 1099 | * 0 - ADDBA Rsp |
| 1100 | * |
| 1101 | * \return eSIR_SUCCESS if setup completes successfully |
| 1102 | * eSIR_FAILURE is some problem is encountered |
| 1103 | */ |
| 1104 | |
| 1105 | static tSirMacStatusCodes |
| 1106 | __limValidateAddBAParameterSet( tpAniSirGlobal pMac, |
| 1107 | tpDphHashNode pSta, |
| 1108 | tDot11fFfAddBAParameterSet baParameterSet, |
| 1109 | tANI_U8 dialogueToken, |
| 1110 | tLimAddBaValidationReqType reqType , |
| 1111 | tANI_U8* pDelBAFlag /*this parameter is NULL except for call from processAddBAReq*/) |
| 1112 | { |
| 1113 | if(baParameterSet.tid >= STACFG_MAX_TC) |
| 1114 | { |
| 1115 | return eSIR_MAC_WME_INVALID_PARAMS_STATUS; |
| 1116 | } |
| 1117 | |
| 1118 | //check if there is already a BA session setup with this STA/TID while processing AddBaReq |
| 1119 | if((true == pSta->tcCfg[baParameterSet.tid].fUseBARx) && |
| 1120 | (LIM_ADDBA_REQ == reqType)) |
| 1121 | { |
| 1122 | //There is already BA session setup for STA/TID. |
Hoonki Lee | 9af07cf | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 1123 | limLog( pMac, LOGE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1124 | FL( "AddBAReq rcvd when there is already a session for this StaId = %d, tid = %d\n " ), |
| 1125 | pSta->staIndex, baParameterSet.tid); |
| 1126 | limPrintMacAddr( pMac, pSta->staAddr, LOGW ); |
| 1127 | |
| 1128 | if(pDelBAFlag) |
| 1129 | *pDelBAFlag = true; |
| 1130 | } |
| 1131 | return eSIR_MAC_SUCCESS_STATUS; |
| 1132 | } |
| 1133 | |
| 1134 | /** |
| 1135 | * \brief Validate a DELBA Ind from peer with respect |
| 1136 | * to our own BA configuration |
| 1137 | * |
| 1138 | * \sa __limValidateDelBAParameterSet |
| 1139 | * |
| 1140 | * \param pMac The global tpAniSirGlobal object |
| 1141 | * |
| 1142 | * \param baParameterSet The DELBA Parameter Set. |
| 1143 | * |
| 1144 | * \param pSta Runtime, STA-related configuration cached |
| 1145 | * in the HashNode object |
| 1146 | * |
| 1147 | * \return eSIR_SUCCESS if setup completes successfully |
| 1148 | * eSIR_FAILURE is some problem is encountered |
| 1149 | */ |
| 1150 | static tSirMacStatusCodes |
| 1151 | __limValidateDelBAParameterSet( tpAniSirGlobal pMac, |
| 1152 | tDot11fFfDelBAParameterSet baParameterSet, |
| 1153 | tpDphHashNode pSta ) |
| 1154 | { |
| 1155 | tSirMacStatusCodes statusCode = eSIR_MAC_STA_BLK_ACK_NOT_SUPPORTED_STATUS; |
| 1156 | |
| 1157 | // Validate if a BA is active for the requested TID |
| 1158 | if( pSta->tcCfg[baParameterSet.tid].fUseBATx || |
| 1159 | pSta->tcCfg[baParameterSet.tid].fUseBARx ) |
| 1160 | { |
| 1161 | statusCode = eSIR_MAC_SUCCESS_STATUS; |
| 1162 | |
| 1163 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1164 | FL("Valid DELBA Ind received. Time to send WDA_DELBA_IND to HAL...")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1165 | } |
| 1166 | else |
| 1167 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1168 | FL("Received an INVALID DELBA Ind for TID %d..."), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1169 | baParameterSet.tid ); |
| 1170 | |
| 1171 | return statusCode; |
| 1172 | } |
| 1173 | |
| 1174 | /** |
| 1175 | * \brief Process an ADDBA REQ |
| 1176 | * |
| 1177 | * \sa limProcessAddBAReq |
| 1178 | * |
| 1179 | * \param pMac The global tpAniSirGlobal object |
| 1180 | * |
| 1181 | * \param pRxPacketInfo Handle to the Rx packet info from HDD |
| 1182 | * |
| 1183 | * \return none |
| 1184 | * |
| 1185 | */ |
| 1186 | static void |
| 1187 | __limProcessAddBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1188 | { |
| 1189 | tDot11fAddBAReq frmAddBAReq; |
| 1190 | tpSirMacMgmtHdr pHdr; |
| 1191 | tpDphHashNode pSta; |
| 1192 | tSirMacStatusCodes status = eSIR_MAC_SUCCESS_STATUS; |
| 1193 | tANI_U16 aid; |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1194 | tANI_U32 frameLen, nStatus,val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1195 | tANI_U8 *pBody; |
| 1196 | tANI_U8 delBAFlag =0; |
| 1197 | |
| 1198 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1199 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1200 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1201 | val = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1202 | |
| 1203 | // Unpack the received frame |
| 1204 | nStatus = dot11fUnpackAddBAReq( pMac, pBody, frameLen, &frmAddBAReq ); |
| 1205 | if( DOT11F_FAILED( nStatus )) |
| 1206 | { |
| 1207 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1208 | FL("Failed to unpack and parse an ADDBA Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | nStatus, |
| 1210 | frameLen ); |
| 1211 | |
| 1212 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1213 | |
| 1214 | // Without an unpacked request we cannot respond, so silently ignore the request |
| 1215 | return; |
| 1216 | } |
| 1217 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1218 | { |
| 1219 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1220 | FL( "There were warnings while unpacking an ADDBA Request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1221 | nStatus, |
| 1222 | frameLen ); |
| 1223 | |
| 1224 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1225 | } |
| 1226 | |
Kiran Kumar Lokere | 2ac471f | 2013-05-30 16:08:48 -0700 | [diff] [blame] | 1227 | psessionEntry->amsduSupportedInBA = frmAddBAReq.AddBAParameterSet.amsduSupported; |
| 1228 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1229 | pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1230 | if( pSta == NULL ) |
| 1231 | { |
| 1232 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1233 | FL( "STA context not found - ignoring ADDBA from " )); |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1234 | limPrintMacAddr( pMac, pHdr->sa, LOGE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1235 | |
| 1236 | // FIXME - Should we do this? |
| 1237 | status = eSIR_MAC_INABLITY_TO_CONFIRM_ASSOC_STATUS; |
| 1238 | goto returnAfterError; |
| 1239 | } |
| 1240 | |
| 1241 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1242 | FL( "ADDBA Req from STA with AID %d, tid = %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1243 | aid, frmAddBAReq.AddBAParameterSet.tid); |
| 1244 | |
| 1245 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 1246 | // we can only do BA on "hard" STAs |
| 1247 | if (!(IS_HWSTA_IDX(pSta->staIndex))) |
| 1248 | { |
| 1249 | status = eSIR_MAC_REQ_DECLINED_STATUS; |
| 1250 | goto returnAfterError; |
| 1251 | } |
| 1252 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 1253 | |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1254 | if (wlan_cfgGetInt(pMac, WNI_CFG_DEL_ALL_RX_BA_SESSIONS_2_4_G_BTC, &val) != |
| 1255 | eSIR_SUCCESS) |
| 1256 | { |
| 1257 | limLog(pMac, LOGE, |
| 1258 | FL("Unable to get WNI_CFG_DEL_ALL_RX_BA_SESSIONS_2_4_G_BTC")); |
| 1259 | val = 0; |
| 1260 | } |
| 1261 | if ((SIR_BAND_2_4_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) && |
| 1262 | val) |
| 1263 | { |
| 1264 | limLog( pMac, LOGW, |
| 1265 | FL( "BTC disabled aggregation - ignoring ADDBA from " )); |
| 1266 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1267 | |
| 1268 | status = eSIR_MAC_REQ_DECLINED_STATUS; |
| 1269 | goto returnAfterError; |
| 1270 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1271 | |
| 1272 | // Now, validate the ADDBA Req |
| 1273 | if( eSIR_MAC_SUCCESS_STATUS != |
| 1274 | (status = __limValidateAddBAParameterSet( pMac, pSta, |
| 1275 | frmAddBAReq.AddBAParameterSet, |
| 1276 | 0, //dialogue token is don't care in request validation. |
| 1277 | LIM_ADDBA_REQ, &delBAFlag))) |
| 1278 | goto returnAfterError; |
| 1279 | |
| 1280 | //BA already set, so we need to delete it before adding new one. |
| 1281 | if(delBAFlag) |
| 1282 | { |
| 1283 | if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac, |
| 1284 | pSta, |
| 1285 | (tANI_U8)frmAddBAReq.AddBAParameterSet.tid, |
| 1286 | eBA_RECIPIENT,psessionEntry)) |
| 1287 | { |
| 1288 | status = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 1289 | goto returnAfterError; |
| 1290 | } |
| 1291 | } |
| 1292 | |
| 1293 | // Check if the ADD BA Declined configuration is Disabled |
| 1294 | if ((pMac->lim.gAddBA_Declined & ( 1 << frmAddBAReq.AddBAParameterSet.tid ) )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1295 | limLog( pMac, LOGE, FL( "Declined the ADDBA Req for the TID %d " ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1296 | frmAddBAReq.AddBAParameterSet.tid); |
| 1297 | status = eSIR_MAC_REQ_DECLINED_STATUS; |
| 1298 | goto returnAfterError; |
| 1299 | } |
| 1300 | |
| 1301 | // |
| 1302 | // Post WDA_ADDBA_REQ to HAL. |
| 1303 | // If HAL/HDD decide to allow this ADDBA Req session, |
| 1304 | // then this BA session is termed active |
| 1305 | // |
| 1306 | |
| 1307 | // Change the Block Ack state of this STA to wait for |
| 1308 | // ADDBA Rsp from HAL |
| 1309 | LIM_SET_STA_BA_STATE(pSta, frmAddBAReq.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP); |
Kiran Kumar Lokere | 495c614 | 2013-04-01 20:52:41 -0700 | [diff] [blame] | 1310 | |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1311 | if (wlan_cfgGetInt(pMac, WNI_CFG_NUM_BUFF_ADVERT , &val) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 495c614 | 2013-04-01 20:52:41 -0700 | [diff] [blame] | 1312 | { |
| 1313 | limLog(pMac, LOGP, FL("Unable to get WNI_CFG_NUM_BUFF_ADVERT")); |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1314 | return ; |
Kiran Kumar Lokere | 495c614 | 2013-04-01 20:52:41 -0700 | [diff] [blame] | 1315 | } |
| 1316 | |
| 1317 | |
| 1318 | if (frmAddBAReq.AddBAParameterSet.bufferSize) |
| 1319 | { |
| 1320 | frmAddBAReq.AddBAParameterSet.bufferSize = |
| 1321 | VOS_MIN(val, frmAddBAReq.AddBAParameterSet.bufferSize); |
| 1322 | } |
| 1323 | else |
| 1324 | { |
| 1325 | frmAddBAReq.AddBAParameterSet.bufferSize = val; |
| 1326 | } |
Kiran Kumar Lokere | 458d732 | 2013-05-29 14:29:43 -0700 | [diff] [blame] | 1327 | limLog( pMac, LOG1, FL( "ADDBAREQ NUMBUFF %d" ), |
Madan Mohan Koyyalamudi | dd11eaf | 2012-11-02 16:04:21 -0700 | [diff] [blame] | 1328 | frmAddBAReq.AddBAParameterSet.bufferSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1329 | |
| 1330 | if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac, |
| 1331 | pSta, |
| 1332 | (tANI_U8) frmAddBAReq.DialogToken.token, |
| 1333 | (tANI_U8) frmAddBAReq.AddBAParameterSet.tid, |
| 1334 | (tANI_U8) frmAddBAReq.AddBAParameterSet.policy, |
| 1335 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 1336 | frmAddBAReq.BATimeout.timeout, |
| 1337 | (tANI_U16) frmAddBAReq.BAStartingSequenceControl.ssn, |
| 1338 | eBA_RECIPIENT,psessionEntry)) |
| 1339 | status = eSIR_MAC_UNSPEC_FAILURE_STATUS; |
| 1340 | else |
| 1341 | return; |
| 1342 | |
| 1343 | returnAfterError: |
| 1344 | |
| 1345 | // |
| 1346 | // Package LIM_MLM_ADDBA_RSP to MLME, with proper |
| 1347 | // status code. MLME will then send an ADDBA RSP |
| 1348 | // over the air to the peer MAC entity |
| 1349 | // |
| 1350 | if( eSIR_SUCCESS != limPostMlmAddBARsp( pMac, |
| 1351 | pHdr->sa, |
| 1352 | status, |
| 1353 | frmAddBAReq.DialogToken.token, |
| 1354 | (tANI_U8) frmAddBAReq.AddBAParameterSet.tid, |
| 1355 | (tANI_U8) frmAddBAReq.AddBAParameterSet.policy, |
| 1356 | frmAddBAReq.AddBAParameterSet.bufferSize, |
| 1357 | frmAddBAReq.BATimeout.timeout,psessionEntry)) |
| 1358 | { |
| 1359 | limLog( pMac, LOGW, |
| 1360 | FL( "Failed to post LIM_MLM_ADDBA_RSP to " )); |
| 1361 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1362 | } |
| 1363 | |
| 1364 | } |
| 1365 | |
| 1366 | /** |
| 1367 | * \brief Process an ADDBA RSP |
| 1368 | * |
| 1369 | * \sa limProcessAddBARsp |
| 1370 | * |
| 1371 | * \param pMac The global tpAniSirGlobal object |
| 1372 | * |
| 1373 | * \param pRxPacketInfo Handle to the packet info structure from HDD |
| 1374 | * |
| 1375 | * \return none |
| 1376 | * |
| 1377 | */ |
| 1378 | static void |
| 1379 | __limProcessAddBARsp( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1380 | { |
| 1381 | tDot11fAddBARsp frmAddBARsp; |
| 1382 | tpSirMacMgmtHdr pHdr; |
| 1383 | tpDphHashNode pSta; |
| 1384 | tSirMacReasonCodes reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1385 | tANI_U16 aid; |
| 1386 | tANI_U32 frameLen, nStatus; |
| 1387 | tANI_U8 *pBody; |
| 1388 | |
| 1389 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1390 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1391 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1392 | |
| 1393 | pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1394 | if( pSta == NULL ) |
| 1395 | { |
| 1396 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1397 | FL( "STA context not found - ignoring ADDBA from " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1398 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1399 | return; |
| 1400 | } |
| 1401 | |
| 1402 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 1403 | // We can only do BA on "hard" STAs. We should not have issued an ADDBA |
| 1404 | // Request, so we should never be processing a ADDBA Response |
| 1405 | if (!(IS_HWSTA_IDX(pSta->staIndex))) |
| 1406 | { |
| 1407 | return; |
| 1408 | } |
| 1409 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 1410 | |
| 1411 | // Unpack the received frame |
| 1412 | nStatus = dot11fUnpackAddBARsp( pMac, pBody, frameLen, &frmAddBARsp ); |
| 1413 | if( DOT11F_FAILED( nStatus )) |
| 1414 | { |
| 1415 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1416 | FL( "Failed to unpack and parse an ADDBA Response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1417 | nStatus, |
| 1418 | frameLen ); |
| 1419 | |
| 1420 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1421 | goto returnAfterError; |
| 1422 | } |
| 1423 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1424 | { |
| 1425 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1426 | FL( "There were warnings while unpacking an ADDBA Response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | nStatus, |
| 1428 | frameLen ); |
| 1429 | |
| 1430 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1431 | } |
| 1432 | |
Hoonki Lee | 9af07cf | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 1433 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1434 | FL( "ADDBA Rsp from STA with AID %d, tid = %d, status = %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1435 | aid, frmAddBARsp.AddBAParameterSet.tid, frmAddBARsp.Status.status); |
| 1436 | |
| 1437 | //if there is no matchin dialougue token then ignore the response. |
| 1438 | |
| 1439 | if(eSIR_SUCCESS != limSearchAndDeleteDialogueToken(pMac, frmAddBARsp.DialogToken.token, |
| 1440 | pSta->assocId, frmAddBARsp.AddBAParameterSet.tid)) |
| 1441 | { |
Hoonki Lee | 9af07cf | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 1442 | PELOGW(limLog(pMac, LOGE, FL("dialogueToken in received addBARsp did not match with outstanding requests"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1443 | return; |
| 1444 | } |
| 1445 | |
| 1446 | // Check first if the peer accepted the ADDBA Req |
| 1447 | if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status ) |
| 1448 | { |
| 1449 | //if peer responded with buffer size 0 then we should pick the default. |
| 1450 | if(0 == frmAddBARsp.AddBAParameterSet.bufferSize) |
| 1451 | frmAddBARsp.AddBAParameterSet.bufferSize = BA_DEFAULT_TX_BUFFER_SIZE; |
| 1452 | |
| 1453 | // Now, validate the ADDBA Rsp |
| 1454 | if( eSIR_MAC_SUCCESS_STATUS != |
| 1455 | __limValidateAddBAParameterSet( pMac, pSta, |
| 1456 | frmAddBARsp.AddBAParameterSet, |
| 1457 | (tANI_U8)frmAddBARsp.DialogToken.token, |
| 1458 | LIM_ADDBA_RSP, NULL)) |
| 1459 | goto returnAfterError; |
| 1460 | } |
| 1461 | else |
| 1462 | goto returnAfterError; |
| 1463 | |
| 1464 | // Change STA state to wait for ADDBA Rsp from HAL |
| 1465 | LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_WT_ADD_RSP); |
| 1466 | |
| 1467 | // |
| 1468 | // Post WDA_ADDBA_REQ to HAL. |
| 1469 | // If HAL/HDD decide to allow this ADDBA Rsp session, |
| 1470 | // then this BA session is termed active |
| 1471 | // |
| 1472 | |
| 1473 | if( eSIR_SUCCESS != limPostMsgAddBAReq( pMac, |
| 1474 | pSta, |
| 1475 | (tANI_U8) frmAddBARsp.DialogToken.token, |
| 1476 | (tANI_U8) frmAddBARsp.AddBAParameterSet.tid, |
| 1477 | (tANI_U8) frmAddBARsp.AddBAParameterSet.policy, |
| 1478 | frmAddBARsp.AddBAParameterSet.bufferSize, |
| 1479 | frmAddBARsp.BATimeout.timeout, |
| 1480 | 0, |
| 1481 | eBA_INITIATOR,psessionEntry)) |
| 1482 | reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; |
| 1483 | else |
| 1484 | return; |
| 1485 | |
| 1486 | returnAfterError: |
| 1487 | |
| 1488 | // TODO: Do we need to signal an error status to SME, |
| 1489 | // if status != eSIR_MAC_SUCCESS_STATUS |
| 1490 | |
| 1491 | // Restore STA "BA" State |
| 1492 | LIM_SET_STA_BA_STATE(pSta, frmAddBARsp.AddBAParameterSet.tid, eLIM_BA_STATE_IDLE); |
| 1493 | // |
| 1494 | // Need to send a DELBA IND to peer, who |
| 1495 | // would have setup a BA session with this STA |
| 1496 | // |
| 1497 | if( eSIR_MAC_SUCCESS_STATUS == frmAddBARsp.Status.status ) |
| 1498 | { |
| 1499 | // |
| 1500 | // Package LIM_MLM_DELBA_REQ to MLME, with proper |
| 1501 | // status code. MLME will then send a DELBA IND |
| 1502 | // over the air to the peer MAC entity |
| 1503 | // |
| 1504 | if( eSIR_SUCCESS != limPostMlmDelBAReq( pMac, |
| 1505 | pSta, |
| 1506 | eBA_INITIATOR, |
| 1507 | (tANI_U8) frmAddBARsp.AddBAParameterSet.tid, |
| 1508 | reasonCode, psessionEntry)) |
| 1509 | { |
| 1510 | limLog( pMac, LOGW, |
| 1511 | FL( "Failed to post LIM_MLM_DELBA_REQ to " )); |
| 1512 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1513 | } |
| 1514 | } |
| 1515 | } |
| 1516 | |
| 1517 | /** |
| 1518 | * \brief Process a DELBA Indication |
| 1519 | * |
| 1520 | * \sa limProcessDelBAInd |
| 1521 | * |
| 1522 | * \param pMac The global tpAniSirGlobal object |
| 1523 | * |
| 1524 | * \param pRxPacketInfo Handle to the Rx packet info from HDD |
| 1525 | * |
| 1526 | * \return none |
| 1527 | * |
| 1528 | */ |
| 1529 | static void |
| 1530 | __limProcessDelBAReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1531 | { |
| 1532 | tDot11fDelBAInd frmDelBAInd; |
| 1533 | tpSirMacMgmtHdr pHdr; |
| 1534 | tpDphHashNode pSta; |
| 1535 | tANI_U16 aid; |
| 1536 | tANI_U32 frameLen, nStatus; |
| 1537 | tANI_U8 *pBody; |
| 1538 | |
| 1539 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1540 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1541 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1542 | |
| 1543 | pSta = dphLookupHashEntry( pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1544 | if( pSta == NULL ) |
| 1545 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1546 | limLog( pMac, LOGE, FL( "STA context not found - ignoring DELBA from ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1547 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1548 | return; |
| 1549 | } |
| 1550 | |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1551 | limLog( pMac, LOG1, FL( "DELBA Ind from STA with AID %d" ), aid ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1552 | |
| 1553 | // Unpack the received frame |
| 1554 | nStatus = dot11fUnpackDelBAInd( pMac, pBody, frameLen, &frmDelBAInd ); |
| 1555 | if( DOT11F_FAILED( nStatus )) |
| 1556 | { |
| 1557 | limLog( pMac, LOGE, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1558 | FL( "Failed to unpack and parse a DELBA Indication (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1559 | nStatus, |
| 1560 | frameLen ); |
| 1561 | |
| 1562 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1563 | return; |
| 1564 | } |
| 1565 | else if ( DOT11F_WARNED( nStatus ) ) |
| 1566 | { |
| 1567 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1568 | FL( "There were warnings while unpacking a DELBA Indication (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1569 | nStatus, |
| 1570 | frameLen ); |
| 1571 | |
| 1572 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1573 | } |
| 1574 | |
| 1575 | limLog( pMac, LOGW, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1576 | FL( "Received DELBA for TID %d, Reason code %d" ), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1577 | frmDelBAInd.DelBAParameterSet.tid, |
| 1578 | frmDelBAInd.Reason.code ); |
| 1579 | |
| 1580 | // Now, validate the DELBA Ind |
| 1581 | if( eSIR_MAC_SUCCESS_STATUS != __limValidateDelBAParameterSet( pMac, |
| 1582 | frmDelBAInd.DelBAParameterSet, |
| 1583 | pSta )) |
| 1584 | return; |
| 1585 | |
| 1586 | // |
| 1587 | // Post WDA_DELBA_IND to HAL and delete the |
| 1588 | // existing BA session |
| 1589 | // |
| 1590 | // NOTE - IEEE 802.11-REVma-D8.0, Section 7.3.1.16 |
| 1591 | // is kind of confusing... |
| 1592 | // |
| 1593 | if( eSIR_SUCCESS != limPostMsgDelBAInd( pMac, |
| 1594 | pSta, |
| 1595 | (tANI_U8) frmDelBAInd.DelBAParameterSet.tid, |
| 1596 | (eBA_RECIPIENT == frmDelBAInd.DelBAParameterSet.initiator)? |
| 1597 | eBA_INITIATOR: eBA_RECIPIENT,psessionEntry)) |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1598 | limLog( pMac, LOGE, FL( "Posting WDA_DELBA_IND to HAL failed ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1599 | |
| 1600 | return; |
| 1601 | |
| 1602 | } |
| 1603 | |
| 1604 | static void |
| 1605 | __limProcessSMPowerSaveUpdate(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry) |
| 1606 | { |
| 1607 | |
| 1608 | #if 0 |
| 1609 | tpSirMacMgmtHdr pHdr; |
| 1610 | tDot11fSMPowerSave frmSMPower; |
| 1611 | tSirMacHTMIMOPowerSaveState state; |
| 1612 | tpDphHashNode pSta; |
| 1613 | tANI_U16 aid; |
| 1614 | tANI_U32 frameLen, nStatus; |
| 1615 | tANI_U8 *pBody; |
| 1616 | |
| 1617 | pHdr = SIR_MAC_BD_TO_MPDUHEADER( pBd ); |
| 1618 | pBody = SIR_MAC_BD_TO_MPDUDATA( pBd ); |
| 1619 | frameLen = SIR_MAC_BD_TO_PAYLOAD_LEN( pBd ); |
| 1620 | |
| 1621 | pSta = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable ); |
| 1622 | if( pSta == NULL ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1623 | limLog( pMac, LOGE,FL( "STA context not found - ignoring UpdateSM PSave Mode from " )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1624 | limPrintMacAddr( pMac, pHdr->sa, LOGW ); |
| 1625 | return; |
| 1626 | } |
| 1627 | |
| 1628 | /**Unpack the received frame */ |
| 1629 | nStatus = dot11fUnpackSMPowerSave( pMac, pBody, frameLen, &frmSMPower); |
| 1630 | |
| 1631 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1632 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Update SM Power (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1633 | nStatus, frameLen ); |
| 1634 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1635 | return; |
| 1636 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1637 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a SMPower Save update (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1638 | nStatus, frameLen ); |
| 1639 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1640 | } |
| 1641 | |
| 1642 | limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with PS_Enable:%d" |
| 1643 | "PS Mode: %d"), frmSMPower.SMPowerModeSet.PowerSave_En, |
| 1644 | frmSMPower.SMPowerModeSet.Mode); |
| 1645 | |
| 1646 | /** Update in the DPH Table about the Update in the SM Power Save mode*/ |
| 1647 | if (frmSMPower.SMPowerModeSet.PowerSave_En && frmSMPower.SMPowerModeSet.Mode) |
| 1648 | state = eSIR_HT_MIMO_PS_DYNAMIC; |
| 1649 | else if ((frmSMPower.SMPowerModeSet.PowerSave_En) && (frmSMPower.SMPowerModeSet.Mode ==0)) |
| 1650 | state = eSIR_HT_MIMO_PS_STATIC; |
| 1651 | else if ((frmSMPower.SMPowerModeSet.PowerSave_En == 0) && (frmSMPower.SMPowerModeSet.Mode == 0)) |
| 1652 | state = eSIR_HT_MIMO_PS_NO_LIMIT; |
| 1653 | else { |
| 1654 | PELOGW(limLog(pMac, LOGW, FL("Received SM Power save Mode update Frame with invalid mode"));) |
| 1655 | return; |
| 1656 | } |
| 1657 | |
| 1658 | if (state == pSta->htMIMOPSState) { |
| 1659 | PELOGE(limLog(pMac, LOGE, FL("The PEER is already set in the same mode"));) |
| 1660 | return; |
| 1661 | } |
| 1662 | |
| 1663 | /** Update in the HAL Station Table for the Update of the Protection Mode */ |
| 1664 | pSta->htMIMOPSState = state; |
| 1665 | limPostSMStateUpdate(pMac,pSta->staIndex, pSta->htMIMOPSState); |
| 1666 | |
| 1667 | #endif |
| 1668 | |
| 1669 | } |
| 1670 | |
| 1671 | #if defined WLAN_FEATURE_VOWIFI |
| 1672 | |
| 1673 | static void |
| 1674 | __limProcessRadioMeasureRequest( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry ) |
| 1675 | { |
| 1676 | tpSirMacMgmtHdr pHdr; |
| 1677 | tDot11fRadioMeasurementRequest frm; |
| 1678 | tANI_U32 frameLen, nStatus; |
| 1679 | tANI_U8 *pBody; |
| 1680 | |
| 1681 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1682 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1683 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1684 | |
| 1685 | if( psessionEntry == NULL ) |
| 1686 | { |
| 1687 | return; |
| 1688 | } |
| 1689 | |
| 1690 | /**Unpack the received frame */ |
| 1691 | nStatus = dot11fUnpackRadioMeasurementRequest( pMac, pBody, frameLen, &frm ); |
| 1692 | |
| 1693 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1694 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Radio Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1695 | nStatus, frameLen ); |
| 1696 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1697 | return; |
| 1698 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1699 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a Radio Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1700 | nStatus, frameLen ); |
| 1701 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1702 | } |
| 1703 | |
| 1704 | // Call rrm function to handle the request. |
| 1705 | |
| 1706 | rrmProcessRadioMeasurementRequest( pMac, pHdr->sa, &frm, psessionEntry ); |
| 1707 | } |
| 1708 | |
| 1709 | static void |
| 1710 | __limProcessLinkMeasurementReq( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry ) |
| 1711 | { |
| 1712 | tpSirMacMgmtHdr pHdr; |
| 1713 | tDot11fLinkMeasurementRequest frm; |
| 1714 | tANI_U32 frameLen, nStatus; |
| 1715 | tANI_U8 *pBody; |
| 1716 | |
| 1717 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1718 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1719 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1720 | |
| 1721 | if( psessionEntry == NULL ) |
| 1722 | { |
| 1723 | return; |
| 1724 | } |
| 1725 | |
| 1726 | /**Unpack the received frame */ |
| 1727 | nStatus = dot11fUnpackLinkMeasurementRequest( pMac, pBody, frameLen, &frm ); |
| 1728 | |
| 1729 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1730 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Link Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1731 | nStatus, frameLen ); |
| 1732 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1733 | return; |
| 1734 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1735 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a Link Measure request (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1736 | nStatus, frameLen ); |
| 1737 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1738 | } |
| 1739 | |
| 1740 | // Call rrm function to handle the request. |
| 1741 | |
| 1742 | rrmProcessLinkMeasurementRequest( pMac, pRxPacketInfo, &frm, psessionEntry ); |
| 1743 | |
| 1744 | } |
| 1745 | |
| 1746 | static void |
| 1747 | __limProcessNeighborReport( tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo ,tpPESession psessionEntry ) |
| 1748 | { |
| 1749 | tpSirMacMgmtHdr pHdr; |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1750 | tDot11fNeighborReportResponse *pFrm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1751 | tANI_U32 frameLen, nStatus; |
| 1752 | tANI_U8 *pBody; |
| 1753 | |
| 1754 | pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); |
| 1755 | pBody = WDA_GET_RX_MPDU_DATA( pRxPacketInfo ); |
| 1756 | frameLen = WDA_GET_RX_PAYLOAD_LEN( pRxPacketInfo ); |
| 1757 | |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1758 | if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, |
| 1759 | (void **)&pFrm, sizeof(tDot11fNeighborReportResponse))) |
| 1760 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1761 | limLog(pMac, LOGE, FL("Unable to PAL allocate memory in __limProcessNeighborReport") ); |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1762 | return; |
| 1763 | } |
| 1764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1765 | if( psessionEntry == NULL ) |
| 1766 | { |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1767 | palFreeMemory(pMac->hHdd, pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1768 | return; |
| 1769 | } |
| 1770 | |
| 1771 | /**Unpack the received frame */ |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1772 | nStatus = dot11fUnpackNeighborReportResponse( pMac, pBody, frameLen,pFrm ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1773 | |
| 1774 | if( DOT11F_FAILED( nStatus )) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1775 | limLog( pMac, LOGE, FL( "Failed to unpack and parse a Neighbor report response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1776 | nStatus, frameLen ); |
| 1777 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1778 | palFreeMemory(pMac->hHdd, pFrm); |
| 1779 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1780 | }else if ( DOT11F_WARNED( nStatus ) ) { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1781 | limLog(pMac, LOGW, FL( "There were warnings while unpacking a Neighbor report response (0x%08x, %d bytes):"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1782 | nStatus, frameLen ); |
| 1783 | PELOG2(sirDumpBuf( pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen );) |
| 1784 | } |
| 1785 | |
| 1786 | //Call rrm function to handle the request. |
Madan Mohan Koyyalamudi | 1903276 | 2012-10-21 12:42:11 -0700 | [diff] [blame] | 1787 | rrmProcessNeighborReportResponse( pMac, pFrm, psessionEntry ); |
| 1788 | |
| 1789 | palFreeMemory(pMac->hHdd, pFrm); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1790 | } |
| 1791 | |
| 1792 | #endif |
| 1793 | |
| 1794 | #ifdef WLAN_FEATURE_11W |
| 1795 | /** |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1796 | * limProcessSAQueryRequestActionFrame |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1797 | * |
| 1798 | *FUNCTION: |
| 1799 | * This function is called by limProcessActionFrame() upon |
| 1800 | * SA query request Action frame reception. |
| 1801 | * |
| 1802 | *LOGIC: |
| 1803 | * |
| 1804 | *ASSUMPTIONS: |
| 1805 | * |
| 1806 | *NOTE: |
| 1807 | * |
| 1808 | * @param pMac - Pointer to Global MAC structure |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1809 | * @param *pRxPacketInfo - Handle to the Rx packet info |
| 1810 | * @param psessionEntry - PE session entry |
| 1811 | * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1812 | * @return None |
| 1813 | */ |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1814 | static void __limProcessSAQueryRequestActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1815 | { |
| 1816 | tpSirMacMgmtHdr pHdr; |
| 1817 | tANI_U8 *pBody; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1818 | tANI_U8 transId[2]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1819 | |
| 1820 | /* Prima --- Below Macro not available in prima |
| 1821 | pHdr = SIR_MAC_BD_TO_MPDUHEADER(pBd); |
| 1822 | pBody = SIR_MAC_BD_TO_MPDUDATA(pBd); */ |
| 1823 | |
| 1824 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1825 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 1826 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1827 | /* If this is an unprotected SA Query Request, then ignore it. */ |
| 1828 | if (pHdr->fc.wep == 0) |
| 1829 | return; |
| 1830 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1831 | /*Extract 11w trsansId from SA query request action frame |
| 1832 | In SA query response action frame we will send same transId |
| 1833 | In SA query request action frame: |
| 1834 | Category : 1 byte |
| 1835 | Action : 1 byte |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1836 | Transaction ID : 2 bytes */ |
| 1837 | vos_mem_copy( &transId[0], &pBody[2], 2 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1838 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1839 | //Send 11w SA query response action frame |
| 1840 | if (limSendSaQueryResponseFrame(pMac, |
| 1841 | transId, |
| 1842 | pHdr->sa,psessionEntry) != eSIR_SUCCESS) |
| 1843 | { |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1844 | PELOGE(limLog(pMac, LOGE, FL("fail to send SA query response action frame."));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1845 | return; |
| 1846 | } |
| 1847 | } |
| 1848 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1849 | /** |
| 1850 | * __limProcessSAQueryResponseActionFrame |
| 1851 | * |
| 1852 | *FUNCTION: |
| 1853 | * This function is called by limProcessActionFrame() upon |
| 1854 | * SA query response Action frame reception. |
| 1855 | * |
| 1856 | *LOGIC: |
| 1857 | * |
| 1858 | *ASSUMPTIONS: |
| 1859 | * |
| 1860 | *NOTE: |
| 1861 | * |
| 1862 | * @param pMac - Pointer to Global MAC structure |
| 1863 | * @param *pRxPacketInfo - Handle to the Rx packet info |
| 1864 | * @param psessionEntry - PE session entry |
| 1865 | * @return None |
| 1866 | */ |
| 1867 | static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession psessionEntry) |
| 1868 | { |
| 1869 | tpSirMacMgmtHdr pHdr; |
| 1870 | tANI_U32 frameLen; |
| 1871 | |
| 1872 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1873 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 1874 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
| 1875 | ("SA Query Response received...")) ; |
| 1876 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 1877 | // type is ACTION |
| 1878 | limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType, |
| 1879 | (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0, |
| 1880 | WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0); |
| 1881 | } |
| 1882 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1883 | #endif |
| 1884 | |
| 1885 | /** |
| 1886 | * limProcessActionFrame |
| 1887 | * |
| 1888 | *FUNCTION: |
| 1889 | * This function is called by limProcessMessageQueue() upon |
| 1890 | * Action frame reception. |
| 1891 | * |
| 1892 | *LOGIC: |
| 1893 | * |
| 1894 | *ASSUMPTIONS: |
| 1895 | * |
| 1896 | *NOTE: |
| 1897 | * |
| 1898 | * @param pMac - Pointer to Global MAC structure |
| 1899 | * @param *pRxPacketInfo - A pointer to packet info structure |
| 1900 | * @return None |
| 1901 | */ |
| 1902 | |
| 1903 | void |
| 1904 | limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 1905 | { |
| 1906 | tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 1907 | tpSirMacActionFrameHdr pActionHdr = (tpSirMacActionFrameHdr) pBody; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1908 | #ifdef WLAN_FEATURE_11W |
| 1909 | tpSirMacMgmtHdr pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 1910 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1912 | switch (pActionHdr->category) |
| 1913 | { |
| 1914 | case SIR_MAC_ACTION_QOS_MGMT: |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1915 | #ifdef WLAN_FEATURE_11W |
| 1916 | if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0)) |
| 1917 | { |
| 1918 | PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame " |
| 1919 | "since RMF is enabled."), pActionHdr->category);) |
| 1920 | break; |
| 1921 | } |
| 1922 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1923 | if (psessionEntry->limQosEnabled) |
| 1924 | { |
| 1925 | switch (pActionHdr->actionID) |
| 1926 | { |
| 1927 | case SIR_MAC_QOS_ADD_TS_REQ: |
| 1928 | __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 1929 | break; |
| 1930 | |
| 1931 | case SIR_MAC_QOS_ADD_TS_RSP: |
| 1932 | __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 1933 | break; |
| 1934 | |
| 1935 | case SIR_MAC_QOS_DEL_TS_REQ: |
| 1936 | __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 1937 | break; |
| 1938 | |
| 1939 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1940 | PELOGE(limLog(pMac, LOGE, FL("Qos action %d not handled"), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1941 | break; |
| 1942 | } |
| 1943 | break ; |
| 1944 | } |
| 1945 | |
| 1946 | break; |
| 1947 | |
| 1948 | case SIR_MAC_ACTION_SPECTRUM_MGMT: |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1949 | #ifdef WLAN_FEATURE_11W |
| 1950 | if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0)) |
| 1951 | { |
| 1952 | PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame " |
| 1953 | "since RMF is enabled."), pActionHdr->category);) |
| 1954 | break; |
| 1955 | } |
| 1956 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1957 | switch (pActionHdr->actionID) |
| 1958 | { |
| 1959 | #ifdef ANI_SUPPORT_11H |
| 1960 | case SIR_MAC_ACTION_MEASURE_REQUEST_ID: |
| 1961 | if(psessionEntry->lim11hEnable) |
| 1962 | { |
| 1963 | __limProcessMeasurementRequestFrame(pMac, pRxPacketInfo); |
| 1964 | } |
| 1965 | break; |
| 1966 | |
| 1967 | case SIR_MAC_ACTION_TPC_REQUEST_ID: |
| 1968 | if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || |
| 1969 | (pessionEntry->limSystemRole == eLIM_AP_ROLE)) |
| 1970 | { |
| 1971 | if(psessionEntry->lim11hEnable) |
| 1972 | { |
| 1973 | __limProcessTpcRequestFrame(pMac, pRxPacketInfo); |
| 1974 | } |
| 1975 | } |
| 1976 | break; |
| 1977 | |
| 1978 | #endif |
| 1979 | case SIR_MAC_ACTION_CHANNEL_SWITCH_ID: |
| 1980 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 1981 | { |
| 1982 | __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry); |
| 1983 | } |
| 1984 | break; |
| 1985 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1986 | PELOGE(limLog(pMac, LOGE, FL("Spectrum mgmt action id %d not handled"), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1987 | break; |
| 1988 | } |
| 1989 | break; |
| 1990 | |
| 1991 | case SIR_MAC_ACTION_WME: |
| 1992 | if (! psessionEntry->limWmeEnabled) |
| 1993 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 1994 | limLog(pMac, LOGW, FL("WME mode disabled - dropping action frame %d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1995 | pActionHdr->actionID); |
| 1996 | break; |
| 1997 | } |
| 1998 | switch(pActionHdr->actionID) |
| 1999 | { |
| 2000 | case SIR_MAC_QOS_ADD_TS_REQ: |
| 2001 | __limProcessAddTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2002 | break; |
| 2003 | |
| 2004 | case SIR_MAC_QOS_ADD_TS_RSP: |
| 2005 | __limProcessAddTsRsp(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2006 | break; |
| 2007 | |
| 2008 | case SIR_MAC_QOS_DEL_TS_REQ: |
| 2009 | __limProcessDelTsReq(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2010 | break; |
| 2011 | |
| 2012 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2013 | PELOGE(limLog(pMac, LOGE, FL("WME action %d not handled"), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2014 | break; |
| 2015 | } |
| 2016 | break; |
| 2017 | |
| 2018 | case SIR_MAC_ACTION_BLKACK: |
| 2019 | // Determine the "type" of BA Action Frame |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2020 | #ifdef WLAN_FEATURE_11W |
| 2021 | if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0)) |
| 2022 | { |
| 2023 | PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame " |
| 2024 | "since RMF is enabled."), pActionHdr->category);) |
| 2025 | break; |
| 2026 | } |
| 2027 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | switch(pActionHdr->actionID) |
| 2029 | { |
| 2030 | case SIR_MAC_BLKACK_ADD_REQ: |
| 2031 | __limProcessAddBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2032 | break; |
| 2033 | |
| 2034 | case SIR_MAC_BLKACK_ADD_RSP: |
| 2035 | __limProcessAddBARsp( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2036 | break; |
| 2037 | |
| 2038 | case SIR_MAC_BLKACK_DEL: |
| 2039 | __limProcessDelBAReq( pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2040 | break; |
| 2041 | |
| 2042 | default: |
| 2043 | break; |
| 2044 | } |
| 2045 | |
| 2046 | break; |
| 2047 | case SIR_MAC_ACTION_HT: |
| 2048 | /** Type of HT Action to be performed*/ |
| 2049 | switch(pActionHdr->actionID) { |
| 2050 | case SIR_MAC_SM_POWER_SAVE: |
| 2051 | __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); |
| 2052 | break; |
| 2053 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2054 | PELOGE(limLog(pMac, LOGE, FL("Action ID %d not handled in HT Action category"), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2055 | break; |
| 2056 | } |
| 2057 | break; |
| 2058 | |
| 2059 | #if defined WLAN_FEATURE_VOWIFI |
| 2060 | case SIR_MAC_ACTION_RRM: |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2061 | #ifdef WLAN_FEATURE_11W |
| 2062 | if ((psessionEntry->limRmfEnabled) && (pHdr->fc.wep == 0)) |
| 2063 | { |
| 2064 | PELOGE(limLog(pMac, LOGE, FL("Dropping unprotected Action category %d frame " |
| 2065 | "since RMF is enabled."), pActionHdr->category);) |
| 2066 | break; |
| 2067 | } |
| 2068 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2069 | if( pMac->rrm.rrmPEContext.rrmEnable ) |
| 2070 | { |
| 2071 | switch(pActionHdr->actionID) { |
| 2072 | case SIR_MAC_RRM_RADIO_MEASURE_REQ: |
| 2073 | __limProcessRadioMeasureRequest( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry ); |
| 2074 | break; |
| 2075 | case SIR_MAC_RRM_LINK_MEASUREMENT_REQ: |
| 2076 | __limProcessLinkMeasurementReq( pMac, (tANI_U8 *) pRxPacketInfo, psessionEntry ); |
| 2077 | break; |
| 2078 | case SIR_MAC_RRM_NEIGHBOR_RPT: |
| 2079 | __limProcessNeighborReport( pMac, (tANI_U8*) pRxPacketInfo, psessionEntry ); |
| 2080 | break; |
| 2081 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2082 | PELOGE( limLog( pMac, LOGE, FL("Action ID %d not handled in RRM"), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2083 | break; |
| 2084 | |
| 2085 | } |
| 2086 | } |
| 2087 | else |
| 2088 | { |
| 2089 | // Else we will just ignore the RRM messages. |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2090 | PELOGE( limLog( pMac, LOGE, FL("RRM Action frame ignored as RRM is disabled in cfg"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2091 | } |
| 2092 | break; |
| 2093 | #endif |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2094 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 2095 | case SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY: |
| 2096 | { |
| 2097 | tpSirMacVendorSpecificFrameHdr pVendorSpecific = (tpSirMacVendorSpecificFrameHdr) pActionHdr; |
| 2098 | tpSirMacMgmtHdr pHdr; |
| 2099 | tANI_U32 frameLen; |
| 2100 | tANI_U8 Oui[] = { 0x00, 0x00, 0xf0 }; |
| 2101 | |
| 2102 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 2103 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 2104 | |
| 2105 | //Check if it is a vendor specific action frame. |
| 2106 | if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && |
| 2107 | (VOS_TRUE == palEqualMemory(pMac->hHdd, psessionEntry->selfMacAddr, |
| 2108 | &pHdr->da[0], sizeof(tSirMacAddr))) && |
Srinivas Girigowda | ed8bab9 | 2013-07-08 17:34:06 -0700 | [diff] [blame^] | 2109 | palEqualMemory( pMac->hHdd, pVendorSpecific->Oui, Oui, 3)) |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2110 | { |
| 2111 | PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"), |
| 2112 | pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);) |
| 2113 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2114 | // type is ACTION |
| 2115 | limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType, |
| 2116 | (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0, |
| 2117 | WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0); |
| 2118 | } |
| 2119 | else |
| 2120 | { |
| 2121 | limLog( pMac, LOGE, FL("Dropping the vendor specific action frame because of( " |
Srinivas Girigowda | ed8bab9 | 2013-07-08 17:34:06 -0700 | [diff] [blame^] | 2122 | "OUI mismatch (%02x %02x %02x) or " |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2123 | "not received with SelfSta Mac address) system role = %d"), |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 2124 | pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], |
| 2125 | pVendorSpecific->Oui[2], |
| 2126 | psessionEntry->limSystemRole ); |
| 2127 | } |
| 2128 | } |
| 2129 | break; |
| 2130 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2131 | case SIR_MAC_ACTION_PUBLIC_USAGE: |
| 2132 | switch(pActionHdr->actionID) { |
| 2133 | case SIR_MAC_ACTION_VENDOR_SPECIFIC: |
| 2134 | { |
| 2135 | tpSirMacVendorSpecificPublicActionFrameHdr pPubAction = (tpSirMacVendorSpecificPublicActionFrameHdr) pActionHdr; |
| 2136 | tpSirMacMgmtHdr pHdr; |
| 2137 | tANI_U32 frameLen; |
| 2138 | tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 }; |
| 2139 | |
| 2140 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 2141 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 2142 | |
| 2143 | //Check if it is a P2P public action frame. |
| 2144 | if( palEqualMemory( pMac->hHdd, pPubAction->Oui, P2POui, 4 ) ) |
| 2145 | { |
| 2146 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2147 | // type is ACTION |
| 2148 | limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType, |
| 2149 | (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0, |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2150 | WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2151 | } |
| 2152 | else |
| 2153 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2154 | limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2155 | pPubAction->Oui[0], pPubAction->Oui[1], pPubAction->Oui[2], pPubAction->Oui[3] ); |
| 2156 | } |
| 2157 | } |
| 2158 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2159 | #ifdef FEATURE_WLAN_TDLS |
| 2160 | case SIR_MAC_TDLS_DIS_RSP: |
| 2161 | { |
| 2162 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2163 | //LIM_LOG_TDLS(printk("Public Action TDLS Discovery RSP ..")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2164 | limProcessTdlsPublicActionFrame(pMac, (tANI_U32*)pRxPacketInfo, psessionEntry) ; |
| 2165 | #else |
| 2166 | tpSirMacMgmtHdr pHdr; |
| 2167 | tANI_U32 frameLen; |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2168 | tANI_S8 rssi; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2169 | |
| 2170 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 2171 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2172 | rssi = WDA_GET_RX_RSSI_DB(pRxPacketInfo); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2173 | VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2174 | ("Public Action TDLS Discovery RSP ..")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2175 | limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType, |
| 2176 | (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0, |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2177 | WDA_GET_RX_CH( pRxPacketInfo ), psessionEntry, rssi); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2178 | #endif |
| 2179 | } |
| 2180 | break; |
| 2181 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2182 | |
| 2183 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2184 | PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2185 | break; |
| 2186 | } |
| 2187 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2188 | |
| 2189 | #ifdef WLAN_FEATURE_11W |
| 2190 | case SIR_MAC_ACTION_SA_QUERY: |
| 2191 | { |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2192 | PELOGE(limLog(pMac, LOG1, FL("SA Query Action category %d action %d."), pActionHdr->category, pActionHdr->actionID);) |
| 2193 | switch (pActionHdr->actionID) |
| 2194 | { |
| 2195 | case SIR_MAC_SA_QUERY_REQ: |
| 2196 | /**11w SA query request action frame received**/ |
| 2197 | /* Respond directly to the incoming request in LIM */ |
| 2198 | __limProcessSAQueryRequestActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry ); |
| 2199 | break; |
| 2200 | case SIR_MAC_SA_QUERY_RSP: |
| 2201 | /**11w SA query response action frame received**/ |
| 2202 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2203 | __limProcessSAQueryResponseActionFrame(pMac,(tANI_U8*) pRxPacketInfo, psessionEntry ); |
| 2204 | break; |
| 2205 | default: |
| 2206 | break; |
| 2207 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2208 | break; |
| 2209 | } |
| 2210 | #endif |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 2211 | #ifdef WLAN_FEATURE_11AC |
| 2212 | case SIR_MAC_ACTION_VHT: |
| 2213 | { |
| 2214 | if (psessionEntry->vhtCapability) |
| 2215 | { |
| 2216 | switch (pActionHdr->actionID) |
| 2217 | { |
| 2218 | case SIR_MAC_VHT_OPMODE_NOTIFICATION: |
| 2219 | __limProcessOperatingModeActionFrame(pMac,pRxPacketInfo,psessionEntry); |
| 2220 | break; |
| 2221 | default: |
| 2222 | break; |
| 2223 | } |
| 2224 | } |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2225 | break; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2226 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 2227 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2228 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2229 | PELOGE(limLog(pMac, LOGE, FL("Action category %d not handled"), pActionHdr->category);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2230 | break; |
| 2231 | } |
| 2232 | } |
| 2233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2234 | /** |
| 2235 | * limProcessActionFrameNoSession |
| 2236 | * |
| 2237 | *FUNCTION: |
| 2238 | * This function is called by limProcessMessageQueue() upon |
| 2239 | * Action frame reception and no session. |
| 2240 | * Currently only public action frames can be received from |
| 2241 | * a non-associated station. |
| 2242 | * |
| 2243 | *LOGIC: |
| 2244 | * |
| 2245 | *ASSUMPTIONS: |
| 2246 | * |
| 2247 | *NOTE: |
| 2248 | * |
| 2249 | * @param pMac - Pointer to Global MAC structure |
| 2250 | * @param *pBd - A pointer to Buffer descriptor + associated PDUs |
| 2251 | * @return None |
| 2252 | */ |
| 2253 | |
| 2254 | void |
| 2255 | limProcessActionFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd) |
| 2256 | { |
| 2257 | tANI_U8 *pBody = WDA_GET_RX_MPDU_DATA(pBd); |
| 2258 | tpSirMacVendorSpecificPublicActionFrameHdr pActionHdr = (tpSirMacVendorSpecificPublicActionFrameHdr) pBody; |
| 2259 | |
Mohit Khanna | 2386376 | 2012-09-11 17:40:09 -0700 | [diff] [blame] | 2260 | limLog( pMac, LOG1, "Received a Action frame -- no session"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2261 | |
| 2262 | switch ( pActionHdr->category ) |
| 2263 | { |
| 2264 | case SIR_MAC_ACTION_PUBLIC_USAGE: |
| 2265 | switch(pActionHdr->actionID) { |
| 2266 | case SIR_MAC_ACTION_VENDOR_SPECIFIC: |
| 2267 | { |
| 2268 | tpSirMacMgmtHdr pHdr; |
| 2269 | tANI_U32 frameLen; |
| 2270 | tANI_U8 P2POui[] = { 0x50, 0x6F, 0x9A, 0x09 }; |
| 2271 | |
| 2272 | pHdr = WDA_GET_RX_MAC_HEADER(pBd); |
| 2273 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pBd); |
| 2274 | |
| 2275 | //Check if it is a P2P public action frame. |
| 2276 | if( palEqualMemory( pMac->hHdd, pActionHdr->Oui, P2POui, 4 ) ) |
| 2277 | { |
| 2278 | /* Forward to the SME to HDD to wpa_supplicant */ |
| 2279 | // type is ACTION |
| 2280 | limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType, |
| 2281 | (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0, |
Chilam NG | 571c65a | 2013-01-19 12:27:36 +0530 | [diff] [blame] | 2282 | WDA_GET_RX_CH( pBd ), NULL, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | } |
| 2284 | else |
| 2285 | { |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2286 | limLog( pMac, LOGE, FL("Unhandled public action frame (Vendor specific). OUI %x %x %x %x"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2287 | pActionHdr->Oui[0], pActionHdr->Oui[1], pActionHdr->Oui[2], pActionHdr->Oui[3] ); |
| 2288 | } |
| 2289 | } |
| 2290 | break; |
| 2291 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2292 | PELOGE(limLog(pMac, LOGE, FL("Unhandled public action frame -- %x "), pActionHdr->actionID);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2293 | break; |
| 2294 | } |
| 2295 | break; |
| 2296 | default: |
Kiran Kumar Lokere | 8000726 | 2013-03-18 19:45:50 -0700 | [diff] [blame] | 2297 | PELOGE(limLog(pMac, LOG1, FL("Unhandled action frame without session -- %x "), pActionHdr->category);) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2298 | break; |
| 2299 | |
| 2300 | } |
| 2301 | } |