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