Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 9c070ad | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | /*=========================================================================== |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 43 | W L A N _ Q C T _ WDA . C |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 44 | OVERVIEW: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 45 | This software unit holds the implementation of the WLAN Transport Layer. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 46 | The functions externalized by this module are to be called ONLY by other |
| 47 | WLAN modules that properly register with the Transport Layer initially. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | DEPENDENCIES: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 49 | Are listed for each API below. |
| 50 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 51 | Copyright (c) 2010-2011 QUALCOMM Incorporated. |
| 52 | All Rights Reserved. |
| 53 | Qualcomm Confidential and Proprietary |
| 54 | ===========================================================================*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 55 | /*=========================================================================== |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 56 | EDIT HISTORY FOR FILE |
| 57 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 58 | This section contains comments describing changes made to the module. |
| 59 | Notice that changes are listed in reverse chronological order. |
| 60 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 61 | $Header$$DateTime$$Author$ |
| 62 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 63 | when who what, where, why |
| 64 | ---------- --- ------------------------------------------------- |
| 65 | 10/05/2011 haparna Adding support for Keep Alive Feature |
| 66 | 2010-12-30 smiryala UMAC convergence changes |
| 67 | 2010-08-19 adwivedi WLAN DAL AL(WDA) layer for Prima |
| 68 | ===========================================================================*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 69 | #if defined( FEATURE_WLAN_INTEGRATED_SOC ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 70 | #include "vos_mq.h" |
| 71 | #include "vos_api.h" |
| 72 | #include "vos_packet.h" |
| 73 | #include "vos_nvitem.h" |
| 74 | #include "sirApi.h" |
| 75 | #include "wlan_qct_pal_packet.h" |
| 76 | #include "wlan_qct_wda.h" |
| 77 | #include "wlan_qct_wda_msg.h" |
| 78 | #include "wlan_qct_wdi_cfg.h" |
| 79 | #include "wlan_qct_wdi.h" |
| 80 | #include "wlan_qct_wdi_ds.h" |
| 81 | #include "wlan_hal_cfg.h" |
| 82 | /**********************/ |
| 83 | #include "wniApi.h" |
| 84 | #include "cfgApi.h" |
| 85 | #include "limApi.h" |
| 86 | #include "wlan_qct_tl.h" |
| 87 | #include "wlan_qct_tli_ba.h" |
| 88 | #include "limUtils.h" |
| 89 | #include "btcApi.h" |
| 90 | #include "vos_sched.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 91 | #ifdef ANI_MANF_DIAG |
| 92 | #include "pttMsgApi.h" |
| 93 | #include "wlan_qct_sys.h" |
| 94 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 95 | /* Used MACRO's */ |
| 96 | /* Get WDA context from vOSS module */ |
| 97 | #define VOS_GET_WDA_CTXT(a) vos_get_context(VOS_MODULE_ID_WDA, a) |
| 98 | #define VOS_GET_MAC_CTXT(a) vos_get_context(VOS_MODULE_ID_PE, a) |
| 99 | #define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName) |
| 100 | #define WDA_BA_TX_FRM_THRESHOLD (5) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 101 | #define CONVERT_WDI2SIR_STATUS(x) \ |
| 102 | ((WDI_STATUS_SUCCESS != (x)) ? eSIR_FAILURE : eSIR_SUCCESS) |
| 103 | |
| 104 | #define IS_WDI_STATUS_FAILURE(status) \ |
| 105 | ((WDI_STATUS_SUCCESS != (status)) && (WDI_STATUS_PENDING != (status))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 106 | #define CONVERT_WDI2VOS_STATUS(x) \ |
| 107 | ((IS_WDI_STATUS_FAILURE(x)) ? VOS_STATUS_E_FAILURE : VOS_STATUS_SUCCESS) |
| 108 | |
| 109 | /* macro's for acessing TL API/data structures */ |
Madan Mohan Koyyalamudi | fc1d1fe | 2012-10-18 15:07:12 -0700 | [diff] [blame] | 110 | #define WDA_TL_GET_STA_STATE(a, b, c) WLANTL_GetSTAState(a, b, c) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | #define WDA_TL_GET_TX_PKTCOUNT(a, b, c, d) WLANTL_GetTxPktCount(a, b, c, d) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 112 | #define WDA_GET_BA_TXFLAG(a, b, c) \ |
| 113 | (((a)->wdaStaInfo[(b)].ucUseBaBitmap) & (1 << (c))) |
| 114 | |
| 115 | #define WDA_SET_BA_TXFLAG(a, b, c) \ |
| 116 | (((a)->wdaStaInfo[(b)].ucUseBaBitmap) |= (1 << (c))) |
| 117 | |
| 118 | #define WDA_CLEAR_BA_TXFLAG(a, b, c) \ |
| 119 | (((a)->wdaStaInfo[b].ucUseBaBitmap) &= ~(1 << c)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 120 | #define WDA_TL_BA_SESSION_ADD(a, b, c, d, e, f, g) \ |
| 121 | WLANTL_BaSessionAdd(a, b, c, d, e, f, g) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 122 | /* timer related Macros */ |
| 123 | #define WDA_CREATE_TIMER(a, b, c, d, e, f, g) \ |
| 124 | tx_timer_create(a, b, c, d, e, f, g) |
| 125 | #define WDA_START_TIMER(a) tx_timer_activate(a) |
| 126 | #define WDA_STOP_TIMER(a) tx_timer_deactivate(a) |
| 127 | #define WDA_DESTROY_TIMER(a) tx_timer_delete(a) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 128 | #define WDA_WDI_START_TIMEOUT (WDI_RESPONSE_TIMEOUT + 5000) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 129 | |
| 130 | #define WDA_LAST_POLLED_THRESHOLD(a, curSta, tid) \ |
| 131 | ((a)->wdaStaInfo[curSta].framesTxed[tid] + WDA_BA_TX_FRM_THRESHOLD) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 132 | #define WDA_BA_MAX_WINSIZE (64) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 133 | #define WDA_INVALID_KEY_INDEX 0xFF |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 134 | #define WDA_NUM_PWR_SAVE_CFG 11 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 135 | #define WDA_TX_COMPLETE_TIME_OUT_VALUE 1000 |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 136 | #define WDA_TRAFFIC_STATS_TIME_OUT_VALUE 1000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 137 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 138 | #define WDA_MAX_RETRIES_TILL_RING_EMPTY 1000 /* MAX 10000 msec = 10 seconds wait */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 139 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 140 | #define WDA_WAIT_MSEC_TILL_RING_EMPTY 10 /* 10 msec wait per cycle */ |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 141 | #define WDA_IS_NULL_MAC_ADDRESS(mac_addr) \ |
| 142 | ((mac_addr[0] == 0x00) && (mac_addr[1] == 0x00) && (mac_addr[2] == 0x00) &&\ |
| 143 | (mac_addr[1] == 0x00) && (mac_addr[2] == 0x00) && (mac_addr[3] == 0x00)) |
| 144 | |
| 145 | #define WDA_MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 146 | #define WDA_MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 147 | #define WDA_DUMPCMD_WAIT_TIMEOUT 10000 |
| 148 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 149 | /* extern declarations */ |
| 150 | extern void vos_WDAComplete_cback(v_PVOID_t pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 151 | /* forward declarations */ |
| 152 | void WDA_SendMsg(tWDA_CbContext *pWDA, tANI_U16 msgType, |
| 153 | void *pBodyptr, tANI_U32 bodyVal) ; |
| 154 | VOS_STATUS WDA_prepareConfigTLV(v_PVOID_t pVosContext, |
| 155 | WDI_StartReqParamsType *wdiStartParams ) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 156 | VOS_STATUS WDA_wdiCompleteCB(v_PVOID_t pVosContext) ; |
| 157 | VOS_STATUS WDA_ProcessSetTxPerTrackingReq(tWDA_CbContext *pWDA, tSirTxPerTrackingParam *pTxPerTrackingParams); |
| 158 | |
| 159 | extern v_BOOL_t sys_validateStaConfig( void *pImage, unsigned long cbFile, |
| 160 | void **ppStaConfig, v_SIZE_t *pcbStaConfig ) ; |
| 161 | void processCfgDownloadReq(tpAniSirGlobal pMac, tANI_U16 length, |
| 162 | tANI_U32 *pConfig) ; |
| 163 | void WDA_UpdateBSSParams(tWDA_CbContext *pWDA, |
| 164 | WDI_ConfigBSSReqInfoType *wdiBssParams, tAddBssParams *wdaBssParams) ; |
| 165 | void WDA_UpdateSTAParams(tWDA_CbContext *pWDA, |
| 166 | WDI_ConfigStaReqInfoType *wdiStaParams, tAddStaParams *wdaStaParams) ; |
| 167 | void WDA_lowLevelIndCallback(WDI_LowLevelIndType *wdiLowLevelInd, |
| 168 | void* pUserData ) ; |
| 169 | static VOS_STATUS wdaCreateTimers(tWDA_CbContext *pWDA) ; |
| 170 | static VOS_STATUS wdaDestroyTimers(tWDA_CbContext *pWDA); |
| 171 | void WDA_BaCheckActivity(tWDA_CbContext *pWDA) ; |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 172 | void WDA_TimerTrafficStatsInd(tWDA_CbContext *pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 173 | void WDA_HALDumpCmdCallback(WDI_HALDumpCmdRspParamsType *wdiRspParams, void* pUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 174 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 175 | VOS_STATUS WDA_ProcessAggrAddTSReq(tWDA_CbContext *pWDA, tAggrAddTsParams *pAggrAddTsReqParams); |
| 176 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 177 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 178 | void WDA_TimerHandler(v_VOID_t *pWDA, tANI_U32 timerInfo) ; |
| 179 | void WDA_ProcessTxCompleteTimeOutInd(tWDA_CbContext* pContext) ; |
| 180 | VOS_STATUS WDA_ResumeDataTx(tWDA_CbContext *pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 181 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 182 | static VOS_STATUS WDA_ProcessSetPrefNetworkReq(tWDA_CbContext *pWDA, tSirPNOScanReq *pPNOScanReqParams); |
| 183 | static VOS_STATUS WDA_ProcessSetRssiFilterReq(tWDA_CbContext *pWDA, tSirSetRSSIFilterReq* pRssiFilterParams); |
| 184 | static VOS_STATUS WDA_ProcessUpdateScanParams(tWDA_CbContext *pWDA, tSirUpdateScanParams *pUpdateScanParams); |
| 185 | #endif // FEATURE_WLAN_SCAN_PNO |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 186 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 187 | static VOS_STATUS WDA_Process8023MulticastListReq ( |
| 188 | tWDA_CbContext *pWDA, |
| 189 | tSirRcvFltMcAddrList *pRcvFltMcAddrLis |
| 190 | ); |
| 191 | static VOS_STATUS WDA_ProcessReceiveFilterSetFilterReq ( |
| 192 | tWDA_CbContext *pWDA, |
| 193 | tSirRcvPktFilterCfgType *pRcvPktFilterCfg |
| 194 | ); |
| 195 | static VOS_STATUS WDA_ProcessPacketFilterMatchCountReq ( |
| 196 | tWDA_CbContext *pWDA, |
| 197 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp |
| 198 | ); |
| 199 | static VOS_STATUS WDA_ProcessReceiveFilterClearFilterReq ( |
| 200 | tWDA_CbContext *pWDA, |
| 201 | tSirRcvFltPktClearParam *pRcvFltPktClearParam |
| 202 | ); |
| 203 | #endif // WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 204 | VOS_STATUS WDA_ProcessSetPowerParamsReq(tWDA_CbContext *pWDA, tSirSetPowerParamsReq *pPowerParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 205 | static VOS_STATUS WDA_ProcessTxControlInd(tWDA_CbContext *pWDA, |
| 206 | tpTxControlParams pTxCtrlParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 207 | VOS_STATUS WDA_GetWepKeysFromCfg( tWDA_CbContext *pWDA, |
| 208 | v_U8_t *pDefaultKeyId, |
| 209 | v_U8_t *pNumKeys, |
| 210 | WDI_KeysType *pWdiKeys ); |
| 211 | |
| 212 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 213 | static VOS_STATUS WDA_ProcessGTKOffloadReq(tWDA_CbContext *pWDA, tpSirGtkOffloadParams pGtkOffloadParams); |
| 214 | static VOS_STATUS WDA_ProcessGTKOffloadGetInfoReq(tWDA_CbContext *pWDA, tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp); |
| 215 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 216 | |
| 217 | VOS_STATUS WDA_ProcessSetTmLevelReq(tWDA_CbContext *pWDA, |
| 218 | tAniSetTmLevelReq *setTmLevelReq); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 219 | #ifdef WLAN_FEATURE_11AC |
| 220 | VOS_STATUS WDA_ProcessUpdateOpMode(tWDA_CbContext *pWDA, |
| 221 | tUpdateVHTOpMode *pData); |
| 222 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 223 | /* |
| 224 | * FUNCTION: WDA_open |
| 225 | * Allocate the WDA context |
| 226 | */ |
| 227 | VOS_STATUS WDA_open(v_PVOID_t pVosContext, v_PVOID_t pOSContext, |
| 228 | tMacOpenParameters *pMacParams ) |
| 229 | { |
| 230 | tWDA_CbContext *wdaContext; |
| 231 | VOS_STATUS status; |
| 232 | WDI_DeviceCapabilityType wdiDevCapability = {0} ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 233 | /* Allocate WDA context */ |
| 234 | status = vos_alloc_context(pVosContext, VOS_MODULE_ID_WDA, |
| 235 | (v_VOID_t **)&wdaContext, sizeof(tWDA_CbContext)) ; |
| 236 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 237 | { |
| 238 | return VOS_STATUS_E_NOMEM; |
| 239 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 240 | /*__asm int 3;*/ |
| 241 | vos_mem_zero(wdaContext,sizeof(tWDA_CbContext)); |
| 242 | |
| 243 | /* Initialize data structures */ |
| 244 | wdaContext->pVosContext = pVosContext; |
| 245 | wdaContext->wdaState = WDA_INIT_STATE; |
| 246 | wdaContext->uTxFlowMask = WDA_TXFLOWMASK; |
| 247 | |
| 248 | /* Initialize WDA-WDI synchronization event */ |
| 249 | status = vos_event_init(&wdaContext->wdaWdiEvent); |
| 250 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 251 | { |
| 252 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 253 | "WDI Sync Event init failed - status = %d\n", status); |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 254 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 255 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | /* Init Frame transfer event */ |
| 257 | status = vos_event_init(&wdaContext->txFrameEvent); |
| 258 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 259 | { |
| 260 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 261 | "VOS Mgmt Frame Event init failed - status = %d\n", status); |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 262 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 263 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 264 | status = vos_event_init(&wdaContext->suspendDataTxEvent); |
| 265 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 266 | { |
| 267 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 268 | "VOS suspend data tx Event init failed - status = %d\n", status); |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 269 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 271 | status = vos_event_init(&wdaContext->waitOnWdiIndicationCallBack); |
| 272 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 273 | { |
| 274 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 275 | "VOS wait On Wdi Ind Event init failed - status = %d\n", status); |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 276 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 278 | vos_trace_setLevel(VOS_MODULE_ID_WDA,VOS_TRACE_LEVEL_ERROR); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 279 | wdaContext->driverMode = pMacParams->driverType; |
| 280 | if(WDI_STATUS_SUCCESS != WDI_Init(pOSContext, &wdaContext->pWdiContext, |
| 281 | &wdiDevCapability, pMacParams->driverType)) |
| 282 | { |
| 283 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 284 | "WDI Init failed" ); |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 285 | goto error; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 286 | } |
| 287 | else |
| 288 | { |
| 289 | pMacParams->maxStation = wdiDevCapability.ucMaxSTASupported ; |
| 290 | pMacParams->maxBssId = wdiDevCapability.ucMaxBSSSupported; |
| 291 | pMacParams->frameTransRequired = wdiDevCapability.bFrameXtlSupported; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | /* update max STA in WDA used for BA */ |
| 293 | wdaContext->wdaMaxSta = pMacParams->maxStation; |
| 294 | /* store the frameTransRequired flag in wdaContext, to send this to HAL |
| 295 | * in WDA_Start |
| 296 | */ |
| 297 | wdaContext->frameTransRequired = wdiDevCapability.bFrameXtlSupported; |
| 298 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 299 | return status; |
Madan Mohan Koyyalamudi | 0b78e15 | 2012-11-28 15:46:51 -0800 | [diff] [blame] | 300 | |
| 301 | error: |
| 302 | vos_free_context(pVosContext, VOS_MODULE_ID_WDA, wdaContext); |
| 303 | return VOS_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 304 | } |
| 305 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | /* |
| 307 | * FUNCTION: WDA_preStart |
| 308 | * Trigger DAL-AL to start CFG download |
| 309 | */ |
| 310 | VOS_STATUS WDA_preStart(v_PVOID_t pVosContext) |
| 311 | { |
| 312 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 313 | vos_msg_t wdaMsg = {0} ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 314 | /* |
| 315 | * trigger CFG download in WDA by sending WDA_CFG_DNLD message |
| 316 | */ |
| 317 | wdaMsg.type = WNI_CFG_DNLD_REQ ; |
| 318 | wdaMsg.bodyptr = NULL; |
| 319 | wdaMsg.bodyval = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 320 | /* post the message.. */ |
| 321 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &wdaMsg ); |
| 322 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 323 | { |
| 324 | vosStatus = VOS_STATUS_E_BADMSG; |
| 325 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 326 | return( vosStatus ); |
| 327 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 328 | /* |
| 329 | * FUNCTION: WDA_wdiStartCallback |
| 330 | * Once WDI_Start is finished, WDI start callback will be called by WDI |
| 331 | * to indicate completion of WDI_Start. |
| 332 | */ |
| 333 | void WDA_wdiStartCallback(WDI_StartRspParamsType *wdiRspParams, |
| 334 | void *pVosContext) |
| 335 | { |
| 336 | tWDA_CbContext *wdaContext; |
| 337 | VOS_STATUS status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 338 | if (NULL == pVosContext) |
| 339 | { |
| 340 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 341 | "%s: Invoked with invalid pVosContext", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 342 | return; |
| 343 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 344 | wdaContext = VOS_GET_WDA_CTXT(pVosContext); |
| 345 | if (NULL == wdaContext) |
| 346 | { |
| 347 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 348 | "%s: Invoked with invalid wdaContext", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | return; |
| 350 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 351 | if (WDI_STATUS_SUCCESS != wdiRspParams->wdiStatus) |
| 352 | { |
| 353 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 354 | "%s: WDI_Start() failure reported", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | } |
| 356 | else |
| 357 | { |
| 358 | wdaContext->wdaState = WDA_START_STATE; |
| 359 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 360 | /* extract and save version information from the Start Response */ |
| 361 | wdaContext->wcnssWlanCompiledVersion.major = |
| 362 | wdiRspParams->wlanCompiledVersion.major; |
| 363 | wdaContext->wcnssWlanCompiledVersion.minor = |
| 364 | wdiRspParams->wlanCompiledVersion.minor; |
| 365 | wdaContext->wcnssWlanCompiledVersion.version = |
| 366 | wdiRspParams->wlanCompiledVersion.version; |
| 367 | wdaContext->wcnssWlanCompiledVersion.revision = |
| 368 | wdiRspParams->wlanCompiledVersion.revision; |
| 369 | wdaContext->wcnssWlanReportedVersion.major = |
| 370 | wdiRspParams->wlanReportedVersion.major; |
| 371 | wdaContext->wcnssWlanReportedVersion.minor = |
| 372 | wdiRspParams->wlanReportedVersion.minor; |
| 373 | wdaContext->wcnssWlanReportedVersion.version = |
| 374 | wdiRspParams->wlanReportedVersion.version; |
| 375 | wdaContext->wcnssWlanReportedVersion.revision = |
| 376 | wdiRspParams->wlanReportedVersion.revision; |
| 377 | wpalMemoryCopy(wdaContext->wcnssSoftwareVersionString, |
| 378 | wdiRspParams->wcnssSoftwareVersion, |
| 379 | sizeof(wdaContext->wcnssSoftwareVersionString)); |
| 380 | wpalMemoryCopy(wdaContext->wcnssHardwareVersionString, |
| 381 | wdiRspParams->wcnssHardwareVersion, |
| 382 | sizeof(wdaContext->wcnssHardwareVersionString)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | /* Notify WDA_start that WDI_Start has completed */ |
| 384 | status = vos_event_set(&wdaContext->wdaWdiEvent); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 385 | if (VOS_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 386 | { |
| 387 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 388 | "%s: Unable to unblock WDA_start", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 389 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 390 | return; |
| 391 | } |
| 392 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 393 | /* |
| 394 | * FUNCTION: WDA_start |
| 395 | * Prepare TLV configuration and call WDI_Start. |
| 396 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 397 | VOS_STATUS WDA_start(v_PVOID_t pVosContext) |
| 398 | { |
| 399 | tWDA_CbContext *wdaContext; |
| 400 | VOS_STATUS status; |
| 401 | WDI_Status wdiStatus; |
| 402 | WDI_StartReqParamsType wdiStartParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | if (NULL == pVosContext) |
| 404 | { |
| 405 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 406 | "%s: Invoked with invalid pVosContext", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 407 | return VOS_STATUS_E_FAILURE; |
| 408 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 409 | wdaContext = VOS_GET_WDA_CTXT(pVosContext); |
| 410 | if (NULL == wdaContext) |
| 411 | { |
| 412 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 413 | "%s: Invoked with invalid wdaContext", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 414 | return VOS_STATUS_E_FAILURE; |
| 415 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 416 | /* Non-FTM mode, WDA status for START must be INIT |
| 417 | * FTM mode, WDA Status for START can be INIT or STOP */ |
| 418 | if ( (WDA_INIT_STATE != wdaContext->wdaState) && |
| 419 | (WDA_STOP_STATE != wdaContext->wdaState) ) |
| 420 | { |
| 421 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 422 | "%s: Invoked from wrong state %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 423 | __func__, wdaContext->wdaState ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 424 | return VOS_STATUS_E_FAILURE; |
| 425 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 426 | /* initialize the wdiStartParam. Note that we can create this on |
| 427 | the stack since we won't exit until WDI_Start() completes or |
| 428 | times out */ |
| 429 | vos_mem_set(&wdiStartParam, sizeof(wdiStartParam), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 430 | wdiStartParam.wdiDriverType = wdaContext->driverMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 431 | /* prepare the config TLV for the WDI */ |
| 432 | status = WDA_prepareConfigTLV(pVosContext, &wdiStartParam); |
| 433 | if ( !VOS_IS_STATUS_SUCCESS(status) ) |
| 434 | { |
| 435 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 436 | "%s: Unable to prepare Config TLV", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 437 | return VOS_STATUS_E_FAILURE; |
| 438 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 439 | /* note from here onwards if an error occurs we must |
| 440 | reclaim the config TLV buffer */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 441 | wdiStartParam.wdiLowLevelIndCB = WDA_lowLevelIndCallback; |
| 442 | wdiStartParam.pIndUserData = (v_PVOID_t *)wdaContext; |
| 443 | wdiStartParam.wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 444 | /* initialize the WDA-WDI synchronization event */ |
| 445 | vos_event_reset(&wdaContext->wdaWdiEvent); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 446 | /* call WDI start */ |
| 447 | wdiStatus = WDI_Start(&wdiStartParam, |
| 448 | (WDI_StartRspCb)WDA_wdiStartCallback, |
| 449 | (v_VOID_t *)pVosContext); |
| 450 | if ( IS_WDI_STATUS_FAILURE(wdiStatus) ) |
| 451 | { |
| 452 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 453 | "%s: WDI Start failed", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 454 | vos_mem_free(wdiStartParam.pConfigBuffer); |
| 455 | return VOS_STATUS_E_FAILURE; |
| 456 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 457 | /* wait for WDI start to invoke our callback */ |
| 458 | status = vos_wait_single_event( &wdaContext->wdaWdiEvent, |
| 459 | WDA_WDI_START_TIMEOUT ); |
| 460 | if ( !VOS_IS_STATUS_SUCCESS(status) ) |
| 461 | { |
| 462 | if ( VOS_STATUS_E_TIMEOUT == status ) |
| 463 | { |
| 464 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 465 | "%s: Timeout occurred during WDI_Start", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 466 | } |
| 467 | else |
| 468 | { |
| 469 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 470 | "%s: Error %d while waiting for WDI_Start", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 471 | __func__, status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 472 | } |
| 473 | vos_mem_free(wdiStartParam.pConfigBuffer); |
| 474 | return VOS_STATUS_E_FAILURE; |
| 475 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 476 | /* WDI_Start() has completed so we can resume our work */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 477 | /* we no longer need the config TLV */ |
| 478 | vos_mem_free(wdiStartParam.pConfigBuffer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 479 | /* if we are not in the START state then WDI_Start() failed */ |
| 480 | if (WDA_START_STATE != wdaContext->wdaState) |
| 481 | { |
| 482 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 483 | "%s: WDI_Start() failure detected", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 484 | return VOS_STATUS_E_FAILURE; |
| 485 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 486 | /* FTM mode does not need to monitor BA activity */ |
| 487 | if ( eDRIVER_TYPE_MFG != wdaContext->driverMode ) |
| 488 | { |
| 489 | status = wdaCreateTimers(wdaContext) ; |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 490 | if(VOS_STATUS_SUCCESS == status) |
| 491 | { |
| 492 | wdaContext->wdaTimersCreated = VOS_TRUE; |
| 493 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 494 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 495 | return status; |
| 496 | } |
| 497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 498 | /* |
| 499 | * FUNCTION: WDA_prepareConfigTLV |
| 500 | * Function to prepare CFG for DAL(WDA) |
| 501 | */ |
| 502 | VOS_STATUS WDA_prepareConfigTLV(v_PVOID_t pVosContext, |
| 503 | WDI_StartReqParamsType *wdiStartParams ) |
| 504 | { |
| 505 | /* get pMac to acess CFG data base */ |
| 506 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pVosContext); |
| 507 | tWDA_CbContext *wdaContext= (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
| 508 | tHalCfg *tlvStruct = NULL ; |
| 509 | tANI_U8 *tlvStructStart = NULL ; |
| 510 | tANI_U32 strLength = WNI_CFG_STA_ID_LEN; |
| 511 | v_PVOID_t *configParam; |
| 512 | tANI_U32 configParamSize; |
| 513 | tANI_U32 *configDataValue; |
| 514 | WDI_WlanVersionType wcnssCompiledApiVersion; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 515 | if ((NULL == pMac)||(NULL == wdaContext)) |
| 516 | { |
| 517 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 518 | "%s: Invoked with invalid wdaContext or pMac", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 519 | VOS_ASSERT(0); |
| 520 | return VOS_STATUS_E_FAILURE; |
| 521 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | configParamSize = (sizeof(tHalCfg) * QWLAN_HAL_CFG_MAX_PARAMS) + |
| 523 | WNI_CFG_STA_ID_LEN + |
| 524 | WNI_CFG_EDCA_WME_ACBK_LEN + |
| 525 | WNI_CFG_EDCA_WME_ACBE_LEN + |
| 526 | WNI_CFG_EDCA_WME_ACVI_LEN + |
| 527 | WNI_CFG_EDCA_WME_ACVO_LEN + |
| 528 | + (QWLAN_HAL_CFG_INTEGER_PARAM * sizeof(tANI_U32)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 529 | /* malloc memory for all configs in one shot */ |
| 530 | configParam = vos_mem_malloc(configParamSize); |
| 531 | |
| 532 | if(NULL == configParam ) |
| 533 | { |
| 534 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 535 | "%s:configParam is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 536 | VOS_ASSERT(0) ; |
| 537 | return VOS_STATUS_E_NOMEM; |
| 538 | } |
| 539 | vos_mem_set(configParam, configParamSize, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 540 | wdiStartParams->pConfigBuffer = configParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 541 | tlvStruct = (tHalCfg *)configParam; |
| 542 | tlvStructStart = (tANI_U8 *)configParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 543 | /* TODO: Remove Later */ |
| 544 | /* QWLAN_HAL_CFG_STA_ID */ |
| 545 | tlvStruct->type = QWLAN_HAL_CFG_STA_ID; |
| 546 | configDataValue = (tANI_U32*)((tANI_U8 *) tlvStruct + sizeof(tHalCfg)); |
| 547 | if(wlan_cfgGetStr(pMac, WNI_CFG_STA_ID, (tANI_U8*)configDataValue, &strLength) != |
| 548 | eSIR_SUCCESS) |
| 549 | { |
| 550 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 551 | "Failed to get value for WNI_CFG_STA_ID"); |
| 552 | goto handle_failure; |
| 553 | } |
| 554 | tlvStruct->length = strLength ; |
| 555 | /* calculate the pad bytes to have the CFG in aligned format */ |
| 556 | tlvStruct->padBytes = ALIGNED_WORD_SIZE - |
| 557 | (tlvStruct->length & (ALIGNED_WORD_SIZE - 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 558 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 559 | + sizeof(tHalCfg) + tlvStruct->length + tlvStruct->padBytes)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | /* QWLAN_HAL_CFG_CURRENT_TX_ANTENNA */ |
| 561 | tlvStruct->type = QWLAN_HAL_CFG_CURRENT_TX_ANTENNA; |
| 562 | tlvStruct->length = sizeof(tANI_U32); |
| 563 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 564 | if(wlan_cfgGetInt(pMac, WNI_CFG_CURRENT_TX_ANTENNA, configDataValue ) |
| 565 | != eSIR_SUCCESS) |
| 566 | { |
| 567 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 568 | "Failed to get value for WNI_CFG_CURRENT_TX_ANTENNA"); |
| 569 | goto handle_failure; |
| 570 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 571 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 572 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 573 | /* QWLAN_HAL_CFG_CURRENT_RX_ANTENNA */ |
| 574 | tlvStruct->type = QWLAN_HAL_CFG_CURRENT_RX_ANTENNA; |
| 575 | tlvStruct->length = sizeof(tANI_U32); |
| 576 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 577 | if(wlan_cfgGetInt(pMac, WNI_CFG_CURRENT_RX_ANTENNA, configDataValue) != |
| 578 | eSIR_SUCCESS) |
| 579 | { |
| 580 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 581 | "Failed to get value for WNI_CFG_CURRENT_RX_ANTENNA"); |
| 582 | goto handle_failure; |
| 583 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 584 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 585 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 586 | /* QWLAN_HAL_CFG_LOW_GAIN_OVERRIDE */ |
| 587 | tlvStruct->type = QWLAN_HAL_CFG_LOW_GAIN_OVERRIDE; |
| 588 | tlvStruct->length = sizeof(tANI_U32); |
| 589 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 590 | if(wlan_cfgGetInt(pMac, WNI_CFG_LOW_GAIN_OVERRIDE, configDataValue ) |
| 591 | != eSIR_SUCCESS) |
| 592 | { |
| 593 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 594 | "Failed to get value for WNI_CFG_LOW_GAIN_OVERRIDE"); |
| 595 | goto handle_failure; |
| 596 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 597 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 598 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
| 599 | |
| 600 | /* QWLAN_HAL_CFG_POWER_STATE_PER_CHAIN */ |
| 601 | tlvStruct->type = QWLAN_HAL_CFG_POWER_STATE_PER_CHAIN; |
| 602 | tlvStruct->length = sizeof(tANI_U32); |
| 603 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 604 | if(wlan_cfgGetInt(pMac, WNI_CFG_POWER_STATE_PER_CHAIN, |
| 605 | configDataValue ) != eSIR_SUCCESS) |
| 606 | { |
| 607 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 608 | "Failed to get value for WNI_CFG_POWER_STATE_PER_CHAIN"); |
| 609 | goto handle_failure; |
| 610 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 612 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 613 | /* QWLAN_HAL_CFG_CAL_PERIOD */ |
| 614 | tlvStruct->type = QWLAN_HAL_CFG_CAL_PERIOD; |
| 615 | tlvStruct->length = sizeof(tANI_U32); |
| 616 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 617 | if(wlan_cfgGetInt(pMac, WNI_CFG_CAL_PERIOD, configDataValue ) |
| 618 | != eSIR_SUCCESS) |
| 619 | { |
| 620 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 621 | "Failed to get value for WNI_CFG_CAL_PERIOD"); |
| 622 | goto handle_failure; |
| 623 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 624 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 625 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 626 | /* QWLAN_HAL_CFG_CAL_CONTROL */ |
| 627 | tlvStruct->type = QWLAN_HAL_CFG_CAL_CONTROL ; |
| 628 | tlvStruct->length = sizeof(tANI_U32); |
| 629 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 630 | if(wlan_cfgGetInt(pMac, WNI_CFG_CAL_CONTROL, configDataValue ) |
| 631 | != eSIR_SUCCESS) |
| 632 | { |
| 633 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 634 | "Failed to get value for WNI_CFG_CAL_CONTROL"); |
| 635 | goto handle_failure; |
| 636 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 637 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 638 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 639 | /* QWLAN_HAL_CFG_PROXIMITY */ |
| 640 | tlvStruct->type = QWLAN_HAL_CFG_PROXIMITY ; |
| 641 | tlvStruct->length = sizeof(tANI_U32); |
| 642 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 643 | if(wlan_cfgGetInt(pMac, WNI_CFG_PROXIMITY, configDataValue ) |
| 644 | != eSIR_SUCCESS) |
| 645 | { |
| 646 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 647 | "Failed to get value for WNI_CFG_PROXIMITY"); |
| 648 | goto handle_failure; |
| 649 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 650 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 651 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 652 | /* QWLAN_HAL_CFG_NETWORK_DENSITY */ |
| 653 | tlvStruct->type = QWLAN_HAL_CFG_NETWORK_DENSITY ; |
| 654 | tlvStruct->length = sizeof(tANI_U32); |
| 655 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 656 | if(wlan_cfgGetInt(pMac, WNI_CFG_NETWORK_DENSITY, configDataValue ) |
| 657 | != eSIR_SUCCESS) |
| 658 | { |
| 659 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 660 | "Failed to get value for WNI_CFG_NETWORK_DENSITY"); |
| 661 | goto handle_failure; |
| 662 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 664 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 665 | /* QWLAN_HAL_CFG_MAX_MEDIUM_TIME */ |
| 666 | tlvStruct->type = QWLAN_HAL_CFG_MAX_MEDIUM_TIME ; |
| 667 | tlvStruct->length = sizeof(tANI_U32); |
| 668 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 669 | if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_MEDIUM_TIME, configDataValue ) != |
| 670 | eSIR_SUCCESS) |
| 671 | { |
| 672 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 673 | "Failed to get value for WNI_CFG_MAX_MEDIUM_TIME"); |
| 674 | goto handle_failure; |
| 675 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 676 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 677 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 678 | /* QWLAN_HAL_CFG_MAX_MPDUS_IN_AMPDU */ |
| 679 | tlvStruct->type = QWLAN_HAL_CFG_MAX_MPDUS_IN_AMPDU ; |
| 680 | tlvStruct->length = sizeof(tANI_U32); |
| 681 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 682 | if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_MPDUS_IN_AMPDU, |
| 683 | configDataValue ) != eSIR_SUCCESS) |
| 684 | { |
| 685 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 686 | "Failed to get value for WNI_CFG_MAX_MPDUS_IN_AMPDU"); |
| 687 | goto handle_failure; |
| 688 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 689 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 690 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 691 | /* QWLAN_HAL_CFG_RTS_THRESHOLD */ |
| 692 | tlvStruct->type = QWLAN_HAL_CFG_RTS_THRESHOLD ; |
| 693 | tlvStruct->length = sizeof(tANI_U32); |
| 694 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 695 | if(wlan_cfgGetInt(pMac, WNI_CFG_RTS_THRESHOLD, configDataValue ) != |
| 696 | eSIR_SUCCESS) |
| 697 | { |
| 698 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 699 | "Failed to get value for WNI_CFG_RTS_THRESHOLD"); |
| 700 | goto handle_failure; |
| 701 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 703 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 704 | /* QWLAN_HAL_CFG_SHORT_RETRY_LIMIT */ |
| 705 | tlvStruct->type = QWLAN_HAL_CFG_SHORT_RETRY_LIMIT ; |
| 706 | tlvStruct->length = sizeof(tANI_U32); |
| 707 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 708 | if(wlan_cfgGetInt(pMac, WNI_CFG_SHORT_RETRY_LIMIT, configDataValue ) != |
| 709 | eSIR_SUCCESS) |
| 710 | { |
| 711 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 712 | "Failed to get value for WNI_CFG_SHORT_RETRY_LIMIT"); |
| 713 | goto handle_failure; |
| 714 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 715 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 716 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 717 | /* QWLAN_HAL_CFG_LONG_RETRY_LIMIT */ |
| 718 | tlvStruct->type = QWLAN_HAL_CFG_LONG_RETRY_LIMIT ; |
| 719 | tlvStruct->length = sizeof(tANI_U32); |
| 720 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 721 | if(wlan_cfgGetInt(pMac, WNI_CFG_LONG_RETRY_LIMIT, configDataValue ) != |
| 722 | eSIR_SUCCESS) |
| 723 | { |
| 724 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 725 | "Failed to get value for WNI_CFG_LONG_RETRY_LIMIT"); |
| 726 | goto handle_failure; |
| 727 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 729 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | /* QWLAN_HAL_CFG_FRAGMENTATION_THRESHOLD */ |
| 731 | tlvStruct->type = QWLAN_HAL_CFG_FRAGMENTATION_THRESHOLD ; |
| 732 | tlvStruct->length = sizeof(tANI_U32); |
| 733 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 734 | if(wlan_cfgGetInt(pMac, WNI_CFG_FRAGMENTATION_THRESHOLD, |
| 735 | configDataValue ) != eSIR_SUCCESS) |
| 736 | { |
| 737 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 738 | "Failed to get value for WNI_CFG_FRAGMENTATION_THRESHOLD"); |
| 739 | goto handle_failure; |
| 740 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 741 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 742 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 743 | /* QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_ZERO */ |
| 744 | tlvStruct->type = QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_ZERO ; |
| 745 | tlvStruct->length = sizeof(tANI_U32); |
| 746 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 747 | if(wlan_cfgGetInt(pMac, WNI_CFG_DYNAMIC_THRESHOLD_ZERO, |
| 748 | configDataValue ) != eSIR_SUCCESS) |
| 749 | { |
| 750 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 751 | "Failed to get value for WNI_CFG_DYNAMIC_THRESHOLD_ZERO"); |
| 752 | goto handle_failure; |
| 753 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 754 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 755 | + sizeof(tHalCfg) + tlvStruct->length)); |
| 756 | |
| 757 | /* QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_ONE */ |
| 758 | tlvStruct->type = QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_ONE ; |
| 759 | tlvStruct->length = sizeof(tANI_U32); |
| 760 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 761 | if(wlan_cfgGetInt(pMac, WNI_CFG_DYNAMIC_THRESHOLD_ONE, |
| 762 | configDataValue ) != eSIR_SUCCESS) |
| 763 | { |
| 764 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 765 | "Failed to get value for WNI_CFG_DYNAMIC_THRESHOLD_ONE"); |
| 766 | goto handle_failure; |
| 767 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 768 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 769 | + sizeof(tHalCfg) + tlvStruct->length)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 770 | /* QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_TWO */ |
| 771 | tlvStruct->type = QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_TWO ; |
| 772 | tlvStruct->length = sizeof(tANI_U32); |
| 773 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 774 | if(wlan_cfgGetInt(pMac, WNI_CFG_DYNAMIC_THRESHOLD_TWO, |
| 775 | configDataValue ) != eSIR_SUCCESS) |
| 776 | { |
| 777 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 778 | "Failed to get value for WNI_CFG_DYNAMIC_THRESHOLD_TWO"); |
| 779 | goto handle_failure; |
| 780 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 781 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 782 | + sizeof(tHalCfg) + tlvStruct->length)); |
| 783 | |
| 784 | /* QWLAN_HAL_CFG_FIXED_RATE */ |
| 785 | tlvStruct->type = QWLAN_HAL_CFG_FIXED_RATE ; |
| 786 | tlvStruct->length = sizeof(tANI_U32); |
| 787 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 788 | if(wlan_cfgGetInt(pMac, WNI_CFG_FIXED_RATE, configDataValue) |
| 789 | != eSIR_SUCCESS) |
| 790 | { |
| 791 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 792 | "Failed to get value for WNI_CFG_FIXED_RATE"); |
| 793 | goto handle_failure; |
| 794 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 795 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 796 | + sizeof(tHalCfg) + tlvStruct->length)); |
| 797 | |
| 798 | /* QWLAN_HAL_CFG_RETRYRATE_POLICY */ |
| 799 | tlvStruct->type = QWLAN_HAL_CFG_RETRYRATE_POLICY ; |
| 800 | tlvStruct->length = sizeof(tANI_U32); |
| 801 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 802 | if(wlan_cfgGetInt(pMac, WNI_CFG_RETRYRATE_POLICY, configDataValue ) |
| 803 | != eSIR_SUCCESS) |
| 804 | { |
| 805 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 806 | "Failed to get value for WNI_CFG_RETRYRATE_POLICY"); |
| 807 | goto handle_failure; |
| 808 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 809 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 810 | + sizeof(tHalCfg) + tlvStruct->length)); |
| 811 | |
| 812 | /* QWLAN_HAL_CFG_RETRYRATE_SECONDARY */ |
| 813 | tlvStruct->type = QWLAN_HAL_CFG_RETRYRATE_SECONDARY ; |
| 814 | tlvStruct->length = sizeof(tANI_U32); |
| 815 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 816 | if(wlan_cfgGetInt(pMac, WNI_CFG_RETRYRATE_SECONDARY, |
| 817 | configDataValue ) != eSIR_SUCCESS) |
| 818 | { |
| 819 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 820 | "Failed to get value for WNI_CFG_RETRYRATE_SECONDARY"); |
| 821 | goto handle_failure; |
| 822 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 823 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 824 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 825 | /* QWLAN_HAL_CFG_RETRYRATE_TERTIARY */ |
| 826 | tlvStruct->type = QWLAN_HAL_CFG_RETRYRATE_TERTIARY ; |
| 827 | tlvStruct->length = sizeof(tANI_U32); |
| 828 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 829 | if(wlan_cfgGetInt(pMac, WNI_CFG_RETRYRATE_TERTIARY, |
| 830 | configDataValue ) != eSIR_SUCCESS) |
| 831 | { |
| 832 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 833 | "Failed to get value for WNI_CFG_RETRYRATE_TERTIARY"); |
| 834 | goto handle_failure; |
| 835 | } |
| 836 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 837 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 838 | /* QWLAN_HAL_CFG_FORCE_POLICY_PROTECTION */ |
| 839 | tlvStruct->type = QWLAN_HAL_CFG_FORCE_POLICY_PROTECTION ; |
| 840 | tlvStruct->length = sizeof(tANI_U32); |
| 841 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 842 | if(wlan_cfgGetInt(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, |
| 843 | configDataValue ) != eSIR_SUCCESS) |
| 844 | { |
| 845 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 846 | "Failed to get value for WNI_CFG_FORCE_POLICY_PROTECTION"); |
| 847 | goto handle_failure; |
| 848 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 849 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 850 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 851 | /* QWLAN_HAL_CFG_FIXED_RATE_MULTICAST_24GHZ */ |
| 852 | tlvStruct->type = QWLAN_HAL_CFG_FIXED_RATE_MULTICAST_24GHZ ; |
| 853 | tlvStruct->length = sizeof(tANI_U32); |
| 854 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 855 | if(wlan_cfgGetInt(pMac, WNI_CFG_FIXED_RATE_MULTICAST_24GHZ, |
| 856 | configDataValue ) != eSIR_SUCCESS) |
| 857 | { |
| 858 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 859 | "Failed to get value for WNI_CFG_FIXED_RATE_MULTICAST_24GHZ"); |
| 860 | goto handle_failure; |
| 861 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 862 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 863 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 864 | /* QWLAN_HAL_CFG_FIXED_RATE_MULTICAST_5GHZ */ |
| 865 | tlvStruct->type = QWLAN_HAL_CFG_FIXED_RATE_MULTICAST_5GHZ ; |
| 866 | tlvStruct->length = sizeof(tANI_U32); |
| 867 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 868 | if(wlan_cfgGetInt(pMac, WNI_CFG_FIXED_RATE_MULTICAST_5GHZ, |
| 869 | configDataValue ) != eSIR_SUCCESS) |
| 870 | { |
| 871 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 872 | "Failed to get value for WNI_CFG_FIXED_RATE_MULTICAST_5GHZ"); |
| 873 | goto handle_failure; |
| 874 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 875 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 876 | + sizeof(tHalCfg) + tlvStruct->length); |
| 877 | |
| 878 | #if 0 /*FIXME_PRIMA : Enable this after the RA is enabled in HAL*/ |
| 879 | /* QWLAN_HAL_CFG_DEFAULT_RATE_INDEX_24GHZ */ |
| 880 | tlvStruct->type = QWLAN_HAL_CFG_DEFAULT_RATE_INDEX_24GHZ ; |
| 881 | tlvStruct->length = sizeof(tANI_U32); |
| 882 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 883 | if(wlan_cfgGetInt(pMac, WNI_CFG_DEFAULT_RATE_INDEX_24GHZ, |
| 884 | configDataValue ) != eSIR_SUCCESS) |
| 885 | { |
| 886 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 887 | "Failed to get value for WNI_CFG_DEFAULT_RATE_INDEX_24GHZ"); |
| 888 | goto handle_failure; |
| 889 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 890 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 891 | + sizeof(tHalCfg) + tlvStruct->length); |
| 892 | #endif |
| 893 | /* QWLAN_HAL_CFG_DEFAULT_RATE_INDEX_5GHZ */ |
| 894 | tlvStruct->type = QWLAN_HAL_CFG_DEFAULT_RATE_INDEX_5GHZ ; |
| 895 | tlvStruct->length = sizeof(tANI_U32); |
| 896 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 897 | if(wlan_cfgGetInt(pMac, WNI_CFG_DEFAULT_RATE_INDEX_5GHZ, |
| 898 | configDataValue ) != eSIR_SUCCESS) |
| 899 | { |
| 900 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 901 | "Failed to get value for WNI_CFG_DEFAULT_RATE_INDEX_5GHZ"); |
| 902 | goto handle_failure; |
| 903 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 904 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 905 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 906 | /* QWLAN_HAL_CFG_MAX_BA_SESSIONS */ |
| 907 | tlvStruct->type = QWLAN_HAL_CFG_MAX_BA_SESSIONS ; |
| 908 | tlvStruct->length = sizeof(tANI_U32); |
| 909 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 910 | if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_BA_SESSIONS, configDataValue ) != |
| 911 | eSIR_SUCCESS) |
| 912 | { |
| 913 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 914 | "Failed to get value for WNI_CFG_MAX_BA_SESSIONS"); |
| 915 | goto handle_failure; |
| 916 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 917 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 918 | + sizeof(tHalCfg) + tlvStruct->length); |
| 919 | |
| 920 | /* QWLAN_HAL_CFG_PS_DATA_INACTIVITY_TIMEOUT */ |
| 921 | tlvStruct->type = QWLAN_HAL_CFG_PS_DATA_INACTIVITY_TIMEOUT ; |
| 922 | tlvStruct->length = sizeof(tANI_U32); |
| 923 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 924 | if(wlan_cfgGetInt(pMac, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, |
| 925 | configDataValue ) != eSIR_SUCCESS) |
| 926 | { |
| 927 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 928 | "Failed to get value for WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT"); |
| 929 | goto handle_failure; |
| 930 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 931 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 932 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 933 | /* QWLAN_HAL_CFG_PS_ENABLE_BCN_FILTER */ |
| 934 | tlvStruct->type = QWLAN_HAL_CFG_PS_ENABLE_BCN_FILTER ; |
| 935 | tlvStruct->length = sizeof(tANI_U32); |
| 936 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 937 | if(wlan_cfgGetInt(pMac, WNI_CFG_PS_ENABLE_BCN_FILTER, |
| 938 | configDataValue ) != eSIR_SUCCESS) |
| 939 | { |
| 940 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 941 | "Failed to get value for WNI_CFG_PS_ENABLE_BCN_FILTER"); |
| 942 | goto handle_failure; |
| 943 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 944 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 945 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 946 | /* QWLAN_HAL_CFG_PS_ENABLE_RSSI_MONITOR */ |
| 947 | tlvStruct->type = QWLAN_HAL_CFG_PS_ENABLE_RSSI_MONITOR ; |
| 948 | tlvStruct->length = sizeof(tANI_U32); |
| 949 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 950 | if(wlan_cfgGetInt(pMac, WNI_CFG_PS_ENABLE_RSSI_MONITOR, |
| 951 | configDataValue ) != eSIR_SUCCESS) |
| 952 | { |
| 953 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 954 | "Failed to get value for WNI_CFG_PS_ENABLE_RSSI_MONITOR"); |
| 955 | goto handle_failure; |
| 956 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 957 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 958 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 959 | /* QWLAN_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE */ |
| 960 | tlvStruct->type = QWLAN_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE ; |
| 961 | tlvStruct->length = sizeof(tANI_U32); |
| 962 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 963 | if(wlan_cfgGetInt(pMac, WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE, |
| 964 | configDataValue ) != eSIR_SUCCESS) |
| 965 | { |
| 966 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 967 | "Failed to get value for WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE"); |
| 968 | goto handle_failure; |
| 969 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 970 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 971 | + sizeof(tHalCfg) + tlvStruct->length); |
| 972 | |
| 973 | /* QWLAN_HAL_CFG_STATS_PERIOD */ |
| 974 | tlvStruct->type = QWLAN_HAL_CFG_STATS_PERIOD ; |
| 975 | tlvStruct->length = sizeof(tANI_U32); |
| 976 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 977 | if(wlan_cfgGetInt(pMac, WNI_CFG_STATS_PERIOD, configDataValue ) != |
| 978 | eSIR_SUCCESS) |
| 979 | { |
| 980 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 981 | "Failed to get value for WNI_CFG_STATS_PERIOD"); |
| 982 | goto handle_failure; |
| 983 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 984 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 985 | + sizeof(tHalCfg) + tlvStruct->length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 986 | /* QWLAN_HAL_CFG_CFP_MAX_DURATION */ |
| 987 | tlvStruct->type = QWLAN_HAL_CFG_CFP_MAX_DURATION ; |
| 988 | tlvStruct->length = sizeof(tANI_U32); |
| 989 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 990 | if(wlan_cfgGetInt(pMac, WNI_CFG_CFP_MAX_DURATION, configDataValue ) != |
| 991 | eSIR_SUCCESS) |
| 992 | { |
| 993 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 994 | "Failed to get value for WNI_CFG_CFP_MAX_DURATION"); |
| 995 | goto handle_failure; |
| 996 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 997 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 998 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 999 | /* QWLAN_HAL_CFG_FRAME_TRANS_ENABLED */ |
| 1000 | tlvStruct->type = QWLAN_HAL_CFG_FRAME_TRANS_ENABLED ; |
| 1001 | tlvStruct->length = sizeof(tANI_U32); |
| 1002 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1003 | vos_mem_copy(configDataValue, &wdaContext->frameTransRequired, |
| 1004 | sizeof(tANI_U32)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1006 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1007 | /* QWLAN_HAL_CFG_DTIM_PERIOD */ |
| 1008 | tlvStruct->type = QWLAN_HAL_CFG_DTIM_PERIOD ; |
| 1009 | tlvStruct->length = sizeof(tANI_U32); |
| 1010 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1011 | if(wlan_cfgGetInt(pMac, WNI_CFG_DTIM_PERIOD, configDataValue) |
| 1012 | != eSIR_SUCCESS) |
| 1013 | { |
| 1014 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1015 | "Failed to get value for WNI_CFG_DTIM_PERIOD"); |
| 1016 | goto handle_failure; |
| 1017 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1018 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1019 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | /* QWLAN_HAL_CFG_EDCA_WMM_ACBK */ |
| 1021 | tlvStruct->type = QWLAN_HAL_CFG_EDCA_WMM_ACBK ; |
| 1022 | strLength = WNI_CFG_EDCA_WME_ACBK_LEN; |
| 1023 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1024 | if(wlan_cfgGetStr(pMac, WNI_CFG_EDCA_WME_ACBK, (tANI_U8 *)configDataValue, |
| 1025 | &strLength) != eSIR_SUCCESS) |
| 1026 | { |
| 1027 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1028 | "Failed to get value for WNI_CFG_EDCA_WME_ACBK"); |
| 1029 | goto handle_failure; |
| 1030 | } |
| 1031 | tlvStruct->length = strLength; |
| 1032 | /* calculate the pad bytes to have the CFG in aligned format */ |
| 1033 | tlvStruct->padBytes = ALIGNED_WORD_SIZE - |
| 1034 | (tlvStruct->length & (ALIGNED_WORD_SIZE - 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1035 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1036 | + sizeof(tHalCfg) + tlvStruct->length + tlvStruct->padBytes) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1037 | /* QWLAN_HAL_CFG_EDCA_WMM_ACBE */ |
| 1038 | tlvStruct->type = QWLAN_HAL_CFG_EDCA_WMM_ACBE ; |
| 1039 | strLength = WNI_CFG_EDCA_WME_ACBE_LEN; |
| 1040 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1041 | if(wlan_cfgGetStr(pMac, WNI_CFG_EDCA_WME_ACBE, (tANI_U8 *)configDataValue, |
| 1042 | &strLength) != eSIR_SUCCESS) |
| 1043 | { |
| 1044 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1045 | "Failed to get value for WNI_CFG_EDCA_WME_ACBE"); |
| 1046 | goto handle_failure; |
| 1047 | } |
| 1048 | tlvStruct->length = strLength; |
| 1049 | /* calculate the pad bytes to have the CFG in aligned format */ |
| 1050 | tlvStruct->padBytes = ALIGNED_WORD_SIZE - |
| 1051 | (tlvStruct->length & (ALIGNED_WORD_SIZE - 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1052 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1053 | + sizeof(tHalCfg) + tlvStruct->length + tlvStruct->padBytes) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1054 | /* QWLAN_HAL_CFG_EDCA_WMM_ACVI */ |
| 1055 | tlvStruct->type = QWLAN_HAL_CFG_EDCA_WMM_ACVO ; |
| 1056 | strLength = WNI_CFG_EDCA_WME_ACVI_LEN; |
| 1057 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1058 | if(wlan_cfgGetStr(pMac, WNI_CFG_EDCA_WME_ACVO, (tANI_U8 *)configDataValue, |
| 1059 | &strLength) != eSIR_SUCCESS) |
| 1060 | { |
| 1061 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1062 | "Failed to get value for WNI_CFG_EDCA_WME_ACVI"); |
| 1063 | goto handle_failure; |
| 1064 | } |
| 1065 | tlvStruct->length = strLength; |
| 1066 | /* calculate the pad bytes to have the CFG in aligned format */ |
| 1067 | tlvStruct->padBytes = ALIGNED_WORD_SIZE - |
| 1068 | (tlvStruct->length & (ALIGNED_WORD_SIZE - 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1069 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1070 | + sizeof(tHalCfg) + tlvStruct->length + tlvStruct->padBytes) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1071 | /* QWLAN_HAL_CFG_EDCA_WMM_ACVO */ |
| 1072 | tlvStruct->type = QWLAN_HAL_CFG_EDCA_WMM_ACVI ; |
| 1073 | strLength = WNI_CFG_EDCA_WME_ACVO_LEN; |
| 1074 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1075 | if(wlan_cfgGetStr(pMac, WNI_CFG_EDCA_WME_ACVI, (tANI_U8 *)configDataValue, |
| 1076 | &strLength) != eSIR_SUCCESS) |
| 1077 | { |
| 1078 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1079 | "Failed to get value for WNI_CFG_EDCA_WME_ACVO"); |
| 1080 | goto handle_failure; |
| 1081 | } |
| 1082 | tlvStruct->length = strLength; |
| 1083 | /* calculate the pad bytes to have the CFG in aligned format */ |
| 1084 | tlvStruct->padBytes = ALIGNED_WORD_SIZE - |
| 1085 | (tlvStruct->length & (ALIGNED_WORD_SIZE - 1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1086 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1087 | + sizeof(tHalCfg) + tlvStruct->length + tlvStruct->padBytes) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1088 | /* QWLAN_HAL_CFG_BA_THRESHOLD_HIGH */ |
| 1089 | tlvStruct->type = QWLAN_HAL_CFG_BA_THRESHOLD_HIGH ; |
| 1090 | tlvStruct->length = sizeof(tANI_U32); |
| 1091 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1092 | if(wlan_cfgGetInt(pMac, WNI_CFG_BA_THRESHOLD_HIGH, configDataValue) |
| 1093 | != eSIR_SUCCESS) |
| 1094 | { |
| 1095 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1096 | "Failed to get value for WNI_CFG_BA_THRESHOLD_HIGH"); |
| 1097 | goto handle_failure; |
| 1098 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1099 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1100 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1101 | /* QWLAN_HAL_CFG_MAX_BA_BUFFERS */ |
| 1102 | tlvStruct->type = QWLAN_HAL_CFG_MAX_BA_BUFFERS ; |
| 1103 | tlvStruct->length = sizeof(tANI_U32); |
| 1104 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1105 | if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_BA_BUFFERS, configDataValue) |
| 1106 | != eSIR_SUCCESS) |
| 1107 | { |
| 1108 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1109 | "Failed to get value for WNI_CFG_MAX_BA_BUFFERS"); |
| 1110 | goto handle_failure; |
| 1111 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1112 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1113 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1114 | /* QWLAN_HAL_CFG_DYNAMIC_PS_POLL_VALUE */ |
| 1115 | tlvStruct->type = QWLAN_HAL_CFG_DYNAMIC_PS_POLL_VALUE ; |
| 1116 | tlvStruct->length = sizeof(tANI_U32); |
| 1117 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1118 | if(wlan_cfgGetInt(pMac, WNI_CFG_DYNAMIC_PS_POLL_VALUE, configDataValue) |
| 1119 | != eSIR_SUCCESS) |
| 1120 | { |
| 1121 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1122 | "Failed to get value for WNI_CFG_DYNAMIC_PS_POLL_VALUE"); |
| 1123 | goto handle_failure; |
| 1124 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1125 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1126 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1127 | /* QWLAN_HAL_CFG_TELE_BCN_TRANS_LI */ |
| 1128 | tlvStruct->type = QWLAN_HAL_CFG_TELE_BCN_TRANS_LI ; |
| 1129 | tlvStruct->length = sizeof(tANI_U32); |
| 1130 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1131 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_TRANS_LI, configDataValue) |
| 1132 | != eSIR_SUCCESS) |
| 1133 | { |
| 1134 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1135 | "Failed to get value for WNI_CFG_TELE_BCN_TRANS_LI"); |
| 1136 | goto handle_failure; |
| 1137 | } |
| 1138 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1139 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1140 | /* QWLAN_HAL_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS */ |
| 1141 | tlvStruct->type = QWLAN_HAL_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS ; |
| 1142 | tlvStruct->length = sizeof(tANI_U32); |
| 1143 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1144 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS, configDataValue) |
| 1145 | != eSIR_SUCCESS) |
| 1146 | { |
| 1147 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1148 | "Failed to get value for WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS"); |
| 1149 | goto handle_failure; |
| 1150 | } |
| 1151 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1152 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | /* QWLAN_HAL_CFG_TELE_BCN_MAX_LI */ |
| 1154 | tlvStruct->type = QWLAN_HAL_CFG_TELE_BCN_MAX_LI ; |
| 1155 | tlvStruct->length = sizeof(tANI_U32); |
| 1156 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1157 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_MAX_LI, configDataValue) |
| 1158 | != eSIR_SUCCESS) |
| 1159 | { |
| 1160 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1161 | "Failed to get value for WNI_CFG_TELE_BCN_MAX_LI"); |
| 1162 | goto handle_failure; |
| 1163 | } |
| 1164 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1165 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1166 | /* QWLAN_HAL_CFG_TELE_BCN_MAX_LI_IDLE_BCNS */ |
| 1167 | tlvStruct->type = QWLAN_HAL_CFG_TELE_BCN_MAX_LI_IDLE_BCNS ; |
| 1168 | tlvStruct->length = sizeof(tANI_U32); |
| 1169 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1170 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS, configDataValue) |
| 1171 | != eSIR_SUCCESS) |
| 1172 | { |
| 1173 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1174 | "Failed to get value for WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS"); |
| 1175 | goto handle_failure; |
| 1176 | } |
| 1177 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1178 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1179 | /* QWLAN_HAL_CFG_TELE_BCN_WAKEUP_EN */ |
| 1180 | tlvStruct->type = QWLAN_HAL_CFG_TELE_BCN_WAKEUP_EN ; |
| 1181 | tlvStruct->length = sizeof(tANI_U32); |
| 1182 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1183 | if(wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_WAKEUP_EN, configDataValue) |
| 1184 | != eSIR_SUCCESS) |
| 1185 | { |
| 1186 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1187 | "Failed to get value for WNI_CFG_TELE_BCN_WAKEUP_EN"); |
| 1188 | goto handle_failure; |
| 1189 | } |
| 1190 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1191 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1192 | /* QWLAN_HAL_CFG_INFRA_STA_KEEP_ALIVE_PERIOD */ |
| 1193 | tlvStruct->type = QWLAN_HAL_CFG_INFRA_STA_KEEP_ALIVE_PERIOD ; |
| 1194 | tlvStruct->length = sizeof(tANI_U32); |
| 1195 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1196 | if(wlan_cfgGetInt(pMac, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, configDataValue) |
| 1197 | != eSIR_SUCCESS) |
| 1198 | { |
| 1199 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1200 | "Failed to get value for WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD"); |
| 1201 | goto handle_failure; |
| 1202 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1203 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1204 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1205 | /*QWLAN_HAL_CFG_TX_PWR_CTRL_ENABLE*/ |
| 1206 | tlvStruct->type = QWLAN_HAL_CFG_TX_PWR_CTRL_ENABLE ; |
| 1207 | tlvStruct->length = sizeof(tANI_U32); |
| 1208 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1209 | if(wlan_cfgGetInt(pMac, WNI_CFG_TX_PWR_CTRL_ENABLE, configDataValue) |
| 1210 | != eSIR_SUCCESS) |
| 1211 | { |
| 1212 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1213 | "Failed to get value for WNI_CFG_TX_PWR_CTRL_ENABLE"); |
| 1214 | goto handle_failure; |
| 1215 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1216 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1217 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1218 | /* QWLAN_HAL_CFG_ENABLE_CLOSE_LOOP */ |
| 1219 | tlvStruct->type = QWLAN_HAL_CFG_ENABLE_CLOSE_LOOP ; |
| 1220 | tlvStruct->length = sizeof(tANI_U32); |
| 1221 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1222 | if(wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_CLOSE_LOOP, configDataValue) |
| 1223 | != eSIR_SUCCESS) |
| 1224 | { |
| 1225 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1226 | "Failed to get value for WNI_CFG_ENABLE_CLOSE_LOOP"); |
| 1227 | goto handle_failure; |
| 1228 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1229 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1230 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1231 | /* [COEX] strictly speaking, the Coex parameters are not part of the WLAN_CFG_FILE binary, |
| 1232 | * but are from the WLAN_INI_FILE file. However, this is the only parameter download routine |
| 1233 | * into FW, so the parameters are added here. |
| 1234 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1235 | /* [COEX] QWLAN_HAL_CFG_BTC_EXECUTION_MODE */ |
| 1236 | tlvStruct->type = QWLAN_HAL_CFG_BTC_EXECUTION_MODE ; |
| 1237 | tlvStruct->length = sizeof(tANI_U32); |
| 1238 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1239 | *configDataValue = pMac->btc.btcConfig.btcExecutionMode; |
| 1240 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1241 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1242 | /* [COEX] QWLAN_HAL_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK */ |
| 1243 | tlvStruct->type = QWLAN_HAL_CFG_BTC_DHCP_BT_SLOTS_TO_BLOCK ; |
| 1244 | tlvStruct->length = sizeof(tANI_U32); |
| 1245 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1246 | *configDataValue = pMac->btc.btcConfig.btcConsBtSlotsToBlockDuringDhcp; |
| 1247 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1248 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1249 | /* [COEX] QWLAN_HAL_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS */ |
| 1250 | tlvStruct->type = QWLAN_HAL_CFG_BTC_A2DP_DHCP_BT_SUB_INTERVALS ; |
| 1251 | tlvStruct->length = sizeof(tANI_U32); |
| 1252 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1253 | *configDataValue = pMac->btc.btcConfig.btcA2DPBtSubIntervalsDuringDhcp; |
| 1254 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1255 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 1256 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_INQ_BT */ |
| 1257 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_INQ_BT ; |
| 1258 | tlvStruct->length = sizeof(tANI_U32); |
| 1259 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1260 | *configDataValue = pMac->btc.btcConfig.btcStaticLenInqBt; |
| 1261 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1262 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1263 | |
| 1264 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_PAGE_BT */ |
| 1265 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_PAGE_BT ; |
| 1266 | tlvStruct->length = sizeof(tANI_U32); |
| 1267 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1268 | *configDataValue = pMac->btc.btcConfig.btcStaticLenPageBt; |
| 1269 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1270 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1271 | |
| 1272 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_CONN_BT */ |
| 1273 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_CONN_BT ; |
| 1274 | tlvStruct->length = sizeof(tANI_U32); |
| 1275 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1276 | *configDataValue = pMac->btc.btcConfig.btcStaticLenConnBt; |
| 1277 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1278 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1279 | |
| 1280 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_LE_BT */ |
| 1281 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_LE_BT ; |
| 1282 | tlvStruct->length = sizeof(tANI_U32); |
| 1283 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1284 | *configDataValue = pMac->btc.btcConfig.btcStaticLenLeBt; |
| 1285 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1286 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1287 | |
| 1288 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_INQ_WLAN */ |
| 1289 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_INQ_WLAN ; |
| 1290 | tlvStruct->length = sizeof(tANI_U32); |
| 1291 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1292 | *configDataValue = pMac->btc.btcConfig.btcStaticLenInqWlan; |
| 1293 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1294 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1295 | |
| 1296 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_PAGE_WLAN */ |
| 1297 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_PAGE_WLAN ; |
| 1298 | tlvStruct->length = sizeof(tANI_U32); |
| 1299 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1300 | *configDataValue = pMac->btc.btcConfig.btcStaticLenPageWlan; |
| 1301 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1302 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1303 | |
| 1304 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_CONN_WLAN */ |
| 1305 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_CONN_WLAN ; |
| 1306 | tlvStruct->length = sizeof(tANI_U32); |
| 1307 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1308 | *configDataValue = pMac->btc.btcConfig.btcStaticLenConnWlan; |
| 1309 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1310 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1311 | |
| 1312 | /* [COEX] QWLAN_HAL_CFG_BTC_STATIC_LEN_LE_WLAN */ |
| 1313 | tlvStruct->type = QWLAN_HAL_CFG_BTC_STATIC_LEN_LE_WLAN ; |
| 1314 | tlvStruct->length = sizeof(tANI_U32); |
| 1315 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1316 | *configDataValue = pMac->btc.btcConfig.btcStaticLenLeWlan; |
| 1317 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1318 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1319 | |
| 1320 | /* [COEX] QWLAN_HAL_CFG_BTC_DYN_MAX_LEN_BT */ |
| 1321 | tlvStruct->type = QWLAN_HAL_CFG_BTC_DYN_MAX_LEN_BT ; |
| 1322 | tlvStruct->length = sizeof(tANI_U32); |
| 1323 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1324 | *configDataValue = pMac->btc.btcConfig.btcDynMaxLenBt; |
| 1325 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1326 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1327 | |
| 1328 | /* [COEX] QWLAN_HAL_CFG_BTC_DYN_MAX_LEN_WLAN */ |
| 1329 | tlvStruct->type = QWLAN_HAL_CFG_BTC_DYN_MAX_LEN_WLAN ; |
| 1330 | tlvStruct->length = sizeof(tANI_U32); |
| 1331 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1332 | *configDataValue = pMac->btc.btcConfig.btcDynMaxLenWlan; |
| 1333 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1334 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1335 | |
| 1336 | /* [COEX] QWLAN_HAL_CFG_BTC_MAX_SCO_BLOCK_PERC */ |
| 1337 | tlvStruct->type = QWLAN_HAL_CFG_BTC_MAX_SCO_BLOCK_PERC ; |
| 1338 | tlvStruct->length = sizeof(tANI_U32); |
| 1339 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1340 | *configDataValue = pMac->btc.btcConfig.btcMaxScoBlockPerc; |
| 1341 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1342 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1343 | |
| 1344 | /* [COEX] QWLAN_HAL_CFG_BTC_DHCP_PROT_ON_A2DP */ |
| 1345 | tlvStruct->type = QWLAN_HAL_CFG_BTC_DHCP_PROT_ON_A2DP ; |
| 1346 | tlvStruct->length = sizeof(tANI_U32); |
| 1347 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1348 | *configDataValue = pMac->btc.btcConfig.btcDhcpProtOnA2dp; |
| 1349 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1350 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1351 | |
| 1352 | /* [COEX] QWLAN_HAL_CFG_BTC_DHCP_PROT_ON_SCO */ |
| 1353 | tlvStruct->type = QWLAN_HAL_CFG_BTC_DHCP_PROT_ON_SCO ; |
| 1354 | tlvStruct->length = sizeof(tANI_U32); |
| 1355 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1356 | *configDataValue = pMac->btc.btcConfig.btcDhcpProtOnSco; |
| 1357 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1358 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1359 | |
| 1360 | /* QWLAN_HAL_CFG_WCNSS_API_VERSION */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1361 | tlvStruct->type = QWLAN_HAL_CFG_WCNSS_API_VERSION ; |
| 1362 | tlvStruct->length = sizeof(tANI_U32); |
| 1363 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1364 | WDI_GetWcnssCompiledApiVersion(&wcnssCompiledApiVersion); |
| 1365 | *configDataValue = WLAN_HAL_CONSTRUCT_API_VERSION(wcnssCompiledApiVersion.major, |
| 1366 | wcnssCompiledApiVersion.minor, |
| 1367 | wcnssCompiledApiVersion.version, |
| 1368 | wcnssCompiledApiVersion.revision); |
| 1369 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1370 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1371 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 1372 | /* QWLAN_HAL_CFG_AP_KEEPALIVE_TIMEOUT */ |
| 1373 | tlvStruct->type = QWLAN_HAL_CFG_AP_KEEPALIVE_TIMEOUT ; |
| 1374 | tlvStruct->length = sizeof(tANI_U32); |
| 1375 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1376 | if(wlan_cfgGetInt(pMac, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT, |
| 1377 | configDataValue ) != eSIR_SUCCESS) |
| 1378 | { |
| 1379 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1380 | "Failed to get value for WNI_CFG_AP_KEEP_ALIVE_TIMEOUT"); |
| 1381 | goto handle_failure; |
| 1382 | } |
| 1383 | |
| 1384 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1385 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1386 | /* QWLAN_HAL_CFG_GO_KEEPALIVE_TIMEOUT */ |
| 1387 | tlvStruct->type = QWLAN_HAL_CFG_GO_KEEPALIVE_TIMEOUT ; |
| 1388 | tlvStruct->length = sizeof(tANI_U32); |
| 1389 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1390 | if(wlan_cfgGetInt(pMac, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT, |
| 1391 | configDataValue ) != eSIR_SUCCESS) |
| 1392 | { |
| 1393 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1394 | "Failed to get value for WNI_CFG_GO_KEEP_ALIVE_TIMEOUT"); |
| 1395 | goto handle_failure; |
| 1396 | } |
| 1397 | |
| 1398 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1399 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1400 | |
| 1401 | /* QWLAN_HAL_CFG_ENABLE_MC_ADDR_LIST */ |
| 1402 | tlvStruct->type = QWLAN_HAL_CFG_ENABLE_MC_ADDR_LIST; |
| 1403 | tlvStruct->length = sizeof(tANI_U32); |
| 1404 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1405 | if(wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_MC_ADDR_LIST, configDataValue) |
| 1406 | != eSIR_SUCCESS) |
| 1407 | { |
| 1408 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1409 | "Failed to get value for WNI_CFG_ENABLE_MC_ADDR_LIST"); |
| 1410 | goto handle_failure; |
| 1411 | } |
| 1412 | |
| 1413 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1414 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1415 | |
Madan Mohan Koyyalamudi | 33df569 | 2012-12-07 14:24:14 -0800 | [diff] [blame] | 1416 | /* QWLAN_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION */ |
| 1417 | tlvStruct->type = QWLAN_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION ; |
| 1418 | tlvStruct->length = sizeof(tANI_U32); |
| 1419 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1420 | if(wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION, configDataValue) |
| 1421 | != eSIR_SUCCESS) |
| 1422 | { |
| 1423 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1424 | "Failed to get value for WNI_CFG_ENABLE_LPWR_IMG_TRANSITION"); |
| 1425 | goto handle_failure; |
| 1426 | } |
| 1427 | |
| 1428 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1429 | + sizeof(tHalCfg) + tlvStruct->length) ; |
Gopichand Nakkala | ba26127 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 1430 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 1431 | tlvStruct->type = QWLAN_HAL_CFG_MAX_ASSOC_LIMIT; |
| 1432 | tlvStruct->length = sizeof(tANI_U32); |
| 1433 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1434 | if(wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_STA_LIMIT, configDataValue) |
| 1435 | != eSIR_SUCCESS) |
| 1436 | { |
| 1437 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1438 | "Failed to get value for WNI_CFG_ASSOC_STA_LIMIT"); |
| 1439 | goto handle_failure; |
| 1440 | } |
| 1441 | |
| 1442 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1443 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1444 | #endif |
| 1445 | |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 1446 | /* QWLAN_HAL_CFG_ENABLE_MCC_ADAPTIVE_SCHEDULER */ |
| 1447 | tlvStruct->type = QWLAN_HAL_CFG_ENABLE_MCC_ADAPTIVE_SCHEDULER; |
| 1448 | tlvStruct->length = sizeof(tANI_U32); |
| 1449 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 1450 | |
| 1451 | if(wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, configDataValue) |
| 1452 | != eSIR_SUCCESS) |
| 1453 | { |
| 1454 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1455 | "Failed to get value for WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED"); |
| 1456 | goto handle_failure; |
| 1457 | } |
| 1458 | |
| 1459 | tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct |
| 1460 | + sizeof(tHalCfg) + tlvStruct->length) ; |
| 1461 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1462 | wdiStartParams->usConfigBufferLen = (tANI_U8 *)tlvStruct - tlvStructStart ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1463 | #ifdef WLAN_DEBUG |
| 1464 | { |
| 1465 | int i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1466 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 1467 | "****** Dumping CFG TLV ***** "); |
| 1468 | for (i=0; (i+7) < wdiStartParams->usConfigBufferLen; i+=8) |
| 1469 | { |
| 1470 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 1471 | "%02x %02x %02x %02x %02x %02x %02x %02x", |
| 1472 | tlvStructStart[i], |
| 1473 | tlvStructStart[i+1], |
| 1474 | tlvStructStart[i+2], |
| 1475 | tlvStructStart[i+3], |
| 1476 | tlvStructStart[i+4], |
| 1477 | tlvStructStart[i+5], |
| 1478 | tlvStructStart[i+6], |
| 1479 | tlvStructStart[i+7]); |
| 1480 | } |
| 1481 | /* Dump the bytes in the last line*/ |
| 1482 | for (; i < wdiStartParams->usConfigBufferLen; i++) |
| 1483 | { |
| 1484 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 1485 | "%02x ",tlvStructStart[i]); |
| 1486 | } |
| 1487 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 1488 | "**************************** "); |
| 1489 | } |
| 1490 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1491 | return VOS_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1492 | handle_failure: |
| 1493 | vos_mem_free(configParam); |
| 1494 | return VOS_STATUS_E_FAILURE; |
| 1495 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1496 | /* |
| 1497 | * FUNCTION: WDA_wdiCompleteCB |
| 1498 | * call the voss call back function |
| 1499 | */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1500 | void WDA_stopCallback(WDI_Status status, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1501 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1502 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 1503 | tWDA_CbContext *wdaContext; |
| 1504 | |
| 1505 | if(NULL == pWdaParams) |
| 1506 | { |
| 1507 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1508 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1509 | VOS_ASSERT(0) ; |
| 1510 | return ; |
| 1511 | } |
| 1512 | |
| 1513 | wdaContext = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 1514 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1515 | if (NULL == wdaContext) |
| 1516 | { |
| 1517 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1518 | "%s: Invoked with invalid wdaContext", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1519 | return ; |
| 1520 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1521 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1522 | /* free the config structure */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1523 | if(pWdaParams->wdaWdiApiMsgParam != NULL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1524 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1525 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1526 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1527 | vos_mem_free(pWdaParams); |
| 1528 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1529 | if(WDI_STATUS_SUCCESS != status) |
| 1530 | { |
| 1531 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1532 | "WDI stop callback returned failure" ); |
| 1533 | VOS_ASSERT(0) ; |
| 1534 | } |
| 1535 | else |
| 1536 | { |
| 1537 | wdaContext->wdaState = WDA_STOP_STATE; |
| 1538 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1539 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1540 | /* Indicate VOSS about the start complete */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1541 | vos_WDAComplete_cback(wdaContext->pVosContext); |
| 1542 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1543 | return ; |
| 1544 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1545 | /* |
| 1546 | * FUNCTION: WDA_stop |
| 1547 | * call WDI_stop |
| 1548 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1549 | VOS_STATUS WDA_stop(v_PVOID_t pVosContext, tANI_U8 reason) |
| 1550 | { |
| 1551 | WDI_Status wdiStatus; |
| 1552 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 1553 | WDI_StopReqParamsType *wdiStopReq; |
| 1554 | tWDA_CbContext *pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1555 | tWDA_ReqParams *pWdaParams ; |
| 1556 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1557 | if (NULL == pWDA) |
| 1558 | { |
| 1559 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1560 | "%s: Invoked with invalid pWDA", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1561 | VOS_ASSERT(0); |
| 1562 | return VOS_STATUS_E_FAILURE; |
| 1563 | } |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 1564 | if (pWDA->wdiFailed == true) |
| 1565 | { |
| 1566 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1567 | "%s: WDI in failed state", __func__ ); |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 1568 | return VOS_STATUS_E_ALREADY; |
| 1569 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1570 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | /* FTM mode stay START_STATE */ |
| 1572 | if( (WDA_READY_STATE != pWDA->wdaState) && |
| 1573 | (WDA_INIT_STATE != pWDA->wdaState) && |
| 1574 | (WDA_START_STATE != pWDA->wdaState) ) |
| 1575 | { |
| 1576 | VOS_ASSERT(0); |
| 1577 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1578 | wdiStopReq = (WDI_StopReqParamsType *) |
| 1579 | vos_mem_malloc(sizeof(WDI_StopReqParamsType)); |
| 1580 | if(NULL == wdiStopReq) |
| 1581 | { |
| 1582 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1583 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1584 | VOS_ASSERT(0); |
| 1585 | return VOS_STATUS_E_NOMEM; |
| 1586 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1587 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1588 | wdiStopReq->wdiStopReason = reason; |
| 1589 | wdiStopReq->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1590 | |
| 1591 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 1592 | if(NULL == pWdaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1593 | { |
| 1594 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1595 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1596 | VOS_ASSERT(0); |
| 1597 | vos_mem_free(wdiStopReq); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1598 | return VOS_STATUS_E_NOMEM; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1599 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1600 | |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 1601 | if ( (eDRIVER_TYPE_MFG != pWDA->driverMode) && |
| 1602 | (VOS_TRUE == pWDA->wdaTimersCreated)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1603 | { |
| 1604 | wdaDestroyTimers(pWDA); |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 1605 | pWDA->wdaTimersCreated = VOS_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1606 | } |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 1607 | |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1608 | pWdaParams->wdaWdiApiMsgParam = (v_PVOID_t *)wdiStopReq; |
| 1609 | pWdaParams->wdaMsgParam = NULL; |
| 1610 | pWdaParams->pWdaContext = pWDA; |
| 1611 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1612 | /* call WDI stop */ |
| 1613 | wdiStatus = WDI_Stop(wdiStopReq, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1614 | (WDI_StopRspCb)WDA_stopCallback, pWdaParams); |
| 1615 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1616 | if (IS_WDI_STATUS_FAILURE(wdiStatus) ) |
| 1617 | { |
| 1618 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1619 | "error in WDA Stop" ); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 1620 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 1621 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1622 | status = VOS_STATUS_E_FAILURE; |
| 1623 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1624 | return status; |
| 1625 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1626 | /* |
| 1627 | * FUNCTION: WDA_close |
| 1628 | * call WDI_close and free the WDA context |
| 1629 | */ |
| 1630 | VOS_STATUS WDA_close(v_PVOID_t pVosContext) |
| 1631 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1632 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 1633 | WDI_Status wstatus; |
| 1634 | VOS_STATUS vstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1635 | tWDA_CbContext *wdaContext= (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1636 | if (NULL == wdaContext) |
| 1637 | { |
| 1638 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1639 | "%s: Invoked with invalid wdaContext", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1640 | return VOS_STATUS_E_FAILURE; |
| 1641 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1642 | if((WDA_INIT_STATE != wdaContext->wdaState) && |
| 1643 | (WDA_STOP_STATE != wdaContext->wdaState)) |
| 1644 | { |
| 1645 | VOS_ASSERT(0); |
| 1646 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1647 | /*call WDI close*/ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1648 | wstatus = WDI_Close(); |
| 1649 | if ( wstatus != WDI_STATUS_SUCCESS ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1650 | { |
| 1651 | status = VOS_STATUS_E_FAILURE; |
| 1652 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1653 | wdaContext->wdaState = WDA_CLOSE_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1654 | /* Destroy the events */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1655 | vstatus = vos_event_destroy(&wdaContext->wdaWdiEvent); |
| 1656 | if(!VOS_IS_STATUS_SUCCESS(vstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1657 | { |
| 1658 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1659 | "WDI Sync Event destroy failed - status = %d\n", status); |
| 1660 | status = VOS_STATUS_E_FAILURE; |
| 1661 | } |
| 1662 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1663 | vstatus = vos_event_destroy(&wdaContext->txFrameEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1664 | if(!VOS_IS_STATUS_SUCCESS(vstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1665 | { |
| 1666 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1667 | "VOS Event destroy failed - status = %d\n", status); |
| 1668 | status = VOS_STATUS_E_FAILURE; |
| 1669 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1670 | vstatus = vos_event_destroy(&wdaContext->suspendDataTxEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1671 | if(!VOS_IS_STATUS_SUCCESS(vstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1672 | { |
| 1673 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1674 | "VOS Event destroy failed - status = %d\n", status); |
| 1675 | status = VOS_STATUS_E_FAILURE; |
| 1676 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1677 | vstatus = vos_event_destroy(&wdaContext->waitOnWdiIndicationCallBack); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1678 | if(!VOS_IS_STATUS_SUCCESS(vstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1679 | { |
| 1680 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1681 | "VOS Event destroy failed - status = %d\n", status); |
| 1682 | status = VOS_STATUS_E_FAILURE; |
| 1683 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1684 | /* free WDA context */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1685 | vstatus = vos_free_context(pVosContext, VOS_MODULE_ID_WDA, wdaContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1686 | if ( !VOS_IS_STATUS_SUCCESS(vstatus) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1687 | { |
| 1688 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1689 | "error in WDA close " ); |
| 1690 | status = VOS_STATUS_E_FAILURE; |
| 1691 | } |
| 1692 | return status; |
| 1693 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1694 | /* |
| 1695 | * FUNCTION: WDA_IsWcnssWlanCompiledVersionGreaterThanOrEqual |
| 1696 | * returns 1 if the compiled version is greater than or equal to the input version |
| 1697 | */ |
| 1698 | |
| 1699 | uint8 WDA_IsWcnssWlanCompiledVersionGreaterThanOrEqual(uint8 major, uint8 minor, uint8 version, uint8 revision) |
| 1700 | { |
| 1701 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 1702 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); |
| 1703 | tSirVersionType compiledVersion; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1704 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, &compiledVersion); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1705 | if ((compiledVersion.major > major) || ((compiledVersion.major == major)&& (compiledVersion.minor > minor)) || |
| 1706 | ((compiledVersion.major == major)&& (compiledVersion.minor == minor) &&(compiledVersion.version > version)) || |
| 1707 | ((compiledVersion.major == major)&& (compiledVersion.minor == minor) &&(compiledVersion.version == version) && |
| 1708 | (compiledVersion.revision >= revision))) |
| 1709 | return 1; |
| 1710 | else |
| 1711 | return 0; |
| 1712 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | /* |
| 1714 | * FUNCTION: WDA_IsWcnssWlanReportedVersionGreaterThanOrEqual |
| 1715 | * returns 1 if the compiled version is greater than or equal to the input version |
| 1716 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1717 | uint8 WDA_IsWcnssWlanReportedVersionGreaterThanOrEqual(uint8 major, uint8 minor, uint8 version, uint8 revision) |
| 1718 | { |
| 1719 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 1720 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); |
| 1721 | tSirVersionType reportedVersion; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1722 | status = WDA_GetWcnssWlanReportedVersion(vosContext, &reportedVersion); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1723 | if ((reportedVersion.major > major) || ((reportedVersion.major == major)&& (reportedVersion.minor > minor)) || |
| 1724 | ((reportedVersion.major == major)&& (reportedVersion.minor == minor) &&(reportedVersion.version > version)) || |
| 1725 | ((reportedVersion.major == major)&& (reportedVersion.minor == minor) &&(reportedVersion.version == version) && |
| 1726 | (reportedVersion.revision >= revision))) |
| 1727 | return 1; |
| 1728 | else |
| 1729 | return 0; |
| 1730 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1731 | /* |
| 1732 | * FUNCTION: WDA_GetWcnssWlanCompiledVersion |
| 1733 | * Returns the version of the WCNSS WLAN API with which the HOST |
| 1734 | * device driver was compiled |
| 1735 | */ |
| 1736 | VOS_STATUS WDA_GetWcnssWlanCompiledVersion(v_PVOID_t pvosGCtx, |
| 1737 | tSirVersionType *pVersion) |
| 1738 | { |
| 1739 | tWDA_CbContext *pWDA; |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 1740 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_LOW, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1741 | "%s: Entered", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1742 | if ((NULL == pvosGCtx) || (NULL == pVersion)) |
| 1743 | { |
| 1744 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1745 | "%s: Invoked with invalid parameter", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1746 | VOS_ASSERT(0); |
| 1747 | return VOS_STATUS_E_FAILURE; |
| 1748 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1749 | pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pvosGCtx); |
| 1750 | if (NULL == pWDA ) |
| 1751 | { |
| 1752 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1753 | "%s: Invalid WDA context", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1754 | VOS_ASSERT(0); |
| 1755 | return VOS_STATUS_E_FAILURE; |
| 1756 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1757 | *pVersion = pWDA->wcnssWlanCompiledVersion; |
| 1758 | return VOS_STATUS_SUCCESS; |
| 1759 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1760 | /* |
| 1761 | * FUNCTION: WDA_GetWcnssWlanReportedVersion |
| 1762 | * Returns the version of the WCNSS WLAN API with which the WCNSS |
| 1763 | * device driver was compiled |
| 1764 | */ |
| 1765 | VOS_STATUS WDA_GetWcnssWlanReportedVersion(v_PVOID_t pvosGCtx, |
| 1766 | tSirVersionType *pVersion) |
| 1767 | { |
| 1768 | tWDA_CbContext *pWDA; |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 1769 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_LOW, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1770 | "%s: Entered", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1771 | if ((NULL == pvosGCtx) || (NULL == pVersion)) |
| 1772 | { |
| 1773 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1774 | "%s: Invoked with invalid parameter", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1775 | VOS_ASSERT(0); |
| 1776 | return VOS_STATUS_E_FAILURE; |
| 1777 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1778 | pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pvosGCtx); |
| 1779 | if (NULL == pWDA ) |
| 1780 | { |
| 1781 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1782 | "%s: Invalid WDA context", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1783 | VOS_ASSERT(0); |
| 1784 | return VOS_STATUS_E_FAILURE; |
| 1785 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1786 | *pVersion = pWDA->wcnssWlanReportedVersion; |
| 1787 | return VOS_STATUS_SUCCESS; |
| 1788 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1789 | /* |
| 1790 | * FUNCTION: WDA_GetWcnssSoftwareVersion |
| 1791 | * Returns the WCNSS Software version string |
| 1792 | */ |
| 1793 | VOS_STATUS WDA_GetWcnssSoftwareVersion(v_PVOID_t pvosGCtx, |
| 1794 | tANI_U8 *pVersion, |
| 1795 | tANI_U32 versionBufferSize) |
| 1796 | { |
| 1797 | tWDA_CbContext *pWDA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1798 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1799 | "%s: Entered", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1800 | if ((NULL == pvosGCtx) || (NULL == pVersion)) |
| 1801 | { |
| 1802 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1803 | "%s: Invoked with invalid parameter", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1804 | VOS_ASSERT(0); |
| 1805 | return VOS_STATUS_E_FAILURE; |
| 1806 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1807 | pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pvosGCtx); |
| 1808 | if (NULL == pWDA ) |
| 1809 | { |
| 1810 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1811 | "%s: Invalid WDA context", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1812 | VOS_ASSERT(0); |
| 1813 | return VOS_STATUS_E_FAILURE; |
| 1814 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1815 | wpalMemoryCopy(pVersion, pWDA->wcnssSoftwareVersionString, versionBufferSize); |
| 1816 | return VOS_STATUS_SUCCESS; |
| 1817 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1818 | /* |
| 1819 | * FUNCTION: WDA_GetWcnssHardwareVersion |
| 1820 | * Returns the WCNSS Hardware version string |
| 1821 | */ |
| 1822 | VOS_STATUS WDA_GetWcnssHardwareVersion(v_PVOID_t pvosGCtx, |
| 1823 | tANI_U8 *pVersion, |
| 1824 | tANI_U32 versionBufferSize) |
| 1825 | { |
| 1826 | tWDA_CbContext *pWDA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1827 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1828 | "%s: Entered", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1829 | if ((NULL == pvosGCtx) || (NULL == pVersion)) |
| 1830 | { |
| 1831 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1832 | "%s: Invoked with invalid parameter", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | VOS_ASSERT(0); |
| 1834 | return VOS_STATUS_E_FAILURE; |
| 1835 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1836 | pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pvosGCtx); |
| 1837 | if (NULL == pWDA ) |
| 1838 | { |
| 1839 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1840 | "%s: Invalid WDA context", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1841 | VOS_ASSERT(0); |
| 1842 | return VOS_STATUS_E_FAILURE; |
| 1843 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1844 | wpalMemoryCopy(pVersion, pWDA->wcnssHardwareVersionString, versionBufferSize); |
| 1845 | return VOS_STATUS_SUCCESS; |
| 1846 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1847 | /* |
| 1848 | * FUNCTION: WDA_WniCfgDnld |
| 1849 | * Trigger CFG Download |
| 1850 | */ |
| 1851 | VOS_STATUS WDA_WniCfgDnld(tWDA_CbContext *pWDA) |
| 1852 | { |
| 1853 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1854 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1855 | v_VOID_t *pFileImage = NULL; |
| 1856 | v_SIZE_t cbFileImageSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1857 | v_VOID_t *pCfgBinary = NULL; |
| 1858 | v_SIZE_t cbCfgBinarySize = 0; |
| 1859 | |
| 1860 | v_BOOL_t bStatus = VOS_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1861 | if (NULL == pMac ) |
| 1862 | { |
| 1863 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1864 | "%s: Invoked with invalid MAC context ", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1865 | VOS_ASSERT(0); |
| 1866 | return VOS_STATUS_E_FAILURE; |
| 1867 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | /* get the number of bytes in the CFG Binary... */ |
| 1869 | vosStatus = vos_get_binary_blob( VOS_BINARY_ID_CONFIG, NULL, |
| 1870 | &cbFileImageSize ); |
| 1871 | if ( VOS_STATUS_E_NOMEM != vosStatus ) |
| 1872 | { |
| 1873 | VOS_TRACE( VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR, |
| 1874 | "Error obtaining binary size" ); |
| 1875 | goto fail; |
| 1876 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1877 | // malloc a buffer to read in the Configuration binary file. |
| 1878 | pFileImage = vos_mem_malloc( cbFileImageSize ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1879 | if ( NULL == pFileImage ) |
| 1880 | { |
| 1881 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1882 | "Unable to allocate memory for the CFG binary [size= %d bytes]", |
| 1883 | cbFileImageSize ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1884 | vosStatus = VOS_STATUS_E_NOMEM; |
| 1885 | goto fail; |
| 1886 | } |
| 1887 | |
| 1888 | /* Get the entire CFG file image... */ |
| 1889 | vosStatus = vos_get_binary_blob( VOS_BINARY_ID_CONFIG, pFileImage, |
| 1890 | &cbFileImageSize ); |
| 1891 | if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) |
| 1892 | { |
| 1893 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1894 | "Error: Cannot retrieve CFG file image from vOSS. [size= %d bytes]", |
| 1895 | cbFileImageSize ); |
| 1896 | goto fail; |
| 1897 | } |
| 1898 | |
| 1899 | /* |
| 1900 | * Validate the binary image. This function will return a pointer |
| 1901 | * and length where the CFG binary is located within the binary image file. |
| 1902 | */ |
| 1903 | bStatus = sys_validateStaConfig( pFileImage, cbFileImageSize, |
| 1904 | &pCfgBinary, &cbCfgBinarySize ); |
| 1905 | if ( VOS_FALSE == bStatus ) |
| 1906 | { |
| 1907 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1908 | "Error: Cannot find STA CFG in binary image file" ); |
| 1909 | vosStatus = VOS_STATUS_E_FAILURE; |
| 1910 | goto fail; |
| 1911 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1912 | /* |
| 1913 | * TODO: call the config download function |
| 1914 | * for now calling the existing cfg download API |
| 1915 | */ |
| 1916 | processCfgDownloadReq(pMac,cbCfgBinarySize,pCfgBinary); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1917 | if( pFileImage != NULL ) |
| 1918 | { |
| 1919 | vos_mem_free( pFileImage ); |
| 1920 | } |
| 1921 | return vosStatus; |
| 1922 | |
| 1923 | fail: |
| 1924 | if(pCfgBinary != NULL) |
| 1925 | vos_mem_free( pFileImage ); |
| 1926 | |
| 1927 | return vosStatus; |
| 1928 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1929 | /* ----------------------------------------------------------------- |
| 1930 | * WDI interface |
| 1931 | * ----------------------------------------------------------------- |
| 1932 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1933 | /* |
| 1934 | * FUNCTION: WDA_suspendDataTxCallback |
| 1935 | * call back function called from TL after suspend Transmission |
| 1936 | */ |
| 1937 | VOS_STATUS WDA_SuspendDataTxCallback( v_PVOID_t pvosGCtx, |
| 1938 | v_U8_t* ucSTAId, |
| 1939 | VOS_STATUS vosStatus) |
| 1940 | { |
| 1941 | tWDA_CbContext *pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pvosGCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1942 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1943 | "%s: Entered " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1944 | if (NULL == pWDA ) |
| 1945 | { |
| 1946 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1947 | "%s: Invoked with invalid WDA context ", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1948 | VOS_ASSERT(0); |
| 1949 | return VOS_STATUS_E_FAILURE; |
| 1950 | } |
| 1951 | if(VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 1952 | { |
| 1953 | pWDA->txStatus = WDA_TL_TX_SUSPEND_SUCCESS; |
| 1954 | } |
| 1955 | else |
| 1956 | { |
| 1957 | pWDA->txStatus = WDA_TL_TX_SUSPEND_FAILURE; |
| 1958 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1959 | /* Trigger the event to bring the WDA TL suspend function to come |
| 1960 | * out of wait*/ |
| 1961 | vosStatus = vos_event_set(&pWDA->suspendDataTxEvent); |
| 1962 | if(!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 1963 | { |
| 1964 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1965 | "NEW VOS Event Set failed - status = %d \n", vosStatus); |
| 1966 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1967 | /* If TL suspended had timedout before this callback was called, resume back |
| 1968 | * TL.*/ |
| 1969 | if (pWDA->txSuspendTimedOut) |
| 1970 | { |
| 1971 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1972 | "Late TLSuspendCallback, resuming TL back again\n"); |
| 1973 | WDA_ResumeDataTx(pWDA); |
| 1974 | pWDA->txSuspendTimedOut = FALSE; |
| 1975 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1976 | return VOS_STATUS_SUCCESS; |
| 1977 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1978 | /* |
| 1979 | * FUNCTION: WDA_suspendDataTx |
| 1980 | * Update TL to suspend the data Transmission |
| 1981 | */ |
| 1982 | VOS_STATUS WDA_SuspendDataTx(tWDA_CbContext *pWDA) |
| 1983 | { |
| 1984 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 1985 | tANI_U8 eventIdx = 0; |
| 1986 | tANI_U8 ucSTAId = 0; |
| 1987 | |
| 1988 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1989 | "%s: Entered " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1990 | pWDA->txStatus = WDA_TL_TX_SUSPEND_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1991 | if (pWDA->txSuspendTimedOut) |
| 1992 | { |
| 1993 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 1994 | "TL suspend timedout previously, CB not called yet\n"); |
| 1995 | return status; |
| 1996 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1997 | /* Reset the event to be not signalled */ |
| 1998 | status = vos_event_reset(&pWDA->suspendDataTxEvent); |
| 1999 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 2000 | { |
| 2001 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2002 | "VOS Event reset failed - status = %d\n",status); |
| 2003 | return VOS_STATUS_E_FAILURE; |
| 2004 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2005 | /*Indicate TL to suspend transmission for all Sta Id */ |
| 2006 | ucSTAId = WLAN_ALL_STA; |
| 2007 | status = WLANTL_SuspendDataTx(pWDA->pVosContext, &ucSTAId, |
| 2008 | WDA_SuspendDataTxCallback); |
| 2009 | if(status != VOS_STATUS_SUCCESS) |
| 2010 | { |
| 2011 | return status; |
| 2012 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2013 | /* Wait for the event to be set by the TL, to get the response of |
| 2014 | * suspending the TX queues, this event should be set by the Callback |
| 2015 | * function called by TL*/ |
| 2016 | status = vos_wait_events(&pWDA->suspendDataTxEvent, 1, |
| 2017 | WDA_TL_SUSPEND_TIMEOUT, &eventIdx); |
| 2018 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 2019 | { |
| 2020 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2021 | "%s: Status %d when waiting for Suspend Data TX Event", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2022 | __func__, status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2023 | /* Set this flag to true when TL suspend times out, so that when TL |
| 2024 | * suspend eventually happens and calls the callback, TL can be resumed |
| 2025 | * right away by looking at this flag when true.*/ |
| 2026 | pWDA->txSuspendTimedOut = TRUE; |
| 2027 | } |
| 2028 | else |
| 2029 | { |
| 2030 | pWDA->txSuspendTimedOut = FALSE; |
| 2031 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2032 | if(WDA_TL_TX_SUSPEND_SUCCESS == pWDA->txStatus) |
| 2033 | { |
| 2034 | status = VOS_STATUS_SUCCESS; |
| 2035 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2036 | return status; |
| 2037 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | /* |
| 2039 | * FUNCTION: WDA_resumeDataTx |
| 2040 | * Update TL to resume the data Transmission |
| 2041 | */ |
| 2042 | VOS_STATUS WDA_ResumeDataTx(tWDA_CbContext *pWDA) |
| 2043 | { |
| 2044 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 2045 | tANI_U8 ucSTAId = 0; |
| 2046 | |
| 2047 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2048 | "%s: Entered " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2049 | ucSTAId = WLAN_ALL_STA; |
| 2050 | status = WLANTL_ResumeDataTx(pWDA->pVosContext, &ucSTAId); |
| 2051 | return status; |
| 2052 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2053 | /* |
| 2054 | * FUNCTION: WDA_InitScanReqCallback |
| 2055 | * Trigger Init SCAN callback |
| 2056 | */ |
| 2057 | void WDA_InitScanReqCallback(WDI_Status wdiStatus, void* pUserData) |
| 2058 | { |
| 2059 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 2060 | tWDA_CbContext *pWDA; |
| 2061 | tInitScanParams *pWDA_ScanParam ; |
| 2062 | VOS_STATUS status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2063 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2064 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2065 | if(NULL == pWdaParams) |
| 2066 | { |
| 2067 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2068 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2069 | VOS_ASSERT(0) ; |
| 2070 | return ; |
| 2071 | } |
| 2072 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2073 | pWDA_ScanParam = (tInitScanParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2074 | if(NULL == pWDA_ScanParam) |
| 2075 | { |
| 2076 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2077 | "%s: pWDA_ScanParam received NULL", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2078 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2079 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2080 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2081 | return ; |
| 2082 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2083 | if(WDI_STATUS_SUCCESS != wdiStatus) |
| 2084 | { |
| 2085 | status = WDA_ResumeDataTx(pWDA) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2086 | if(VOS_STATUS_SUCCESS != status) |
| 2087 | { |
| 2088 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2089 | "%s error in Resume Tx ", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2090 | } |
| 2091 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2092 | /* free WDI command buffer */ |
| 2093 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2094 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2096 | |
| 2097 | /* assign status to scan params */ |
| 2098 | pWDA_ScanParam->status = CONVERT_WDI2SIR_STATUS(wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2099 | /* send SCAN RSP message back to PE */ |
| 2100 | WDA_SendMsg(pWDA, WDA_INIT_SCAN_RSP, (void *)pWDA_ScanParam, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2101 | return ; |
| 2102 | } |
| 2103 | |
| 2104 | /* |
| 2105 | * FUNCTION: WDA_ProcessInitScanReq |
| 2106 | * Trigger Init SCAN in DAL |
| 2107 | */ |
| 2108 | VOS_STATUS WDA_ProcessInitScanReq(tWDA_CbContext *pWDA, |
| 2109 | tInitScanParams *initScanParams) |
| 2110 | { |
| 2111 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 2112 | WDI_InitScanReqParamsType *wdiInitScanParam = |
| 2113 | (WDI_InitScanReqParamsType *)vos_mem_malloc( |
| 2114 | sizeof(WDI_InitScanReqParamsType)) ; |
| 2115 | tWDA_ReqParams *pWdaParams; |
| 2116 | tANI_U8 i = 0; |
| 2117 | |
| 2118 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2119 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2120 | if(NULL == wdiInitScanParam) |
| 2121 | { |
| 2122 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2123 | "%s:VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2124 | VOS_ASSERT(0); |
| 2125 | return VOS_STATUS_E_NOMEM; |
| 2126 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2127 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2128 | if(NULL == pWdaParams) |
| 2129 | { |
| 2130 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2131 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2132 | VOS_ASSERT(0); |
| 2133 | vos_mem_free(wdiInitScanParam); |
| 2134 | return VOS_STATUS_E_NOMEM; |
| 2135 | } |
| 2136 | |
| 2137 | /* Copy init Scan params to WDI structure */ |
| 2138 | wdiInitScanParam->wdiReqInfo.wdiScanMode = initScanParams->scanMode ; |
| 2139 | vos_mem_copy(wdiInitScanParam->wdiReqInfo.macBSSID, initScanParams->bssid, |
| 2140 | sizeof(tSirMacAddr)) ; |
| 2141 | wdiInitScanParam->wdiReqInfo.bNotifyBSS = initScanParams->notifyBss ; |
| 2142 | wdiInitScanParam->wdiReqInfo.ucFrameType = initScanParams->frameType ; |
| 2143 | wdiInitScanParam->wdiReqInfo.ucFrameLength = initScanParams->frameLength ; |
| 2144 | #ifdef WLAN_FEATURE_P2P |
| 2145 | wdiInitScanParam->wdiReqInfo.bUseNOA = initScanParams->useNoA; |
| 2146 | wdiInitScanParam->wdiReqInfo.scanDuration = initScanParams->scanDuration; |
| 2147 | #else |
| 2148 | wdiInitScanParam->wdiReqInfo.bUseNOA = 0; |
| 2149 | wdiInitScanParam->wdiReqInfo.scanDuration = 0; |
| 2150 | #endif |
| 2151 | wdiInitScanParam->wdiReqInfo.wdiScanEntry.activeBSScnt = |
| 2152 | initScanParams->scanEntry.activeBSScnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2153 | for (i=0; i < initScanParams->scanEntry.activeBSScnt; i++) |
| 2154 | { |
| 2155 | wdiInitScanParam->wdiReqInfo.wdiScanEntry.bssIdx[i] = |
| 2156 | initScanParams->scanEntry.bssIdx[i] ; |
| 2157 | } |
| 2158 | |
| 2159 | /* if Frame length, copy macMgmtHdr or WDI structure */ |
| 2160 | if(0 != wdiInitScanParam->wdiReqInfo.ucFrameLength) |
| 2161 | { |
| 2162 | vos_mem_copy(&wdiInitScanParam->wdiReqInfo.wdiMACMgmtHdr, |
| 2163 | &initScanParams->macMgmtHdr, sizeof(tSirMacMgmtHdr)) ; |
| 2164 | } |
| 2165 | wdiInitScanParam->wdiReqStatusCB = NULL ; |
| 2166 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2167 | /* Store Init Req pointer, as this will be used for response */ |
| 2168 | pWdaParams->pWdaContext = pWDA; |
| 2169 | pWdaParams->wdaMsgParam = initScanParams; |
| 2170 | pWdaParams->wdaWdiApiMsgParam = wdiInitScanParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2171 | /* first try to suspend TX */ |
| 2172 | status = WDA_SuspendDataTx(pWDA) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2173 | if(WDI_STATUS_SUCCESS != status) |
| 2174 | { |
| 2175 | goto handleWdiFailure; |
| 2176 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2177 | /* call DAL API to pass init scan request to DAL */ |
| 2178 | status = WDI_InitScanReq(wdiInitScanParam, |
| 2179 | WDA_InitScanReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2180 | if(IS_WDI_STATUS_FAILURE(status)) |
| 2181 | { |
| 2182 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2183 | "error in WDA Init Scan, Resume Tx " ); |
| 2184 | status = WDA_ResumeDataTx(pWDA) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2185 | VOS_ASSERT(0) ; |
| 2186 | |
| 2187 | goto handleWdiFailure; |
| 2188 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2189 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2190 | handleWdiFailure: |
| 2191 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2192 | "Failure in WDI Api, free all the memory " ); |
| 2193 | /* free WDI command buffer */ |
| 2194 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2195 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2196 | /* send Failure to PE */ |
| 2197 | initScanParams->status = eSIR_FAILURE ; |
| 2198 | WDA_SendMsg(pWDA, WDA_INIT_SCAN_RSP, (void *)initScanParams, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2199 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2200 | } |
| 2201 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2202 | /* |
| 2203 | * FUNCTION: WDA_StartScanReqCallback |
| 2204 | * send Start SCAN RSP back to PE |
| 2205 | */ |
| 2206 | void WDA_StartScanReqCallback(WDI_StartScanRspParamsType *pScanRsp, |
| 2207 | void* pUserData) |
| 2208 | { |
| 2209 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 2210 | tWDA_CbContext *pWDA; |
| 2211 | tStartScanParams *pWDA_ScanParam; |
| 2212 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2213 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2214 | if(NULL == pWdaParams) |
| 2215 | { |
| 2216 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2217 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2218 | VOS_ASSERT(0) ; |
| 2219 | return ; |
| 2220 | } |
| 2221 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2222 | pWDA_ScanParam = (tStartScanParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2223 | if(NULL == pWDA_ScanParam) |
| 2224 | { |
| 2225 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2226 | "%s: pWDA_ScanParam received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2227 | VOS_ASSERT(0) ; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2228 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2229 | return ; |
| 2230 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2231 | if(NULL == pWdaParams->wdaWdiApiMsgParam) |
| 2232 | { |
| 2233 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2234 | "%s: wdaWdiApiMsgParam is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2235 | VOS_ASSERT(0) ; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2236 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2237 | return ; |
| 2238 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2239 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2240 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2242 | |
| 2243 | /* assign status to scan params */ |
| 2244 | pWDA_ScanParam->status = CONVERT_WDI2SIR_STATUS(pScanRsp->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2245 | /* send SCAN RSP message back to PE */ |
| 2246 | WDA_SendMsg(pWDA, WDA_START_SCAN_RSP, (void *)pWDA_ScanParam, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2247 | return ; |
| 2248 | } |
| 2249 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2250 | /* |
| 2251 | * FUNCTION: WDA_ProcessStartScanReq |
| 2252 | * Trigger start SCAN in WDI |
| 2253 | */ |
| 2254 | VOS_STATUS WDA_ProcessStartScanReq(tWDA_CbContext *pWDA, |
| 2255 | tStartScanParams *startScanParams) |
| 2256 | { |
| 2257 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 2258 | WDI_StartScanReqParamsType *wdiStartScanParams = |
| 2259 | (WDI_StartScanReqParamsType *)vos_mem_malloc( |
| 2260 | sizeof(WDI_StartScanReqParamsType)) ; |
| 2261 | tWDA_ReqParams *pWdaParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2262 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2263 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2264 | if(NULL == wdiStartScanParams) |
| 2265 | { |
| 2266 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2267 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2268 | VOS_ASSERT(0); |
| 2269 | return VOS_STATUS_E_NOMEM; |
| 2270 | } |
| 2271 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2272 | if(NULL == pWdaParams) |
| 2273 | { |
| 2274 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2275 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2276 | VOS_ASSERT(0); |
| 2277 | vos_mem_free(wdiStartScanParams); |
| 2278 | return VOS_STATUS_E_NOMEM; |
| 2279 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2280 | /* Copy init Scan params to WDI structure */ |
| 2281 | wdiStartScanParams->ucChannel = startScanParams->scanChannel ; |
| 2282 | wdiStartScanParams->wdiReqStatusCB = NULL ; |
| 2283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | /* Store Init Req pointer, as this will be used for response */ |
| 2285 | /* store Params pass it to WDI */ |
| 2286 | pWdaParams->pWdaContext = pWDA; |
| 2287 | pWdaParams->wdaMsgParam = startScanParams; |
| 2288 | pWdaParams->wdaWdiApiMsgParam = wdiStartScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2289 | /* call DAL API to pass init scan request to DAL */ |
| 2290 | status = WDI_StartScanReq(wdiStartScanParams, |
| 2291 | WDA_StartScanReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2292 | /* failure returned by WDI API */ |
| 2293 | if(IS_WDI_STATUS_FAILURE(status)) |
| 2294 | { |
| 2295 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2296 | "Failure in Start Scan WDI API, free all the memory " |
| 2297 | "It should be due to previous abort scan." ); |
| 2298 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2299 | vos_mem_free(pWdaParams) ; |
| 2300 | startScanParams->status = eSIR_FAILURE ; |
| 2301 | WDA_SendMsg(pWDA, WDA_START_SCAN_RSP, (void *)startScanParams, 0) ; |
| 2302 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2303 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2304 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2305 | /* |
| 2306 | * FUNCTION: WDA_EndScanReqCallback |
| 2307 | * END SCAN callback |
| 2308 | */ |
| 2309 | void WDA_EndScanReqCallback(WDI_Status status, void* pUserData) |
| 2310 | { |
| 2311 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 2312 | tWDA_CbContext *pWDA; |
| 2313 | tEndScanParams *endScanParam; |
| 2314 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2315 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2316 | if(NULL == pWdaParams) |
| 2317 | { |
| 2318 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2319 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2320 | VOS_ASSERT(0) ; |
| 2321 | return ; |
| 2322 | } |
| 2323 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2324 | endScanParam = (tEndScanParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2325 | if(NULL == endScanParam) |
| 2326 | { |
| 2327 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2328 | "%s: endScanParam received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2329 | VOS_ASSERT(0) ; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2330 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2331 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2332 | return ; |
| 2333 | } |
| 2334 | |
| 2335 | /* Free WDI command buffer */ |
| 2336 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2337 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2338 | /* assign status to scan params */ |
| 2339 | endScanParam->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2340 | /* send response back to PE */ |
| 2341 | WDA_SendMsg(pWDA, WDA_END_SCAN_RSP, (void *)endScanParam, 0) ; |
| 2342 | return ; |
| 2343 | } |
| 2344 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2345 | /* |
| 2346 | * FUNCTION: WDA_ProcessEndScanReq |
| 2347 | * Trigger END SCAN in WDI |
| 2348 | */ |
| 2349 | VOS_STATUS WDA_ProcessEndScanReq(tWDA_CbContext *pWDA, |
| 2350 | tEndScanParams *endScanParams) |
| 2351 | { |
| 2352 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 2353 | WDI_EndScanReqParamsType *wdiEndScanParams = |
| 2354 | (WDI_EndScanReqParamsType *)vos_mem_malloc( |
| 2355 | sizeof(WDI_EndScanReqParamsType)) ; |
| 2356 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2357 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2358 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2359 | if(NULL == wdiEndScanParams) |
| 2360 | { |
| 2361 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2362 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2363 | VOS_ASSERT(0); |
| 2364 | return VOS_STATUS_E_NOMEM; |
| 2365 | } |
| 2366 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2367 | if(NULL == pWdaParams) |
| 2368 | { |
| 2369 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2370 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2371 | VOS_ASSERT(0); |
| 2372 | vos_mem_free(wdiEndScanParams); |
| 2373 | return VOS_STATUS_E_NOMEM; |
| 2374 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2375 | /* Copy init Scan params to WDI structure */ |
| 2376 | wdiEndScanParams->ucChannel = endScanParams->scanChannel ; |
| 2377 | wdiEndScanParams->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2378 | /* Store Init Req pointer, as this will be used for response */ |
| 2379 | /* store Params pass it to WDI */ |
| 2380 | pWdaParams->pWdaContext = pWDA; |
| 2381 | pWdaParams->wdaMsgParam = endScanParams; |
| 2382 | pWdaParams->wdaWdiApiMsgParam = wdiEndScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2383 | /* call DAL API to pass init scan request to DAL */ |
| 2384 | status = WDI_EndScanReq(wdiEndScanParams, |
| 2385 | WDA_EndScanReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2386 | if(IS_WDI_STATUS_FAILURE(status)) |
| 2387 | { |
| 2388 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2389 | "Failure in End Scan WDI API, free all the memory " |
| 2390 | "It should be due to previous abort scan." ); |
| 2391 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2392 | vos_mem_free(pWdaParams) ; |
| 2393 | endScanParams->status = eSIR_FAILURE ; |
| 2394 | WDA_SendMsg(pWDA, WDA_END_SCAN_RSP, (void *)endScanParams, 0) ; |
| 2395 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2396 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2397 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2398 | /* |
| 2399 | * FUNCTION: WDA_FinishScanReqCallback |
| 2400 | * Trigger Finish SCAN callback |
| 2401 | */ |
| 2402 | void WDA_FinishScanReqCallback(WDI_Status wdiStatus, void* pUserData) |
| 2403 | { |
| 2404 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 2405 | tWDA_CbContext *pWDA; |
| 2406 | tFinishScanParams *finishScanParam; |
| 2407 | VOS_STATUS status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2408 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2409 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2410 | if(NULL == pWdaParams) |
| 2411 | { |
| 2412 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2413 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2414 | VOS_ASSERT(0) ; |
| 2415 | return ; |
| 2416 | } |
| 2417 | |
| 2418 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2419 | finishScanParam = (tFinishScanParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2420 | if(NULL == finishScanParam) |
| 2421 | { |
| 2422 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2423 | "%s: finishScanParam is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2424 | VOS_ASSERT(0) ; |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 2425 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2426 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2427 | return ; |
| 2428 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2429 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2430 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2431 | /* |
| 2432 | * Now Resume TX, if we reached here means, TX is already suspended, we |
| 2433 | * have to resume it unconditionaly |
| 2434 | */ |
| 2435 | status = WDA_ResumeDataTx(pWDA) ; |
| 2436 | |
| 2437 | if(VOS_STATUS_SUCCESS != status) |
| 2438 | { |
| 2439 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2440 | "%s error in Resume Tx ", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2441 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2442 | finishScanParam->status = CONVERT_WDI2SIR_STATUS(wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2443 | WDA_SendMsg(pWDA, WDA_FINISH_SCAN_RSP, (void *)finishScanParam, 0) ; |
| 2444 | return ; |
| 2445 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2446 | /* |
| 2447 | * FUNCTION: WDA_ProcessFinshScanReq |
| 2448 | * Trigger Finish SCAN in WDI |
| 2449 | */ |
| 2450 | VOS_STATUS WDA_ProcessFinishScanReq(tWDA_CbContext *pWDA, |
| 2451 | tFinishScanParams *finishScanParams) |
| 2452 | { |
| 2453 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 2454 | WDI_FinishScanReqParamsType *wdiFinishScanParams = |
| 2455 | (WDI_FinishScanReqParamsType *)vos_mem_malloc( |
| 2456 | sizeof(WDI_FinishScanReqParamsType)) ; |
| 2457 | tWDA_ReqParams *pWdaParams ; |
| 2458 | tANI_U8 i = 0; |
| 2459 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2460 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2461 | if(NULL == wdiFinishScanParams) |
| 2462 | { |
| 2463 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2464 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2465 | VOS_ASSERT(0); |
| 2466 | return VOS_STATUS_E_NOMEM; |
| 2467 | } |
| 2468 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2469 | if(NULL == pWdaParams) |
| 2470 | { |
| 2471 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2472 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2473 | VOS_ASSERT(0); |
| 2474 | vos_mem_free(wdiFinishScanParams); |
| 2475 | return VOS_STATUS_E_NOMEM; |
| 2476 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | /* Copy init Scan params to WDI structure */ |
| 2478 | wdiFinishScanParams->wdiReqInfo.wdiScanMode = finishScanParams->scanMode ; |
| 2479 | vos_mem_copy(wdiFinishScanParams->wdiReqInfo.macBSSID, |
| 2480 | finishScanParams->bssid, sizeof(tSirMacAddr)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2481 | wdiFinishScanParams->wdiReqInfo.bNotifyBSS = finishScanParams->notifyBss ; |
| 2482 | wdiFinishScanParams->wdiReqInfo.ucFrameType = finishScanParams->frameType ; |
| 2483 | wdiFinishScanParams->wdiReqInfo.ucFrameLength = |
| 2484 | finishScanParams->frameLength ; |
| 2485 | wdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel = |
| 2486 | finishScanParams->currentOperChannel ; |
| 2487 | wdiFinishScanParams->wdiReqInfo.wdiCBState = finishScanParams->cbState ; |
| 2488 | wdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt = |
| 2489 | finishScanParams->scanEntry.activeBSScnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2490 | for (i = 0; i < finishScanParams->scanEntry.activeBSScnt; i++) |
| 2491 | { |
| 2492 | wdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] = |
| 2493 | finishScanParams->scanEntry.bssIdx[i] ; |
| 2494 | } |
| 2495 | |
| 2496 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2497 | /* if Frame length, copy macMgmtHdr ro WDI structure */ |
| 2498 | if(0 != wdiFinishScanParams->wdiReqInfo.ucFrameLength) |
| 2499 | { |
| 2500 | vos_mem_copy(&wdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr, |
| 2501 | &finishScanParams->macMgmtHdr, |
| 2502 | sizeof(WDI_MacMgmtHdr)) ; |
| 2503 | } |
| 2504 | wdiFinishScanParams->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2505 | /* Store Init Req pointer, as this will be used for response */ |
| 2506 | /* store Params pass it to WDI */ |
| 2507 | pWdaParams->pWdaContext = pWDA; |
| 2508 | pWdaParams->wdaMsgParam = finishScanParams; |
| 2509 | pWdaParams->wdaWdiApiMsgParam = wdiFinishScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2510 | /* call DAL API to pass init scan request to DAL */ |
| 2511 | status = WDI_FinishScanReq(wdiFinishScanParams, |
| 2512 | WDA_FinishScanReqCallback, pWdaParams) ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2513 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2514 | |
| 2515 | /* |
| 2516 | * WDI API returns failure.. |
| 2517 | */ |
| 2518 | if(IS_WDI_STATUS_FAILURE( status)) |
| 2519 | { |
| 2520 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2521 | "Failure in Finish Scan WDI API, free all the memory " ); |
| 2522 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2523 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2524 | finishScanParams->status = eSIR_FAILURE ; |
| 2525 | WDA_SendMsg(pWDA, WDA_FINISH_SCAN_RSP, (void *)finishScanParams, 0) ; |
| 2526 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2527 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2528 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2529 | /*--------------------------------------------------------------------- |
| 2530 | * ASSOC API's |
| 2531 | *--------------------------------------------------------------------- |
| 2532 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2533 | /* |
| 2534 | * FUNCTION: WDA_JoinReqCallback |
| 2535 | * Trigger Init SCAN callback |
| 2536 | */ |
| 2537 | void WDA_JoinReqCallback(WDI_Status status, void* pUserData) |
| 2538 | { |
| 2539 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 2540 | tWDA_CbContext *pWDA; |
| 2541 | tSwitchChannelParams *joinReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2542 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2543 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2544 | if(NULL == pWdaParams) |
| 2545 | { |
| 2546 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2547 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2548 | VOS_ASSERT(0) ; |
| 2549 | return ; |
| 2550 | } |
| 2551 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2552 | joinReqParam = (tSwitchChannelParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2553 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 2554 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2555 | /* reset macBSSID */ |
| 2556 | vos_mem_set(pWDA->macBSSID, sizeof(pWDA->macBSSID),0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2557 | /* reset macSTASelf */ |
| 2558 | vos_mem_set(pWDA->macSTASelf, sizeof(pWDA->macSTASelf),0 ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2559 | joinReqParam->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2560 | WDA_SendMsg(pWDA, WDA_SWITCH_CHANNEL_RSP, (void *)joinReqParam , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2561 | return ; |
| 2562 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2563 | /* |
| 2564 | * FUNCTION: WDA_ProcessJoinReq |
| 2565 | * Trigger Join REQ in WDI |
| 2566 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2567 | VOS_STATUS WDA_ProcessJoinReq(tWDA_CbContext *pWDA, |
| 2568 | tSwitchChannelParams* joinReqParam) |
| 2569 | { |
| 2570 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2571 | WDI_JoinReqParamsType *wdiJoinReqParam = |
| 2572 | (WDI_JoinReqParamsType *)vos_mem_malloc( |
| 2573 | sizeof(WDI_JoinReqParamsType)) ; |
| 2574 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2575 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2576 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2577 | if(NULL == wdiJoinReqParam) |
| 2578 | { |
| 2579 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2580 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2581 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 2582 | vos_mem_free(joinReqParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2583 | return VOS_STATUS_E_NOMEM; |
| 2584 | } |
| 2585 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2586 | if(NULL == pWdaParams) |
| 2587 | { |
| 2588 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2589 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2590 | VOS_ASSERT(0); |
| 2591 | vos_mem_free(wdiJoinReqParam); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 2592 | vos_mem_free(joinReqParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2593 | return VOS_STATUS_E_NOMEM; |
| 2594 | } |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 2595 | |
| 2596 | /*if the BSSID or self STA in pWDA is NULL, join request can't be processed*/ |
| 2597 | if(WDA_IS_NULL_MAC_ADDRESS(pWDA->macBSSID) || |
| 2598 | WDA_IS_NULL_MAC_ADDRESS(pWDA->macSTASelf)) |
| 2599 | { |
| 2600 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
| 2601 | "%s: received join request when BSSID or self-STA is NULL " |
| 2602 | " BSSID:" WDA_MAC_ADDRESS_STR "Self-STA:" WDA_MAC_ADDRESS_STR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2603 | __func__, WDA_MAC_ADDR_ARRAY(pWDA->macBSSID), |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 2604 | WDA_MAC_ADDR_ARRAY(pWDA->macSTASelf)); |
| 2605 | VOS_ASSERT(0); |
| 2606 | vos_mem_free(wdiJoinReqParam); |
| 2607 | vos_mem_free(pWdaParams); |
| 2608 | joinReqParam->status = eSIR_FAILURE ; |
| 2609 | WDA_SendMsg(pWDA, WDA_SWITCH_CHANNEL_RSP, (void *)joinReqParam, 0) ; |
| 2610 | return VOS_STATUS_E_INVAL; |
| 2611 | } |
| 2612 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2613 | /* copy the BSSID for pWDA */ |
| 2614 | vos_mem_copy(wdiJoinReqParam->wdiReqInfo.macBSSID, pWDA->macBSSID, |
| 2615 | sizeof(tSirMacAddr)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2616 | vos_mem_copy(wdiJoinReqParam->wdiReqInfo.macSTASelf, |
| 2617 | pWDA->macSTASelf, sizeof(tSirMacAddr)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2618 | wdiJoinReqParam->wdiReqInfo.wdiChannelInfo.ucChannel = |
| 2619 | joinReqParam->channelNumber ; |
Madan Mohan Koyyalamudi | 83b1282 | 2012-11-02 12:43:10 -0700 | [diff] [blame] | 2620 | #ifdef WLAN_FEATURE_VOWIFI |
| 2621 | wdiJoinReqParam->wdiReqInfo.wdiChannelInfo.cMaxTxPower = |
| 2622 | joinReqParam->maxTxPower ; |
| 2623 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2624 | wdiJoinReqParam->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint = |
| 2625 | joinReqParam->localPowerConstraint ; |
| 2626 | #endif |
| 2627 | wdiJoinReqParam->wdiReqInfo.wdiChannelInfo.wdiSecondaryChannelOffset = |
| 2628 | joinReqParam->secondaryChannelOffset ; |
| 2629 | wdiJoinReqParam->wdiReqInfo.linkState = pWDA->linkState; |
| 2630 | |
| 2631 | wdiJoinReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2632 | /* Store Init Req pointer, as this will be used for response */ |
| 2633 | /* store Params pass it to WDI */ |
| 2634 | pWdaParams->pWdaContext = pWDA; |
| 2635 | pWdaParams->wdaMsgParam = joinReqParam; |
| 2636 | pWdaParams->wdaWdiApiMsgParam = wdiJoinReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2637 | status = WDI_JoinReq(wdiJoinReqParam, |
| 2638 | (WDI_JoinRspCb )WDA_JoinReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2639 | if(IS_WDI_STATUS_FAILURE(status)) |
| 2640 | { |
| 2641 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2642 | "Failure in Join WDI API, free all the memory " ); |
| 2643 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2644 | vos_mem_free(pWdaParams) ; |
| 2645 | joinReqParam->status = eSIR_FAILURE ; |
| 2646 | WDA_SendMsg(pWDA, WDA_SWITCH_CHANNEL_RSP, (void *)joinReqParam, 0) ; |
| 2647 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2648 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2649 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2650 | /* |
| 2651 | * FUNCTION: WDA_SwitchChannelReqCallback |
| 2652 | * send Switch channel RSP back to PE |
| 2653 | */ |
| 2654 | void WDA_SwitchChannelReqCallback( |
| 2655 | WDI_SwitchCHRspParamsType *wdiSwitchChanRsp, void* pUserData) |
| 2656 | { |
| 2657 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 2658 | tWDA_CbContext *pWDA; |
| 2659 | tSwitchChannelParams *pSwitchChanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2660 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2661 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2662 | if(NULL == pWdaParams) |
| 2663 | { |
| 2664 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2665 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2666 | VOS_ASSERT(0) ; |
| 2667 | return ; |
| 2668 | } |
| 2669 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2670 | pSwitchChanParams = (tSwitchChannelParams *)pWdaParams->wdaMsgParam; |
| 2671 | |
| 2672 | #ifdef WLAN_FEATURE_VOWIFI |
| 2673 | pSwitchChanParams->txMgmtPower = wdiSwitchChanRsp->ucTxMgmtPower; |
| 2674 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2675 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2676 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2677 | pSwitchChanParams->status = |
| 2678 | CONVERT_WDI2SIR_STATUS(wdiSwitchChanRsp->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2679 | WDA_SendMsg(pWDA, WDA_SWITCH_CHANNEL_RSP, (void *)pSwitchChanParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2680 | return ; |
| 2681 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2682 | /* |
| 2683 | * FUNCTION: WDA_ProcessChannelSwitchReq |
| 2684 | * Request to WDI to switch channel REQ params. |
| 2685 | */ |
| 2686 | VOS_STATUS WDA_ProcessChannelSwitchReq(tWDA_CbContext *pWDA, |
| 2687 | tSwitchChannelParams *pSwitchChanParams) |
| 2688 | { |
| 2689 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 2690 | WDI_SwitchChReqParamsType *wdiSwitchChanParam = |
| 2691 | (WDI_SwitchChReqParamsType *)vos_mem_malloc( |
| 2692 | sizeof(WDI_SwitchChReqParamsType)) ; |
| 2693 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2694 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2695 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2696 | if(NULL == wdiSwitchChanParam) |
| 2697 | { |
| 2698 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2699 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2700 | VOS_ASSERT(0); |
| 2701 | return VOS_STATUS_E_NOMEM; |
| 2702 | } |
| 2703 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2704 | if(NULL == pWdaParams) |
| 2705 | { |
| 2706 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2707 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2708 | VOS_ASSERT(0); |
| 2709 | vos_mem_free(wdiSwitchChanParam); |
| 2710 | return VOS_STATUS_E_NOMEM; |
| 2711 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2712 | wdiSwitchChanParam->wdiChInfo.ucChannel = pSwitchChanParams->channelNumber; |
| 2713 | #ifndef WLAN_FEATURE_VOWIFI |
| 2714 | wdiSwitchChanParam->wdiChInfo.ucLocalPowerConstraint = |
| 2715 | pSwitchChanParams->localPowerConstraint; |
| 2716 | #endif |
| 2717 | wdiSwitchChanParam->wdiChInfo.wdiSecondaryChannelOffset = |
| 2718 | pSwitchChanParams->secondaryChannelOffset; |
| 2719 | wdiSwitchChanParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2720 | /* Store req pointer, as this will be used for response */ |
| 2721 | /* store Params pass it to WDI */ |
| 2722 | pWdaParams->pWdaContext = pWDA; |
| 2723 | pWdaParams->wdaMsgParam = pSwitchChanParams; |
| 2724 | pWdaParams->wdaWdiApiMsgParam = wdiSwitchChanParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2725 | #ifdef WLAN_FEATURE_VOWIFI |
| 2726 | wdiSwitchChanParam->wdiChInfo.cMaxTxPower |
| 2727 | = pSwitchChanParams->maxTxPower; |
| 2728 | vos_mem_copy(wdiSwitchChanParam->wdiChInfo.macSelfStaMacAddr, |
| 2729 | pSwitchChanParams ->selfStaMacAddr, |
| 2730 | sizeof(tSirMacAddr)); |
| 2731 | #endif |
| 2732 | vos_mem_copy(wdiSwitchChanParam->wdiChInfo.macBSSId, |
| 2733 | pSwitchChanParams->bssId, |
| 2734 | sizeof(tSirMacAddr)); |
| 2735 | |
| 2736 | status = WDI_SwitchChReq(wdiSwitchChanParam, |
| 2737 | (WDI_SwitchChRspCb)WDA_SwitchChannelReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2738 | if(IS_WDI_STATUS_FAILURE(status)) |
| 2739 | { |
| 2740 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2741 | "Failure in process channel switch Req WDI API, free all the memory " ); |
| 2742 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2743 | vos_mem_free(pWdaParams) ; |
| 2744 | pSwitchChanParams->status = eSIR_FAILURE ; |
| 2745 | WDA_SendMsg(pWDA, WDA_SWITCH_CHANNEL_RSP, (void *)pSwitchChanParams, 0) ; |
| 2746 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2747 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2748 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2749 | /* |
| 2750 | * FUNCTION: WDA_ConfigBssReqCallback |
| 2751 | * config BSS Req Callback, called by WDI |
| 2752 | */ |
| 2753 | void WDA_ConfigBssReqCallback(WDI_ConfigBSSRspParamsType *wdiConfigBssRsp |
| 2754 | ,void* pUserData) |
| 2755 | { |
| 2756 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 2757 | tWDA_CbContext *pWDA; |
| 2758 | tAddBssParams *configBssReqParam; |
| 2759 | tAddStaParams *staConfigBssParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2760 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2761 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2762 | if(NULL == pWdaParams) |
| 2763 | { |
| 2764 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2765 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2766 | VOS_ASSERT(0) ; |
| 2767 | return ; |
| 2768 | } |
| 2769 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 2770 | configBssReqParam = (tAddBssParams *)pWdaParams->wdaMsgParam; |
| 2771 | staConfigBssParam = &configBssReqParam->staContext ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2772 | configBssReqParam->status = |
| 2773 | CONVERT_WDI2SIR_STATUS(wdiConfigBssRsp->wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2774 | if(WDI_STATUS_SUCCESS == wdiConfigBssRsp->wdiStatus) |
| 2775 | { |
| 2776 | vos_mem_copy(configBssReqParam->bssId, wdiConfigBssRsp->macBSSID, |
| 2777 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2778 | configBssReqParam->bssIdx = wdiConfigBssRsp->ucBSSIdx; |
| 2779 | configBssReqParam->bcastDpuSignature = wdiConfigBssRsp->ucBcastSig; |
| 2780 | configBssReqParam->mgmtDpuSignature = wdiConfigBssRsp->ucUcastSig; |
| 2781 | |
| 2782 | if (configBssReqParam->operMode == BSS_OPERATIONAL_MODE_STA) |
| 2783 | { |
| 2784 | if(configBssReqParam->bssType == eSIR_IBSS_MODE) |
| 2785 | { |
| 2786 | pWDA->wdaGlobalSystemRole = eSYSTEM_STA_IN_IBSS_ROLE; |
| 2787 | staConfigBssParam->staType = STA_ENTRY_BSSID; |
| 2788 | } |
| 2789 | else if ((configBssReqParam->bssType == eSIR_BTAMP_STA_MODE) && |
| 2790 | (staConfigBssParam->staType == STA_ENTRY_SELF)) |
| 2791 | { |
| 2792 | /* This is the 1st add BSS Req for the BTAMP STA */ |
| 2793 | pWDA->wdaGlobalSystemRole = eSYSTEM_BTAMP_STA_ROLE; |
| 2794 | staConfigBssParam->staType = STA_ENTRY_BSSID; |
| 2795 | } |
| 2796 | else if ((configBssReqParam->bssType == eSIR_BTAMP_AP_MODE) && |
| 2797 | (staConfigBssParam->staType == STA_ENTRY_PEER)) |
| 2798 | { |
| 2799 | /* This is the 2nd ADD BSS Request that is sent |
| 2800 | * on the BTAMP STA side. The Sta type is |
| 2801 | * set to STA_ENTRY_PEER here.*/ |
| 2802 | pWDA->wdaGlobalSystemRole = eSYSTEM_BTAMP_STA_ROLE; |
| 2803 | } |
| 2804 | else if ((configBssReqParam->bssType == eSIR_BTAMP_AP_MODE) && |
| 2805 | (staConfigBssParam->staType == STA_ENTRY_SELF)) |
| 2806 | { |
| 2807 | /* statype is already set by PE. |
| 2808 | * Only 1 ADD BSS Req is sent on the BTAMP AP side.*/ |
| 2809 | pWDA->wdaGlobalSystemRole = eSYSTEM_BTAMP_AP_ROLE; |
| 2810 | staConfigBssParam->staType = STA_ENTRY_BSSID; |
| 2811 | } |
| 2812 | else |
| 2813 | { |
| 2814 | pWDA->wdaGlobalSystemRole = eSYSTEM_STA_ROLE; |
| 2815 | staConfigBssParam->staType = STA_ENTRY_PEER; |
| 2816 | } |
| 2817 | } |
| 2818 | else if (configBssReqParam->operMode == BSS_OPERATIONAL_MODE_AP) |
| 2819 | { |
| 2820 | pWDA->wdaGlobalSystemRole = eSYSTEM_AP_ROLE; |
| 2821 | staConfigBssParam->staType = STA_ENTRY_SELF; |
| 2822 | } |
| 2823 | else |
| 2824 | { |
| 2825 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2826 | "Invalid operation mode specified"); |
| 2827 | VOS_ASSERT(0); |
| 2828 | } |
| 2829 | |
| 2830 | staConfigBssParam->staIdx = wdiConfigBssRsp->ucSTAIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2831 | staConfigBssParam->bssIdx = wdiConfigBssRsp->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2832 | staConfigBssParam->ucUcastSig = wdiConfigBssRsp->ucUcastSig; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2833 | staConfigBssParam->ucBcastSig = wdiConfigBssRsp->ucBcastSig; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2834 | vos_mem_copy(staConfigBssParam->staMac, wdiConfigBssRsp->macSTA, |
| 2835 | sizeof(tSirMacAddr)); |
| 2836 | staConfigBssParam->txChannelWidthSet = |
| 2837 | configBssReqParam->txChannelWidthSet; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2838 | if(staConfigBssParam->staType == STA_ENTRY_PEER && |
| 2839 | staConfigBssParam->htCapable) |
| 2840 | { |
| 2841 | pWDA->wdaStaInfo[staConfigBssParam->staIdx].bssIdx = |
| 2842 | wdiConfigBssRsp->ucBSSIdx; |
| 2843 | pWDA->wdaStaInfo[staConfigBssParam->staIdx].ucValidStaIndex = |
| 2844 | WDA_VALID_STA_INDEX ; |
| 2845 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2846 | if(WDI_DS_SetStaIdxPerBssIdx(pWDA->pWdiContext, |
| 2847 | wdiConfigBssRsp->ucBSSIdx, |
| 2848 | wdiConfigBssRsp->ucSTAIdx)) |
| 2849 | { |
| 2850 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2851 | "%s: fail to set STA idx associated with BSS index", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2852 | VOS_ASSERT(0) ; |
| 2853 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2854 | if(WDI_DS_AddSTAMemPool(pWDA->pWdiContext, wdiConfigBssRsp->ucSTAIdx)) |
| 2855 | { |
| 2856 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2857 | "%s: add BSS into mempool fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2858 | VOS_ASSERT(0) ; |
| 2859 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2860 | #ifdef WLAN_FEATURE_VOWIFI |
| 2861 | configBssReqParam->txMgmtPower = wdiConfigBssRsp->ucTxMgmtPower; |
| 2862 | #endif |
| 2863 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2864 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2865 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2866 | WDA_SendMsg(pWDA, WDA_ADD_BSS_RSP, (void *)configBssReqParam , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2867 | return ; |
| 2868 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2869 | /* |
| 2870 | * FUNCTION: WDA_UpdateEdcaParamsForAC |
| 2871 | * Update WDI EDCA params with PE edca params |
| 2872 | */ |
| 2873 | void WDA_UpdateEdcaParamsForAC(tWDA_CbContext *pWDA, |
| 2874 | WDI_EdcaParamRecord *wdiEdcaParam, |
| 2875 | tSirMacEdcaParamRecord *macEdcaParam) |
| 2876 | { |
| 2877 | wdiEdcaParam->wdiACI.aifsn = macEdcaParam->aci.aifsn; |
| 2878 | wdiEdcaParam->wdiACI.acm= macEdcaParam->aci.acm; |
| 2879 | wdiEdcaParam->wdiACI.aci = macEdcaParam->aci.aci; |
| 2880 | wdiEdcaParam->wdiCW.min = macEdcaParam->cw.min; |
| 2881 | wdiEdcaParam->wdiCW.max = macEdcaParam->cw.max; |
| 2882 | wdiEdcaParam->usTXOPLimit = macEdcaParam->txoplimit; |
| 2883 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2884 | /* |
| 2885 | * FUNCTION: WDA_ProcessConfigBssReq |
| 2886 | * Configure BSS before starting Assoc with AP |
| 2887 | */ |
| 2888 | VOS_STATUS WDA_ProcessConfigBssReq(tWDA_CbContext *pWDA, |
| 2889 | tAddBssParams* configBssReqParam) |
| 2890 | { |
| 2891 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2892 | WDI_ConfigBSSReqParamsType *wdiConfigBssReqParam = |
| 2893 | (WDI_ConfigBSSReqParamsType *)vos_mem_malloc( |
| 2894 | sizeof(WDI_ConfigBSSReqParamsType)) ; |
| 2895 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2896 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2897 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2898 | if(NULL == wdiConfigBssReqParam) |
| 2899 | { |
| 2900 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2901 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2902 | VOS_ASSERT(0); |
| 2903 | return VOS_STATUS_E_NOMEM; |
| 2904 | } |
| 2905 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 2906 | if(NULL == pWdaParams) |
| 2907 | { |
| 2908 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2909 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2910 | VOS_ASSERT(0); |
| 2911 | vos_mem_free(wdiConfigBssReqParam); |
| 2912 | return VOS_STATUS_E_NOMEM; |
| 2913 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2914 | vos_mem_set(wdiConfigBssReqParam, sizeof(WDI_ConfigBSSReqParamsType), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2915 | WDA_UpdateBSSParams(pWDA, &wdiConfigBssReqParam->wdiReqInfo, |
| 2916 | configBssReqParam) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2917 | /* Store Init Req pointer, as this will be used for response */ |
| 2918 | /* store Params pass it to WDI */ |
| 2919 | pWdaParams->pWdaContext = pWDA; |
| 2920 | pWdaParams->wdaMsgParam = configBssReqParam; |
| 2921 | pWdaParams->wdaWdiApiMsgParam = wdiConfigBssReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2922 | status = WDI_ConfigBSSReq(wdiConfigBssReqParam, |
| 2923 | (WDI_ConfigBSSRspCb )WDA_ConfigBssReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2924 | if(IS_WDI_STATUS_FAILURE(status)) |
| 2925 | { |
| 2926 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 2927 | "Failure in Config BSS WDI API, free all the memory " ); |
| 2928 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 2929 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2930 | configBssReqParam->status = eSIR_FAILURE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2931 | WDA_SendMsg(pWDA, WDA_ADD_BSS_RSP, (void *)configBssReqParam, 0) ; |
| 2932 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2933 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 2934 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2935 | #ifdef ENABLE_HAL_COMBINED_MESSAGES |
| 2936 | /* |
| 2937 | * FUNCTION: WDA_PostAssocReqCallback |
| 2938 | * Post ASSOC req callback, send RSP back to PE |
| 2939 | */ |
| 2940 | void WDA_PostAssocReqCallback(WDI_PostAssocRspParamsType *wdiPostAssocRsp, |
| 2941 | void* pUserData) |
| 2942 | { |
| 2943 | tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData ; |
| 2944 | tPostAssocParams *postAssocReqParam = |
| 2945 | (tPostAssocParams *)pWDA->wdaMsgParam ; |
| 2946 | /*STA context within the BSS Params*/ |
| 2947 | tAddStaParams *staPostAssocParam = |
| 2948 | &postAssocReqParam->addBssParams.staContext ; |
| 2949 | /*STA Params for self STA*/ |
| 2950 | tAddStaParams *selfStaPostAssocParam = |
| 2951 | &postAssocReqParam->addStaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2952 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2953 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2954 | postAssocReqParam->status = |
| 2955 | CONVERT_WDI2SIR_STATUS(wdiPostAssocRsp->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2956 | if(WDI_STATUS_SUCCESS == wdiPostAssocRsp->wdiStatus) |
| 2957 | { |
| 2958 | staPostAssocParam->staIdx = wdiPostAssocRsp->bssParams.ucSTAIdx ; |
| 2959 | vos_mem_copy(staPostAssocParam->staMac, wdiPostAssocRsp->bssParams.macSTA, |
| 2960 | sizeof(tSirMacAddr)) ; |
| 2961 | staPostAssocParam->ucUcastSig = wdiPostAssocRsp->bssParams.ucUcastSig ; |
| 2962 | staPostAssocParam->ucBcastSig = wdiPostAssocRsp->bssParams.ucBcastSig ; |
| 2963 | staPostAssocParam->bssIdx = wdiPostAssocRsp->bssParams.ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2964 | selfStaPostAssocParam->staIdx = wdiPostAssocRsp->staParams.ucSTAIdx; |
| 2965 | } |
| 2966 | vos_mem_free(pWDA->wdaWdiApiMsgParam) ; |
| 2967 | pWDA->wdaWdiApiMsgParam = NULL; |
| 2968 | pWDA->wdaMsgParam = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2969 | WDA_SendMsg(pWDA, WDA_POST_ASSOC_RSP, (void *)postAssocReqParam, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2970 | return ; |
| 2971 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2972 | /* |
| 2973 | * FUNCTION: WDA_ProcessPostAssocReq |
| 2974 | * Trigger POST ASSOC processing in WDI |
| 2975 | */ |
| 2976 | VOS_STATUS WDA_ProcessPostAssocReq(tWDA_CbContext *pWDA, |
| 2977 | tPostAssocParams *postAssocReqParam) |
| 2978 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2979 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 2980 | |
| 2981 | WDI_PostAssocReqParamsType *wdiPostAssocReqParam = |
| 2982 | (WDI_PostAssocReqParamsType *)vos_mem_malloc( |
| 2983 | sizeof(WDI_PostAssocReqParamsType)) ; |
| 2984 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2985 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2986 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2987 | if(NULL == wdiPostAssocReqParam) |
| 2988 | { |
| 2989 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2990 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2991 | VOS_ASSERT(0); |
| 2992 | return VOS_STATUS_E_NOMEM; |
| 2993 | } |
| 2994 | |
| 2995 | if((NULL != pWDA->wdaMsgParam) || (NULL != pWDA->wdaWdiApiMsgParam)) |
| 2996 | { |
| 2997 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 2998 | "%s: wdaMsgParam or wdaWdiApiMsgParam is not NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2999 | VOS_ASSERT(0); |
| 3000 | return VOS_STATUS_E_FAILURE; |
| 3001 | } |
| 3002 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3003 | /* update BSS params into WDI structure */ |
| 3004 | WDA_UpdateBSSParams(pWDA, &wdiPostAssocReqParam->wdiBSSParams, |
| 3005 | &postAssocReqParam->addBssParams) ; |
| 3006 | /* update STA params into WDI structure */ |
| 3007 | WDA_UpdateSTAParams(pWDA, &wdiPostAssocReqParam->wdiSTAParams, |
| 3008 | &postAssocReqParam->addStaParams) ; |
| 3009 | |
| 3010 | wdiPostAssocReqParam->wdiBSSParams.ucEDCAParamsValid = |
| 3011 | postAssocReqParam->addBssParams.highPerformance; |
| 3012 | WDA_UpdateEdcaParamsForAC(pWDA, |
| 3013 | &wdiPostAssocReqParam->wdiBSSParams.wdiBEEDCAParams, |
| 3014 | &postAssocReqParam->addBssParams.acbe); |
| 3015 | WDA_UpdateEdcaParamsForAC(pWDA, |
| 3016 | &wdiPostAssocReqParam->wdiBSSParams.wdiBKEDCAParams, |
| 3017 | &postAssocReqParam->addBssParams.acbk); |
| 3018 | WDA_UpdateEdcaParamsForAC(pWDA, |
| 3019 | &wdiPostAssocReqParam->wdiBSSParams.wdiVIEDCAParams, |
| 3020 | &postAssocReqParam->addBssParams.acvi); |
| 3021 | WDA_UpdateEdcaParamsForAC(pWDA, |
| 3022 | &wdiPostAssocReqParam->wdiBSSParams.wdiVOEDCAParams, |
| 3023 | &postAssocReqParam->addBssParams.acvo); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3024 | /* Store Init Req pointer, as this will be used for response */ |
| 3025 | pWDA->wdaMsgParam = (void *)postAssocReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3026 | /* store Params pass it to WDI */ |
| 3027 | pWDA->wdaWdiApiMsgParam = (void *)wdiPostAssocReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3028 | status = WDI_PostAssocReq(wdiPostAssocReqParam, |
| 3029 | (WDI_PostAssocRspCb )WDA_PostAssocReqCallback, pWDA) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3030 | if(IS_WDI_STATUS_FAILURE(status)) |
| 3031 | { |
| 3032 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 3033 | "Failure in Post Assoc WDI API, free all the memory " ); |
| 3034 | vos_mem_free(pWDA->wdaWdiApiMsgParam) ; |
| 3035 | pWDA->wdaWdiApiMsgParam = NULL; |
| 3036 | pWDA->wdaMsgParam = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3037 | postAssocReqParam->status = eSIR_FAILURE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3038 | WDA_SendMsg(pWDA, WDA_POST_ASSOC_RSP, (void *)postAssocReqParam, 0) ; |
| 3039 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3040 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 3041 | } |
| 3042 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3043 | /* |
| 3044 | * FUNCTION: WDA_AddStaReqCallback |
| 3045 | * ADD STA req callback, send RSP back to PE |
| 3046 | */ |
| 3047 | void WDA_AddStaReqCallback(WDI_ConfigSTARspParamsType *wdiConfigStaRsp, |
| 3048 | void* pUserData) |
| 3049 | { |
| 3050 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 3051 | tWDA_CbContext *pWDA; |
| 3052 | tAddStaParams *addStaReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3053 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3054 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3055 | if(NULL == pWdaParams) |
| 3056 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3057 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,"%s: pWdaParams is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3058 | VOS_ASSERT(0) ; |
| 3059 | return ; |
| 3060 | } |
| 3061 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 3062 | addStaReqParam = (tAddStaParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3063 | addStaReqParam->status = |
| 3064 | CONVERT_WDI2SIR_STATUS(wdiConfigStaRsp->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3065 | if(WDI_STATUS_SUCCESS == wdiConfigStaRsp->wdiStatus) |
| 3066 | { |
| 3067 | addStaReqParam->staIdx = wdiConfigStaRsp->ucSTAIdx; |
| 3068 | /*TODO: UMAC structure doesn't have these fields*/ |
| 3069 | /*addStaReqParam-> = wdiConfigStaRsp->ucDpuIndex; |
| 3070 | addStaReqParam-> = wdiConfigStaRsp->ucBcastDpuIndex; |
| 3071 | addStaReqParam-> = wdiConfigStaRsp->ucBcastMgmtDpuIdx; */ |
| 3072 | addStaReqParam->ucUcastSig = wdiConfigStaRsp->ucUcastSig; |
| 3073 | addStaReqParam->ucBcastSig = wdiConfigStaRsp->ucBcastSig; |
| 3074 | /* update staIndex as valid index for BA if STA is HT capable*/ |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 3075 | #ifdef FEATURE_WLAN_TDLS |
| 3076 | if( (addStaReqParam->staType == STA_ENTRY_PEER || |
| 3077 | addStaReqParam->staType == STA_ENTRY_TDLS_PEER) && addStaReqParam->htCapable) |
| 3078 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3079 | if(addStaReqParam->staType == STA_ENTRY_PEER && addStaReqParam->htCapable) |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 3080 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3081 | { |
| 3082 | pWDA->wdaStaInfo[addStaReqParam->staIdx].bssIdx = |
| 3083 | wdiConfigStaRsp->ucBssIdx; |
| 3084 | pWDA->wdaStaInfo[addStaReqParam->staIdx].ucValidStaIndex = |
| 3085 | WDA_VALID_STA_INDEX ; |
| 3086 | } |
| 3087 | if(WDI_DS_AddSTAMemPool(pWDA->pWdiContext, wdiConfigStaRsp->ucSTAIdx)) |
| 3088 | { |
| 3089 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3090 | "%s: add STA into mempool fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3091 | VOS_ASSERT(0) ; |
| 3092 | return ; |
| 3093 | } |
| 3094 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3095 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 3096 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3097 | WDA_SendMsg(pWDA, WDA_ADD_STA_RSP, (void *)addStaReqParam, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3098 | return ; |
| 3099 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3100 | /* |
| 3101 | * FUNCTION: WDA_ConfigStaReq |
| 3102 | * Trigger Config STA processing in WDI |
| 3103 | */ |
| 3104 | VOS_STATUS WDA_ProcessAddStaReq(tWDA_CbContext *pWDA, |
| 3105 | tAddStaParams *addStaReqParam) |
| 3106 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3107 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3108 | WDI_ConfigSTAReqParamsType *wdiConfigStaReqParam = |
| 3109 | (WDI_ConfigSTAReqParamsType *)vos_mem_malloc( |
| 3110 | sizeof(WDI_ConfigSTAReqParamsType)) ; |
| 3111 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3112 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3113 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3114 | if(NULL == wdiConfigStaReqParam) |
| 3115 | { |
| 3116 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3117 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3118 | VOS_ASSERT(0); |
| 3119 | return VOS_STATUS_E_NOMEM; |
| 3120 | } |
| 3121 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 3122 | if(NULL == pWdaParams) |
| 3123 | { |
| 3124 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3125 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3126 | VOS_ASSERT(0); |
| 3127 | vos_mem_free(wdiConfigStaReqParam); |
| 3128 | return VOS_STATUS_E_NOMEM; |
| 3129 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3130 | vos_mem_set(wdiConfigStaReqParam, sizeof(WDI_ConfigSTAReqParamsType), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3131 | /* update STA params into WDI structure */ |
| 3132 | WDA_UpdateSTAParams(pWDA, &wdiConfigStaReqParam->wdiReqInfo, |
| 3133 | addStaReqParam) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3134 | /* Store Init Req pointer, as this will be used for response */ |
| 3135 | /* store Params pass it to WDI */ |
| 3136 | pWdaParams->pWdaContext = pWDA; |
| 3137 | pWdaParams->wdaMsgParam = addStaReqParam; |
| 3138 | pWdaParams->wdaWdiApiMsgParam = wdiConfigStaReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3139 | status = WDI_ConfigSTAReq(wdiConfigStaReqParam, |
| 3140 | (WDI_ConfigSTARspCb )WDA_AddStaReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3141 | if(IS_WDI_STATUS_FAILURE(status)) |
| 3142 | { |
| 3143 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 3144 | "Failure in Config STA WDI API, free all the memory " ); |
| 3145 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3146 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3147 | addStaReqParam->status = eSIR_FAILURE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3148 | WDA_SendMsg(pWDA, WDA_ADD_STA_RSP, (void *)addStaReqParam, 0) ; |
| 3149 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3150 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 3151 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3152 | /* |
| 3153 | * FUNCTION: WDA_DelBSSReqCallback |
| 3154 | * Dens DEL BSS RSP back to PE |
| 3155 | */ |
| 3156 | void WDA_DelBSSReqCallback(WDI_DelBSSRspParamsType *wdiDelBssRsp, |
| 3157 | void* pUserData) |
| 3158 | { |
| 3159 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 3160 | tWDA_CbContext *pWDA; |
| 3161 | tDeleteBssParams *delBssReqParam; |
| 3162 | tANI_U8 staIdx,tid; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3163 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3164 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3165 | if(NULL == pWdaParams) |
| 3166 | { |
| 3167 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3168 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3169 | VOS_ASSERT(0) ; |
| 3170 | return ; |
| 3171 | } |
| 3172 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 3173 | delBssReqParam = (tDeleteBssParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3174 | delBssReqParam->status = CONVERT_WDI2SIR_STATUS(wdiDelBssRsp->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | if(WDI_STATUS_SUCCESS == wdiDelBssRsp->wdiStatus) |
| 3176 | { |
| 3177 | vos_mem_copy(delBssReqParam->bssid, wdiDelBssRsp->macBSSID, |
| 3178 | sizeof(tSirMacAddr)) ; |
| 3179 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3180 | if(WDI_DS_GetStaIdxFromBssIdx(pWDA->pWdiContext, delBssReqParam->bssIdx, &staIdx)) |
| 3181 | { |
| 3182 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3183 | "%s: Get STA index from BSS index Fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3184 | VOS_ASSERT(0) ; |
| 3185 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3186 | if(WDI_DS_DelSTAMemPool(pWDA->pWdiContext, staIdx)) |
| 3187 | { |
| 3188 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3189 | "%s: DEL STA from MemPool Fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | VOS_ASSERT(0) ; |
| 3191 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3192 | if(WDI_DS_ClearStaIdxPerBssIdx(pWDA->pWdiContext, delBssReqParam->bssIdx, staIdx)) |
| 3193 | { |
| 3194 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3195 | "%s: Clear STA index form table Fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3196 | VOS_ASSERT(0) ; |
| 3197 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3198 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3199 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3200 | /* reset the the system role*/ |
| 3201 | pWDA->wdaGlobalSystemRole = eSYSTEM_UNKNOWN_ROLE; |
| 3202 | |
| 3203 | /* Reset the BA related information */ |
| 3204 | for(staIdx=0; staIdx < WDA_MAX_STA; staIdx++) |
| 3205 | { |
| 3206 | if( pWDA->wdaStaInfo[staIdx].bssIdx == wdiDelBssRsp->ucBssIdx ) |
| 3207 | { |
| 3208 | pWDA->wdaStaInfo[staIdx].ucValidStaIndex = WDA_INVALID_STA_INDEX; |
| 3209 | pWDA->wdaStaInfo[staIdx].ucUseBaBitmap = 0; |
| 3210 | /* Reset framesTxed counters here */ |
| 3211 | for(tid = 0; tid < STACFG_MAX_TC; tid++) |
| 3212 | { |
| 3213 | pWDA->wdaStaInfo[staIdx].framesTxed[tid] = 0; |
| 3214 | } |
| 3215 | } |
| 3216 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3217 | WDA_SendMsg(pWDA, WDA_DELETE_BSS_RSP, (void *)delBssReqParam , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3218 | return ; |
| 3219 | } |
| 3220 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3221 | /* |
| 3222 | * FUNCTION: WDA_ProcessDelBssReq |
| 3223 | * Init DEL BSS req with WDI |
| 3224 | */ |
| 3225 | VOS_STATUS WDA_ProcessDelBssReq(tWDA_CbContext *pWDA, |
| 3226 | tDeleteBssParams *delBssParam) |
| 3227 | { |
| 3228 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3229 | WDI_DelBSSReqParamsType *wdiDelBssReqParam = |
| 3230 | (WDI_DelBSSReqParamsType *)vos_mem_malloc( |
| 3231 | sizeof(WDI_DelBSSReqParamsType)) ; |
| 3232 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3233 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3234 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3235 | if(NULL == wdiDelBssReqParam) |
| 3236 | { |
| 3237 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3238 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3239 | VOS_ASSERT(0); |
| 3240 | return VOS_STATUS_E_NOMEM; |
| 3241 | } |
| 3242 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 3243 | if(NULL == pWdaParams) |
| 3244 | { |
| 3245 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3246 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3247 | VOS_ASSERT(0); |
| 3248 | vos_mem_free(wdiDelBssReqParam); |
| 3249 | return VOS_STATUS_E_NOMEM; |
| 3250 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3251 | wdiDelBssReqParam->ucBssIdx = delBssParam->bssIdx; |
| 3252 | wdiDelBssReqParam->wdiReqStatusCB = NULL ; |
| 3253 | |
| 3254 | /* Store Init Req pointer, as this will be used for response */ |
| 3255 | /* store Params pass it to WDI */ |
| 3256 | pWdaParams->pWdaContext = pWDA; |
| 3257 | pWdaParams->wdaMsgParam = delBssParam; |
| 3258 | pWdaParams->wdaWdiApiMsgParam = wdiDelBssReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3259 | status = WDI_DelBSSReq(wdiDelBssReqParam, |
| 3260 | (WDI_DelBSSRspCb )WDA_DelBSSReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3261 | if(IS_WDI_STATUS_FAILURE(status)) |
| 3262 | { |
| 3263 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 3264 | "Failure in Del BSS WDI API, free all the memory " ); |
| 3265 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3266 | vos_mem_free(pWdaParams) ; |
| 3267 | delBssParam->status = eSIR_FAILURE ; |
| 3268 | WDA_SendMsg(pWDA, WDA_DELETE_BSS_RSP, (void *)delBssParam, 0) ; |
| 3269 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3270 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 3271 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3272 | /* |
| 3273 | * FUNCTION: WDA_DelSTAReqCallback |
| 3274 | * Dens DEL STA RSP back to PE |
| 3275 | */ |
| 3276 | void WDA_DelSTAReqCallback(WDI_DelSTARspParamsType *wdiDelStaRsp, |
| 3277 | void* pUserData) |
| 3278 | { |
| 3279 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 3280 | tWDA_CbContext *pWDA; |
| 3281 | tDeleteStaParams *delStaReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3282 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3283 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3284 | if(NULL == pWdaParams) |
| 3285 | { |
| 3286 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3287 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3288 | VOS_ASSERT(0) ; |
| 3289 | return ; |
| 3290 | } |
| 3291 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 3292 | delStaReqParam = (tDeleteStaParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3293 | delStaReqParam->status = CONVERT_WDI2SIR_STATUS(wdiDelStaRsp->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3294 | if(WDI_STATUS_SUCCESS == wdiDelStaRsp->wdiStatus) |
| 3295 | { |
| 3296 | if(WDI_DS_DelSTAMemPool(pWDA->pWdiContext, wdiDelStaRsp->ucSTAIdx)) |
| 3297 | { |
| 3298 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3299 | "%s: DEL STA from MemPool Fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3300 | VOS_ASSERT(0) ; |
| 3301 | } |
| 3302 | delStaReqParam->staIdx = wdiDelStaRsp->ucSTAIdx ; |
| 3303 | } |
| 3304 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3305 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3306 | /*Reset the BA information corresponding to this STAIdx */ |
| 3307 | pWDA->wdaStaInfo[wdiDelStaRsp->ucSTAIdx].ucValidStaIndex = |
| 3308 | WDA_INVALID_STA_INDEX; |
| 3309 | pWDA->wdaStaInfo[wdiDelStaRsp->ucSTAIdx].ucUseBaBitmap = 0; |
| 3310 | |
| 3311 | WDA_SendMsg(pWDA, WDA_DELETE_STA_RSP, (void *)delStaReqParam , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3312 | return ; |
| 3313 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3314 | /* |
| 3315 | * FUNCTION: WDA_ProcessDelStaReq |
| 3316 | * Init DEL STA req with WDI |
| 3317 | */ |
| 3318 | VOS_STATUS WDA_ProcessDelStaReq(tWDA_CbContext *pWDA, |
| 3319 | tDeleteStaParams *delStaParam) |
| 3320 | { |
| 3321 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3322 | WDI_DelSTAReqParamsType *wdiDelStaReqParam = |
| 3323 | (WDI_DelSTAReqParamsType *)vos_mem_malloc( |
| 3324 | sizeof(WDI_DelSTAReqParamsType)) ; |
| 3325 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3326 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3327 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3328 | if(NULL == wdiDelStaReqParam) |
| 3329 | { |
| 3330 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3331 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3332 | VOS_ASSERT(0); |
| 3333 | return VOS_STATUS_E_NOMEM; |
| 3334 | } |
| 3335 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 3336 | if(NULL == pWdaParams) |
| 3337 | { |
| 3338 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3339 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3340 | VOS_ASSERT(0); |
| 3341 | vos_mem_free(wdiDelStaReqParam); |
| 3342 | return VOS_STATUS_E_NOMEM; |
| 3343 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | wdiDelStaReqParam->ucSTAIdx = delStaParam->staIdx ; |
| 3345 | wdiDelStaReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3346 | /* Store Init Req pointer, as this will be used for response */ |
| 3347 | /* store Params pass it to WDI */ |
| 3348 | pWdaParams->pWdaContext = pWDA; |
| 3349 | pWdaParams->wdaMsgParam = delStaParam; |
| 3350 | pWdaParams->wdaWdiApiMsgParam = wdiDelStaReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3351 | status = WDI_DelSTAReq(wdiDelStaReqParam, |
| 3352 | (WDI_DelSTARspCb )WDA_DelSTAReqCallback, pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3353 | if(IS_WDI_STATUS_FAILURE(status)) |
| 3354 | { |
| 3355 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 3356 | "Failure in Del STA WDI API, free all the memory status = %d", |
| 3357 | status ); |
| 3358 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3359 | vos_mem_free(pWdaParams) ; |
| 3360 | delStaParam->status = eSIR_FAILURE ; |
| 3361 | WDA_SendMsg(pWDA, WDA_DELETE_STA_RSP, (void *)delStaParam, 0) ; |
| 3362 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3363 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 3364 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3365 | void WDA_ProcessAddStaSelfRsp(WDI_AddSTASelfRspParamsType* pwdiAddSTASelfRsp, void* pUserData) |
| 3366 | { |
| 3367 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 3368 | tWDA_CbContext *pWDA; |
| 3369 | tAddStaSelfParams *pAddStaSelfRsp = NULL; |
| 3370 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3371 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3372 | if(NULL == pWdaParams) |
| 3373 | { |
| 3374 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3375 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3376 | VOS_ASSERT(0) ; |
| 3377 | return ; |
| 3378 | } |
| 3379 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 3380 | pAddStaSelfRsp = (tAddStaSelfParams*)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3381 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3382 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3383 | pAddStaSelfRsp->status = CONVERT_WDI2SIR_STATUS(pwdiAddSTASelfRsp->wdiStatus); |
| 3384 | vos_mem_copy(pAddStaSelfRsp->selfMacAddr, |
| 3385 | pwdiAddSTASelfRsp->macSelfSta, |
| 3386 | sizeof(pAddStaSelfRsp->selfMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3387 | WDA_SendMsg( pWDA, WDA_ADD_STA_SELF_RSP, (void *)pAddStaSelfRsp, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3388 | return ; |
| 3389 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3390 | /* |
| 3391 | * FUNCTION: WDA_ProcessAddStaSelfReq |
| 3392 | * |
| 3393 | */ |
| 3394 | VOS_STATUS WDA_ProcessAddStaSelfReq( tWDA_CbContext *pWDA, tpAddStaSelfParams pAddStaSelfReq) |
| 3395 | { |
| 3396 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3397 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3398 | WDI_AddSTASelfReqParamsType *wdiAddStaSelfReq = |
| 3399 | (WDI_AddSTASelfReqParamsType *)vos_mem_malloc( |
| 3400 | sizeof(WDI_AddSTASelfReqParamsType)) ; |
| 3401 | tWDA_ReqParams *pWdaParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3402 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3403 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3404 | if( NULL == wdiAddStaSelfReq ) |
| 3405 | { |
| 3406 | VOS_ASSERT( 0 ); |
| 3407 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3408 | "%s: Unable to allocate memory " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3409 | return( VOS_STATUS_E_NOMEM ); |
| 3410 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3411 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3412 | if( NULL == pWdaParams ) |
| 3413 | { |
| 3414 | VOS_ASSERT( 0 ); |
| 3415 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3416 | "%s: Unable to allocate memory " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3417 | vos_mem_free(wdiAddStaSelfReq) ; |
| 3418 | return( VOS_STATUS_E_NOMEM ); |
| 3419 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3420 | wdiAddStaSelfReq->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3421 | vos_mem_copy( wdiAddStaSelfReq->wdiAddSTASelfInfo.selfMacAddr, pAddStaSelfReq->selfMacAddr, 6); |
| 3422 | /* Store Init Req pointer, as this will be used for response */ |
| 3423 | /* store Params pass it to WDI */ |
| 3424 | pWdaParams->pWdaContext = pWDA; |
| 3425 | pWdaParams->wdaMsgParam = pAddStaSelfReq; |
| 3426 | pWdaParams->wdaWdiApiMsgParam = wdiAddStaSelfReq; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3427 | wstatus = WDI_AddSTASelfReq( wdiAddStaSelfReq, WDA_ProcessAddStaSelfRsp, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3428 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3429 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3430 | { |
| 3431 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 3432 | "Failure in Add Self Sta Request API, free all the memory status = %d", |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3433 | wstatus ); |
| 3434 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3435 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3436 | vos_mem_free(pWdaParams) ; |
| 3437 | pAddStaSelfReq->status = eSIR_FAILURE ; |
| 3438 | WDA_SendMsg( pWDA, WDA_ADD_STA_SELF_RSP, (void *)pAddStaSelfReq, 0) ; |
| 3439 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3440 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3441 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3442 | /* |
| 3443 | * FUNCTION: WDA_DelSTASelfRespCallback |
| 3444 | * |
| 3445 | */ |
| 3446 | void WDA_DelSTASelfRespCallback(WDI_DelSTASelfRspParamsType * |
| 3447 | wdiDelStaSelfRspParams , void* pUserData) |
| 3448 | { |
| 3449 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 3450 | tWDA_CbContext *pWDA; |
| 3451 | tDelStaSelfParams *delStaSelfParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3452 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3453 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3454 | if (NULL == pWdaParams) |
| 3455 | { |
| 3456 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3457 | "%s: Invalid pWdaParams pointer", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3458 | VOS_ASSERT(0); |
| 3459 | return; |
| 3460 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3461 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 3462 | delStaSelfParams = (tDelStaSelfParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3463 | delStaSelfParams->status = |
| 3464 | CONVERT_WDI2SIR_STATUS(wdiDelStaSelfRspParams->wdiStatus) ; |
| 3465 | |
| 3466 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3467 | vos_mem_free(pWdaParams) ; |
| 3468 | |
| 3469 | WDA_SendMsg(pWDA, WDA_DEL_STA_SELF_RSP, (void *)delStaSelfParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3470 | return ; |
| 3471 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3472 | /* |
| 3473 | * FUNCTION: WDA_DelSTASelfReqCallback |
| 3474 | * |
| 3475 | */ |
| 3476 | void WDA_DelSTASelfReqCallback(WDI_Status wdiStatus, |
| 3477 | void* pUserData) |
| 3478 | { |
| 3479 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 3480 | tWDA_CbContext *pWDA; |
| 3481 | tDelStaSelfParams *delStaSelfParams; |
| 3482 | |
| 3483 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 3484 | "<------ %s, wdiStatus: %d pWdaParams: 0x%x", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3485 | __func__, wdiStatus, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3486 | |
| 3487 | if (NULL == pWdaParams) |
| 3488 | { |
| 3489 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3490 | "%s: Invalid pWdaParams pointer", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3491 | VOS_ASSERT(0); |
| 3492 | return; |
| 3493 | } |
| 3494 | |
| 3495 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 3496 | delStaSelfParams = (tDelStaSelfParams *)pWdaParams->wdaMsgParam; |
| 3497 | |
| 3498 | delStaSelfParams->status = CONVERT_WDI2SIR_STATUS(wdiStatus) ; |
| 3499 | |
| 3500 | if(IS_WDI_STATUS_FAILURE(wdiStatus)) |
| 3501 | { |
| 3502 | VOS_ASSERT(0); |
| 3503 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3504 | vos_mem_free(pWdaParams) ; |
| 3505 | WDA_SendMsg(pWDA, WDA_DEL_STA_SELF_RSP, (void *)delStaSelfParams , 0) ; |
| 3506 | } |
| 3507 | |
| 3508 | return ; |
| 3509 | } |
| 3510 | |
| 3511 | /* |
| 3512 | * FUNCTION: WDA_DelSTASelfReq |
| 3513 | * Trigger Config STA processing in WDI |
| 3514 | */ |
| 3515 | VOS_STATUS WDA_ProcessDelSTASelfReq(tWDA_CbContext *pWDA, |
| 3516 | tDelStaSelfParams* pDelStaSelfReqParam) |
| 3517 | { |
| 3518 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3519 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3520 | tWDA_ReqParams *pWdaParams = NULL; |
| 3521 | WDI_DelSTASelfReqParamsType *wdiDelStaSelfReq = |
| 3522 | (WDI_DelSTASelfReqParamsType *)vos_mem_malloc( |
| 3523 | sizeof(WDI_DelSTASelfReqParamsType)) ; |
| 3524 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3525 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3526 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3527 | if( NULL == wdiDelStaSelfReq ) |
| 3528 | { |
| 3529 | VOS_ASSERT( 0 ); |
| 3530 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3531 | "%s: Unable to allocate memory " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | return( VOS_STATUS_E_NOMEM ); |
| 3533 | } |
| 3534 | |
| 3535 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 3536 | if( NULL == pWdaParams ) |
| 3537 | { |
| 3538 | VOS_ASSERT( 0 ); |
| 3539 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3540 | "%s: Unable to allocate memory " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3541 | vos_mem_free(wdiDelStaSelfReq) ; |
| 3542 | return( VOS_STATUS_E_NOMEM ); |
| 3543 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3544 | pWdaParams->pWdaContext = pWDA; |
| 3545 | /* Store param pointer as passed in by caller */ |
| 3546 | pWdaParams->wdaMsgParam = pDelStaSelfReqParam; |
| 3547 | /* store Params pass it to WDI */ |
| 3548 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiDelStaSelfReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3549 | vos_mem_copy( wdiDelStaSelfReq->wdiDelStaSelfInfo.selfMacAddr, |
| 3550 | pDelStaSelfReqParam->selfMacAddr, sizeof(tSirMacAddr)); |
| 3551 | |
| 3552 | wdiDelStaSelfReq->wdiReqStatusCB = WDA_DelSTASelfReqCallback; |
| 3553 | wdiDelStaSelfReq->pUserData = pWdaParams; |
| 3554 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3555 | wstatus = WDI_DelSTASelfReq(wdiDelStaSelfReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3556 | (WDI_DelSTASelfRspCb)WDA_DelSTASelfRespCallback, pWdaParams); |
| 3557 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3558 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3559 | { |
| 3560 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
| 3561 | "Failure in Del Sta Self REQ WDI API, free all the memory " ); |
| 3562 | VOS_ASSERT(0); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3563 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3564 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 3565 | vos_mem_free(pWdaParams) ; |
| 3566 | pDelStaSelfReqParam->status = eSIR_FAILURE ; |
| 3567 | WDA_SendMsg(pWDA, WDA_DEL_STA_SELF_RSP, (void *)pDelStaSelfReqParam, 0) ; |
| 3568 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3569 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3570 | } |
| 3571 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3572 | /* |
| 3573 | * FUNCTION: WDA_SendMsg |
| 3574 | * Send Message back to PE |
| 3575 | */ |
| 3576 | void WDA_SendMsg(tWDA_CbContext *pWDA, tANI_U16 msgType, |
| 3577 | void *pBodyptr, tANI_U32 bodyVal) |
| 3578 | { |
| 3579 | tSirMsgQ msg = {0} ; |
| 3580 | tANI_U32 status = VOS_STATUS_SUCCESS ; |
| 3581 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3582 | msg.type = msgType; |
| 3583 | msg.bodyval = bodyVal; |
| 3584 | msg.bodyptr = pBodyptr; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3585 | status = limPostMsgApi(pMac, &msg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3586 | if (VOS_STATUS_SUCCESS != status) |
| 3587 | { |
| 3588 | if(NULL != pBodyptr) |
| 3589 | { |
| 3590 | vos_mem_free(pBodyptr); |
| 3591 | } |
| 3592 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3593 | "%s: limPostMsgApi is failed " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3594 | VOS_ASSERT(0) ; |
| 3595 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3596 | return ; |
| 3597 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3598 | /* |
| 3599 | * FUNCTION: WDA_UpdateBSSParams |
| 3600 | * Translated WDA/PE BSS info into WDI BSS info.. |
| 3601 | */ |
| 3602 | void WDA_UpdateBSSParams(tWDA_CbContext *pWDA, |
| 3603 | WDI_ConfigBSSReqInfoType *wdiBssParams, |
| 3604 | tAddBssParams *wdaBssParams) |
| 3605 | { |
| 3606 | v_U8_t keyIndex = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3607 | /* copy bssReq Params to WDI structure */ |
| 3608 | vos_mem_copy(wdiBssParams->macBSSID, |
| 3609 | wdaBssParams->bssId, sizeof(tSirMacAddr)) ; |
| 3610 | vos_mem_copy(wdiBssParams->macSelfAddr, wdaBssParams->selfMacAddr, |
| 3611 | sizeof(tSirMacAddr)) ; |
| 3612 | wdiBssParams->wdiBSSType = wdaBssParams->bssType ; |
| 3613 | wdiBssParams->ucOperMode = wdaBssParams->operMode ; |
| 3614 | wdiBssParams->wdiNWType = wdaBssParams->nwType ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3615 | wdiBssParams->ucShortSlotTimeSupported = |
| 3616 | wdaBssParams->shortSlotTimeSupported ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3617 | wdiBssParams->ucllaCoexist = wdaBssParams->llaCoexist ; |
| 3618 | wdiBssParams->ucllbCoexist = wdaBssParams->llbCoexist ; |
| 3619 | wdiBssParams->ucllgCoexist = wdaBssParams->llgCoexist ; |
| 3620 | wdiBssParams->ucHT20Coexist = wdaBssParams->ht20Coexist ; |
| 3621 | wdiBssParams->ucObssProtEnabled = wdaBssParams->obssProtEnabled ; |
| 3622 | |
| 3623 | wdiBssParams->ucllnNonGFCoexist = wdaBssParams->llnNonGFCoexist ; |
| 3624 | wdiBssParams->ucTXOPProtectionFullSupport = |
| 3625 | wdaBssParams->fLsigTXOPProtectionFullSupport ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3626 | wdiBssParams->ucRIFSMode = wdaBssParams->fRIFSMode ; |
| 3627 | wdiBssParams->usBeaconInterval = wdaBssParams->beaconInterval ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3628 | wdiBssParams->ucDTIMPeriod = wdaBssParams->dtimPeriod ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3629 | wdiBssParams->ucTXChannelWidthSet = wdaBssParams->txChannelWidthSet ; |
| 3630 | wdiBssParams->ucCurrentOperChannel = wdaBssParams->currentOperChannel ; |
| 3631 | wdiBssParams->ucCurrentExtChannel = wdaBssParams->currentExtChannel ; |
| 3632 | wdiBssParams->bHiddenSSIDEn = wdaBssParams->bHiddenSSIDEn ; |
| 3633 | |
| 3634 | /* copy SSID into WDI structure */ |
| 3635 | wdiBssParams->wdiSSID.ucLength = wdaBssParams->ssId.length ; |
| 3636 | vos_mem_copy(wdiBssParams->wdiSSID.sSSID, |
| 3637 | wdaBssParams->ssId.ssId, wdaBssParams->ssId.length) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3638 | WDA_UpdateSTAParams(pWDA, &wdiBssParams->wdiSTAContext, |
| 3639 | &wdaBssParams->staContext) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3640 | wdiBssParams->wdiAction = wdaBssParams->updateBss; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3641 | #ifdef WLAN_FEATURE_VOWIFI |
| 3642 | wdiBssParams->cMaxTxPower = wdaBssParams->maxTxPower; |
| 3643 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3644 | wdiBssParams->ucPersona = wdaBssParams->halPersona; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3645 | wdiBssParams->bSpectrumMgtEn = wdaBssParams->bSpectrumMgtEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3646 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 3647 | wdiBssParams->bExtSetStaKeyParamValid = wdaBssParams->extSetStaKeyParamValid; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3648 | if(wdiBssParams->bExtSetStaKeyParamValid) |
| 3649 | { |
| 3650 | /* copy set STA key params to WDI structure */ |
| 3651 | wdiBssParams->wdiExtSetKeyParam.ucSTAIdx = |
| 3652 | wdaBssParams->extSetStaKeyParam.staIdx; |
| 3653 | wdiBssParams->wdiExtSetKeyParam.wdiEncType = |
| 3654 | wdaBssParams->extSetStaKeyParam.encType; |
| 3655 | wdiBssParams->wdiExtSetKeyParam.wdiWEPType = |
| 3656 | wdaBssParams->extSetStaKeyParam.wepType; |
| 3657 | wdiBssParams->wdiExtSetKeyParam.ucDefWEPIdx = |
| 3658 | wdaBssParams->extSetStaKeyParam.defWEPIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3659 | if(wdaBssParams->extSetStaKeyParam.encType != eSIR_ED_NONE) |
| 3660 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 3661 | if( (wdiBssParams->wdiExtSetKeyParam.wdiWEPType == WDI_WEP_STATIC) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3662 | (WDA_INVALID_KEY_INDEX == wdaBssParams->extSetStaKeyParam.defWEPIdx) && |
| 3663 | (eSYSTEM_AP_ROLE != pWDA->wdaGlobalSystemRole)) |
| 3664 | { |
| 3665 | WDA_GetWepKeysFromCfg( pWDA, |
| 3666 | &wdiBssParams->wdiExtSetKeyParam.ucDefWEPIdx, |
| 3667 | &wdiBssParams->wdiExtSetKeyParam.ucNumKeys, |
| 3668 | wdiBssParams->wdiExtSetKeyParam.wdiKey ); |
| 3669 | } |
| 3670 | else |
| 3671 | { |
| 3672 | #ifdef WLAN_SOFTAP_FEATURE |
| 3673 | for( keyIndex=0; keyIndex < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; |
| 3674 | keyIndex++) |
| 3675 | { |
| 3676 | wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].keyId = |
| 3677 | wdaBssParams->extSetStaKeyParam.key[keyIndex].keyId; |
| 3678 | wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].unicast = |
| 3679 | wdaBssParams->extSetStaKeyParam.key[keyIndex].unicast; |
| 3680 | wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection = |
| 3681 | wdaBssParams->extSetStaKeyParam.key[keyIndex].keyDirection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3682 | vos_mem_copy(wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc, |
| 3683 | wdaBssParams->extSetStaKeyParam.key[keyIndex].keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 3684 | wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole = |
| 3685 | wdaBssParams->extSetStaKeyParam.key[keyIndex].paeRole; |
| 3686 | wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength = |
| 3687 | wdaBssParams->extSetStaKeyParam.key[keyIndex].keyLength; |
| 3688 | vos_mem_copy(wdiBssParams->wdiExtSetKeyParam.wdiKey[keyIndex].key, |
| 3689 | wdaBssParams->extSetStaKeyParam.key[keyIndex].key, SIR_MAC_MAX_KEY_LENGTH); |
| 3690 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3691 | wdiBssParams->wdiExtSetKeyParam.ucNumKeys = |
| 3692 | SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; |
| 3693 | #else |
| 3694 | wdiBssParams->wdiExtSetKeyParam.wdiKey[0].keyId = |
| 3695 | wdaBssParams->extSetStaKeyParam.key.keyId; |
| 3696 | wdiBssParams->wdiExtSetKeyParam.wdiKey[0].unicast = |
| 3697 | wdaBssParams->extSetStaKeyParam.key.unicast; |
| 3698 | wdiBssParams->wdiExtSetKeyParam.wdiKey[0].keyDirection = |
| 3699 | wdaBssParams->extSetStaKeyParam.key.keyDirection; |
| 3700 | vos_mem_copy(wdiBssParams->wdiExtSetKeyParam.wdiKey[0].keyRsc, |
| 3701 | wdaBssParams->extSetStaKeyParam.key.keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 3702 | wdiBssParams->wdiExtSetKeyParam.wdiKey[0].paeRole = |
| 3703 | wdaBssParams->extSetStaKeyParam.key.paeRole; |
| 3704 | wdiBssParams->wdiExtSetKeyParam.wdiKey[0].keyLength = |
| 3705 | wdaBssParams->extSetStaKeyParam.key.keyLength; |
| 3706 | vos_mem_copy(wdiBssParams->wdiExtSetKeyParam.wdiKey[0].key, |
| 3707 | wdaBssParams->extSetStaKeyParam.key[keyIndex].key, |
| 3708 | SIR_MAC_MAX_KEY_LENGTH); |
| 3709 | wdiBssParams->wdiExtSetKeyParam.ucNumKeys = 1; |
| 3710 | #endif |
| 3711 | } |
| 3712 | } |
| 3713 | wdiBssParams->wdiExtSetKeyParam.ucSingleTidRc = wdaBssParams->extSetStaKeyParam.singleTidRc; |
| 3714 | } |
| 3715 | else /* wdaBssParams->bExtSetStaKeyParamValid is not valid */ |
| 3716 | { |
| 3717 | vos_mem_zero( &wdaBssParams->extSetStaKeyParam, |
| 3718 | sizeof(wdaBssParams->extSetStaKeyParam) ); |
| 3719 | } |
| 3720 | #endif /*WLAN_FEATURE_VOWIFI_11R*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3721 | #ifdef WLAN_FEATURE_11AC |
| 3722 | wdiBssParams->ucVhtCapableSta = wdaBssParams->vhtCapable; |
| 3723 | wdiBssParams->ucVhtTxChannelWidthSet = wdaBssParams->vhtTxChannelWidthSet; |
| 3724 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3725 | |
| 3726 | return ; |
| 3727 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3728 | /* |
| 3729 | * FUNCTION: WDA_UpdateSTAParams |
| 3730 | * Translated WDA/PE BSS info into WDI BSS info.. |
| 3731 | */ |
| 3732 | void WDA_UpdateSTAParams(tWDA_CbContext *pWDA, |
| 3733 | WDI_ConfigStaReqInfoType *wdiStaParams, |
| 3734 | tAddStaParams *wdaStaParams) |
| 3735 | { |
| 3736 | tANI_U8 i = 0; |
| 3737 | /* Update STA params */ |
| 3738 | vos_mem_copy(wdiStaParams->macBSSID, wdaStaParams->bssId, |
| 3739 | sizeof(tSirMacAddr)) ; |
| 3740 | wdiStaParams->usAssocId = wdaStaParams->assocId; |
| 3741 | wdiStaParams->wdiSTAType = wdaStaParams->staType; |
| 3742 | |
| 3743 | wdiStaParams->ucShortPreambleSupported = |
| 3744 | wdaStaParams->shortPreambleSupported; |
| 3745 | vos_mem_copy(wdiStaParams->macSTA, wdaStaParams->staMac, |
| 3746 | sizeof(tSirMacAddr)) ; |
| 3747 | wdiStaParams->usListenInterval = wdaStaParams->listenInterval; |
| 3748 | |
| 3749 | wdiStaParams->ucWMMEnabled = wdaStaParams->wmmEnabled; |
| 3750 | |
| 3751 | wdiStaParams->ucHTCapable = wdaStaParams->htCapable; |
| 3752 | wdiStaParams->ucTXChannelWidthSet = wdaStaParams->txChannelWidthSet; |
| 3753 | wdiStaParams->ucRIFSMode = wdaStaParams->rifsMode; |
| 3754 | wdiStaParams->ucLSIGTxopProtection = wdaStaParams->lsigTxopProtection; |
| 3755 | wdiStaParams->ucMaxAmpduSize = wdaStaParams->maxAmpduSize; |
| 3756 | wdiStaParams->ucMaxAmpduDensity = wdaStaParams->maxAmpduDensity; |
| 3757 | wdiStaParams->ucMaxAmsduSize = wdaStaParams->maxAmsduSize; |
| 3758 | |
| 3759 | wdiStaParams->ucShortGI40Mhz = wdaStaParams->fShortGI40Mhz; |
| 3760 | wdiStaParams->ucShortGI20Mhz = wdaStaParams->fShortGI20Mhz; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3761 | wdiStaParams->wdiSupportedRates.opRateMode = |
| 3762 | wdaStaParams->supportedRates.opRateMode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3763 | for(i = 0;i < WDI_NUM_11B_RATES;i++) |
| 3764 | { |
| 3765 | wdiStaParams->wdiSupportedRates.llbRates[i] = |
| 3766 | wdaStaParams->supportedRates.llbRates[i]; |
| 3767 | } |
| 3768 | for(i = 0;i < WDI_NUM_11A_RATES;i++) |
| 3769 | { |
| 3770 | wdiStaParams->wdiSupportedRates.llaRates[i] = |
| 3771 | wdaStaParams->supportedRates.llaRates[i]; |
| 3772 | } |
| 3773 | for(i = 0;i < SIR_NUM_POLARIS_RATES;i++) |
| 3774 | { |
| 3775 | wdiStaParams->wdiSupportedRates.aLegacyRates[i] = |
| 3776 | wdaStaParams->supportedRates.aniLegacyRates[i]; |
| 3777 | } |
| 3778 | wdiStaParams->wdiSupportedRates.uEnhancedRateBitmap = |
| 3779 | wdaStaParams->supportedRates.aniEnhancedRateBitmap; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3780 | #ifdef WLAN_FEATURE_11AC |
| 3781 | wdiStaParams->wdiSupportedRates.vhtRxMCSMap = wdaStaParams->supportedRates.vhtRxMCSMap; |
| 3782 | wdiStaParams->wdiSupportedRates.vhtRxHighestDataRate = wdaStaParams->supportedRates.vhtRxHighestDataRate; |
| 3783 | wdiStaParams->wdiSupportedRates.vhtTxMCSMap = wdaStaParams->supportedRates.vhtTxMCSMap; |
| 3784 | wdiStaParams->wdiSupportedRates.vhtTxHighestDataRate = wdaStaParams->supportedRates.vhtTxHighestDataRate; |
| 3785 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3786 | for(i = 0;i <SIR_MAC_MAX_SUPPORTED_MCS_SET;i++) |
| 3787 | { |
| 3788 | wdiStaParams->wdiSupportedRates.aSupportedMCSSet[i] = |
| 3789 | wdaStaParams->supportedRates.supportedMCSSet[i]; |
| 3790 | } |
| 3791 | wdiStaParams->wdiSupportedRates.aRxHighestDataRate = |
| 3792 | wdaStaParams->supportedRates.rxHighestDataRate; |
| 3793 | |
| 3794 | wdiStaParams->ucRMFEnabled = wdaStaParams->rmfEnabled; |
| 3795 | |
| 3796 | wdiStaParams->wdiAction = wdaStaParams->updateSta; |
| 3797 | |
| 3798 | wdiStaParams->ucAPSD = wdaStaParams->uAPSD; |
| 3799 | wdiStaParams->ucMaxSPLen = wdaStaParams->maxSPLen; |
| 3800 | wdiStaParams->ucGreenFieldCapable = wdaStaParams->greenFieldCapable; |
| 3801 | |
| 3802 | wdiStaParams->ucDelayedBASupport = wdaStaParams->delBASupport; |
| 3803 | wdiStaParams->us32MaxAmpduDuratio = wdaStaParams->us32MaxAmpduDuration; |
| 3804 | wdiStaParams->ucDsssCckMode40Mhz = wdaStaParams->fDsssCckMode40Mhz; |
| 3805 | wdiStaParams->ucEncryptType = wdaStaParams->encryptType; |
| 3806 | #ifdef WLAN_FEATURE_P2P |
| 3807 | wdiStaParams->ucP2pCapableSta = wdaStaParams->p2pCapableSta; |
| 3808 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3809 | #ifdef WLAN_FEATURE_11AC |
| 3810 | wdiStaParams->ucVhtCapableSta = wdaStaParams->vhtCapable; |
| 3811 | wdiStaParams->ucVhtTxChannelWidthSet = wdaStaParams->vhtTxChannelWidthSet; |
Shailender Karmuchi | 31f9ebe | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 3812 | wdiStaParams->ucVhtTxBFEnabled = wdaStaParams->vhtTxBFCapable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3813 | #endif |
Gopichand Nakkala | b7ed0a6 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 3814 | wdiStaParams->ucHtLdpcEnabled= wdaStaParams->htLdpcCapable; |
| 3815 | wdiStaParams->ucVhtLdpcEnabled = wdaStaParams->vhtLdpcCapable; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3816 | return ; |
| 3817 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3818 | /* |
| 3819 | * ------------------------------------------------------------------------- |
| 3820 | * CFG update to WDI |
| 3821 | * ------------------------------------------------------------------------- |
| 3822 | */ |
| 3823 | |
| 3824 | /* |
| 3825 | * FUNCTION: WDA_ConvertWniCfgIdToHALCfgId |
| 3826 | * Convert the WNI CFG ID to HAL CFG ID |
| 3827 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3828 | static inline v_U8_t WDA_ConvertWniCfgIdToHALCfgId(v_U32_t wniCfgId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3829 | { |
| 3830 | switch(wniCfgId) |
| 3831 | { |
| 3832 | case WNI_CFG_STA_ID: |
| 3833 | return QWLAN_HAL_CFG_STA_ID; |
| 3834 | case WNI_CFG_CURRENT_TX_ANTENNA: |
| 3835 | return QWLAN_HAL_CFG_CURRENT_TX_ANTENNA; |
| 3836 | case WNI_CFG_CURRENT_RX_ANTENNA: |
| 3837 | return QWLAN_HAL_CFG_CURRENT_RX_ANTENNA; |
| 3838 | case WNI_CFG_LOW_GAIN_OVERRIDE: |
| 3839 | return QWLAN_HAL_CFG_LOW_GAIN_OVERRIDE; |
| 3840 | case WNI_CFG_POWER_STATE_PER_CHAIN: |
| 3841 | return QWLAN_HAL_CFG_POWER_STATE_PER_CHAIN; |
| 3842 | case WNI_CFG_CAL_PERIOD: |
| 3843 | return QWLAN_HAL_CFG_CAL_PERIOD; |
| 3844 | case WNI_CFG_CAL_CONTROL: |
| 3845 | return QWLAN_HAL_CFG_CAL_CONTROL; |
| 3846 | case WNI_CFG_PROXIMITY: |
| 3847 | return QWLAN_HAL_CFG_PROXIMITY; |
| 3848 | case WNI_CFG_NETWORK_DENSITY: |
| 3849 | return QWLAN_HAL_CFG_NETWORK_DENSITY; |
| 3850 | case WNI_CFG_MAX_MEDIUM_TIME: |
| 3851 | return QWLAN_HAL_CFG_MAX_MEDIUM_TIME; |
| 3852 | case WNI_CFG_MAX_MPDUS_IN_AMPDU: |
| 3853 | return QWLAN_HAL_CFG_MAX_MPDUS_IN_AMPDU; |
| 3854 | case WNI_CFG_RTS_THRESHOLD: |
| 3855 | return QWLAN_HAL_CFG_RTS_THRESHOLD; |
| 3856 | case WNI_CFG_SHORT_RETRY_LIMIT: |
| 3857 | return QWLAN_HAL_CFG_SHORT_RETRY_LIMIT; |
| 3858 | case WNI_CFG_LONG_RETRY_LIMIT: |
| 3859 | return QWLAN_HAL_CFG_LONG_RETRY_LIMIT; |
| 3860 | case WNI_CFG_FRAGMENTATION_THRESHOLD: |
| 3861 | return QWLAN_HAL_CFG_FRAGMENTATION_THRESHOLD; |
| 3862 | case WNI_CFG_DYNAMIC_THRESHOLD_ZERO: |
| 3863 | return QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_ZERO; |
| 3864 | case WNI_CFG_DYNAMIC_THRESHOLD_ONE: |
| 3865 | return QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_ONE; |
| 3866 | case WNI_CFG_DYNAMIC_THRESHOLD_TWO: |
| 3867 | return QWLAN_HAL_CFG_DYNAMIC_THRESHOLD_TWO; |
| 3868 | case WNI_CFG_FIXED_RATE: |
| 3869 | return QWLAN_HAL_CFG_FIXED_RATE; |
| 3870 | case WNI_CFG_RETRYRATE_POLICY: |
| 3871 | return QWLAN_HAL_CFG_RETRYRATE_POLICY; |
| 3872 | case WNI_CFG_RETRYRATE_SECONDARY: |
| 3873 | return QWLAN_HAL_CFG_RETRYRATE_SECONDARY; |
| 3874 | case WNI_CFG_RETRYRATE_TERTIARY: |
| 3875 | return QWLAN_HAL_CFG_RETRYRATE_TERTIARY; |
| 3876 | case WNI_CFG_FORCE_POLICY_PROTECTION: |
| 3877 | return QWLAN_HAL_CFG_FORCE_POLICY_PROTECTION; |
| 3878 | case WNI_CFG_FIXED_RATE_MULTICAST_24GHZ: |
| 3879 | return QWLAN_HAL_CFG_FIXED_RATE_MULTICAST_24GHZ; |
| 3880 | case WNI_CFG_FIXED_RATE_MULTICAST_5GHZ: |
| 3881 | return QWLAN_HAL_CFG_FIXED_RATE_MULTICAST_5GHZ; |
| 3882 | case WNI_CFG_DEFAULT_RATE_INDEX_24GHZ: |
| 3883 | return QWLAN_HAL_CFG_DEFAULT_RATE_INDEX_24GHZ; |
| 3884 | case WNI_CFG_DEFAULT_RATE_INDEX_5GHZ: |
| 3885 | return QWLAN_HAL_CFG_DEFAULT_RATE_INDEX_5GHZ; |
| 3886 | case WNI_CFG_MAX_BA_SESSIONS: |
| 3887 | return QWLAN_HAL_CFG_MAX_BA_SESSIONS; |
| 3888 | case WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT: |
| 3889 | return QWLAN_HAL_CFG_PS_DATA_INACTIVITY_TIMEOUT; |
| 3890 | case WNI_CFG_PS_ENABLE_BCN_FILTER: |
| 3891 | return QWLAN_HAL_CFG_PS_ENABLE_BCN_FILTER; |
| 3892 | case WNI_CFG_PS_ENABLE_RSSI_MONITOR: |
| 3893 | return QWLAN_HAL_CFG_PS_ENABLE_RSSI_MONITOR; |
| 3894 | case WNI_CFG_NUM_BEACON_PER_RSSI_AVERAGE: |
| 3895 | return QWLAN_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE; |
| 3896 | case WNI_CFG_STATS_PERIOD: |
| 3897 | return QWLAN_HAL_CFG_STATS_PERIOD; |
| 3898 | case WNI_CFG_CFP_MAX_DURATION: |
| 3899 | return QWLAN_HAL_CFG_CFP_MAX_DURATION; |
| 3900 | #if 0 /*This is not part of CFG*/ |
| 3901 | case WNI_CFG_FRAME_TRANS_ENABLED: |
| 3902 | return QWLAN_HAL_CFG_FRAME_TRANS_ENABLED; |
| 3903 | #endif |
| 3904 | case WNI_CFG_DTIM_PERIOD: |
| 3905 | return QWLAN_HAL_CFG_DTIM_PERIOD; |
| 3906 | case WNI_CFG_EDCA_WME_ACBK: |
| 3907 | return QWLAN_HAL_CFG_EDCA_WMM_ACBK; |
| 3908 | case WNI_CFG_EDCA_WME_ACBE: |
| 3909 | return QWLAN_HAL_CFG_EDCA_WMM_ACBE; |
| 3910 | case WNI_CFG_EDCA_WME_ACVI: |
| 3911 | return QWLAN_HAL_CFG_EDCA_WMM_ACVI; |
| 3912 | case WNI_CFG_EDCA_WME_ACVO: |
| 3913 | return QWLAN_HAL_CFG_EDCA_WMM_ACVO; |
| 3914 | #if 0 |
| 3915 | case WNI_CFG_TELE_BCN_WAKEUP_EN: |
| 3916 | return QWLAN_HAL_CFG_TELE_BCN_WAKEUP_EN; |
| 3917 | case WNI_CFG_TELE_BCN_TRANS_LI: |
| 3918 | return QWLAN_HAL_CFG_TELE_BCN_TRANS_LI; |
| 3919 | case WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS: |
| 3920 | return QWLAN_HAL_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS; |
| 3921 | case WNI_CFG_TELE_BCN_MAX_LI: |
| 3922 | return QWLAN_HAL_CFG_TELE_BCN_MAX_LI; |
| 3923 | case WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS: |
| 3924 | return QWLAN_HAL_CFG_TELE_BCN_MAX_LI_IDLE_BCNS; |
| 3925 | #endif |
| 3926 | case WNI_CFG_ENABLE_CLOSE_LOOP: |
| 3927 | return QWLAN_HAL_CFG_ENABLE_CLOSE_LOOP; |
Madan Mohan Koyyalamudi | 33df569 | 2012-12-07 14:24:14 -0800 | [diff] [blame] | 3928 | case WNI_CFG_ENABLE_LPWR_IMG_TRANSITION: |
| 3929 | return QWLAN_HAL_CFG_ENABLE_LPWR_IMG_TRANSITION; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3930 | default: |
| 3931 | { |
| 3932 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 3933 | "There is no HAL CFG Id corresponding to WNI CFG Id: %d\n", |
| 3934 | wniCfgId); |
| 3935 | return VOS_STATUS_E_INVAL; |
| 3936 | } |
| 3937 | } |
| 3938 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3939 | /* |
| 3940 | * FUNCTION: WDA_UpdateCfgCallback |
| 3941 | * |
| 3942 | */ |
| 3943 | void WDA_UpdateCfgCallback(WDI_Status wdiStatus, void* pUserData) |
| 3944 | { |
| 3945 | tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData ; |
| 3946 | WDI_UpdateCfgReqParamsType *wdiCfgParam = |
| 3947 | (WDI_UpdateCfgReqParamsType *)pWDA->wdaWdiCfgApiMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3949 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3950 | /* |
| 3951 | * currently there is no response message is expected between PE and |
| 3952 | * WDA, Failure return from WDI is a ASSERT condition |
| 3953 | */ |
| 3954 | if(WDI_STATUS_SUCCESS != wdiStatus) |
| 3955 | { |
| 3956 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3957 | "%s: CFG (%d) config failure \n", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3958 | ((tHalCfg *)(wdiCfgParam->pConfigBuffer))->type); |
| 3959 | } |
| 3960 | |
| 3961 | vos_mem_free(wdiCfgParam->pConfigBuffer) ; |
| 3962 | vos_mem_free(pWDA->wdaWdiCfgApiMsgParam) ; |
| 3963 | pWDA->wdaWdiCfgApiMsgParam = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3964 | return ; |
| 3965 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3966 | /* |
| 3967 | * FUNCTION: WDA_UpdateCfg |
| 3968 | * |
| 3969 | */ |
| 3970 | VOS_STATUS WDA_UpdateCfg(tWDA_CbContext *pWDA, tSirMsgQ *cfgParam) |
| 3971 | { |
| 3972 | |
| 3973 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 3974 | tANI_U32 val =0; |
| 3975 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext) ; |
| 3976 | tHalCfg *configData; |
| 3977 | WDI_UpdateCfgReqParamsType *wdiCfgReqParam = NULL ; |
| 3978 | tANI_U8 *configDataValue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3979 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3980 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3981 | if (NULL == pMac ) |
| 3982 | { |
| 3983 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3984 | "%s: Invoked with invalid MAC context ", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3985 | return VOS_STATUS_E_FAILURE; |
| 3986 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3987 | if(WDA_START_STATE != pWDA->wdaState) |
| 3988 | { |
| 3989 | return VOS_STATUS_E_FAILURE; |
| 3990 | } |
| 3991 | |
| 3992 | if(NULL != pWDA->wdaWdiCfgApiMsgParam) |
| 3993 | { |
| 3994 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 3995 | "%s:wdaWdiCfgApiMsgParam is not NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3996 | VOS_ASSERT(0); |
| 3997 | return VOS_STATUS_E_FAILURE; |
| 3998 | } |
| 3999 | |
| 4000 | wdiCfgReqParam = (WDI_UpdateCfgReqParamsType *)vos_mem_malloc( |
| 4001 | sizeof(WDI_UpdateCfgReqParamsType)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4002 | if(NULL == wdiCfgReqParam) |
| 4003 | { |
| 4004 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4005 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4006 | VOS_ASSERT(0); |
| 4007 | return VOS_STATUS_E_NOMEM; |
| 4008 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4009 | wdiCfgReqParam->pConfigBuffer = vos_mem_malloc(sizeof(tHalCfg) + |
| 4010 | sizeof(tANI_U32)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4011 | if(NULL == wdiCfgReqParam->pConfigBuffer) |
| 4012 | { |
| 4013 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4014 | "%s: VOS MEM Alloc Failure \n", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4015 | vos_mem_free(wdiCfgReqParam); |
| 4016 | VOS_ASSERT(0); |
| 4017 | return VOS_STATUS_E_NOMEM; |
| 4018 | } |
| 4019 | |
| 4020 | /*convert the WNI CFG Id to HAL CFG Id*/ |
| 4021 | ((tHalCfg *)wdiCfgReqParam->pConfigBuffer)->type = |
| 4022 | WDA_ConvertWniCfgIdToHALCfgId(cfgParam->bodyval); |
| 4023 | |
| 4024 | /*TODO: revisit this for handling string parameters */ |
| 4025 | if (wlan_cfgGetInt(pMac, (tANI_U16) cfgParam->bodyval, |
| 4026 | &val) != eSIR_SUCCESS) |
| 4027 | { |
| 4028 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4029 | "Failed to cfg get id %d\n", cfgParam->bodyval); |
| 4030 | vos_mem_free(wdiCfgReqParam->pConfigBuffer); |
| 4031 | vos_mem_free(wdiCfgReqParam); |
| 4032 | return eSIR_FAILURE; |
| 4033 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4034 | ((tHalCfg *)wdiCfgReqParam->pConfigBuffer)->length = sizeof(tANI_U32); |
| 4035 | configData =((tHalCfg *)wdiCfgReqParam->pConfigBuffer) ; |
| 4036 | configDataValue = ((tANI_U8 *)configData + sizeof(tHalCfg)); |
| 4037 | vos_mem_copy( configDataValue, &val, sizeof(tANI_U32)); |
| 4038 | wdiCfgReqParam->wdiReqStatusCB = NULL ; |
| 4039 | |
| 4040 | /* store Params pass it to WDI */ |
| 4041 | pWDA->wdaWdiCfgApiMsgParam = (void *)wdiCfgReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4042 | #ifdef FEATURE_HAL_SUPPORT_DYNAMIC_UPDATE_CFG |
| 4043 | status = WDI_UpdateCfgReq(wdiCfgReqParam, |
| 4044 | (WDI_UpdateCfgRspCb )WDA_UpdateCfgCallback, pWDA) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4045 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4046 | { |
| 4047 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4048 | "Failure in Update CFG WDI API, free all the memory " ); |
| 4049 | vos_mem_free(wdiCfgReqParam->pConfigBuffer) ; |
| 4050 | vos_mem_free(pWDA->wdaWdiCfgApiMsgParam) ; |
| 4051 | pWDA->wdaWdiCfgApiMsgParam = NULL; |
| 4052 | /* Failure is not expected */ |
| 4053 | VOS_ASSERT(0) ; |
| 4054 | } |
| 4055 | #else |
| 4056 | vos_mem_free(wdiCfgReqParam->pConfigBuffer) ; |
| 4057 | vos_mem_free(pWDA->wdaWdiCfgApiMsgParam) ; |
| 4058 | pWDA->wdaWdiCfgApiMsgParam = NULL; |
| 4059 | #endif |
| 4060 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4061 | } |
| 4062 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4063 | VOS_STATUS WDA_GetWepKeysFromCfg( tWDA_CbContext *pWDA, |
| 4064 | v_U8_t *pDefaultKeyId, |
| 4065 | v_U8_t *pNumKeys, |
| 4066 | WDI_KeysType *pWdiKeys ) |
| 4067 | { |
| 4068 | v_U32_t i, j, defKeyId = 0; |
| 4069 | v_U32_t val = SIR_MAC_KEY_LENGTH; |
| 4070 | VOS_STATUS status = WDI_STATUS_SUCCESS; |
| 4071 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4072 | if (NULL == pMac ) |
| 4073 | { |
| 4074 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4075 | "%s: Invoked with invalid MAC context ", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4076 | return VOS_STATUS_E_FAILURE; |
| 4077 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4078 | if( eSIR_SUCCESS != wlan_cfgGetInt( pMac, WNI_CFG_WEP_DEFAULT_KEYID, |
| 4079 | &defKeyId )) |
| 4080 | { |
| 4081 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4082 | "Unable to retrieve defaultKeyId from CFG. Defaulting to 0..."); |
| 4083 | } |
| 4084 | |
| 4085 | *pDefaultKeyId = (v_U8_t)defKeyId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4086 | /* Need to extract ALL of the configured WEP Keys */ |
| 4087 | for( i = 0, j = 0; i < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; i++ ) |
| 4088 | { |
| 4089 | val = SIR_MAC_KEY_LENGTH; |
| 4090 | if( eSIR_SUCCESS != wlan_cfgGetStr( pMac, |
| 4091 | (v_U16_t) (WNI_CFG_WEP_DEFAULT_KEY_1 + i), |
| 4092 | pWdiKeys[j].key, |
| 4093 | &val )) |
| 4094 | { |
| 4095 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4096 | "WEP Key index [%d] may not configured in CFG\n",i); |
| 4097 | } |
| 4098 | else |
| 4099 | { |
| 4100 | pWdiKeys[j].keyId = (tANI_U8) i; |
| 4101 | /* |
| 4102 | * Actually, a DC (Don't Care) because |
| 4103 | * this is determined (and set) by PE/MLME |
| 4104 | */ |
| 4105 | pWdiKeys[j].unicast = 0; |
| 4106 | /* |
| 4107 | * Another DC (Don't Care) |
| 4108 | */ |
| 4109 | pWdiKeys[j].keyDirection = eSIR_TX_RX; |
| 4110 | /* Another DC (Don't Care). Unused for WEP */ |
| 4111 | pWdiKeys[j].paeRole = 0; |
| 4112 | /* Determined from wlan_cfgGetStr() above.*/ |
| 4113 | pWdiKeys[j].keyLength = (tANI_U16) val; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4114 | j++; |
| 4115 | *pNumKeys = (tANI_U8) j; |
| 4116 | } |
| 4117 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4118 | return status; |
| 4119 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4120 | /* |
| 4121 | * FUNCTION: WDA_SetBssKeyReqCallback |
| 4122 | * send SET BSS key RSP back to PE |
| 4123 | */ |
| 4124 | void WDA_SetBssKeyReqCallback(WDI_Status status, void* pUserData) |
| 4125 | { |
| 4126 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 4127 | tWDA_CbContext *pWDA; |
| 4128 | tSetBssKeyParams *setBssKeyParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4129 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4130 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4131 | if(NULL == pWdaParams) |
| 4132 | { |
| 4133 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4134 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4135 | VOS_ASSERT(0) ; |
| 4136 | return ; |
| 4137 | } |
| 4138 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 4139 | setBssKeyParams = (tSetBssKeyParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4140 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4141 | vos_mem_free(pWdaParams) ; |
| 4142 | setBssKeyParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4143 | WDA_SendMsg(pWDA, WDA_SET_BSSKEY_RSP, (void *)setBssKeyParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4144 | return ; |
| 4145 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4146 | /* |
| 4147 | * FUNCTION: WDA_ProcessSetBssKeyReq |
| 4148 | * Request to WDI for programming the BSS key( key for |
| 4149 | * broadcast/multicast frames Encryption) |
| 4150 | */ |
| 4151 | VOS_STATUS WDA_ProcessSetBssKeyReq(tWDA_CbContext *pWDA, |
| 4152 | tSetBssKeyParams *setBssKeyParams ) |
| 4153 | { |
| 4154 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4155 | WDI_SetBSSKeyReqParamsType *wdiSetBssKeyParam = |
| 4156 | (WDI_SetBSSKeyReqParamsType *)vos_mem_malloc( |
| 4157 | sizeof(WDI_SetBSSKeyReqParamsType)) ; |
| 4158 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4159 | v_U8_t keyIndex; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4160 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4161 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4162 | if(NULL == wdiSetBssKeyParam) |
| 4163 | { |
| 4164 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4165 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4166 | VOS_ASSERT(0); |
| 4167 | return VOS_STATUS_E_NOMEM; |
| 4168 | } |
| 4169 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 4170 | if(NULL == pWdaParams) |
| 4171 | { |
| 4172 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4173 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4174 | VOS_ASSERT(0); |
| 4175 | vos_mem_free(wdiSetBssKeyParam); |
| 4176 | return VOS_STATUS_E_NOMEM; |
| 4177 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4178 | vos_mem_zero(wdiSetBssKeyParam, sizeof(WDI_SetBSSKeyReqParamsType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4179 | /* copy set BSS params to WDI structure */ |
| 4180 | wdiSetBssKeyParam->wdiBSSKeyInfo.ucBssIdx = setBssKeyParams->bssIdx; |
| 4181 | wdiSetBssKeyParam->wdiBSSKeyInfo.wdiEncType = setBssKeyParams->encType; |
| 4182 | wdiSetBssKeyParam->wdiBSSKeyInfo.ucNumKeys = setBssKeyParams->numKeys; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4183 | if(setBssKeyParams->encType != eSIR_ED_NONE) |
| 4184 | { |
| 4185 | if( setBssKeyParams->numKeys == 0 && |
| 4186 | (( setBssKeyParams->encType == eSIR_ED_WEP40)|| |
| 4187 | setBssKeyParams->encType == eSIR_ED_WEP104)) |
| 4188 | { |
| 4189 | tANI_U8 defaultKeyId = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4190 | WDA_GetWepKeysFromCfg( pWDA, &defaultKeyId, |
| 4191 | &wdiSetBssKeyParam->wdiBSSKeyInfo.ucNumKeys, |
| 4192 | wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys ); |
| 4193 | } |
| 4194 | else |
| 4195 | { |
| 4196 | for( keyIndex=0; keyIndex < setBssKeyParams->numKeys; keyIndex++) |
| 4197 | { |
| 4198 | wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].keyId = |
| 4199 | setBssKeyParams->key[keyIndex].keyId; |
| 4200 | wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].unicast = |
| 4201 | setBssKeyParams->key[keyIndex].unicast; |
| 4202 | wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection = |
| 4203 | setBssKeyParams->key[keyIndex].keyDirection; |
| 4204 | vos_mem_copy(wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc, |
| 4205 | setBssKeyParams->key[keyIndex].keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 4206 | wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].paeRole = |
| 4207 | setBssKeyParams->key[keyIndex].paeRole; |
| 4208 | wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].keyLength = |
| 4209 | setBssKeyParams->key[keyIndex].keyLength; |
| 4210 | vos_mem_copy(wdiSetBssKeyParam->wdiBSSKeyInfo.aKeys[keyIndex].key, |
| 4211 | setBssKeyParams->key[keyIndex].key, |
| 4212 | SIR_MAC_MAX_KEY_LENGTH); |
| 4213 | } |
| 4214 | } |
| 4215 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4216 | wdiSetBssKeyParam->wdiBSSKeyInfo.ucSingleTidRc = |
| 4217 | setBssKeyParams->singleTidRc; |
| 4218 | wdiSetBssKeyParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4219 | /* Store set key pointer, as this will be used for response */ |
| 4220 | /* store Params pass it to WDI */ |
| 4221 | pWdaParams->pWdaContext = pWDA; |
| 4222 | pWdaParams->wdaMsgParam = setBssKeyParams; |
| 4223 | pWdaParams->wdaWdiApiMsgParam = wdiSetBssKeyParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4224 | status = WDI_SetBSSKeyReq(wdiSetBssKeyParam, |
| 4225 | (WDI_SetBSSKeyRspCb)WDA_SetBssKeyReqCallback ,pWdaParams); |
| 4226 | |
| 4227 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4228 | { |
| 4229 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4230 | "Failure in Set BSS Key Req WDI API, free all the memory " ); |
| 4231 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4232 | vos_mem_free(pWdaParams) ; |
| 4233 | setBssKeyParams->status = eSIR_FAILURE ; |
| 4234 | WDA_SendMsg(pWDA, WDA_SET_BSSKEY_RSP, (void *)setBssKeyParams, 0) ; |
| 4235 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4236 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4237 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4238 | /* |
| 4239 | * FUNCTION: WDA_RemoveBssKeyReqCallback |
| 4240 | * send SET BSS key RSP back to PE |
| 4241 | */ |
| 4242 | void WDA_RemoveBssKeyReqCallback(WDI_Status status, void* pUserData) |
| 4243 | { |
| 4244 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 4245 | tWDA_CbContext *pWDA; |
| 4246 | tRemoveBssKeyParams *removeBssKeyParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4247 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4248 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4249 | if(NULL == pWdaParams) |
| 4250 | { |
| 4251 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4252 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4253 | VOS_ASSERT(0) ; |
| 4254 | return ; |
| 4255 | } |
| 4256 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 4257 | removeBssKeyParams = (tRemoveBssKeyParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4258 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4259 | vos_mem_free(pWdaParams) ; |
| 4260 | |
| 4261 | removeBssKeyParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4262 | WDA_SendMsg(pWDA, WDA_REMOVE_BSSKEY_RSP, (void *)removeBssKeyParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4263 | return ; |
| 4264 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4265 | /* |
| 4266 | * FUNCTION: WDA_ProcessRemoveBssKeyReq |
| 4267 | * Request to WDI to remove the BSS key( key for broadcast/multicast |
| 4268 | * frames Encryption) |
| 4269 | */ |
| 4270 | VOS_STATUS WDA_ProcessRemoveBssKeyReq(tWDA_CbContext *pWDA, |
| 4271 | tRemoveBssKeyParams *removeBssKeyParams ) |
| 4272 | { |
| 4273 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4274 | WDI_RemoveBSSKeyReqParamsType *wdiRemoveBssKeyParam = |
| 4275 | (WDI_RemoveBSSKeyReqParamsType *)vos_mem_malloc( |
| 4276 | sizeof(WDI_RemoveBSSKeyReqParamsType)) ; |
| 4277 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4278 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4279 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4280 | if(NULL == wdiRemoveBssKeyParam) |
| 4281 | { |
| 4282 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4283 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4284 | VOS_ASSERT(0); |
| 4285 | return VOS_STATUS_E_NOMEM; |
| 4286 | } |
| 4287 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 4288 | if(NULL == pWdaParams) |
| 4289 | { |
| 4290 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4291 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4292 | VOS_ASSERT(0); |
| 4293 | vos_mem_free(wdiRemoveBssKeyParam); |
| 4294 | return VOS_STATUS_E_NOMEM; |
| 4295 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4296 | /* copy Remove BSS key params to WDI structure*/ |
| 4297 | wdiRemoveBssKeyParam->wdiKeyInfo.ucBssIdx = removeBssKeyParams->bssIdx; |
| 4298 | wdiRemoveBssKeyParam->wdiKeyInfo.wdiEncType = removeBssKeyParams->encType; |
| 4299 | wdiRemoveBssKeyParam->wdiKeyInfo.ucKeyId = removeBssKeyParams->keyId; |
| 4300 | wdiRemoveBssKeyParam->wdiKeyInfo.wdiWEPType = removeBssKeyParams->wepType; |
| 4301 | wdiRemoveBssKeyParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4302 | /* Store remove key pointer, as this will be used for response */ |
| 4303 | /* store Params pass it to WDI */ |
| 4304 | pWdaParams->pWdaContext = pWDA; |
| 4305 | pWdaParams->wdaMsgParam = removeBssKeyParams; |
| 4306 | pWdaParams->wdaWdiApiMsgParam = wdiRemoveBssKeyParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4307 | status = WDI_RemoveBSSKeyReq(wdiRemoveBssKeyParam, |
| 4308 | (WDI_RemoveBSSKeyRspCb)WDA_RemoveBssKeyReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4309 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4310 | { |
| 4311 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4312 | "Failure in Remove BSS Key Req WDI API, free all the memory " ); |
| 4313 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4314 | vos_mem_free(pWdaParams) ; |
| 4315 | removeBssKeyParams->status = eSIR_FAILURE ; |
| 4316 | WDA_SendMsg(pWDA, WDA_REMOVE_BSSKEY_RSP, (void *)removeBssKeyParams, 0) ; |
| 4317 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4318 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4319 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4320 | /* |
| 4321 | * FUNCTION: WDA_SetBssKeyReqCallback |
| 4322 | * send SET BSS key RSP back to PE |
| 4323 | */ |
| 4324 | void WDA_SetStaKeyReqCallback(WDI_Status status, void* pUserData) |
| 4325 | { |
| 4326 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 4327 | tWDA_CbContext *pWDA; |
| 4328 | tSetStaKeyParams *setStaKeyParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4329 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4330 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4331 | if(NULL == pWdaParams) |
| 4332 | { |
| 4333 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4334 | ,"%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4335 | VOS_ASSERT(0) ; |
| 4336 | return ; |
| 4337 | } |
| 4338 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 4339 | setStaKeyParams = (tSetStaKeyParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4340 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4341 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4342 | setStaKeyParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4343 | WDA_SendMsg(pWDA, WDA_SET_STAKEY_RSP, (void *)setStaKeyParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4344 | return ; |
| 4345 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4346 | /* |
| 4347 | * FUNCTION: WDA_ProcessSetStaKeyReq |
| 4348 | * Request to WDI for programming the STA key( key for Unicast frames |
| 4349 | * Encryption) |
| 4350 | */ |
| 4351 | VOS_STATUS WDA_ProcessSetStaKeyReq(tWDA_CbContext *pWDA, |
| 4352 | tSetStaKeyParams *setStaKeyParams ) |
| 4353 | { |
| 4354 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4355 | WDI_SetSTAKeyReqParamsType *wdiSetStaKeyParam = |
| 4356 | (WDI_SetSTAKeyReqParamsType *)vos_mem_malloc( |
| 4357 | sizeof(WDI_SetSTAKeyReqParamsType)) ; |
| 4358 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4359 | v_U8_t keyIndex; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4360 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4361 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4362 | if(NULL == wdiSetStaKeyParam) |
| 4363 | { |
| 4364 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4365 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4366 | VOS_ASSERT(0); |
| 4367 | return VOS_STATUS_E_NOMEM; |
| 4368 | } |
| 4369 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 4370 | if(NULL == pWdaParams) |
| 4371 | { |
| 4372 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4373 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4374 | VOS_ASSERT(0); |
| 4375 | vos_mem_free(wdiSetStaKeyParam); |
| 4376 | return VOS_STATUS_E_NOMEM; |
| 4377 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4378 | vos_mem_set(wdiSetStaKeyParam, sizeof(WDI_SetSTAKeyReqParamsType), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4379 | vos_mem_zero(wdiSetStaKeyParam, sizeof(WDI_SetSTAKeyReqParamsType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4380 | /* copy set STA key params to WDI structure */ |
| 4381 | wdiSetStaKeyParam->wdiKeyInfo.ucSTAIdx = setStaKeyParams->staIdx; |
| 4382 | wdiSetStaKeyParam->wdiKeyInfo.wdiEncType = setStaKeyParams->encType; |
| 4383 | wdiSetStaKeyParam->wdiKeyInfo.wdiWEPType = setStaKeyParams->wepType; |
| 4384 | wdiSetStaKeyParam->wdiKeyInfo.ucDefWEPIdx = setStaKeyParams->defWEPIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4385 | if(setStaKeyParams->encType != eSIR_ED_NONE) |
| 4386 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 4387 | if( (wdiSetStaKeyParam->wdiKeyInfo.wdiWEPType == WDI_WEP_STATIC) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4388 | (WDA_INVALID_KEY_INDEX == setStaKeyParams->defWEPIdx) && |
| 4389 | (eSYSTEM_AP_ROLE != pWDA->wdaGlobalSystemRole)) |
| 4390 | { |
| 4391 | WDA_GetWepKeysFromCfg( pWDA, |
| 4392 | &wdiSetStaKeyParam->wdiKeyInfo.ucDefWEPIdx, |
| 4393 | &wdiSetStaKeyParam->wdiKeyInfo.ucNumKeys, |
| 4394 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey ); |
| 4395 | } |
| 4396 | else |
| 4397 | { |
| 4398 | #ifdef WLAN_SOFTAP_FEATURE |
| 4399 | for( keyIndex=0; keyIndex < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; |
| 4400 | keyIndex++) |
| 4401 | { |
| 4402 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyId = |
| 4403 | setStaKeyParams->key[keyIndex].keyId; |
| 4404 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].unicast = |
| 4405 | setStaKeyParams->key[keyIndex].unicast; |
| 4406 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyDirection = |
| 4407 | setStaKeyParams->key[keyIndex].keyDirection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4408 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
| 4409 | setStaKeyParams->key[keyIndex].keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 4410 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].paeRole = |
| 4411 | setStaKeyParams->key[keyIndex].paeRole; |
| 4412 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyLength = |
| 4413 | setStaKeyParams->key[keyIndex].keyLength; |
| 4414 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].key, |
| 4415 | setStaKeyParams->key[keyIndex].key, SIR_MAC_MAX_KEY_LENGTH); |
| 4416 | /* set default index to index which have key direction as WDI_TX_DEFAULT */ |
| 4417 | if (WDI_TX_DEFAULT == wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyDirection) |
| 4418 | { |
| 4419 | wdiSetStaKeyParam->wdiKeyInfo.ucDefWEPIdx = keyIndex; |
| 4420 | } |
| 4421 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4422 | wdiSetStaKeyParam->wdiKeyInfo.ucNumKeys = |
| 4423 | SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; |
| 4424 | #else |
| 4425 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyId = |
| 4426 | setStaKeyParams->key.keyId; |
| 4427 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].unicast = |
| 4428 | setStaKeyParams->key.unicast; |
| 4429 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyDirection = |
| 4430 | setStaKeyParams->key.keyDirection; |
| 4431 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyRsc, |
| 4432 | setStaKeyParams->key.keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 4433 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].paeRole = |
| 4434 | setStaKeyParams->key.paeRole; |
| 4435 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyLength = |
| 4436 | setStaKeyParams->key.keyLength; |
| 4437 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].key, |
| 4438 | setStaKeyParams->key[keyIndex].key, |
| 4439 | SIR_MAC_MAX_KEY_LENGTH); |
| 4440 | wdiSetStaKeyParam->wdiKeyInfo.ucNumKeys = 1; |
| 4441 | #endif |
| 4442 | } |
| 4443 | } |
| 4444 | wdiSetStaKeyParam->wdiKeyInfo.ucSingleTidRc = setStaKeyParams->singleTidRc; |
| 4445 | wdiSetStaKeyParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4446 | /* Store set key pointer, as this will be used for response */ |
| 4447 | /* store Params pass it to WDI */ |
| 4448 | pWdaParams->pWdaContext = pWDA; |
| 4449 | pWdaParams->wdaMsgParam = setStaKeyParams; |
| 4450 | pWdaParams->wdaWdiApiMsgParam = wdiSetStaKeyParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4451 | status = WDI_SetSTAKeyReq(wdiSetStaKeyParam, |
| 4452 | (WDI_SetSTAKeyRspCb)WDA_SetStaKeyReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4453 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4454 | { |
| 4455 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4456 | "Failure in set STA Key Req WDI API, free all the memory " ); |
| 4457 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4458 | vos_mem_free(pWdaParams) ; |
| 4459 | setStaKeyParams->status = eSIR_FAILURE ; |
| 4460 | WDA_SendMsg(pWDA, WDA_SET_STAKEY_RSP, (void *)setStaKeyParams, 0) ; |
| 4461 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4462 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4463 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4464 | /* |
| 4465 | * FUNCTION: WDA_SetBcastStaKeyReqCallback |
| 4466 | * send SET Bcast STA key RSP back to PE |
| 4467 | */ |
| 4468 | void WDA_SetBcastStaKeyReqCallback(WDI_Status status, void* pUserData) |
| 4469 | { |
| 4470 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 4471 | tWDA_CbContext *pWDA; |
| 4472 | tSetStaKeyParams *setStaKeyParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4473 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4474 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4475 | if(NULL == pWdaParams) |
| 4476 | { |
| 4477 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4478 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4479 | VOS_ASSERT(0) ; |
| 4480 | return ; |
| 4481 | } |
| 4482 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 4483 | setStaKeyParams = (tSetStaKeyParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4484 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4485 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4486 | setStaKeyParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4487 | WDA_SendMsg(pWDA, WDA_SET_STA_BCASTKEY_RSP, (void *)setStaKeyParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4488 | return ; |
| 4489 | } |
| 4490 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4491 | /* |
| 4492 | * FUNCTION: WDA_ProcessSetBcastStaKeyReq |
| 4493 | * Request to WDI for programming the Bcast STA key( key for Broadcast frames |
| 4494 | * Encryption) |
| 4495 | */ |
| 4496 | VOS_STATUS WDA_ProcessSetBcastStaKeyReq(tWDA_CbContext *pWDA, |
| 4497 | tSetStaKeyParams *setStaKeyParams ) |
| 4498 | { |
| 4499 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4500 | WDI_SetSTAKeyReqParamsType *wdiSetStaKeyParam = |
| 4501 | (WDI_SetSTAKeyReqParamsType *)vos_mem_malloc( |
| 4502 | sizeof(WDI_SetSTAKeyReqParamsType)) ; |
| 4503 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4504 | v_U8_t keyIndex; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4505 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4506 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4507 | if(NULL == wdiSetStaKeyParam) |
| 4508 | { |
| 4509 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4510 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4511 | VOS_ASSERT(0); |
| 4512 | return VOS_STATUS_E_NOMEM; |
| 4513 | } |
| 4514 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 4515 | if(NULL == pWdaParams) |
| 4516 | { |
| 4517 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4518 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4519 | VOS_ASSERT(0); |
| 4520 | vos_mem_free(wdiSetStaKeyParam); |
| 4521 | return VOS_STATUS_E_NOMEM; |
| 4522 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4523 | vos_mem_set(wdiSetStaKeyParam, sizeof(WDI_SetSTAKeyReqParamsType), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4524 | vos_mem_zero(wdiSetStaKeyParam, sizeof(WDI_SetSTAKeyReqParamsType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4525 | /* copy set STA key params to WDI structure */ |
| 4526 | wdiSetStaKeyParam->wdiKeyInfo.ucSTAIdx = setStaKeyParams->staIdx; |
| 4527 | wdiSetStaKeyParam->wdiKeyInfo.wdiEncType = setStaKeyParams->encType; |
| 4528 | wdiSetStaKeyParam->wdiKeyInfo.wdiWEPType = setStaKeyParams->wepType; |
| 4529 | wdiSetStaKeyParam->wdiKeyInfo.ucDefWEPIdx = setStaKeyParams->defWEPIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4530 | if(setStaKeyParams->encType != eSIR_ED_NONE) |
| 4531 | { |
| 4532 | #ifdef WLAN_SOFTAP_FEATURE |
| 4533 | for( keyIndex=0; keyIndex < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; |
| 4534 | keyIndex++) |
| 4535 | { |
| 4536 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyId = |
| 4537 | setStaKeyParams->key[keyIndex].keyId; |
| 4538 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].unicast = |
| 4539 | setStaKeyParams->key[keyIndex].unicast; |
| 4540 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyDirection = |
| 4541 | setStaKeyParams->key[keyIndex].keyDirection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4542 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
| 4543 | setStaKeyParams->key[keyIndex].keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 4544 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].paeRole = |
| 4545 | setStaKeyParams->key[keyIndex].paeRole; |
| 4546 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].keyLength = |
| 4547 | setStaKeyParams->key[keyIndex].keyLength; |
| 4548 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[keyIndex].key, |
| 4549 | setStaKeyParams->key[keyIndex].key, SIR_MAC_MAX_KEY_LENGTH); |
| 4550 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4551 | wdiSetStaKeyParam->wdiKeyInfo.ucNumKeys = |
| 4552 | SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; |
| 4553 | #else |
| 4554 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyId = |
| 4555 | setStaKeyParams->key.keyId; |
| 4556 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].unicast = |
| 4557 | setStaKeyParams->key.unicast; |
| 4558 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyDirection = |
| 4559 | setStaKeyParams->key.keyDirection; |
| 4560 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyRsc, |
| 4561 | setStaKeyParams->key.keyRsc, WLAN_MAX_KEY_RSC_LEN); |
| 4562 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].paeRole = |
| 4563 | setStaKeyParams->key.paeRole; |
| 4564 | wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].keyLength = |
| 4565 | setStaKeyParams->key.keyLength; |
| 4566 | vos_mem_copy(wdiSetStaKeyParam->wdiKeyInfo.wdiKey[0].key, |
| 4567 | setStaKeyParams->key[keyIndex].key, |
| 4568 | SIR_MAC_MAX_KEY_LENGTH); |
| 4569 | wdiSetStaKeyParam->wdiKeyInfo.ucNumKeys = 1; |
| 4570 | #endif |
| 4571 | } |
| 4572 | wdiSetStaKeyParam->wdiKeyInfo.ucSingleTidRc = setStaKeyParams->singleTidRc; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4573 | /* Store set key pointer, as this will be used for response */ |
| 4574 | /* store Params pass it to WDI */ |
| 4575 | pWdaParams->pWdaContext = pWDA; |
| 4576 | pWdaParams->wdaMsgParam = setStaKeyParams; |
| 4577 | pWdaParams->wdaWdiApiMsgParam = wdiSetStaKeyParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4578 | status = WDI_SetSTABcastKeyReq(wdiSetStaKeyParam, |
| 4579 | (WDI_SetSTAKeyRspCb)WDA_SetBcastStaKeyReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4580 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4581 | { |
| 4582 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4583 | "Failure in set BCAST STA Key Req WDI API, free all the memory " ); |
| 4584 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4585 | vos_mem_free(pWdaParams) ; |
| 4586 | setStaKeyParams->status = eSIR_FAILURE ; |
| 4587 | WDA_SendMsg(pWDA, WDA_SET_STA_BCASTKEY_RSP, (void *)setStaKeyParams, 0) ; |
| 4588 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4589 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4590 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4591 | /* |
| 4592 | * FUNCTION: WDA_RemoveStaKeyReqCallback |
| 4593 | * send SET BSS key RSP back to PE |
| 4594 | */ |
| 4595 | void WDA_RemoveStaKeyReqCallback(WDI_Status status, void* pUserData) |
| 4596 | { |
| 4597 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 4598 | tWDA_CbContext *pWDA; |
| 4599 | tRemoveStaKeyParams *removeStaKeyParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4600 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4601 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4602 | if(NULL == pWdaParams) |
| 4603 | { |
| 4604 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4605 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4606 | VOS_ASSERT(0) ; |
| 4607 | return ; |
| 4608 | } |
| 4609 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 4610 | removeStaKeyParams = (tRemoveStaKeyParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4611 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4612 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4613 | removeStaKeyParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4614 | WDA_SendMsg(pWDA, WDA_REMOVE_STAKEY_RSP, (void *)removeStaKeyParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4615 | return ; |
| 4616 | } |
| 4617 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4618 | /* |
| 4619 | * FUNCTION: WDA_ProcessRemoveStaKeyReq |
| 4620 | * Request to WDI to remove the STA key( key for Unicast frames Encryption) |
| 4621 | */ |
| 4622 | VOS_STATUS WDA_ProcessRemoveStaKeyReq(tWDA_CbContext *pWDA, |
| 4623 | tRemoveStaKeyParams *removeStaKeyParams ) |
| 4624 | { |
| 4625 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4626 | WDI_RemoveSTAKeyReqParamsType *wdiRemoveStaKeyParam = |
| 4627 | (WDI_RemoveSTAKeyReqParamsType *)vos_mem_malloc( |
| 4628 | sizeof(WDI_RemoveSTAKeyReqParamsType)) ; |
| 4629 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4630 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4631 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4632 | if(NULL == wdiRemoveStaKeyParam) |
| 4633 | { |
| 4634 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4635 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4636 | VOS_ASSERT(0); |
| 4637 | return VOS_STATUS_E_NOMEM; |
| 4638 | } |
| 4639 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 4640 | if(NULL == pWdaParams) |
| 4641 | { |
| 4642 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4643 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4644 | VOS_ASSERT(0); |
| 4645 | vos_mem_free(wdiRemoveStaKeyParam); |
| 4646 | return VOS_STATUS_E_NOMEM; |
| 4647 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4648 | /* copy remove STA key params to WDI structure*/ |
| 4649 | wdiRemoveStaKeyParam->wdiKeyInfo.ucSTAIdx = removeStaKeyParams->staIdx; |
| 4650 | wdiRemoveStaKeyParam->wdiKeyInfo.wdiEncType = removeStaKeyParams->encType; |
| 4651 | wdiRemoveStaKeyParam->wdiKeyInfo.ucKeyId = removeStaKeyParams->keyId; |
| 4652 | wdiRemoveStaKeyParam->wdiKeyInfo.ucUnicast = removeStaKeyParams->unicast; |
| 4653 | wdiRemoveStaKeyParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4654 | /* Store remove key pointer, as this will be used for response */ |
| 4655 | /* store Params pass it to WDI */ |
| 4656 | pWdaParams->pWdaContext = pWDA; |
| 4657 | pWdaParams->wdaMsgParam = removeStaKeyParams; |
| 4658 | pWdaParams->wdaWdiApiMsgParam = wdiRemoveStaKeyParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4659 | status = WDI_RemoveSTAKeyReq(wdiRemoveStaKeyParam, |
| 4660 | (WDI_RemoveSTAKeyRspCb)WDA_RemoveStaKeyReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4661 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4662 | { |
| 4663 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4664 | "Failure in remove STA Key Req WDI API, free all the memory " ); |
| 4665 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 4666 | vos_mem_free(pWdaParams) ; |
| 4667 | removeStaKeyParams->status = eSIR_FAILURE ; |
| 4668 | WDA_SendMsg(pWDA, WDA_REMOVE_STAKEY_RSP, (void *)removeStaKeyParams, 0) ; |
| 4669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4670 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4671 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4672 | /* |
| 4673 | * FUNCTION: WDA_IsHandleSetLinkStateReq |
| 4674 | * Update the WDA state and return the status to handle this message or not |
| 4675 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4676 | WDA_processSetLinkStateStatus WDA_IsHandleSetLinkStateReq( |
| 4677 | tWDA_CbContext *pWDA, |
| 4678 | tLinkStateParams *linkStateParams) |
| 4679 | { |
| 4680 | WDA_processSetLinkStateStatus status = WDA_PROCESS_SET_LINK_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4681 | switch(linkStateParams->state) |
| 4682 | { |
| 4683 | case eSIR_LINK_PREASSOC_STATE: |
| 4684 | case eSIR_LINK_BTAMP_PREASSOC_STATE: |
| 4685 | /* |
| 4686 | * set the WDA state to PRE ASSOC |
| 4687 | * copy the BSSID into pWDA to use it in join request and return, |
| 4688 | * No need to handle these messages. |
| 4689 | */ |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4690 | if( !WDA_IS_NULL_MAC_ADDRESS(linkStateParams->bssid) ) |
| 4691 | { |
| 4692 | vos_mem_copy(pWDA->macBSSID,linkStateParams->bssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4693 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4694 | } |
| 4695 | else |
| 4696 | { |
| 4697 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4698 | "%s: BSSID in set link state is NULL ", __func__); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4699 | VOS_ASSERT(0); |
| 4700 | } |
| 4701 | |
| 4702 | if( !WDA_IS_NULL_MAC_ADDRESS(linkStateParams->selfMacAddr) ) |
| 4703 | { |
| 4704 | vos_mem_copy(pWDA->macSTASelf,linkStateParams->selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4705 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4706 | } |
| 4707 | else |
| 4708 | { |
| 4709 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4710 | "%s: self mac address in set link state is NULL ", __func__); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4711 | VOS_ASSERT(0); |
| 4712 | } |
| 4713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4714 | /* UMAC is issuing the setlink state with PREASSOC twice (before set |
| 4715 | *channel and after ) so reset the WDA state to ready when the second |
| 4716 | * time UMAC issue the link state with PREASSOC |
| 4717 | */ |
| 4718 | if(WDA_PRE_ASSOC_STATE == pWDA->wdaState) |
| 4719 | { |
| 4720 | /* RESET WDA state back to WDA_READY_STATE */ |
| 4721 | pWDA->wdaState = WDA_READY_STATE; |
| 4722 | } |
| 4723 | else |
| 4724 | { |
| 4725 | pWDA->wdaState = WDA_PRE_ASSOC_STATE; |
| 4726 | } |
| 4727 | //populate linkState info in WDACbCtxt |
| 4728 | pWDA->linkState = linkStateParams->state; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4729 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4730 | default: |
| 4731 | if(pWDA->wdaState != WDA_READY_STATE) |
| 4732 | { |
Madan Mohan Koyyalamudi | 68f5354 | 2012-09-24 14:19:32 -0700 | [diff] [blame] | 4733 | /*If WDA_SET_LINK_STATE is recieved with any other link state apart |
| 4734 | *from eSIR_LINK_PREASSOC_STATE and eSIR_LINK_BTAMP_PREASSOC_STATE when |
| 4735 | *pWDA->wdaState is in WDA_PRE_ASSOC_STATE(This can happen only in |
| 4736 | *error cases) so reset the WDA state to WDA_READY_STATE to avoid |
| 4737 | *the ASSERT in WDA_Stop during module unload.*/ |
| 4738 | if (pWDA->wdaState == WDA_PRE_ASSOC_STATE) |
| 4739 | { |
| 4740 | pWDA->wdaState = WDA_READY_STATE; |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4741 | /* Don't ignore the set link in this case*/ |
Madan Mohan Koyyalamudi | 68f5354 | 2012-09-24 14:19:32 -0700 | [diff] [blame] | 4742 | } |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4743 | else |
| 4744 | { |
| 4745 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 68f5354 | 2012-09-24 14:19:32 -0700 | [diff] [blame] | 4746 | "Set link state called when WDA is not in READY STATE " ); |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 4747 | status = WDA_IGNORE_SET_LINK_STATE; |
| 4748 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4749 | } |
| 4750 | break; |
| 4751 | } |
| 4752 | |
| 4753 | return status; |
| 4754 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4755 | /* |
| 4756 | * FUNCTION: WDA_SetLinkStateCallback |
| 4757 | * call back function for set link state from WDI |
| 4758 | */ |
| 4759 | void WDA_SetLinkStateCallback(WDI_Status status, void* pUserData) |
| 4760 | { |
| 4761 | tWDA_CbContext *pWDA; |
| 4762 | tLinkStateParams *linkStateParams; |
| 4763 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4764 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4765 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4766 | if(NULL == pWdaParams) |
| 4767 | { |
| 4768 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4769 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4770 | VOS_ASSERT(0) ; |
| 4771 | return ; |
| 4772 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4773 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4774 | linkStateParams = (tLinkStateParams *)pWdaParams->wdaMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4775 | /* |
| 4776 | * In STA mode start the BA activity check timer after association |
| 4777 | * and in AP mode start BA activity check timer after BSS start */ |
| 4778 | if( ((linkStateParams->state == eSIR_LINK_POSTASSOC_STATE) && |
| 4779 | status == WDI_STATUS_SUCCESS) || ((status == WDI_STATUS_SUCCESS) && |
| 4780 | (linkStateParams->state == eSIR_LINK_AP_STATE)) ) |
| 4781 | { |
| 4782 | WDA_START_TIMER(&pWDA->wdaTimers.baActivityChkTmr); |
| 4783 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4784 | WDA_SendMsg(pWDA, WDA_SET_LINK_STATE_RSP, (void *)linkStateParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4785 | /* |
| 4786 | * No respone required for WDA_SET_LINK_STATE so free the request |
| 4787 | * param here |
| 4788 | */ |
| 4789 | if( pWdaParams != NULL ) |
| 4790 | { |
| 4791 | if( pWdaParams->wdaWdiApiMsgParam != NULL ) |
| 4792 | { |
| 4793 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 4794 | } |
| 4795 | vos_mem_free(pWdaParams); |
| 4796 | } |
| 4797 | return ; |
| 4798 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4799 | /* |
| 4800 | * FUNCTION: WDA_ProcessSetLinkState |
| 4801 | * Request to WDI to set the link status. |
| 4802 | */ |
| 4803 | VOS_STATUS WDA_ProcessSetLinkState(tWDA_CbContext *pWDA, |
| 4804 | tLinkStateParams *linkStateParams) |
| 4805 | { |
| 4806 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4807 | WDI_SetLinkReqParamsType *wdiSetLinkStateParam = |
| 4808 | (WDI_SetLinkReqParamsType *)vos_mem_malloc( |
| 4809 | sizeof(WDI_SetLinkReqParamsType)) ; |
| 4810 | tWDA_ReqParams *pWdaParams ; |
| 4811 | tpAniSirGlobal pMac; |
| 4812 | pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); |
| 4813 | |
| 4814 | if(NULL == pMac) |
| 4815 | { |
| 4816 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4817 | "%s:pMac is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4818 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 68f5354 | 2012-09-24 14:19:32 -0700 | [diff] [blame] | 4819 | vos_mem_free(wdiSetLinkStateParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4820 | return VOS_STATUS_E_FAILURE; |
| 4821 | } |
| 4822 | |
| 4823 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4824 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4825 | if(NULL == wdiSetLinkStateParam) |
| 4826 | { |
| 4827 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4828 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4829 | VOS_ASSERT(0); |
| 4830 | return VOS_STATUS_E_NOMEM; |
| 4831 | } |
| 4832 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 4833 | if(NULL == pWdaParams) |
| 4834 | { |
| 4835 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4836 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4837 | VOS_ASSERT(0); |
| 4838 | vos_mem_free(wdiSetLinkStateParam); |
| 4839 | return VOS_STATUS_E_NOMEM; |
| 4840 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4841 | if(WDA_IGNORE_SET_LINK_STATE == |
| 4842 | WDA_IsHandleSetLinkStateReq(pWDA,linkStateParams)) |
| 4843 | { |
| 4844 | status = WDI_STATUS_E_FAILURE; |
| 4845 | } |
| 4846 | else |
| 4847 | { |
| 4848 | vos_mem_copy(wdiSetLinkStateParam->wdiLinkInfo.macBSSID, |
| 4849 | linkStateParams->bssid, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4850 | vos_mem_copy(wdiSetLinkStateParam->wdiLinkInfo.macSelfStaMacAddr, |
| 4851 | linkStateParams->selfMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4852 | wdiSetLinkStateParam->wdiLinkInfo.wdiLinkState = linkStateParams->state; |
| 4853 | wdiSetLinkStateParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4854 | pWdaParams->pWdaContext = pWDA; |
| 4855 | /* Store remove key pointer, as this will be used for response */ |
| 4856 | pWdaParams->wdaMsgParam = (void *)linkStateParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4857 | /* store Params pass it to WDI */ |
| 4858 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiSetLinkStateParam ; |
| 4859 | /* Stop Timer only other than GO role and concurrent session */ |
| 4860 | if( (linkStateParams->state == eSIR_LINK_IDLE_STATE) |
| 4861 | && !vos_concurrent_sessions_running() && |
| 4862 | (wdaGetGlobalSystemRole(pMac) != eSYSTEM_AP_ROLE) ) |
| 4863 | { |
| 4864 | WDA_STOP_TIMER(&pWDA->wdaTimers.baActivityChkTmr); |
| 4865 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4866 | status = WDI_SetLinkStateReq(wdiSetLinkStateParam, |
| 4867 | (WDI_SetLinkStateRspCb)WDA_SetLinkStateCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4868 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4869 | { |
| 4870 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4871 | "Failure in set link state Req WDI API, free all the memory " ); |
| 4872 | } |
| 4873 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4874 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4875 | { |
| 4876 | vos_mem_free(wdiSetLinkStateParam) ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4877 | WDA_SendMsg(pWDA, WDA_SET_LINK_STATE_RSP, (void *)linkStateParams, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4878 | vos_mem_free(pWdaParams); |
| 4879 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4880 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 4881 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4882 | /* |
| 4883 | * FUNCTION: WDA_GetStatsReqParamsCallback |
| 4884 | * send the response to PE with Stats received from WDI |
| 4885 | */ |
| 4886 | void WDA_GetStatsReqParamsCallback( |
| 4887 | WDI_GetStatsRspParamsType *wdiGetStatsRsp, |
| 4888 | void* pUserData) |
| 4889 | { |
| 4890 | tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData ; |
| 4891 | tAniGetPEStatsRsp *pGetPEStatsRspParams; |
| 4892 | |
| 4893 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4894 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4895 | pGetPEStatsRspParams = |
| 4896 | (tAniGetPEStatsRsp *)vos_mem_malloc(sizeof(tAniGetPEStatsRsp) + |
| 4897 | (wdiGetStatsRsp->usMsgLen - sizeof(WDI_GetStatsRspParamsType))); |
| 4898 | |
| 4899 | if(NULL == pGetPEStatsRspParams) |
| 4900 | { |
| 4901 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4902 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4903 | VOS_ASSERT(0); |
| 4904 | return; |
| 4905 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4906 | vos_mem_set(pGetPEStatsRspParams, wdiGetStatsRsp->usMsgLen, 0); |
| 4907 | pGetPEStatsRspParams->msgType = wdiGetStatsRsp->usMsgType; |
| 4908 | pGetPEStatsRspParams->msgLen = sizeof(tAniGetPEStatsRsp) + |
| 4909 | (wdiGetStatsRsp->usMsgLen - sizeof(WDI_GetStatsRspParamsType)); |
| 4910 | pGetPEStatsRspParams->msgLen = wdiGetStatsRsp->usMsgLen + sizeof(tANI_U8); |
| 4911 | |
| 4912 | //Fill the Session Id Properly in PE |
| 4913 | pGetPEStatsRspParams->sessionId = 0; |
| 4914 | pGetPEStatsRspParams->rc = |
| 4915 | CONVERT_WDI2VOS_STATUS(wdiGetStatsRsp->wdiStatus); |
| 4916 | pGetPEStatsRspParams->staId = wdiGetStatsRsp->ucSTAIdx; |
| 4917 | pGetPEStatsRspParams->statsMask = wdiGetStatsRsp->uStatsMask; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4918 | vos_mem_copy( pGetPEStatsRspParams + 1, |
| 4919 | wdiGetStatsRsp + 1, |
| 4920 | wdiGetStatsRsp->usMsgLen - sizeof(WDI_GetStatsRspParamsType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4921 | /* send response to UMAC*/ |
| 4922 | WDA_SendMsg(pWDA, WDA_GET_STATISTICS_RSP, pGetPEStatsRspParams , 0) ; |
| 4923 | |
| 4924 | return; |
| 4925 | } |
| 4926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4927 | /* |
| 4928 | * FUNCTION: WDA_ProcessGetStatsReq |
| 4929 | * Request to WDI to get the statistics |
| 4930 | */ |
| 4931 | VOS_STATUS WDA_ProcessGetStatsReq(tWDA_CbContext *pWDA, |
| 4932 | tAniGetPEStatsReq *pGetStatsParams) |
| 4933 | { |
| 4934 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 4935 | WDI_GetStatsReqParamsType wdiGetStatsParam; |
| 4936 | tAniGetPEStatsRsp *pGetPEStatsRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4937 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4938 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4939 | wdiGetStatsParam.wdiGetStatsParamsInfo.ucSTAIdx = |
| 4940 | pGetStatsParams->staId; |
| 4941 | wdiGetStatsParam.wdiGetStatsParamsInfo.uStatsMask = |
| 4942 | pGetStatsParams->statsMask; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4943 | wdiGetStatsParam.wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4944 | status = WDI_GetStatsReq(&wdiGetStatsParam, |
| 4945 | (WDI_GetStatsRspCb)WDA_GetStatsReqParamsCallback, pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4946 | if(IS_WDI_STATUS_FAILURE(status)) |
| 4947 | { |
| 4948 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 4949 | "Failure in Get Stats Req WDI API, free all the memory " ); |
| 4950 | pGetPEStatsRspParams = |
| 4951 | (tAniGetPEStatsRsp *)vos_mem_malloc(sizeof(tAniGetPEStatsRsp)); |
| 4952 | if(NULL == pGetPEStatsRspParams) |
| 4953 | { |
| 4954 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4955 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4956 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 4957 | vos_mem_free(pGetStatsParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4958 | return VOS_STATUS_E_NOMEM; |
| 4959 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4960 | pGetPEStatsRspParams->msgType = WDA_GET_STATISTICS_RSP; |
| 4961 | pGetPEStatsRspParams->msgLen = sizeof(tAniGetPEStatsRsp); |
| 4962 | pGetPEStatsRspParams->staId = pGetStatsParams->staId; |
| 4963 | pGetPEStatsRspParams->rc = eSIR_FAILURE; |
| 4964 | WDA_SendMsg(pWDA, WDA_GET_STATISTICS_RSP, |
| 4965 | (void *)pGetPEStatsRspParams, 0) ; |
| 4966 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4967 | /* Free the request message */ |
| 4968 | vos_mem_free(pGetStatsParams); |
| 4969 | return CONVERT_WDI2VOS_STATUS(status); |
| 4970 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4971 | /* |
| 4972 | * FUNCTION: WDA_UpdateEDCAParamCallback |
| 4973 | * call back function for Update EDCA params from WDI |
| 4974 | */ |
| 4975 | void WDA_UpdateEDCAParamCallback(WDI_Status status, void* pUserData) |
| 4976 | { |
| 4977 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 4978 | tEdcaParams *pEdcaParams; |
| 4979 | |
| 4980 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4981 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4982 | if(NULL == pWdaParams) |
| 4983 | { |
| 4984 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 4985 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4986 | VOS_ASSERT(0) ; |
| 4987 | return ; |
| 4988 | } |
| 4989 | pEdcaParams = (tEdcaParams *)pWdaParams->wdaMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4990 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 4991 | vos_mem_free(pWdaParams); |
| 4992 | vos_mem_free(pEdcaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4993 | return ; |
| 4994 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4995 | /* |
| 4996 | * FUNCTION: WDA_ProcessUpdateEDCAParamReq |
| 4997 | * Request to WDI to Update the EDCA params. |
| 4998 | */ |
| 4999 | VOS_STATUS WDA_ProcessUpdateEDCAParamReq(tWDA_CbContext *pWDA, |
| 5000 | tEdcaParams *pEdcaParams) |
| 5001 | { |
| 5002 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5003 | WDI_UpdateEDCAParamsType *wdiEdcaParam = |
| 5004 | (WDI_UpdateEDCAParamsType *)vos_mem_malloc( |
| 5005 | sizeof(WDI_UpdateEDCAParamsType)) ; |
| 5006 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5007 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5008 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5009 | if(NULL == wdiEdcaParam) |
| 5010 | { |
| 5011 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5012 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5013 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 5014 | vos_mem_free(pEdcaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5015 | return VOS_STATUS_E_NOMEM; |
| 5016 | } |
| 5017 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5018 | if(NULL == pWdaParams) |
| 5019 | { |
| 5020 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5021 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5022 | VOS_ASSERT(0); |
| 5023 | vos_mem_free(wdiEdcaParam); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 5024 | vos_mem_free(pEdcaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5025 | return VOS_STATUS_E_NOMEM; |
| 5026 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5027 | wdiEdcaParam->wdiEDCAInfo.ucBssIdx = pEdcaParams->bssIdx; |
| 5028 | wdiEdcaParam->wdiEDCAInfo.ucEDCAParamsValid = pEdcaParams->highPerformance; |
| 5029 | WDA_UpdateEdcaParamsForAC(pWDA, &wdiEdcaParam->wdiEDCAInfo.wdiEdcaBEInfo, |
| 5030 | &pEdcaParams->acbe); |
| 5031 | WDA_UpdateEdcaParamsForAC(pWDA, &wdiEdcaParam->wdiEDCAInfo.wdiEdcaBKInfo, |
| 5032 | &pEdcaParams->acbk); |
| 5033 | WDA_UpdateEdcaParamsForAC(pWDA, &wdiEdcaParam->wdiEDCAInfo.wdiEdcaVIInfo, |
| 5034 | &pEdcaParams->acvi); |
| 5035 | WDA_UpdateEdcaParamsForAC(pWDA, &wdiEdcaParam->wdiEDCAInfo.wdiEdcaVOInfo, |
| 5036 | &pEdcaParams->acvo); |
| 5037 | wdiEdcaParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5038 | pWdaParams->pWdaContext = pWDA; |
| 5039 | /* Store remove key pointer, as this will be used for response */ |
| 5040 | pWdaParams->wdaMsgParam = (void *)pEdcaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5041 | /* store Params pass it to WDI */ |
| 5042 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiEdcaParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5043 | status = WDI_UpdateEDCAParams(wdiEdcaParam, |
| 5044 | (WDI_UpdateEDCAParamsRspCb)WDA_UpdateEDCAParamCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5045 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5046 | { |
| 5047 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5048 | "Failure in Update EDCA Params WDI API, free all the memory " ); |
| 5049 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5050 | vos_mem_free(pWdaParams); |
| 5051 | vos_mem_free(pEdcaParams); |
| 5052 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5053 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 5054 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5055 | /* |
| 5056 | * FUNCTION: WDA_AddBAReqCallback |
| 5057 | * send ADD BA RSP back to PE |
| 5058 | */ |
| 5059 | void WDA_AddBAReqCallback(WDI_AddBARspinfoType *pAddBARspParams, |
| 5060 | void* pUserData) |
| 5061 | { |
| 5062 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 5063 | tWDA_CbContext *pWDA; |
| 5064 | tAddBAParams *pAddBAReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5065 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5066 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5067 | if(NULL == pWdaParams) |
| 5068 | { |
| 5069 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5070 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5071 | VOS_ASSERT(0) ; |
| 5072 | return ; |
| 5073 | } |
| 5074 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 5075 | pAddBAReqParams = (tAddBAParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5076 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5077 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5078 | pAddBAReqParams->status = CONVERT_WDI2SIR_STATUS(pAddBARspParams->wdiStatus) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5079 | WDA_SendMsg(pWDA, WDA_ADDBA_RSP, (void *)pAddBAReqParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5080 | return ; |
| 5081 | } |
| 5082 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5083 | /* |
| 5084 | * FUNCTION: WDA_ProcessAddBAReq |
| 5085 | * Request to WDI to Update the ADDBA REQ params. |
| 5086 | */ |
| 5087 | VOS_STATUS WDA_ProcessAddBAReq(tWDA_CbContext *pWDA, VOS_STATUS status, |
| 5088 | tANI_U16 baSessionID, tANI_U8 staIdx, tAddBAParams *pAddBAReqParams) |
| 5089 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 5090 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5091 | WDI_AddBAReqParamsType *wdiAddBAReqParam = |
| 5092 | (WDI_AddBAReqParamsType *)vos_mem_malloc( |
| 5093 | sizeof(WDI_AddBAReqParamsType)) ; |
| 5094 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5095 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5096 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5097 | if(NULL == wdiAddBAReqParam) |
| 5098 | { |
| 5099 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5100 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5101 | VOS_ASSERT(0); |
| 5102 | return VOS_STATUS_E_NOMEM; |
| 5103 | } |
| 5104 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5105 | if(NULL == pWdaParams) |
| 5106 | { |
| 5107 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5108 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5109 | VOS_ASSERT(0); |
| 5110 | vos_mem_free(wdiAddBAReqParam); |
| 5111 | return VOS_STATUS_E_NOMEM; |
| 5112 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5113 | do |
| 5114 | { |
| 5115 | WDI_AddBAReqinfoType *wdiAddBaInfo = &wdiAddBAReqParam->wdiBAInfoType ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5116 | wdiAddBaInfo->ucSTAIdx = staIdx ; |
| 5117 | wdiAddBaInfo->ucBaSessionID = baSessionID ; |
| 5118 | wdiAddBaInfo->ucWinSize = WDA_BA_MAX_WINSIZE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5119 | } while(0) ; |
| 5120 | wdiAddBAReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5121 | pWdaParams->pWdaContext = pWDA; |
| 5122 | /* store Params pass it to WDI */ |
| 5123 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiAddBAReqParam ; |
| 5124 | pWdaParams->wdaMsgParam = pAddBAReqParams; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 5125 | wstatus = WDI_AddBAReq(wdiAddBAReqParam, |
| 5126 | (WDI_AddBARspCb)WDA_AddBAReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5127 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 5128 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5129 | { |
| 5130 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 5131 | "Failure in ADD BA REQ Params WDI API, free all the memory" ); |
| 5132 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
| 5133 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5134 | vos_mem_free(pWdaParams); |
| 5135 | pAddBAReqParams->status = eSIR_FAILURE; |
| 5136 | WDA_SendMsg(pWDA, WDA_ADDBA_RSP, (void *)pAddBAReqParams , 0) ; |
| 5137 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 5138 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5139 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5140 | /* |
| 5141 | * FUNCTION: WDA_AddBASessionReqCallback |
| 5142 | * send ADD BA SESSION RSP back to PE/(or TL) |
| 5143 | */ |
| 5144 | void WDA_AddBASessionReqCallback( |
| 5145 | WDI_AddBASessionRspParamsType *wdiAddBaSession, void* pUserData) |
| 5146 | { |
| 5147 | VOS_STATUS status = VOS_STATUS_SUCCESS ; |
| 5148 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 5149 | tWDA_CbContext *pWDA; |
| 5150 | tAddBAParams *pAddBAReqParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5151 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5152 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5153 | if(NULL == pWdaParams) |
| 5154 | { |
| 5155 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5156 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5157 | VOS_ASSERT(0) ; |
| 5158 | return ; |
| 5159 | } |
| 5160 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 5161 | pAddBAReqParams = (tAddBAParams *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5162 | if( NULL == pAddBAReqParams ) |
| 5163 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5164 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5165 | "%s: pAddBAReqParams received NULL " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5166 | VOS_ASSERT( 0 ); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 5167 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5168 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5169 | return ; |
| 5170 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5171 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5172 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5173 | /* |
| 5174 | * if WDA in update TL state, update TL with BA session parama and send |
| 5175 | * another request to HAL(/WDI) (ADD_BA_REQ) |
| 5176 | */ |
| 5177 | |
| 5178 | if((VOS_STATUS_SUCCESS == |
| 5179 | CONVERT_WDI2VOS_STATUS(wdiAddBaSession->wdiStatus)) && |
| 5180 | (WDA_BA_UPDATE_TL_STATE == pWDA->wdaState)) |
| 5181 | { |
| 5182 | /* Update TL with BA info received from HAL/WDI */ |
| 5183 | status = WDA_TL_BA_SESSION_ADD(pWDA->pVosContext, |
| 5184 | wdiAddBaSession->usBaSessionID, |
| 5185 | wdiAddBaSession->ucSTAIdx, |
| 5186 | wdiAddBaSession->ucBaTID, |
| 5187 | wdiAddBaSession->ucBaBufferSize, |
| 5188 | wdiAddBaSession->ucWinSize, |
| 5189 | wdiAddBaSession->usBaSSN ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5190 | WDA_ProcessAddBAReq(pWDA, status, wdiAddBaSession->usBaSessionID, |
| 5191 | wdiAddBaSession->ucSTAIdx, pAddBAReqParams) ; |
| 5192 | } |
| 5193 | else |
| 5194 | { |
| 5195 | pAddBAReqParams->status = |
| 5196 | CONVERT_WDI2SIR_STATUS(wdiAddBaSession->wdiStatus) ; |
| 5197 | |
| 5198 | /* Setting Flag to indicate that Set BA is success */ |
| 5199 | if(WDI_STATUS_SUCCESS == wdiAddBaSession->wdiStatus) |
| 5200 | { |
| 5201 | tANI_U16 curSta = wdiAddBaSession->ucSTAIdx; |
| 5202 | tANI_U8 tid = wdiAddBaSession->ucBaTID; |
| 5203 | WDA_SET_BA_TXFLAG(pWDA, curSta, tid) ; |
| 5204 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5205 | WDA_SendMsg(pWDA, WDA_ADDBA_RSP, (void *)pAddBAReqParams , 0) ; |
| 5206 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5207 | /*Reset the WDA state to READY */ |
| 5208 | pWDA->wdaState = WDA_READY_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5209 | return ; |
| 5210 | } |
| 5211 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5212 | /* |
| 5213 | * FUNCTION: WDA_ProcessAddBASessionReq |
| 5214 | * Request to WDI to Update the ADDBA REQ params. |
| 5215 | */ |
| 5216 | VOS_STATUS WDA_ProcessAddBASessionReq(tWDA_CbContext *pWDA, |
| 5217 | tAddBAParams *pAddBAReqParams) |
| 5218 | { |
| 5219 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5220 | WDI_AddBASessionReqParamsType *wdiAddBASessionReqParam = |
| 5221 | (WDI_AddBASessionReqParamsType *)vos_mem_malloc( |
| 5222 | sizeof(WDI_AddBASessionReqParamsType)) ; |
| 5223 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5224 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5225 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5226 | if(NULL == wdiAddBASessionReqParam) |
| 5227 | { |
| 5228 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5229 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5230 | VOS_ASSERT(0); |
| 5231 | return VOS_STATUS_E_NOMEM; |
| 5232 | } |
| 5233 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5234 | if(NULL == pWdaParams) |
| 5235 | { |
| 5236 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5237 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5238 | VOS_ASSERT(0); |
| 5239 | vos_mem_free(wdiAddBASessionReqParam); |
| 5240 | return VOS_STATUS_E_NOMEM; |
| 5241 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5242 | /* |
| 5243 | * Populate ADD BA parameters and pass these paarmeters to WDI. |
| 5244 | * ADD BA SESSION REQ will update HAL with BA params, WDA, will changes |
| 5245 | * the state to track if these is BA recipient case or BA initiator |
| 5246 | * case. |
| 5247 | */ |
| 5248 | do |
| 5249 | { |
| 5250 | WDI_AddBASessionReqinfoType *wdiBAInfoType = |
| 5251 | &wdiAddBASessionReqParam->wdiBASessionInfoType ; |
| 5252 | /* vos_mem_copy(wdiBAInfoType->macBSSID, |
| 5253 | pAddBAReqParams->bssId, sizeof(tSirMacAddr));*/ |
| 5254 | wdiBAInfoType->ucSTAIdx = pAddBAReqParams->staIdx; |
| 5255 | vos_mem_copy(wdiBAInfoType->macPeerAddr, |
| 5256 | pAddBAReqParams->peerMacAddr, sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5257 | wdiBAInfoType->ucBaTID = pAddBAReqParams->baTID; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5258 | wdiBAInfoType->ucBaPolicy = pAddBAReqParams->baPolicy; |
| 5259 | wdiBAInfoType->usBaBufferSize = pAddBAReqParams->baBufferSize; |
| 5260 | wdiBAInfoType->usBaTimeout = pAddBAReqParams->baTimeout; |
| 5261 | wdiBAInfoType->usBaSSN = pAddBAReqParams->baSSN; |
| 5262 | wdiBAInfoType->ucBaDirection = pAddBAReqParams->baDirection; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5263 | /* check the BA direction and update state accordingly */ |
| 5264 | (eBA_RECIPIENT == wdiBAInfoType->ucBaDirection) |
| 5265 | ? (pWDA->wdaState = WDA_BA_UPDATE_TL_STATE) |
| 5266 | : (pWDA->wdaState = WDA_BA_UPDATE_LIM_STATE); |
| 5267 | |
| 5268 | }while(0) ; |
| 5269 | wdiAddBASessionReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5270 | pWdaParams->pWdaContext = pWDA; |
| 5271 | /* Store ADD BA pointer, as this will be used for response */ |
| 5272 | pWdaParams->wdaMsgParam = (void *)pAddBAReqParams ; |
| 5273 | /* store Params pass it to WDI */ |
| 5274 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiAddBASessionReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5275 | status = WDI_AddBASessionReq(wdiAddBASessionReqParam, |
| 5276 | (WDI_AddBASessionRspCb)WDA_AddBASessionReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5277 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5278 | { |
| 5279 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5280 | "Failure in ADD BA Session REQ Params WDI API, free all the memory " ); |
| 5281 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5282 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 5283 | vos_mem_free(pWdaParams); |
| 5284 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5285 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5286 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5287 | /* |
| 5288 | * FUNCTION: WDA_DelBANotifyTL |
| 5289 | * send DEL BA IND to TL |
| 5290 | */ |
| 5291 | void WDA_DelBANotifyTL(tWDA_CbContext *pWDA, |
| 5292 | tDelBAParams *pDelBAReqParams) |
| 5293 | { |
| 5294 | tpDelBAInd pDelBAInd = (tpDelBAInd)vos_mem_malloc(sizeof( tDelBAInd )); |
| 5295 | //tSirMsgQ msg; |
| 5296 | vos_msg_t vosMsg; |
| 5297 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5298 | if(NULL == pDelBAInd) |
| 5299 | { |
| 5300 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5301 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5302 | VOS_ASSERT(0) ; |
| 5303 | return; |
| 5304 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5305 | pDelBAInd->mesgType = WDA_DELETEBA_IND; |
| 5306 | pDelBAInd->staIdx = (tANI_U8) pDelBAReqParams->staIdx; |
| 5307 | pDelBAInd->baTID = (tANI_U8) pDelBAReqParams->baTID; |
| 5308 | pDelBAInd->mesgLen = sizeof( tDelBAInd ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5309 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5310 | |
| 5311 | vosMsg.type = WDA_DELETEBA_IND; |
| 5312 | vosMsg.bodyptr = pDelBAInd; |
| 5313 | vosStatus = vos_mq_post_message(VOS_MQ_ID_TL, &vosMsg); |
| 5314 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5315 | { |
| 5316 | vosStatus = VOS_STATUS_E_BADMSG; |
| 5317 | } |
| 5318 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5319 | /* |
| 5320 | * FUNCTION: WDA_DelBAReqCallback |
| 5321 | * send DEL BA RSP back to PE |
| 5322 | */ |
| 5323 | void WDA_DelBAReqCallback(WDI_Status status, void* pUserData) |
| 5324 | { |
| 5325 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 5326 | tWDA_CbContext *pWDA; |
| 5327 | tDelBAParams *pDelBAReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5328 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5329 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5330 | if(NULL == pWdaParams) |
| 5331 | { |
| 5332 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5333 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5334 | VOS_ASSERT(0) ; |
| 5335 | return ; |
| 5336 | } |
| 5337 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 5338 | pDelBAReqParams = (tDelBAParams *)pWdaParams->wdaMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5339 | /* Notify TL about DEL BA in case of recipinet */ |
| 5340 | if((VOS_STATUS_SUCCESS == CONVERT_WDI2VOS_STATUS(status)) && |
| 5341 | (eBA_RECIPIENT == pDelBAReqParams->baDirection)) |
| 5342 | { |
| 5343 | WDA_DelBANotifyTL(pWDA, pDelBAReqParams); |
| 5344 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5345 | /* |
| 5346 | * No respone required for WDA_DELBA_IND so just free the request |
| 5347 | * param here |
| 5348 | */ |
| 5349 | vos_mem_free(pDelBAReqParams); |
| 5350 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 5351 | vos_mem_free(pWdaParams); |
| 5352 | return ; |
| 5353 | } |
| 5354 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5355 | /* |
| 5356 | * FUNCTION: WDA_ProcessDelBAReq |
| 5357 | * Request to WDI to Update the DELBA REQ params. |
| 5358 | */ |
| 5359 | VOS_STATUS WDA_ProcessDelBAReq(tWDA_CbContext *pWDA, |
| 5360 | tDelBAParams *pDelBAReqParams) |
| 5361 | { |
| 5362 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5363 | WDI_DelBAReqParamsType *wdiDelBAReqParam = |
| 5364 | (WDI_DelBAReqParamsType *)vos_mem_malloc( |
| 5365 | sizeof(WDI_DelBAReqParamsType)) ; |
| 5366 | tWDA_ReqParams *pWdaParams ; |
| 5367 | tANI_U16 staIdx = 0; |
| 5368 | tANI_U8 tid = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5369 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5370 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5371 | if(NULL == wdiDelBAReqParam) |
| 5372 | { |
| 5373 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5374 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5375 | VOS_ASSERT(0); |
| 5376 | return VOS_STATUS_E_NOMEM; |
| 5377 | } |
| 5378 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5379 | if(NULL == pWdaParams) |
| 5380 | { |
| 5381 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5382 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5383 | VOS_ASSERT(0); |
| 5384 | vos_mem_free(wdiDelBAReqParam); |
| 5385 | return VOS_STATUS_E_NOMEM; |
| 5386 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5387 | wdiDelBAReqParam->wdiBAInfo.ucSTAIdx = pDelBAReqParams->staIdx; |
| 5388 | wdiDelBAReqParam->wdiBAInfo.ucBaTID = pDelBAReqParams->baTID; |
| 5389 | wdiDelBAReqParam->wdiBAInfo.ucBaDirection = pDelBAReqParams->baDirection; |
| 5390 | wdiDelBAReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5391 | pWdaParams->pWdaContext = pWDA; |
| 5392 | /* Store DEL BA pointer, as this will be used for response */ |
| 5393 | pWdaParams->wdaMsgParam = (void *)pDelBAReqParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5394 | /* store Params pass it to WDI */ |
| 5395 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiDelBAReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5396 | /* if BA exchange over the air is failed, clear this tid in BaBitmap |
| 5397 | * maintained in WDA, so that WDA can retry for another BA session |
| 5398 | */ |
| 5399 | staIdx = pDelBAReqParams->staIdx; |
| 5400 | tid = pDelBAReqParams->baTID; |
| 5401 | WDA_CLEAR_BA_TXFLAG(pWDA, staIdx, tid); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5402 | status = WDI_DelBAReq(wdiDelBAReqParam, |
| 5403 | (WDI_DelBARspCb)WDA_DelBAReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5404 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5405 | { |
| 5406 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5407 | "Failure in DEL BA REQ Params WDI API, free all the memory " ); |
| 5408 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5409 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 5410 | vos_mem_free(pWdaParams); |
| 5411 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5412 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5413 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5414 | /* |
| 5415 | * FUNCTION: WDA_AddTSReqCallback |
| 5416 | * send ADD TS RSP back to PE |
| 5417 | */ |
| 5418 | void WDA_AddTSReqCallback(WDI_Status status, void* pUserData) |
| 5419 | { |
| 5420 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 5421 | tWDA_CbContext *pWDA; |
| 5422 | tAddTsParams *pAddTsReqParams; |
| 5423 | |
| 5424 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5425 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5426 | if(NULL == pWdaParams) |
| 5427 | { |
| 5428 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5429 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5430 | VOS_ASSERT(0) ; |
| 5431 | return ; |
| 5432 | } |
| 5433 | pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; |
| 5434 | pAddTsReqParams = (tAddTsParams *)pWdaParams->wdaMsgParam ; |
| 5435 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5436 | vos_mem_free(pWdaParams); |
| 5437 | |
| 5438 | pAddTsReqParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5439 | WDA_SendMsg(pWDA, WDA_ADD_TS_RSP, (void *)pAddTsReqParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5440 | return ; |
| 5441 | } |
| 5442 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5443 | /* |
| 5444 | * FUNCTION: WDA_ProcessAddTSReq |
| 5445 | * Request to WDI to Update the ADD TS REQ params. |
| 5446 | */ |
| 5447 | VOS_STATUS WDA_ProcessAddTSReq(tWDA_CbContext *pWDA, |
| 5448 | tAddTsParams *pAddTsReqParams) |
| 5449 | { |
| 5450 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5451 | WDI_AddTSReqParamsType *wdiAddTSReqParam = |
| 5452 | (WDI_AddTSReqParamsType *)vos_mem_malloc( |
| 5453 | sizeof(WDI_AddTSReqParamsType)) ; |
| 5454 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5455 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5456 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5457 | if(NULL == wdiAddTSReqParam) |
| 5458 | { |
| 5459 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5460 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5461 | VOS_ASSERT(0); |
| 5462 | return VOS_STATUS_E_NOMEM; |
| 5463 | } |
| 5464 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5465 | if(NULL == pWdaParams) |
| 5466 | { |
| 5467 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5468 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5469 | VOS_ASSERT(0); |
| 5470 | vos_mem_free(wdiAddTSReqParam); |
| 5471 | return VOS_STATUS_E_NOMEM; |
| 5472 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5473 | wdiAddTSReqParam->wdiTsInfo.ucSTAIdx = pAddTsReqParams->staIdx; |
| 5474 | wdiAddTSReqParam->wdiTsInfo.ucTspecIdx = pAddTsReqParams->tspecIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5475 | //TS IE |
| 5476 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.ucType = pAddTsReqParams->tspec.type; |
| 5477 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.ucLength = |
| 5478 | pAddTsReqParams->tspec.length; |
| 5479 | |
| 5480 | //TS IE : TS INFO : TRAFFIC |
| 5481 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.ackPolicy = |
| 5482 | pAddTsReqParams->tspec.tsinfo.traffic.ackPolicy; |
| 5483 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio = |
| 5484 | pAddTsReqParams->tspec.tsinfo.traffic.userPrio; |
| 5485 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb = |
| 5486 | pAddTsReqParams->tspec.tsinfo.traffic.psb; |
| 5487 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation = |
| 5488 | pAddTsReqParams->tspec.tsinfo.traffic.aggregation; |
| 5489 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy = |
| 5490 | pAddTsReqParams->tspec.tsinfo.traffic.accessPolicy; |
| 5491 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction = |
| 5492 | pAddTsReqParams->tspec.tsinfo.traffic.direction; |
| 5493 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid = |
| 5494 | pAddTsReqParams->tspec.tsinfo.traffic.tsid; |
| 5495 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType = |
| 5496 | pAddTsReqParams->tspec.tsinfo.traffic.trafficType; |
| 5497 | |
| 5498 | //TS IE : TS INFO : SCHEDULE |
| 5499 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule = |
| 5500 | pAddTsReqParams->tspec.tsinfo.schedule.schedule; |
| 5501 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd = |
| 5502 | pAddTsReqParams->tspec.tsinfo.schedule.rsvd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5503 | //TS IE |
| 5504 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.usNomMsduSz = |
| 5505 | pAddTsReqParams->tspec.nomMsduSz; |
| 5506 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.usMaxMsduSz = |
| 5507 | pAddTsReqParams->tspec.maxMsduSz; |
| 5508 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uMinSvcInterval = |
| 5509 | pAddTsReqParams->tspec.minSvcInterval; |
| 5510 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uMaxSvcInterval = |
| 5511 | pAddTsReqParams->tspec.maxSvcInterval; |
| 5512 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uInactInterval = |
| 5513 | pAddTsReqParams->tspec.inactInterval; |
| 5514 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uSuspendInterval = |
| 5515 | pAddTsReqParams->tspec.suspendInterval; |
| 5516 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uSvcStartTime = |
| 5517 | pAddTsReqParams->tspec.svcStartTime; |
| 5518 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uMinDataRate = |
| 5519 | pAddTsReqParams->tspec.minDataRate; |
| 5520 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uMeanDataRate = |
| 5521 | pAddTsReqParams->tspec.meanDataRate; |
| 5522 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uPeakDataRate = |
| 5523 | pAddTsReqParams->tspec.peakDataRate; |
| 5524 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uMaxBurstSz = |
| 5525 | pAddTsReqParams->tspec.maxBurstSz; |
| 5526 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uDelayBound = |
| 5527 | pAddTsReqParams->tspec.delayBound; |
| 5528 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.uMinPhyRate = |
| 5529 | pAddTsReqParams->tspec.minPhyRate; |
| 5530 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.usSurplusBw = |
| 5531 | pAddTsReqParams->tspec.surplusBw; |
| 5532 | wdiAddTSReqParam->wdiTsInfo.wdiTspecIE.usMediumTime = |
| 5533 | pAddTsReqParams->tspec.mediumTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5534 | /* TODO: tAddTsParams doesn't have the following fields */ |
| 5535 | #if 0 |
| 5536 | wdiAddTSReqParam->wdiTsInfo.ucUapsdFlags = |
| 5537 | wdiAddTSReqParam->wdiTsInfo.ucServiceInterval = |
| 5538 | wdiAddTSReqParam->wdiTsInfo.ucSuspendInterval = |
| 5539 | wdiAddTSReqParam->wdiTsInfo.ucDelayedInterval = |
| 5540 | #endif |
| 5541 | wdiAddTSReqParam->wdiReqStatusCB = NULL ; |
| 5542 | |
| 5543 | pWdaParams->pWdaContext = pWDA; |
| 5544 | /* Store ADD TS pointer, as this will be used for response */ |
| 5545 | pWdaParams->wdaMsgParam = (void *)pAddTsReqParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5546 | /* store Params pass it to WDI */ |
| 5547 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiAddTSReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5548 | status = WDI_AddTSReq(wdiAddTSReqParam, |
| 5549 | (WDI_AddTsRspCb)WDA_AddTSReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5550 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5551 | { |
| 5552 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5553 | "Failure in ADD TS REQ Params WDI API, free all the memory " ); |
| 5554 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5555 | vos_mem_free(pWdaParams); |
| 5556 | pAddTsReqParams->status = eSIR_FAILURE ; |
| 5557 | WDA_SendMsg(pWDA, WDA_ADD_TS_RSP, (void *)pAddTsReqParams , 0) ; |
| 5558 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5559 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5560 | } |
| 5561 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5562 | /* |
| 5563 | * FUNCTION: WDA_DelTSReqCallback |
| 5564 | * send DEL TS RSP back to PE |
| 5565 | */ |
| 5566 | void WDA_DelTSReqCallback(WDI_Status status, void* pUserData) |
| 5567 | { |
| 5568 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5569 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5570 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5571 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5572 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 5573 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5574 | /* |
| 5575 | * No respone required for WDA_DEL_TS_REQ so just free the request |
| 5576 | * param here |
| 5577 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5578 | return ; |
| 5579 | } |
| 5580 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5581 | /* |
| 5582 | * FUNCTION: WDA_ProcessDelTSReq |
| 5583 | * Request to WDI to Update the DELTS REQ params. |
| 5584 | */ |
| 5585 | VOS_STATUS WDA_ProcessDelTSReq(tWDA_CbContext *pWDA, |
| 5586 | tDelTsParams *pDelTSReqParams) |
| 5587 | { |
| 5588 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5589 | WDI_DelTSReqParamsType *wdiDelTSReqParam = |
| 5590 | (WDI_DelTSReqParamsType *)vos_mem_malloc( |
| 5591 | sizeof(WDI_DelTSReqParamsType)) ; |
| 5592 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5593 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5594 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5595 | if(NULL == wdiDelTSReqParam) |
| 5596 | { |
| 5597 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5598 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5599 | VOS_ASSERT(0); |
| 5600 | return VOS_STATUS_E_NOMEM; |
| 5601 | } |
| 5602 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5603 | if(NULL == pWdaParams) |
| 5604 | { |
| 5605 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5606 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5607 | VOS_ASSERT(0); |
| 5608 | vos_mem_free(wdiDelTSReqParam); |
| 5609 | return VOS_STATUS_E_NOMEM; |
| 5610 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5611 | vos_mem_copy(wdiDelTSReqParam->wdiDelTSInfo.macBSSID, |
| 5612 | pDelTSReqParams->bssId, sizeof(tSirMacAddr)); |
| 5613 | wdiDelTSReqParam->wdiDelTSInfo.ucSTAIdx = pDelTSReqParams->staIdx; |
| 5614 | wdiDelTSReqParam->wdiDelTSInfo.ucTspecIdx = pDelTSReqParams->tspecIdx; |
| 5615 | wdiDelTSReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5616 | pWdaParams->pWdaContext = pWDA; |
| 5617 | /* Store DEL TS pointer, as this will be used for response */ |
| 5618 | pWdaParams->wdaMsgParam = (void *)pDelTSReqParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5619 | /* store Params pass it to WDI */ |
| 5620 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiDelTSReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5621 | status = WDI_DelTSReq(wdiDelTSReqParam, |
| 5622 | (WDI_DelTsRspCb)WDA_DelTSReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5623 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5624 | { |
| 5625 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5626 | "Failure in DEL TS REQ Params WDI API, free all the memory " ); |
| 5627 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5628 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 5629 | vos_mem_free(pWdaParams); |
| 5630 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5631 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5632 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5633 | /* |
| 5634 | * FUNCTION: WDA_UpdateBeaconParamsCallback |
| 5635 | * Free the memory. No need to send any response to PE in this case |
| 5636 | */ |
| 5637 | void WDA_UpdateBeaconParamsCallback(WDI_Status status, void* pUserData) |
| 5638 | { |
| 5639 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5640 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5641 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5642 | if(NULL == pWdaParams) |
| 5643 | { |
| 5644 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5645 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5646 | VOS_ASSERT(0) ; |
| 5647 | return ; |
| 5648 | } |
| 5649 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5650 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 5651 | vos_mem_free(pWdaParams); |
| 5652 | /* |
| 5653 | * No respone required for WDA_UPDATE_BEACON_IND so just free the request |
| 5654 | * param here |
| 5655 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5656 | return ; |
| 5657 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5658 | /* |
| 5659 | * FUNCTION: WDA_ProcessUpdateBeaconParams |
| 5660 | * Request to WDI to send the beacon parameters to HAL to update the Hardware |
| 5661 | */ |
| 5662 | VOS_STATUS WDA_ProcessUpdateBeaconParams(tWDA_CbContext *pWDA, |
| 5663 | tUpdateBeaconParams *pUpdateBeaconParams) |
| 5664 | { |
| 5665 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5666 | WDI_UpdateBeaconParamsType *wdiUpdateBeaconParams = |
| 5667 | (WDI_UpdateBeaconParamsType *)vos_mem_malloc( |
| 5668 | sizeof(WDI_UpdateBeaconParamsType)) ; |
| 5669 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5670 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5671 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5672 | if(NULL == wdiUpdateBeaconParams) |
| 5673 | { |
| 5674 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5675 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5676 | VOS_ASSERT(0); |
| 5677 | return VOS_STATUS_E_NOMEM; |
| 5678 | } |
| 5679 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5680 | if(NULL == pWdaParams) |
| 5681 | { |
| 5682 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5683 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5684 | VOS_ASSERT(0); |
| 5685 | vos_mem_free(wdiUpdateBeaconParams); |
| 5686 | return VOS_STATUS_E_NOMEM; |
| 5687 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5688 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx = |
| 5689 | pUpdateBeaconParams->bssIdx; |
| 5690 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble = |
| 5691 | pUpdateBeaconParams->fShortPreamble; |
| 5692 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime = |
| 5693 | pUpdateBeaconParams->fShortSlotTime; |
| 5694 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval = |
| 5695 | pUpdateBeaconParams->beaconInterval; |
| 5696 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist = |
| 5697 | pUpdateBeaconParams->llaCoexist; |
| 5698 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist = |
| 5699 | pUpdateBeaconParams->llbCoexist; |
| 5700 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist = |
| 5701 | pUpdateBeaconParams->llgCoexist; |
| 5702 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist= |
| 5703 | pUpdateBeaconParams->ht20MhzCoexist; |
| 5704 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist = |
| 5705 | pUpdateBeaconParams->llnNonGFCoexist; |
| 5706 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport = |
| 5707 | pUpdateBeaconParams->fLsigTXOPProtectionFullSupport; |
| 5708 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode = |
| 5709 | pUpdateBeaconParams->fRIFSMode; |
| 5710 | wdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap = |
| 5711 | pUpdateBeaconParams->paramChangeBitmap; |
| 5712 | wdiUpdateBeaconParams->wdiReqStatusCB = NULL ; |
| 5713 | |
| 5714 | pWdaParams->pWdaContext = pWDA; |
| 5715 | /* Store UpdateBeacon Req pointer, as this will be used for response */ |
| 5716 | pWdaParams->wdaMsgParam = (void *)pUpdateBeaconParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5717 | /* store Params pass it to WDI */ |
| 5718 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiUpdateBeaconParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5719 | status = WDI_UpdateBeaconParamsReq(wdiUpdateBeaconParams, |
| 5720 | (WDI_UpdateBeaconParamsRspCb)WDA_UpdateBeaconParamsCallback, |
| 5721 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5722 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5723 | { |
| 5724 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5725 | "Failure in UPDATE BEACON REQ Params WDI API, free all the memory " ); |
| 5726 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5727 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 5728 | vos_mem_free(pWdaParams); |
| 5729 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5730 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5731 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5732 | #ifdef FEATURE_WLAN_CCX |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5733 | /* |
| 5734 | * FUNCTION: WDA_TSMStatsReqCallback |
| 5735 | * send TSM Stats RSP back to PE |
| 5736 | */ |
| 5737 | void WDA_TSMStatsReqCallback(WDI_TSMStatsRspParamsType *pwdiTSMStatsRspParams, void* pUserData) |
| 5738 | { |
| 5739 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 5740 | tWDA_CbContext *pWDA = NULL; |
| 5741 | tTSMStats *pTsmRspParams = NULL; |
| 5742 | |
| 5743 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5744 | "<------ Entering: %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5745 | if(NULL == pWdaParams) |
| 5746 | { |
| 5747 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5748 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5749 | VOS_ASSERT(0) ; |
| 5750 | return ; |
| 5751 | } |
| 5752 | pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; |
| 5753 | pTsmRspParams = (tTSMStats *)pWdaParams->wdaMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5754 | if( NULL == pTsmRspParams ) |
| 5755 | { |
| 5756 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5757 | "%s: pTsmRspParams received NULL " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5758 | VOS_ASSERT( 0 ); |
| 5759 | return ; |
| 5760 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5761 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5762 | vos_mem_free(pWdaParams); |
| 5763 | |
| 5764 | pTsmRspParams->tsmMetrics.UplinkPktQueueDly = pwdiTSMStatsRspParams->UplinkPktQueueDly; |
| 5765 | vos_mem_copy(pTsmRspParams->tsmMetrics.UplinkPktQueueDlyHist, |
| 5766 | pwdiTSMStatsRspParams->UplinkPktQueueDlyHist, |
| 5767 | sizeof(pwdiTSMStatsRspParams->UplinkPktQueueDlyHist)/ |
| 5768 | sizeof(pwdiTSMStatsRspParams->UplinkPktQueueDlyHist[0])); |
| 5769 | pTsmRspParams->tsmMetrics.UplinkPktTxDly = pwdiTSMStatsRspParams->UplinkPktTxDly; |
| 5770 | pTsmRspParams->tsmMetrics.UplinkPktLoss = pwdiTSMStatsRspParams->UplinkPktLoss; |
| 5771 | pTsmRspParams->tsmMetrics.UplinkPktCount = pwdiTSMStatsRspParams->UplinkPktCount; |
| 5772 | pTsmRspParams->tsmMetrics.RoamingCount = pwdiTSMStatsRspParams->RoamingCount; |
| 5773 | pTsmRspParams->tsmMetrics.RoamingDly = pwdiTSMStatsRspParams->RoamingDly; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5774 | WDA_SendMsg(pWDA, WDA_TSM_STATS_RSP, (void *)pTsmRspParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5775 | return ; |
| 5776 | } |
| 5777 | |
| 5778 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5779 | /* |
| 5780 | * FUNCTION: WDA_ProcessTsmStatsReq |
| 5781 | * Request to WDI to get the TSM Stats params. |
| 5782 | */ |
| 5783 | VOS_STATUS WDA_ProcessTsmStatsReq(tWDA_CbContext *pWDA, |
| 5784 | tTSMStats *pTsmStats) |
| 5785 | { |
| 5786 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5787 | WDI_TSMStatsReqParamsType *wdiTSMReqParam = NULL; |
| 5788 | tWDA_ReqParams *pWdaParams = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5789 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5790 | "------> Entering: %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5791 | wdiTSMReqParam = (WDI_TSMStatsReqParamsType *)vos_mem_malloc( |
| 5792 | sizeof(WDI_TSMStatsReqParamsType)); |
| 5793 | if(NULL == wdiTSMReqParam) |
| 5794 | { |
| 5795 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5796 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5797 | VOS_ASSERT(0); |
| 5798 | return VOS_STATUS_E_NOMEM; |
| 5799 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5800 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 5801 | if(NULL == pWdaParams) |
| 5802 | { |
| 5803 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5804 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5805 | VOS_ASSERT(0); |
| 5806 | vos_mem_free(wdiTSMReqParam); |
| 5807 | return VOS_STATUS_E_NOMEM; |
| 5808 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5809 | wdiTSMReqParam->wdiTsmStatsParamsInfo.ucTid = pTsmStats->tid; |
| 5810 | vos_mem_copy(wdiTSMReqParam->wdiTsmStatsParamsInfo.bssid, |
| 5811 | pTsmStats->bssId, |
| 5812 | sizeof(wpt_macAddr)); |
| 5813 | wdiTSMReqParam->wdiReqStatusCB = NULL ; |
| 5814 | |
| 5815 | pWdaParams->pWdaContext = pWDA; |
| 5816 | /* Store TSM Stats pointer, as this will be used for response */ |
| 5817 | pWdaParams->wdaMsgParam = (void *)pTsmStats ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5818 | /* store Params pass it to WDI */ |
| 5819 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiTSMReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5820 | status = WDI_TSMStatsReq(wdiTSMReqParam, |
| 5821 | (WDI_TsmRspCb)WDA_TSMStatsReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5822 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5823 | { |
| 5824 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5825 | "Failure in TSM STATS REQ Params WDI API, free all the memory " ); |
| 5826 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5827 | vos_mem_free(pWdaParams) ; |
Madan Mohan Koyyalamudi | 6b5b500 | 2012-11-08 14:49:29 -0800 | [diff] [blame] | 5828 | WDA_SendMsg(pWDA, WDA_TSM_STATS_RSP, (void *)pTsmStats , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5829 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5830 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 5831 | } |
| 5832 | #endif |
| 5833 | /* |
| 5834 | * FUNCTION: WDA_SendBeaconParamsCallback |
| 5835 | * No need to send any response to PE in this case |
| 5836 | */ |
| 5837 | void WDA_SendBeaconParamsCallback(WDI_Status status, void* pUserData) |
| 5838 | { |
| 5839 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5840 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5841 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5842 | return ; |
| 5843 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5844 | /* |
| 5845 | * FUNCTION: WDA_ProcessSendBeacon |
| 5846 | * Request to WDI to send the beacon template to HAL to update the TPE memory and |
| 5847 | * start beacon trasmission |
| 5848 | */ |
| 5849 | VOS_STATUS WDA_ProcessSendBeacon(tWDA_CbContext *pWDA, |
| 5850 | tSendbeaconParams *pSendbeaconParams) |
| 5851 | { |
| 5852 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 5853 | WDI_SendBeaconParamsType wdiSendBeaconReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5854 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5855 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5856 | vos_mem_copy(wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.macBSSID, |
| 5857 | pSendbeaconParams->bssId, sizeof(tSirMacAddr)); |
| 5858 | wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.beaconLength = |
| 5859 | pSendbeaconParams->beaconLength; |
| 5860 | #ifdef WLAN_SOFTAP_FEATURE |
| 5861 | wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.timIeOffset = |
| 5862 | pSendbeaconParams->timIeOffset; |
| 5863 | #endif |
| 5864 | #ifdef WLAN_FEATURE_P2P |
| 5865 | wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.usP2PIeOffset = |
| 5866 | pSendbeaconParams->p2pIeOffset; |
| 5867 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5868 | /* Copy the beacon template to local buffer */ |
| 5869 | vos_mem_copy(wdiSendBeaconReqParam.wdiSendBeaconParamsInfo.beacon, |
| 5870 | pSendbeaconParams->beacon, pSendbeaconParams->beaconLength); |
| 5871 | wdiSendBeaconReqParam.wdiReqStatusCB = NULL ; |
| 5872 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5873 | status = WDI_SendBeaconParamsReq(&wdiSendBeaconReqParam, |
| 5874 | (WDI_SendBeaconParamsRspCb)WDA_SendBeaconParamsCallback, pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5875 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5876 | { |
| 5877 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5878 | "Failure in SEND BEACON REQ Params WDI API" ); |
| 5879 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5880 | vos_mem_free(pSendbeaconParams); |
| 5881 | return CONVERT_WDI2VOS_STATUS(status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5882 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5883 | /* |
| 5884 | * FUNCTION: WDA_UpdateProbeRspParamsCallback |
| 5885 | * No need to send any response to PE in this case |
| 5886 | */ |
| 5887 | void WDA_UpdateProbeRspParamsCallback(WDI_Status status, void* pUserData) |
| 5888 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5889 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5890 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5891 | return ; |
| 5892 | } |
| 5893 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5894 | /* |
| 5895 | * FUNCTION: WDA_ProcessUpdateProbeRspTemplate |
| 5896 | * Request to WDI to send the probe response template to HAL to update the TPE memory and |
| 5897 | * send probe response |
| 5898 | */ |
| 5899 | VOS_STATUS WDA_ProcessUpdateProbeRspTemplate(tWDA_CbContext *pWDA, |
| 5900 | tSendProbeRespParams *pSendProbeRspParams) |
| 5901 | { |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5902 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 5903 | WDI_UpdateProbeRspTemplateParamsType *wdiSendProbeRspParam = |
| 5904 | vos_mem_malloc(sizeof(WDI_UpdateProbeRspTemplateParamsType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5905 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5906 | "------> %s " ,__func__); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5907 | |
| 5908 | if (!wdiSendProbeRspParam) |
| 5909 | return CONVERT_WDI2VOS_STATUS(WDI_STATUS_MEM_FAILURE); |
| 5910 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5911 | /*Copy update probe response parameters*/ |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5912 | vos_mem_copy(wdiSendProbeRspParam->wdiProbeRspTemplateInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5913 | pSendProbeRspParams->bssId, sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5914 | wdiSendProbeRspParam->wdiProbeRspTemplateInfo.uProbeRespTemplateLen = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5915 | pSendProbeRspParams->probeRespTemplateLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5916 | /* Copy the Probe Response template to local buffer */ |
| 5917 | vos_mem_copy( |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5918 | wdiSendProbeRspParam->wdiProbeRspTemplateInfo.pProbeRespTemplate, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5919 | pSendProbeRspParams->pProbeRespTemplate, |
| 5920 | pSendProbeRspParams->probeRespTemplateLen); |
| 5921 | vos_mem_copy( |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5922 | wdiSendProbeRspParam->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5923 | pSendProbeRspParams->ucProxyProbeReqValidIEBmap, |
| 5924 | WDI_PROBE_REQ_BITMAP_IE_LEN); |
| 5925 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5926 | wdiSendProbeRspParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5927 | |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5928 | status = WDI_UpdateProbeRspTemplateReq(wdiSendProbeRspParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5929 | (WDI_UpdateProbeRspTemplateRspCb)WDA_UpdateProbeRspParamsCallback, pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5930 | if(IS_WDI_STATUS_FAILURE(status)) |
| 5931 | { |
| 5932 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 5933 | "Failure in SEND Probe RSP Params WDI API" ); |
| 5934 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5935 | vos_mem_free(pSendProbeRspParams); |
Madan Mohan Koyyalamudi | 8f207c1 | 2012-10-30 18:18:38 -0700 | [diff] [blame] | 5936 | vos_mem_free(wdiSendProbeRspParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5937 | return CONVERT_WDI2VOS_STATUS(status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5938 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5939 | #if defined(WLAN_FEATURE_VOWIFI) || defined(FEATURE_WLAN_CCX) |
| 5940 | /* |
| 5941 | * FUNCTION: WDA_SetMaxTxPowerCallBack |
| 5942 | * send the response to PE with power value received from WDI |
| 5943 | */ |
| 5944 | void WDA_SetMaxTxPowerCallBack(WDI_SetMaxTxPowerRspMsg * pwdiSetMaxTxPowerRsp, |
| 5945 | void* pUserData) |
| 5946 | { |
| 5947 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 5948 | tWDA_CbContext *pWDA = NULL; |
| 5949 | tMaxTxPowerParams *pMaxTxPowerParams = NULL; |
| 5950 | |
| 5951 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5952 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5953 | if(NULL == pWdaParams) |
| 5954 | { |
| 5955 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5956 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5957 | VOS_ASSERT(0) ; |
| 5958 | return ; |
| 5959 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5960 | pWDA = (tWDA_CbContext *) pWdaParams->pWdaContext; |
| 5961 | pMaxTxPowerParams = (tMaxTxPowerParams *)pWdaParams->wdaMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5962 | if( NULL == pMaxTxPowerParams ) |
| 5963 | { |
| 5964 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5965 | "%s: pMaxTxPowerParams received NULL " ,__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5966 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 5967 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 5968 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5969 | return ; |
| 5970 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5972 | |
| 5973 | /*need to free memory for the pointers used in the |
| 5974 | WDA Process.Set Max Tx Power Req function*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5975 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 5976 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5977 | pMaxTxPowerParams->power = pwdiSetMaxTxPowerRsp->ucPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5978 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5979 | |
| 5980 | /* send response to UMAC*/ |
| 5981 | WDA_SendMsg(pWDA, WDA_SET_MAX_TX_POWER_RSP, pMaxTxPowerParams , 0) ; |
| 5982 | |
| 5983 | return; |
| 5984 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5985 | /* |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 5986 | * FUNCTION: WDA_ProcessSetMaxTxPowerReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5987 | * Request to WDI to send set Max Tx Power Request |
| 5988 | */ |
| 5989 | VOS_STATUS WDA_ProcessSetMaxTxPowerReq(tWDA_CbContext *pWDA, |
| 5990 | tMaxTxPowerParams *MaxTxPowerParams) |
| 5991 | { |
| 5992 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 5993 | WDI_SetMaxTxPowerParamsType *wdiSetMaxTxPowerParams = NULL; |
| 5994 | tWDA_ReqParams *pWdaParams = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 5995 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5996 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 5997 | "------> %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 5998 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5999 | wdiSetMaxTxPowerParams = (WDI_SetMaxTxPowerParamsType *)vos_mem_malloc( |
| 6000 | sizeof(WDI_SetMaxTxPowerParamsType)); |
| 6001 | if(NULL == wdiSetMaxTxPowerParams) |
| 6002 | { |
| 6003 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6004 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6005 | VOS_ASSERT(0); |
| 6006 | return VOS_STATUS_E_NOMEM; |
| 6007 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6008 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6009 | if(NULL == pWdaParams) |
| 6010 | { |
| 6011 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6012 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6013 | vos_mem_free(wdiSetMaxTxPowerParams); |
| 6014 | VOS_ASSERT(0); |
| 6015 | return VOS_STATUS_E_NOMEM; |
| 6016 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6017 | /* Copy.Max.Tx.Power Params to WDI structure */ |
| 6018 | vos_mem_copy(wdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId, |
| 6019 | MaxTxPowerParams->bssId, |
| 6020 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6021 | vos_mem_copy(wdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr, |
| 6022 | MaxTxPowerParams->selfStaMacAddr, |
| 6023 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6024 | wdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower = |
| 6025 | MaxTxPowerParams->power; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6026 | wdiSetMaxTxPowerParams->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6027 | pWdaParams->pWdaContext = pWDA; |
| 6028 | pWdaParams->wdaMsgParam = (void *)MaxTxPowerParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6029 | /* store Params pass it to WDI */ |
| 6030 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiSetMaxTxPowerParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6031 | status = WDI_SetMaxTxPowerReq(wdiSetMaxTxPowerParams, |
| 6032 | (WDA_SetMaxTxPowerRspCb)WDA_SetMaxTxPowerCallBack, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6033 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6034 | { |
| 6035 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6036 | "Failure in SET MAX TX Power REQ Params WDI API, free all the memory " ); |
| 6037 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 6038 | vos_mem_free(pWdaParams); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6039 | /* send response to UMAC*/ |
| 6040 | WDA_SendMsg(pWDA, WDA_SET_MAX_TX_POWER_RSP, MaxTxPowerParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6041 | } |
| 6042 | return CONVERT_WDI2VOS_STATUS(status); |
| 6043 | |
| 6044 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6045 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6046 | #ifdef WLAN_FEATURE_P2P |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6047 | /* |
| 6048 | * FUNCTION: WDA_SetP2PGONOAReqParamsCallback |
| 6049 | * Free the memory. No need to send any response to PE in this case |
| 6050 | */ |
| 6051 | void WDA_SetP2PGONOAReqParamsCallback(WDI_Status status, void* pUserData) |
| 6052 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6053 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 6054 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6055 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6056 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6057 | |
| 6058 | if(NULL == pWdaParams) |
| 6059 | { |
| 6060 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6061 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6062 | VOS_ASSERT(0) ; |
| 6063 | return ; |
| 6064 | } |
| 6065 | |
| 6066 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 6067 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 6068 | vos_mem_free(pWdaParams); |
| 6069 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6070 | /* |
| 6071 | * No respone required for SIR_HAL_SET_P2P_GO_NOA_REQ |
| 6072 | * so just free the request param here |
| 6073 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6074 | return ; |
| 6075 | } |
| 6076 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6077 | /* |
| 6078 | * FUNCTION: WDA_ProcessSetP2PGONOAReq |
| 6079 | * Request to WDI to set the P2P Group Owner Notice of Absence Req |
| 6080 | */ |
| 6081 | VOS_STATUS WDA_ProcessSetP2PGONOAReq(tWDA_CbContext *pWDA, |
| 6082 | tP2pPsParams *pP2pPsConfigParams) |
| 6083 | { |
| 6084 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 6085 | WDI_SetP2PGONOAReqParamsType *wdiSetP2PGONOAReqParam = |
| 6086 | (WDI_SetP2PGONOAReqParamsType *)vos_mem_malloc( |
| 6087 | sizeof(WDI_SetP2PGONOAReqParamsType)) ; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6088 | tWDA_ReqParams *pWdaParams = NULL; |
| 6089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6090 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6091 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6092 | if(NULL == wdiSetP2PGONOAReqParam) |
| 6093 | { |
| 6094 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6095 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6096 | VOS_ASSERT(0); |
| 6097 | return VOS_STATUS_E_NOMEM; |
| 6098 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6099 | |
| 6100 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6101 | if(NULL == pWdaParams) |
| 6102 | { |
| 6103 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6104 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6105 | vos_mem_free(pP2pPsConfigParams); |
Madan Mohan Koyyalamudi | 683acf1 | 2012-10-30 18:10:18 -0700 | [diff] [blame] | 6106 | vos_mem_free(wdiSetP2PGONOAReqParam); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6107 | VOS_ASSERT(0); |
| 6108 | return VOS_STATUS_E_NOMEM; |
| 6109 | } |
| 6110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6111 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.ucOpp_ps = |
| 6112 | pP2pPsConfigParams->opp_ps; |
| 6113 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.uCtWindow = |
| 6114 | pP2pPsConfigParams->ctWindow; |
| 6115 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.ucCount = |
| 6116 | pP2pPsConfigParams->count; |
| 6117 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.uDuration = |
| 6118 | pP2pPsConfigParams->duration; |
| 6119 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.uInterval = |
| 6120 | pP2pPsConfigParams->interval; |
| 6121 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.uSingle_noa_duration = |
| 6122 | pP2pPsConfigParams->single_noa_duration; |
| 6123 | wdiSetP2PGONOAReqParam->wdiP2PGONOAInfo.ucPsSelection = |
| 6124 | pP2pPsConfigParams->psSelection; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6125 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6126 | wdiSetP2PGONOAReqParam->wdiReqStatusCB = NULL ; |
| 6127 | /* Store msg pointer from PE, as this will be used for response */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6128 | pWdaParams->wdaMsgParam = (void *)pP2pPsConfigParams ; |
| 6129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6130 | /* store Params pass it to WDI */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6131 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiSetP2PGONOAReqParam ; |
| 6132 | pWdaParams->pWdaContext = pWDA; |
| 6133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6134 | status = WDI_SetP2PGONOAReq(wdiSetP2PGONOAReqParam, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6135 | (WDI_SetP2PGONOAReqParamsRspCb)WDA_SetP2PGONOAReqParamsCallback, pWdaParams); |
| 6136 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6137 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6138 | { |
| 6139 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6140 | "Failure in Set P2P GO NOA Req WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6141 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 6142 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 6143 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6144 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6145 | return CONVERT_WDI2VOS_STATUS(status); |
| 6146 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6147 | } |
| 6148 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6149 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 6150 | /* |
| 6151 | * FUNCTION: WDA_AggrAddTSReqCallback |
| 6152 | * send ADD AGGREGATED TS RSP back to PE |
| 6153 | */ |
| 6154 | void WDA_AggrAddTSReqCallback(WDI_Status status, void* pUserData) |
| 6155 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6156 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 6157 | tWDA_CbContext *pWDA; |
| 6158 | tAggrAddTsParams *pAggrAddTsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6159 | int i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6160 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6161 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6162 | if(NULL == pWdaParams) |
| 6163 | { |
| 6164 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6165 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6166 | VOS_ASSERT(0) ; |
| 6167 | return ; |
| 6168 | } |
| 6169 | |
| 6170 | pWDA = pWdaParams->pWdaContext; |
| 6171 | pAggrAddTsReqParams = (tAggrAddTsParams *)pWdaParams->wdaMsgParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6172 | |
| 6173 | for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) |
| 6174 | { |
| 6175 | pAggrAddTsReqParams->status[i] = CONVERT_WDI2SIR_STATUS(status) ; |
| 6176 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6177 | WDA_SendMsg(pWDA, WDA_AGGR_QOS_RSP, (void *)pAggrAddTsReqParams , 0) ; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6178 | |
| 6179 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 6180 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6181 | return ; |
| 6182 | }/* WLAN_FEATURE_VOWIFI_11R */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6183 | /* |
| 6184 | * FUNCTION: WDA_ProcessAddTSReq |
| 6185 | * Request to WDI to send an update with AGGREGATED ADD TS REQ params. |
| 6186 | */ |
| 6187 | VOS_STATUS WDA_ProcessAggrAddTSReq(tWDA_CbContext *pWDA, |
| 6188 | tAggrAddTsParams *pAggrAddTsReqParams) |
| 6189 | { |
| 6190 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 6191 | int i; |
| 6192 | WDI_AggrAddTSReqParamsType *wdiAggrAddTSReqParam; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6193 | tWDA_ReqParams *pWdaParams = NULL; |
| 6194 | |
| 6195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6196 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6197 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6198 | wdiAggrAddTSReqParam = (WDI_AggrAddTSReqParamsType *)vos_mem_malloc( |
| 6199 | sizeof(WDI_AggrAddTSReqParamsType)) ; |
| 6200 | if(NULL == wdiAggrAddTSReqParam) |
| 6201 | { |
| 6202 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6203 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6204 | VOS_ASSERT(0); |
| 6205 | return VOS_STATUS_E_NOMEM; |
| 6206 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6207 | |
| 6208 | |
| 6209 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6210 | if(NULL == pWdaParams) |
| 6211 | { |
| 6212 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6213 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6214 | vos_mem_free(pAggrAddTsReqParams); |
Madan Mohan Koyyalamudi | 683acf1 | 2012-10-30 18:10:18 -0700 | [diff] [blame] | 6215 | vos_mem_free(wdiAggrAddTSReqParam); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6216 | VOS_ASSERT(0); |
| 6217 | return VOS_STATUS_E_NOMEM; |
| 6218 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6219 | wdiAggrAddTSReqParam->wdiAggrTsInfo.ucSTAIdx = pAggrAddTsReqParams->staIdx; |
| 6220 | wdiAggrAddTSReqParam->wdiAggrTsInfo.ucTspecIdx = |
| 6221 | pAggrAddTsReqParams->tspecIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6222 | for( i = 0; i < WDI_MAX_NO_AC; i++ ) |
| 6223 | { |
| 6224 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].ucType = pAggrAddTsReqParams->tspec[i].type; |
| 6225 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].ucLength = |
| 6226 | pAggrAddTsReqParams->tspec[i].length; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6227 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.ackPolicy = |
| 6228 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.ackPolicy; |
| 6229 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.userPrio = |
| 6230 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.userPrio; |
| 6231 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.psb = |
| 6232 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.psb; |
| 6233 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.aggregation = |
| 6234 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.aggregation; |
| 6235 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.accessPolicy = |
| 6236 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.accessPolicy; |
| 6237 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.direction = |
| 6238 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.direction; |
| 6239 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.tsid = |
| 6240 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.tsid; |
| 6241 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic.trafficType = |
| 6242 | pAggrAddTsReqParams->tspec[i].tsinfo.traffic.trafficType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6243 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule = |
| 6244 | pAggrAddTsReqParams->tspec[i].tsinfo.schedule.schedule; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6245 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz = |
| 6246 | pAggrAddTsReqParams->tspec[i].nomMsduSz; |
| 6247 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz = |
| 6248 | pAggrAddTsReqParams->tspec[i].maxMsduSz; |
| 6249 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval = |
| 6250 | pAggrAddTsReqParams->tspec[i].minSvcInterval; |
| 6251 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval = |
| 6252 | pAggrAddTsReqParams->tspec[i].maxSvcInterval; |
| 6253 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval = |
| 6254 | pAggrAddTsReqParams->tspec[i].inactInterval; |
| 6255 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval = |
| 6256 | pAggrAddTsReqParams->tspec[i].suspendInterval; |
| 6257 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime = |
| 6258 | pAggrAddTsReqParams->tspec[i].svcStartTime; |
| 6259 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate = |
| 6260 | pAggrAddTsReqParams->tspec[i].minDataRate; |
| 6261 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate = |
| 6262 | pAggrAddTsReqParams->tspec[i].meanDataRate; |
| 6263 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate = |
| 6264 | pAggrAddTsReqParams->tspec[i].peakDataRate; |
| 6265 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz = |
| 6266 | pAggrAddTsReqParams->tspec[i].maxBurstSz; |
| 6267 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound = |
| 6268 | pAggrAddTsReqParams->tspec[i].delayBound; |
| 6269 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate = |
| 6270 | pAggrAddTsReqParams->tspec[i].minPhyRate; |
| 6271 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw = |
| 6272 | pAggrAddTsReqParams->tspec[i].surplusBw; |
| 6273 | wdiAggrAddTSReqParam->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime = |
| 6274 | pAggrAddTsReqParams->tspec[i].mediumTime; |
| 6275 | } |
| 6276 | |
| 6277 | /* TODO: tAggrAddTsParams doesn't have the following fields */ |
| 6278 | #if 0 |
| 6279 | wdiAggrAddTSReqParam->wdiTsInfo.ucUapsdFlags = |
| 6280 | wdiAggrAddTSReqParam->wdiTsInfo.ucServiceInterval = |
| 6281 | wdiAggrAddTSReqParam->wdiTsInfo.ucSuspendInterval = |
| 6282 | wdiAggrAddTSReqParam->wdiTsInfo.ucDelayedInterval = |
| 6283 | #endif |
| 6284 | wdiAggrAddTSReqParam->wdiReqStatusCB = NULL ; |
| 6285 | |
| 6286 | /* Store ADD TS pointer, as this will be used for response */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6287 | pWdaParams->wdaMsgParam = (void *)pAggrAddTsReqParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6288 | /* store Params pass it to WDI */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6289 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiAggrAddTSReqParam ; |
| 6290 | |
| 6291 | pWdaParams->pWdaContext = pWDA; |
| 6292 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6293 | status = WDI_AggrAddTSReq(wdiAggrAddTSReqParam, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6294 | (WDI_AggrAddTsRspCb)WDA_AggrAddTSReqCallback, pWdaParams); |
| 6295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6296 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6297 | { |
| 6298 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6299 | "Failure in ADD TS REQ Params WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6300 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 6301 | vos_mem_free(pWdaParams); |
| 6302 | |
| 6303 | /* send the failure response back to PE*/ |
| 6304 | for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) |
| 6305 | { |
| 6306 | pAggrAddTsReqParams->status[i] = eHAL_STATUS_FAILURE ; |
| 6307 | } |
| 6308 | |
| 6309 | WDA_SendMsg(pWdaParams->pWdaContext, WDA_AGGR_QOS_RSP, |
| 6310 | (void *)pAggrAddTsReqParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6311 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6312 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 6313 | } |
| 6314 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6315 | /* |
| 6316 | * FUNCTION: WDA_EnterImpsReqCallback |
| 6317 | * send Enter IMPS RSP back to PE |
| 6318 | */ |
| 6319 | void WDA_EnterImpsReqCallback(WDI_Status status, void* pUserData) |
| 6320 | { |
| 6321 | tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6322 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6323 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6324 | WDA_SendMsg(pWDA, WDA_ENTER_IMPS_RSP, NULL , CONVERT_WDI2SIR_STATUS(status)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6325 | return ; |
| 6326 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6327 | /* |
| 6328 | * FUNCTION: WDA_ProcessEnterImpsReq |
| 6329 | * Request to WDI to Enter IMPS power state. |
| 6330 | */ |
| 6331 | VOS_STATUS WDA_ProcessEnterImpsReq(tWDA_CbContext *pWDA) |
| 6332 | { |
| 6333 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6334 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6335 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6336 | status = WDI_EnterImpsReq((WDI_EnterImpsRspCb)WDA_EnterImpsReqCallback, pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6337 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6338 | { |
| 6339 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6340 | "Failure in Enter IMPS REQ WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6341 | WDA_SendMsg(pWDA, WDA_ENTER_IMPS_RSP, NULL , CONVERT_WDI2SIR_STATUS(status)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6342 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6343 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 6344 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6345 | /* |
| 6346 | * FUNCTION: WDA_ExitImpsReqCallback |
| 6347 | * send Exit IMPS RSP back to PE |
| 6348 | */ |
| 6349 | void WDA_ExitImpsReqCallback(WDI_Status status, void* pUserData) |
| 6350 | { |
| 6351 | tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6352 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6353 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6354 | WDA_SendMsg(pWDA, WDA_EXIT_IMPS_RSP, NULL , CONVERT_WDI2SIR_STATUS(status)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6355 | return ; |
| 6356 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6357 | /* |
| 6358 | * FUNCTION: WDA_ProcessExitImpsReq |
| 6359 | * Request to WDI to Exit IMPS power state. |
| 6360 | */ |
| 6361 | VOS_STATUS WDA_ProcessExitImpsReq(tWDA_CbContext *pWDA) |
| 6362 | { |
| 6363 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6364 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6365 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6366 | status = WDI_ExitImpsReq((WDI_ExitImpsRspCb)WDA_ExitImpsReqCallback, pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6367 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6368 | { |
| 6369 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6370 | "Failure in Exit IMPS REQ WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6371 | WDA_SendMsg(pWDA, WDA_EXIT_IMPS_RSP, NULL , CONVERT_WDI2SIR_STATUS(status)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6372 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6373 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 6374 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6375 | /* |
| 6376 | * FUNCTION: WDA_EnterBmpsReqCallback |
| 6377 | * send Enter BMPS RSP back to PE |
| 6378 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6379 | void WDA_EnterBmpsReqCallback(WDI_EnterBmpsRspParamsType *pwdiEnterBmpsRsp, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6380 | { |
| 6381 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 6382 | tWDA_CbContext *pWDA; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6383 | tEnterBmpsParams *pEnterBmpsRspParams; |
| 6384 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6385 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6386 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6387 | if(NULL == pWdaParams) |
| 6388 | { |
| 6389 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6390 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6391 | VOS_ASSERT(0) ; |
| 6392 | return ; |
| 6393 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6394 | |
| 6395 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 6396 | pEnterBmpsRspParams = (tEnterBmpsParams *)pWdaParams->wdaMsgParam; |
| 6397 | |
| 6398 | pEnterBmpsRspParams->bssIdx = pwdiEnterBmpsRsp->bssIdx; |
| 6399 | pEnterBmpsRspParams->status = CONVERT_WDI2SIR_STATUS(pwdiEnterBmpsRsp->wdiStatus); |
| 6400 | |
| 6401 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6402 | vos_mem_free(pWdaParams) ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6403 | WDA_SendMsg(pWDA, WDA_ENTER_BMPS_RSP, (void *)pEnterBmpsRspParams , 0); |
| 6404 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6405 | return ; |
| 6406 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6407 | /* |
| 6408 | * FUNCTION: WDA_ProcessEnterBmpsReq |
| 6409 | * Request to WDI to Enter BMPS power state. |
| 6410 | */ |
| 6411 | VOS_STATUS WDA_ProcessEnterBmpsReq(tWDA_CbContext *pWDA, |
| 6412 | tEnterBmpsParams *pEnterBmpsReqParams) |
| 6413 | { |
| 6414 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 6415 | WDI_EnterBmpsReqParamsType *wdiEnterBmpsReqParams; |
| 6416 | tWDA_ReqParams *pWdaParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6417 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6418 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6419 | if ((NULL == pWDA) || (NULL == pEnterBmpsReqParams)) |
| 6420 | { |
| 6421 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6422 | "%s: invalid param", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6423 | VOS_ASSERT(0); |
| 6424 | return VOS_STATUS_E_FAILURE; |
| 6425 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6426 | wdiEnterBmpsReqParams = vos_mem_malloc(sizeof(WDI_EnterBmpsReqParamsType)); |
| 6427 | if (NULL == wdiEnterBmpsReqParams) |
| 6428 | { |
| 6429 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6430 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6431 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6432 | WDA_SendMsg(pWDA, WDA_ENTER_BMPS_RSP, NULL , |
| 6433 | CONVERT_WDI2SIR_STATUS(WDI_STATUS_MEM_FAILURE)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6434 | return VOS_STATUS_E_NOMEM; |
| 6435 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6436 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)); |
| 6437 | if (NULL == pWdaParams) |
| 6438 | { |
| 6439 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6440 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6441 | VOS_ASSERT(0); |
| 6442 | vos_mem_free(wdiEnterBmpsReqParams); |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6443 | WDA_SendMsg(pWDA, WDA_ENTER_BMPS_RSP, NULL , |
| 6444 | CONVERT_WDI2SIR_STATUS(WDI_STATUS_MEM_FAILURE)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6445 | return VOS_STATUS_E_NOMEM; |
| 6446 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6447 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx = pEnterBmpsReqParams->bssIdx; |
| 6448 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount = pEnterBmpsReqParams->dtimCount; |
| 6449 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod = pEnterBmpsReqParams->dtimPeriod; |
| 6450 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt = pEnterBmpsReqParams->tbtt; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6451 | // For CCX and 11R Roaming |
| 6452 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod = (wpt_uint32)pEnterBmpsReqParams->rssiFilterPeriod; |
| 6453 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage = (wpt_uint32)pEnterBmpsReqParams->numBeaconPerRssiAverage; |
| 6454 | wdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable = (wpt_uint8)pEnterBmpsReqParams->bRssiFilterEnable; |
| 6455 | wdiEnterBmpsReqParams->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6456 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6457 | /* Store param pointer as passed in by caller */ |
| 6458 | /* store Params pass it to WDI */ |
| 6459 | pWdaParams->wdaWdiApiMsgParam = wdiEnterBmpsReqParams; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6460 | pWdaParams->wdaMsgParam = pEnterBmpsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6461 | pWdaParams->pWdaContext = pWDA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6462 | status = WDI_EnterBmpsReq(wdiEnterBmpsReqParams, |
| 6463 | (WDI_EnterBmpsRspCb)WDA_EnterBmpsReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6464 | if (IS_WDI_STATUS_FAILURE(status)) |
| 6465 | { |
| 6466 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6467 | "Failure in Enter BMPS REQ WDI API, free all the memory" ); |
| 6468 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 6469 | vos_mem_free(pWdaParams->wdaMsgParam); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6470 | vos_mem_free(pWdaParams); |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6471 | WDA_SendMsg(pWDA, WDA_ENTER_BMPS_RSP, NULL , CONVERT_WDI2SIR_STATUS(status)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6472 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6473 | return CONVERT_WDI2VOS_STATUS(status); |
| 6474 | } |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6475 | |
| 6476 | |
| 6477 | static void WDA_SendExitBmpsRsp(tWDA_CbContext *pWDA, |
| 6478 | WDI_Status wdiStatus, |
| 6479 | tExitBmpsParams *pExitBmpsReqParams) |
| 6480 | { |
| 6481 | pExitBmpsReqParams->status = CONVERT_WDI2SIR_STATUS(wdiStatus) ; |
| 6482 | |
| 6483 | WDA_SendMsg(pWDA, WDA_EXIT_BMPS_RSP, (void *)pExitBmpsReqParams , 0) ; |
| 6484 | } |
| 6485 | |
| 6486 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6487 | /* |
| 6488 | * FUNCTION: WDA_ExitBmpsReqCallback |
| 6489 | * send Exit BMPS RSP back to PE |
| 6490 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6491 | void WDA_ExitBmpsReqCallback(WDI_ExitBmpsRspParamsType *pwdiExitBmpsRsp, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6492 | { |
| 6493 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 6494 | tWDA_CbContext *pWDA; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6495 | tExitBmpsParams *pExitBmpsRspParams; |
| 6496 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6497 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6498 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6499 | if(NULL == pWdaParams) |
| 6500 | { |
| 6501 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6502 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6503 | VOS_ASSERT(0) ; |
| 6504 | return ; |
| 6505 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6506 | |
| 6507 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 6508 | pExitBmpsRspParams = (tExitBmpsParams *)pWdaParams->wdaMsgParam; |
| 6509 | |
| 6510 | pExitBmpsRspParams->bssIdx = pwdiExitBmpsRsp->bssIdx; |
| 6511 | pExitBmpsRspParams->status = CONVERT_WDI2SIR_STATUS(pwdiExitBmpsRsp->wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6512 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6513 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6514 | vos_mem_free(pWdaParams) ; |
| 6515 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6516 | WDA_SendMsg(pWDA, WDA_EXIT_BMPS_RSP, (void *)pExitBmpsRspParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6517 | return ; |
| 6518 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6519 | /* |
| 6520 | * FUNCTION: WDA_ProcessExitBmpsReq |
| 6521 | * Request to WDI to Exit BMPS power state. |
| 6522 | */ |
| 6523 | VOS_STATUS WDA_ProcessExitBmpsReq(tWDA_CbContext *pWDA, |
| 6524 | tExitBmpsParams *pExitBmpsReqParams) |
| 6525 | { |
| 6526 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 6527 | WDI_ExitBmpsReqParamsType *wdiExitBmpsReqParams = |
| 6528 | (WDI_ExitBmpsReqParamsType *)vos_mem_malloc( |
| 6529 | sizeof(WDI_ExitBmpsReqParamsType)) ; |
| 6530 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6531 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6532 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6533 | if(NULL == wdiExitBmpsReqParams) |
| 6534 | { |
| 6535 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6536 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6537 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6538 | WDA_SendExitBmpsRsp(pWDA, WDI_STATUS_MEM_FAILURE, pExitBmpsReqParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6539 | return VOS_STATUS_E_NOMEM; |
| 6540 | } |
| 6541 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6542 | if(NULL == pWdaParams) |
| 6543 | { |
| 6544 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6545 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6546 | VOS_ASSERT(0); |
| 6547 | vos_mem_free(wdiExitBmpsReqParams); |
| 6548 | return VOS_STATUS_E_NOMEM; |
| 6549 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6550 | wdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull = pExitBmpsReqParams->sendDataNull; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6551 | |
| 6552 | wdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx = pExitBmpsReqParams->bssIdx; |
| 6553 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6554 | wdiExitBmpsReqParams->wdiReqStatusCB = NULL; |
| 6555 | |
| 6556 | /* Store param pointer as passed in by caller */ |
| 6557 | /* store Params pass it to WDI */ |
| 6558 | pWdaParams->wdaWdiApiMsgParam = wdiExitBmpsReqParams; |
| 6559 | pWdaParams->pWdaContext = pWDA; |
| 6560 | pWdaParams->wdaMsgParam = pExitBmpsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6561 | status = WDI_ExitBmpsReq(wdiExitBmpsReqParams, |
| 6562 | (WDI_ExitBmpsRspCb)WDA_ExitBmpsReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6563 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6564 | { |
| 6565 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6566 | "Failure in Exit BMPS REQ WDI API, free all the memory " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6567 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6568 | vos_mem_free(pWdaParams) ; |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 6569 | WDA_SendExitBmpsRsp(pWDA, status, pExitBmpsReqParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6570 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6571 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 6572 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6573 | /* |
| 6574 | * FUNCTION: WDA_EnterUapsdReqCallback |
| 6575 | * send Enter UAPSD RSP back to PE |
| 6576 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6577 | void WDA_EnterUapsdReqCallback( WDI_EnterUapsdRspParamsType *pwdiEnterUapsdRspParams, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6578 | { |
| 6579 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 6580 | tWDA_CbContext *pWDA; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6581 | tUapsdParams *pEnterUapsdRsqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6582 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6583 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6584 | if(NULL == pWdaParams) |
| 6585 | { |
| 6586 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6587 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6588 | VOS_ASSERT(0) ; |
| 6589 | return ; |
| 6590 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6591 | |
| 6592 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 6593 | pEnterUapsdRsqParams = (tUapsdParams *)pWdaParams->wdaMsgParam; |
| 6594 | |
| 6595 | pEnterUapsdRsqParams->bssIdx = pwdiEnterUapsdRspParams->bssIdx; |
| 6596 | pEnterUapsdRsqParams->status = CONVERT_WDI2SIR_STATUS(pwdiEnterUapsdRspParams->wdiStatus); |
| 6597 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6598 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6599 | vos_mem_free(pWdaParams) ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6600 | WDA_SendMsg(pWDA, WDA_ENTER_UAPSD_RSP, (void *)pEnterUapsdRsqParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6601 | return ; |
| 6602 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6603 | /* |
| 6604 | * FUNCTION: WDA_ProcessEnterUapsdReq |
| 6605 | * Request to WDI to Enter UAPSD power state. |
| 6606 | */ |
| 6607 | VOS_STATUS WDA_ProcessEnterUapsdReq(tWDA_CbContext *pWDA, |
| 6608 | tUapsdParams *pEnterUapsdReqParams) |
| 6609 | { |
| 6610 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 6611 | WDI_EnterUapsdReqParamsType *wdiEnterUapsdReqParams = |
| 6612 | (WDI_EnterUapsdReqParamsType *)vos_mem_malloc( |
| 6613 | sizeof(WDI_EnterUapsdReqParamsType)) ; |
| 6614 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6615 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6616 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6617 | if(NULL == wdiEnterUapsdReqParams) |
| 6618 | { |
| 6619 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6620 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6621 | VOS_ASSERT(0); |
| 6622 | return VOS_STATUS_E_NOMEM; |
| 6623 | } |
| 6624 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6625 | if(NULL == pWdaParams) |
| 6626 | { |
| 6627 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6628 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6629 | VOS_ASSERT(0); |
| 6630 | vos_mem_free(wdiEnterUapsdReqParams); |
| 6631 | return VOS_STATUS_E_NOMEM; |
| 6632 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6633 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled = |
| 6634 | pEnterUapsdReqParams->beDeliveryEnabled; |
| 6635 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled = |
| 6636 | pEnterUapsdReqParams->beTriggerEnabled; |
| 6637 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled = |
| 6638 | pEnterUapsdReqParams->bkDeliveryEnabled; |
| 6639 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled = |
| 6640 | pEnterUapsdReqParams->bkTriggerEnabled; |
| 6641 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled = |
| 6642 | pEnterUapsdReqParams->viDeliveryEnabled; |
| 6643 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled = |
| 6644 | pEnterUapsdReqParams->viTriggerEnabled; |
| 6645 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled = |
| 6646 | pEnterUapsdReqParams->voDeliveryEnabled; |
| 6647 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled = |
| 6648 | pEnterUapsdReqParams->voTriggerEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6649 | wdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx = pEnterUapsdReqParams->bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6650 | |
| 6651 | wdiEnterUapsdReqParams->wdiReqStatusCB = NULL; |
| 6652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6653 | /* Store param pointer as passed in by caller */ |
| 6654 | /* store Params pass it to WDI */ |
| 6655 | pWdaParams->wdaWdiApiMsgParam = wdiEnterUapsdReqParams; |
| 6656 | pWdaParams->pWdaContext = pWDA; |
| 6657 | pWdaParams->wdaMsgParam = pEnterUapsdReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6658 | status = WDI_EnterUapsdReq(wdiEnterUapsdReqParams, |
| 6659 | (WDI_EnterUapsdRspCb)WDA_EnterUapsdReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6660 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6661 | { |
| 6662 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6663 | "Failure in Enter UAPSD REQ WDI API, free all the memory " ); |
| 6664 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 6665 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6666 | vos_mem_free(pWdaParams) ; |
| 6667 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6668 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 6669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6670 | /* |
| 6671 | * FUNCTION: WDA_ExitUapsdReqCallback |
| 6672 | * send Exit UAPSD RSP back to PE |
| 6673 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6674 | void WDA_ExitUapsdReqCallback(WDI_ExitUapsdRspParamsType *pwdiExitRspParam, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6675 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6676 | |
| 6677 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 6678 | tWDA_CbContext *pWDA; |
| 6679 | tExitUapsdParams *pExitUapsdRspParams; |
| 6680 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6681 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6682 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6683 | if(NULL == pWdaParams) |
| 6684 | { |
| 6685 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6686 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6687 | VOS_ASSERT(0); |
| 6688 | return; |
| 6689 | } |
| 6690 | |
| 6691 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 6692 | pExitUapsdRspParams = (tExitUapsdParams *)pWdaParams->wdaMsgParam; |
| 6693 | |
| 6694 | pExitUapsdRspParams->bssIdx = pwdiExitRspParam->bssIdx; |
| 6695 | pExitUapsdRspParams->status = CONVERT_WDI2SIR_STATUS(pwdiExitRspParam->wdiStatus); |
| 6696 | |
| 6697 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6698 | vos_mem_free(pWdaParams) ; |
| 6699 | |
| 6700 | WDA_SendMsg(pWDA, WDA_EXIT_UAPSD_RSP, (void *)pExitUapsdRspParams, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6701 | return ; |
| 6702 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6703 | /* |
| 6704 | * FUNCTION: WDA_ProcessExitUapsdReq |
| 6705 | * Request to WDI to Exit UAPSD power state. |
| 6706 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6707 | VOS_STATUS WDA_ProcessExitUapsdReq(tWDA_CbContext *pWDA, |
| 6708 | tExitUapsdParams *pExitUapsdParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6709 | { |
| 6710 | WDI_Status status = WDI_STATUS_SUCCESS ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6711 | tWDA_ReqParams *pWdaParams ; |
| 6712 | WDI_ExitUapsdReqParamsType *wdiExitUapsdReqParams = |
| 6713 | (WDI_ExitUapsdReqParamsType *)vos_mem_malloc( |
| 6714 | sizeof(WDI_ExitUapsdReqParamsType)) ; |
| 6715 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6716 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6717 | "------> %s " ,__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6718 | |
| 6719 | if(NULL == wdiExitUapsdReqParams) |
| 6720 | { |
| 6721 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6722 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6723 | VOS_ASSERT(0); |
| 6724 | return VOS_STATUS_E_NOMEM; |
| 6725 | } |
| 6726 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6727 | if(NULL == pWdaParams) |
| 6728 | { |
| 6729 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6730 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6731 | VOS_ASSERT(0); |
| 6732 | vos_mem_free(wdiExitUapsdReqParams); |
| 6733 | return VOS_STATUS_E_NOMEM; |
| 6734 | } |
| 6735 | |
| 6736 | wdiExitUapsdReqParams->wdiExitUapsdInfo.bssIdx = pExitUapsdParams->bssIdx; |
| 6737 | wdiExitUapsdReqParams->wdiReqStatusCB = NULL; |
| 6738 | |
| 6739 | /* Store param pointer as passed in by caller */ |
| 6740 | /* store Params pass it to WDI */ |
| 6741 | pWdaParams->wdaWdiApiMsgParam = wdiExitUapsdReqParams; |
| 6742 | pWdaParams->pWdaContext = pWDA; |
| 6743 | pWdaParams->wdaMsgParam = pExitUapsdParams; |
| 6744 | |
| 6745 | status = WDI_ExitUapsdReq(wdiExitUapsdReqParams, (WDI_ExitUapsdRspCb)WDA_ExitUapsdReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6746 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6747 | { |
| 6748 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6749 | "Failure in Exit UAPSD REQ WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6750 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 6751 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6752 | vos_mem_free(pWdaParams) ; |
| 6753 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6754 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6755 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 6756 | } |
| 6757 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6758 | /* |
| 6759 | * FUNCTION: WDA_SetPwrSaveCfgReqCallback |
| 6760 | * |
| 6761 | */ |
| 6762 | void WDA_SetPwrSaveCfgReqCallback(WDI_Status status, void* pUserData) |
| 6763 | { |
| 6764 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6765 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6766 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6767 | if(NULL == pWdaParams) |
| 6768 | { |
| 6769 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6770 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6771 | VOS_ASSERT(0) ; |
| 6772 | return ; |
| 6773 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6774 | if( pWdaParams != NULL ) |
| 6775 | { |
| 6776 | if( pWdaParams->wdaWdiApiMsgParam != NULL ) |
| 6777 | { |
| 6778 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6779 | } |
| 6780 | if( pWdaParams->wdaMsgParam != NULL ) |
| 6781 | { |
| 6782 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 6783 | } |
| 6784 | vos_mem_free(pWdaParams) ; |
| 6785 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6786 | return ; |
| 6787 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6788 | /* |
| 6789 | * FUNCTION: WDA_ProcessSetPwrSaveCfgReq |
| 6790 | * Request to WDI to set the power save params at start. |
| 6791 | */ |
| 6792 | VOS_STATUS WDA_ProcessSetPwrSaveCfgReq(tWDA_CbContext *pWDA, |
| 6793 | tSirPowerSaveCfg *pPowerSaveCfg) |
| 6794 | { |
| 6795 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 6796 | tHalCfg *tlvStruct = NULL ; |
| 6797 | tANI_U8 *tlvStructStart = NULL ; |
| 6798 | v_PVOID_t *configParam; |
| 6799 | tANI_U32 configParamSize; |
| 6800 | tANI_U32 *configDataValue; |
| 6801 | WDI_UpdateCfgReqParamsType *wdiPowerSaveCfg; |
| 6802 | tWDA_ReqParams *pWdaParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6803 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6804 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6805 | if ((NULL == pWDA) || (NULL == pPowerSaveCfg)) |
| 6806 | { |
| 6807 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6808 | "%s: invalid param", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6809 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 6810 | vos_mem_free(pPowerSaveCfg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6811 | return VOS_STATUS_E_FAILURE; |
| 6812 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6813 | wdiPowerSaveCfg = vos_mem_malloc(sizeof(WDI_UpdateCfgReqParamsType)); |
| 6814 | if (NULL == wdiPowerSaveCfg) |
| 6815 | { |
| 6816 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6817 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6818 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 6819 | vos_mem_free(pPowerSaveCfg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6820 | return VOS_STATUS_E_NOMEM; |
| 6821 | } |
| 6822 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6823 | if(NULL == pWdaParams) |
| 6824 | { |
| 6825 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6826 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6827 | VOS_ASSERT(0); |
| 6828 | vos_mem_free(wdiPowerSaveCfg); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 6829 | vos_mem_free(pPowerSaveCfg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6830 | return VOS_STATUS_E_NOMEM; |
| 6831 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6832 | configParamSize = (sizeof(tHalCfg) + (sizeof(tANI_U32))) * WDA_NUM_PWR_SAVE_CFG; |
| 6833 | configParam = vos_mem_malloc(configParamSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6834 | if(NULL == configParam) |
| 6835 | { |
| 6836 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6837 | "%s: VOS MEM Alloc Failure \n", __func__); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 6838 | VOS_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6839 | vos_mem_free(pWdaParams); |
| 6840 | vos_mem_free(wdiPowerSaveCfg); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 6841 | vos_mem_free(pPowerSaveCfg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6842 | return VOS_STATUS_E_NOMEM; |
| 6843 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6844 | vos_mem_set(configParam, configParamSize, 0); |
| 6845 | wdiPowerSaveCfg->pConfigBuffer = configParam; |
| 6846 | tlvStruct = (tHalCfg *)configParam; |
| 6847 | tlvStructStart = (tANI_U8 *)configParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6848 | /* QWLAN_HAL_CFG_PS_BROADCAST_FRAME_FILTER_ENABLE */ |
| 6849 | tlvStruct->type = QWLAN_HAL_CFG_PS_BROADCAST_FRAME_FILTER_ENABLE; |
| 6850 | tlvStruct->length = sizeof(tANI_U32); |
| 6851 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6852 | *configDataValue = (tANI_U32)pPowerSaveCfg->broadcastFrameFilter; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6853 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6854 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6855 | /* QWLAN_HAL_CFG_PS_HEART_BEAT_THRESHOLD */ |
| 6856 | tlvStruct->type = QWLAN_HAL_CFG_PS_HEART_BEAT_THRESHOLD; |
| 6857 | tlvStruct->length = sizeof(tANI_U32); |
| 6858 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6859 | *configDataValue = (tANI_U32)pPowerSaveCfg->HeartBeatCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6860 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6861 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6862 | /* QWLAN_HAL_CFG_PS_IGNORE_DTIM */ |
| 6863 | tlvStruct->type = QWLAN_HAL_CFG_PS_IGNORE_DTIM; |
| 6864 | tlvStruct->length = sizeof(tANI_U32); |
| 6865 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6866 | *configDataValue = (tANI_U32)pPowerSaveCfg->ignoreDtim; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6867 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6868 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6869 | /* QWLAN_HAL_CFG_PS_LISTEN_INTERVAL */ |
| 6870 | tlvStruct->type = QWLAN_HAL_CFG_PS_LISTEN_INTERVAL; |
| 6871 | tlvStruct->length = sizeof(tANI_U32); |
| 6872 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6873 | *configDataValue = (tANI_U32)pPowerSaveCfg->listenInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6874 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6875 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6876 | /* QWLAN_HAL_CFG_PS_MAX_PS_POLL */ |
| 6877 | tlvStruct->type = QWLAN_HAL_CFG_PS_MAX_PS_POLL; |
| 6878 | tlvStruct->length = sizeof(tANI_U32); |
| 6879 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6880 | *configDataValue = (tANI_U32)pPowerSaveCfg->maxPsPoll; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6881 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6882 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6883 | /* QWLAN_HAL_CFG_PS_MIN_RSSI_THRESHOLD */ |
| 6884 | tlvStruct->type = QWLAN_HAL_CFG_PS_MIN_RSSI_THRESHOLD; |
| 6885 | tlvStruct->length = sizeof(tANI_U32); |
| 6886 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6887 | *configDataValue = (tANI_U32)pPowerSaveCfg->minRssiThreshold; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6888 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6889 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6890 | /* QWLAN_HAL_CFG_PS_NTH_BEACON_FILTER */ |
| 6891 | tlvStruct->type = QWLAN_HAL_CFG_PS_NTH_BEACON_FILTER; |
| 6892 | tlvStruct->length = sizeof(tANI_U32); |
| 6893 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6894 | *configDataValue = (tANI_U32)pPowerSaveCfg->nthBeaconFilter; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6895 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6896 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6897 | /* QWLAN_HAL_CFG_PS_ENABLE_BCN_EARLY_TERM */ |
| 6898 | tlvStruct->type = QWLAN_HAL_CFG_PS_ENABLE_BCN_EARLY_TERM; |
| 6899 | tlvStruct->length = sizeof(tANI_U32); |
| 6900 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6901 | *configDataValue = (tANI_U32)pPowerSaveCfg->fEnableBeaconEarlyTermination; |
| 6902 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6903 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6904 | /* QWLAN_HAL_CFG_BCN_EARLY_TERM_WAKEUP_INTERVAL */ |
| 6905 | tlvStruct->type = QWLAN_HAL_CFG_BCN_EARLY_TERM_WAKEUP_INTERVAL; |
| 6906 | tlvStruct->length = sizeof(tANI_U32); |
| 6907 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6908 | *configDataValue = (tANI_U32)pPowerSaveCfg->bcnEarlyTermWakeInterval; |
| 6909 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6910 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6911 | /* QWLAN_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE */ |
| 6912 | tlvStruct->type = QWLAN_HAL_CFG_NUM_BEACON_PER_RSSI_AVERAGE; |
| 6913 | tlvStruct->length = sizeof(tANI_U32); |
| 6914 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6915 | *configDataValue = (tANI_U32)pPowerSaveCfg->numBeaconPerRssiAverage; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6916 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6917 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6918 | /* QWLAN_HAL_CFG_PS_RSSI_FILTER_PERIOD */ |
| 6919 | tlvStruct->type = QWLAN_HAL_CFG_PS_RSSI_FILTER_PERIOD; |
| 6920 | tlvStruct->length = sizeof(tANI_U32); |
| 6921 | configDataValue = (tANI_U32 *)(tlvStruct + 1); |
| 6922 | *configDataValue = (tANI_U32)pPowerSaveCfg->rssiFilterPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6923 | tlvStruct = (tHalCfg *)(( (tANI_U8 *) tlvStruct |
| 6924 | + sizeof(tHalCfg) + tlvStruct->length)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6925 | wdiPowerSaveCfg->uConfigBufferLen = (tANI_U8 *)tlvStruct - tlvStructStart ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6926 | wdiPowerSaveCfg->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6927 | /* store Params pass it to WDI */ |
| 6928 | pWdaParams->wdaMsgParam = configParam; |
| 6929 | pWdaParams->wdaWdiApiMsgParam = wdiPowerSaveCfg; |
| 6930 | pWdaParams->pWdaContext = pWDA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6931 | status = WDI_SetPwrSaveCfgReq(wdiPowerSaveCfg, |
| 6932 | (WDI_SetPwrSaveCfgCb)WDA_SetPwrSaveCfgReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6933 | if(IS_WDI_STATUS_FAILURE(status)) |
| 6934 | { |
| 6935 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 6936 | "Failure in Set Pwr Save CFG REQ WDI API, free all the memory " ); |
| 6937 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 6938 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 6939 | vos_mem_free(pWdaParams); |
| 6940 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6941 | vos_mem_free(pPowerSaveCfg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6942 | return CONVERT_WDI2VOS_STATUS(status); |
| 6943 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6944 | /* |
| 6945 | * FUNCTION: WDA_SetUapsdAcParamsReqCallback |
| 6946 | * |
| 6947 | */ |
| 6948 | void WDA_SetUapsdAcParamsReqCallback(WDI_Status status, void* pUserData) |
| 6949 | { |
| 6950 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6951 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6952 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6953 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 6954 | vos_mem_free(pWdaParams); |
| 6955 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6956 | return ; |
| 6957 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6958 | /* |
| 6959 | * FUNCTION: WDA_SetUapsdAcParamsReq |
| 6960 | * Request to WDI to set the UAPSD params for an ac (sta mode). |
| 6961 | */ |
| 6962 | VOS_STATUS WDA_SetUapsdAcParamsReq(v_PVOID_t pVosContext, v_U8_t staIdx, |
| 6963 | tUapsdInfo *pUapsdInfo) |
| 6964 | { |
| 6965 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 6966 | tWDA_CbContext *pWDA = NULL ; |
| 6967 | WDI_SetUapsdAcParamsReqParamsType *wdiUapsdParams = |
| 6968 | (WDI_SetUapsdAcParamsReqParamsType *)vos_mem_malloc( |
| 6969 | sizeof(WDI_SetUapsdAcParamsReqParamsType)) ; |
| 6970 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6971 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6972 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6973 | if(NULL == wdiUapsdParams) |
| 6974 | { |
| 6975 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6976 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6977 | VOS_ASSERT(0); |
| 6978 | return VOS_STATUS_E_NOMEM; |
| 6979 | } |
| 6980 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 6981 | if(NULL == pWdaParams) |
| 6982 | { |
| 6983 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6984 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6985 | VOS_ASSERT(0); |
| 6986 | vos_mem_free(wdiUapsdParams); |
| 6987 | return VOS_STATUS_E_NOMEM; |
| 6988 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6989 | wdiUapsdParams->wdiUapsdInfo.ucAc = pUapsdInfo->ac; |
| 6990 | wdiUapsdParams->wdiUapsdInfo.uDelayInterval = pUapsdInfo->delayInterval; |
| 6991 | wdiUapsdParams->wdiUapsdInfo.uSrvInterval = pUapsdInfo->srvInterval; |
| 6992 | wdiUapsdParams->wdiUapsdInfo.ucSTAIdx = pUapsdInfo->staidx; |
| 6993 | wdiUapsdParams->wdiUapsdInfo.uSusInterval = pUapsdInfo->susInterval; |
| 6994 | wdiUapsdParams->wdiUapsdInfo.ucUp = pUapsdInfo->up; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6995 | wdiUapsdParams->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6996 | pWDA = vos_get_context( VOS_MODULE_ID_WDA, pVosContext ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6997 | pWdaParams->pWdaContext = pWDA; |
| 6998 | /* Store param pointer as passed in by caller */ |
| 6999 | pWdaParams->wdaMsgParam = pUapsdInfo; |
| 7000 | /* store Params pass it to WDI */ |
| 7001 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiUapsdParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7002 | status = WDI_SetUapsdAcParamsReq(wdiUapsdParams, |
| 7003 | (WDI_SetUapsdAcParamsCb)WDA_SetUapsdAcParamsReqCallback, |
| 7004 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7005 | if(IS_WDI_STATUS_FAILURE(status)) |
| 7006 | { |
| 7007 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7008 | "Failure in Set UAPSD params REQ WDI API, free all the memory " ); |
| 7009 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7010 | vos_mem_free(pWdaParams); |
| 7011 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7012 | if((WDI_STATUS_SUCCESS == status) || (WDI_STATUS_PENDING == status)) |
| 7013 | return VOS_STATUS_SUCCESS; |
| 7014 | else |
| 7015 | return VOS_STATUS_E_FAILURE; |
| 7016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7017 | } |
| 7018 | /* |
| 7019 | * FUNCTION: WDA_ClearUapsdAcParamsReq |
| 7020 | * Currently the WDA API is a NOP. It has been added for symmetry & Also it was |
| 7021 | * decided that the if the UPASD parameters change, FW would get a exit UAPSD |
| 7022 | * and again enter the UPASD with the modified params. Hence the disable |
| 7023 | * function was kept empty. |
| 7024 | * |
| 7025 | */ |
| 7026 | VOS_STATUS WDA_ClearUapsdAcParamsReq(v_PVOID_t pVosContext, v_U8_t staIdx, wpt_uint8 ac) |
| 7027 | { |
| 7028 | /* do nothing */ |
| 7029 | return VOS_STATUS_SUCCESS; |
| 7030 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7031 | /* |
| 7032 | * FUNCTION: WDA_UpdateUapsdParamsReqCallback |
| 7033 | * |
| 7034 | */ |
| 7035 | void WDA_UpdateUapsdParamsReqCallback(WDI_Status status, void* pUserData) |
| 7036 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7037 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 7038 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7039 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7040 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7041 | |
| 7042 | if(NULL == pWdaParams) |
| 7043 | { |
| 7044 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7045 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7046 | VOS_ASSERT(0) ; |
| 7047 | return ; |
| 7048 | } |
| 7049 | |
| 7050 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7051 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7052 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7053 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7054 | //print a msg, nothing else to do |
| 7055 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 7056 | "WDA_UpdateUapsdParamsReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7057 | return ; |
| 7058 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7059 | /* |
| 7060 | * FUNCTION: WDA_UpdateUapsdParamsReq |
| 7061 | * Request to WDI to update UAPSD params (in softAP mode) for a station. |
| 7062 | */ |
| 7063 | VOS_STATUS WDA_UpdateUapsdParamsReq(tWDA_CbContext *pWDA, |
| 7064 | tUpdateUapsdParams* pUpdateUapsdInfo) |
| 7065 | { |
| 7066 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7067 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7068 | WDI_UpdateUapsdReqParamsType *wdiUpdateUapsdParams = |
| 7069 | (WDI_UpdateUapsdReqParamsType *)vos_mem_malloc( |
| 7070 | sizeof(WDI_UpdateUapsdReqParamsType)) ; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7071 | tWDA_ReqParams *pWdaParams = NULL; |
| 7072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7073 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7074 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7075 | if(NULL == wdiUpdateUapsdParams) |
| 7076 | { |
| 7077 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7078 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7079 | VOS_ASSERT(0); |
| 7080 | return VOS_STATUS_E_NOMEM; |
| 7081 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7082 | wdiUpdateUapsdParams->wdiUpdateUapsdInfo.uMaxSpLen = pUpdateUapsdInfo->maxSpLen; |
| 7083 | wdiUpdateUapsdParams->wdiUpdateUapsdInfo.ucSTAIdx = pUpdateUapsdInfo->staIdx; |
| 7084 | wdiUpdateUapsdParams->wdiUpdateUapsdInfo.ucUapsdACMask = pUpdateUapsdInfo->uapsdACMask; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7085 | |
| 7086 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7087 | if(NULL == pWdaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7088 | { |
| 7089 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7090 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7091 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7092 | vos_mem_free(pUpdateUapsdInfo); |
| 7093 | vos_mem_free(wdiUpdateUapsdParams); |
| 7094 | return VOS_STATUS_E_NOMEM; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7095 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7096 | /* Store param pointer as passed in by caller */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7097 | pWdaParams->wdaMsgParam = pUpdateUapsdInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7098 | /* store Params pass it to WDI */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7099 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiUpdateUapsdParams; |
| 7100 | pWdaParams->pWdaContext = pWDA; |
| 7101 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7102 | wstatus = WDI_UpdateUapsdParamsReq(wdiUpdateUapsdParams, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7103 | (WDI_UpdateUapsdParamsCb)WDA_UpdateUapsdParamsReqCallback, |
| 7104 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7105 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7106 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7107 | { |
| 7108 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7109 | "Failure in Set UAPSD params REQ WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7110 | status = CONVERT_WDI2VOS_STATUS(wstatus) ; |
| 7111 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7112 | vos_mem_free(pWdaParams->wdaMsgParam); |
Madan Mohan Koyyalamudi | 683acf1 | 2012-10-30 18:10:18 -0700 | [diff] [blame] | 7113 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7114 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7115 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7116 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7117 | /* |
| 7118 | * FUNCTION: WDA_ConfigureRxpFilterCallback |
| 7119 | * |
| 7120 | */ |
| 7121 | void WDA_ConfigureRxpFilterCallback(WDI_Status wdiStatus, void* pUserData) |
| 7122 | { |
| 7123 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7124 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7125 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7126 | if(WDI_STATUS_SUCCESS != wdiStatus) |
| 7127 | { |
| 7128 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7129 | "%s: RXP config filter failure \n", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7130 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7131 | if(NULL == pWdaParams) |
| 7132 | { |
| 7133 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7134 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7135 | VOS_ASSERT(0) ; |
| 7136 | return ; |
| 7137 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7138 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7139 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7140 | vos_mem_free(pWdaParams); |
| 7141 | return ; |
| 7142 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7143 | /* |
| 7144 | * FUNCTION: WDA_ProcessConfigureRxpFilterReq |
| 7145 | * |
| 7146 | */ |
| 7147 | VOS_STATUS WDA_ProcessConfigureRxpFilterReq(tWDA_CbContext *pWDA, |
| 7148 | tSirWlanSetRxpFilters *pWlanSuspendParam) |
| 7149 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7150 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7151 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7152 | WDI_ConfigureRxpFilterReqParamsType *wdiRxpFilterParams = |
| 7153 | (WDI_ConfigureRxpFilterReqParamsType *)vos_mem_malloc( |
| 7154 | sizeof(WDI_ConfigureRxpFilterReqParamsType)) ; |
| 7155 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7156 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7157 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7158 | if(NULL == wdiRxpFilterParams) |
| 7159 | { |
| 7160 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7161 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7162 | VOS_ASSERT(0); |
| 7163 | vos_mem_free(pWlanSuspendParam); |
| 7164 | return VOS_STATUS_E_NOMEM; |
| 7165 | } |
| 7166 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7167 | if(NULL == pWdaParams) |
| 7168 | { |
| 7169 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7170 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7171 | VOS_ASSERT(0); |
| 7172 | vos_mem_free(wdiRxpFilterParams); |
| 7173 | vos_mem_free(pWlanSuspendParam); |
| 7174 | return VOS_STATUS_E_NOMEM; |
| 7175 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7176 | wdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter = |
| 7177 | pWlanSuspendParam->setMcstBcstFilter; |
| 7178 | wdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting = |
| 7179 | pWlanSuspendParam->configuredMcstBcstFilterSetting; |
| 7180 | |
| 7181 | wdiRxpFilterParams->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7182 | pWdaParams->pWdaContext = pWDA; |
| 7183 | pWdaParams->wdaMsgParam = pWlanSuspendParam; |
| 7184 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiRxpFilterParams; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7185 | wstatus = WDI_ConfigureRxpFilterReq(wdiRxpFilterParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7186 | (WDI_ConfigureRxpFilterCb)WDA_ConfigureRxpFilterCallback, |
| 7187 | pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7188 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7189 | { |
| 7190 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7191 | "Failure in configure RXP filter REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7192 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7193 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7194 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7195 | vos_mem_free(pWdaParams); |
| 7196 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7197 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7198 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7199 | /* |
| 7200 | * FUNCTION: WDA_WdiIndicationCallback |
| 7201 | * |
| 7202 | */ |
| 7203 | void WDA_WdiIndicationCallback( WDI_Status wdiStatus, |
| 7204 | void* pUserData) |
| 7205 | { |
| 7206 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7207 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7208 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7209 | /* |
| 7210 | * FUNCTION: WDA_ProcessWlanSuspendInd |
| 7211 | * |
| 7212 | */ |
| 7213 | VOS_STATUS WDA_ProcessWlanSuspendInd(tWDA_CbContext *pWDA, |
| 7214 | tSirWlanSuspendParam *pWlanSuspendParam) |
| 7215 | { |
| 7216 | WDI_Status wdiStatus; |
| 7217 | WDI_SuspendParamsType wdiSuspendParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7218 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7219 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7220 | wdiSuspendParams.wdiSuspendParams.ucConfiguredMcstBcstFilterSetting = |
| 7221 | pWlanSuspendParam->configuredMcstBcstFilterSetting; |
| 7222 | wdiSuspendParams.wdiReqStatusCB = WDA_WdiIndicationCallback; |
| 7223 | wdiSuspendParams.pUserData = pWDA; |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7224 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "%s: %d" ,__func__, pWlanSuspendParam->configuredMcstBcstFilterSetting); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7225 | wdiStatus = WDI_HostSuspendInd(&wdiSuspendParams); |
| 7226 | if(WDI_STATUS_PENDING == wdiStatus) |
| 7227 | { |
| 7228 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7229 | "Pending received for %s:%d ",__func__,__LINE__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7230 | } |
| 7231 | else if( WDI_STATUS_SUCCESS_SYNC != wdiStatus ) |
| 7232 | { |
| 7233 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7234 | "Failure in %s:%d ",__func__,__LINE__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7235 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7236 | vos_mem_free(pWlanSuspendParam); |
| 7237 | return CONVERT_WDI2VOS_STATUS(wdiStatus) ; |
| 7238 | } |
| 7239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7240 | /* |
| 7241 | * FUNCTION: WDA_ProcessWlanResumeCallback |
| 7242 | * |
| 7243 | */ |
| 7244 | void WDA_ProcessWlanResumeCallback( |
| 7245 | WDI_SuspendResumeRspParamsType *resumeRspParams, |
| 7246 | void* pUserData) |
| 7247 | { |
| 7248 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7249 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7250 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7251 | if(NULL == pWdaParams) |
| 7252 | { |
| 7253 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7254 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7255 | VOS_ASSERT(0) ; |
| 7256 | return ; |
| 7257 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7258 | if(WDI_STATUS_SUCCESS != resumeRspParams->wdiStatus) |
| 7259 | { |
| 7260 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7261 | "%s: Process Wlan Resume failure \n", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7262 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7263 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7264 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7265 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7266 | return ; |
| 7267 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7268 | /* |
| 7269 | * FUNCTION: WDA_ProcessWlanResumeReq |
| 7270 | * |
| 7271 | */ |
| 7272 | VOS_STATUS WDA_ProcessWlanResumeReq(tWDA_CbContext *pWDA, |
| 7273 | tSirWlanResumeParam *pWlanResumeParam) |
| 7274 | { |
| 7275 | WDI_Status wdiStatus; |
| 7276 | WDI_ResumeParamsType *wdiResumeParams = |
| 7277 | (WDI_ResumeParamsType *)vos_mem_malloc( |
| 7278 | sizeof(WDI_ResumeParamsType) ) ; |
| 7279 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7280 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7281 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7282 | if(NULL == wdiResumeParams) |
| 7283 | { |
| 7284 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7285 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7286 | VOS_ASSERT(0); |
| 7287 | return VOS_STATUS_E_NOMEM; |
| 7288 | } |
| 7289 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7290 | if(NULL == pWdaParams) |
| 7291 | { |
| 7292 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7293 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7294 | VOS_ASSERT(0); |
| 7295 | vos_mem_free(wdiResumeParams); |
| 7296 | return VOS_STATUS_E_NOMEM; |
| 7297 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7298 | wdiResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting = |
| 7299 | pWlanResumeParam->configuredMcstBcstFilterSetting; |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7300 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "%s: %d" ,__func__, pWlanResumeParam->configuredMcstBcstFilterSetting); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7301 | wdiResumeParams->wdiReqStatusCB = NULL; |
| 7302 | pWdaParams->wdaMsgParam = pWlanResumeParam; |
| 7303 | pWdaParams->wdaWdiApiMsgParam = wdiResumeParams; |
| 7304 | pWdaParams->pWdaContext = pWDA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7305 | wdiStatus = WDI_HostResumeReq(wdiResumeParams, |
| 7306 | (WDI_HostResumeEventRspCb)WDA_ProcessWlanResumeCallback, |
| 7307 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7308 | if(IS_WDI_STATUS_FAILURE(wdiStatus)) |
| 7309 | { |
| 7310 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7311 | "Failure in Host Resume REQ WDI API, free all the memory " ); |
| 7312 | VOS_ASSERT(0); |
| 7313 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7314 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7315 | vos_mem_free(pWdaParams); |
| 7316 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7317 | return CONVERT_WDI2VOS_STATUS(wdiStatus) ; |
| 7318 | } |
| 7319 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7320 | /* |
| 7321 | * FUNCTION: WDA_SetBeaconFilterReqCallback |
| 7322 | * |
| 7323 | */ |
| 7324 | void WDA_SetBeaconFilterReqCallback(WDI_Status status, void* pUserData) |
| 7325 | { |
| 7326 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7327 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7328 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7329 | if(NULL == pWdaParams) |
| 7330 | { |
| 7331 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7332 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7333 | VOS_ASSERT(0) ; |
| 7334 | return ; |
| 7335 | } |
| 7336 | |
| 7337 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 7338 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7339 | vos_mem_free(pWdaParams) ; |
| 7340 | /* |
| 7341 | * No respone required for SetBeaconFilter req so just free the request |
| 7342 | * param here |
| 7343 | */ |
| 7344 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7345 | return ; |
| 7346 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7347 | /* |
| 7348 | * FUNCTION: WDA_SetBeaconFilterReq |
| 7349 | * Request to WDI to send the beacon filtering related information. |
| 7350 | */ |
| 7351 | VOS_STATUS WDA_SetBeaconFilterReq(tWDA_CbContext *pWDA, |
| 7352 | tBeaconFilterMsg* pBeaconFilterInfo) |
| 7353 | { |
| 7354 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 7355 | tANI_U8 *dstPtr, *srcPtr; |
| 7356 | tANI_U8 filterLength; |
| 7357 | WDI_BeaconFilterReqParamsType *wdiBeaconFilterInfo = |
| 7358 | (WDI_BeaconFilterReqParamsType *)vos_mem_malloc( |
| 7359 | sizeof(WDI_BeaconFilterReqParamsType) ) ; |
| 7360 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7361 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7362 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7363 | if(NULL == wdiBeaconFilterInfo) |
| 7364 | { |
| 7365 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7366 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7367 | VOS_ASSERT(0); |
| 7368 | return VOS_STATUS_E_NOMEM; |
| 7369 | } |
| 7370 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7371 | if(NULL == pWdaParams) |
| 7372 | { |
| 7373 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7374 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7375 | VOS_ASSERT(0); |
| 7376 | vos_mem_free(wdiBeaconFilterInfo); |
| 7377 | return VOS_STATUS_E_NOMEM; |
| 7378 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7379 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.usBeaconInterval = |
| 7380 | pBeaconFilterInfo->beaconInterval; |
| 7381 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.usCapabilityInfo = |
| 7382 | pBeaconFilterInfo->capabilityInfo; |
| 7383 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.usCapabilityMask = |
| 7384 | pBeaconFilterInfo->capabilityMask; |
| 7385 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.usIeNum = pBeaconFilterInfo->ieNum; |
Madan Mohan Koyyalamudi | a84edda | 2012-10-15 14:58:25 -0700 | [diff] [blame] | 7386 | |
| 7387 | //Fill the BssIdx |
| 7388 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.bssIdx = pBeaconFilterInfo->bssIdx; |
| 7389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7390 | //Fill structure with info contained in the beaconFilterTable |
| 7391 | dstPtr = (tANI_U8 *)wdiBeaconFilterInfo + sizeof(WDI_BeaconFilterInfoType); |
| 7392 | srcPtr = (tANI_U8 *)pBeaconFilterInfo + sizeof(tBeaconFilterMsg); |
| 7393 | filterLength = wdiBeaconFilterInfo->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe); |
| 7394 | if(WDI_BEACON_FILTER_LEN < filterLength) |
| 7395 | { |
| 7396 | filterLength = WDI_BEACON_FILTER_LEN; |
| 7397 | } |
| 7398 | vos_mem_copy(dstPtr, srcPtr, filterLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7399 | wdiBeaconFilterInfo->wdiReqStatusCB = NULL; |
| 7400 | /* Store param pointer as passed in by caller */ |
| 7401 | /* store Params pass it to WDI */ |
| 7402 | pWdaParams->wdaWdiApiMsgParam = wdiBeaconFilterInfo; |
| 7403 | pWdaParams->pWdaContext = pWDA; |
| 7404 | pWdaParams->wdaMsgParam = pBeaconFilterInfo; |
| 7405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7406 | status = WDI_SetBeaconFilterReq(wdiBeaconFilterInfo, |
| 7407 | (WDI_SetBeaconFilterCb)WDA_SetBeaconFilterReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7408 | if(IS_WDI_STATUS_FAILURE(status)) |
| 7409 | { |
| 7410 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7411 | "Failure in Set Beacon Filter REQ WDI API, free all the memory " ); |
| 7412 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 7413 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7414 | vos_mem_free(pWdaParams) ; |
| 7415 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7416 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 7417 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7418 | /* |
| 7419 | * FUNCTION: WDA_RemBeaconFilterReqCallback |
| 7420 | * |
| 7421 | */ |
| 7422 | void WDA_RemBeaconFilterReqCallback(WDI_Status status, void* pUserData) |
| 7423 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7424 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 7425 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7426 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7427 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7428 | |
| 7429 | if(NULL == pWdaParams) |
| 7430 | { |
| 7431 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7432 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7433 | VOS_ASSERT(0) ; |
| 7434 | return ; |
| 7435 | } |
| 7436 | |
| 7437 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7438 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7439 | vos_mem_free(pWdaParams); |
| 7440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7441 | //print a msg, nothing else to do |
| 7442 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 7443 | "WDA_RemBeaconFilterReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7444 | return ; |
| 7445 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7446 | // TODO: PE does not have this feature for now implemented, |
| 7447 | // but the support for removing beacon filter exists between |
| 7448 | // HAL and FW. This function can be called whenever PE defines |
| 7449 | // a new message for beacon filter removal |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7450 | /* |
| 7451 | * FUNCTION: WDA_RemBeaconFilterReq |
| 7452 | * Request to WDI to send the removal of beacon filtering related information. |
| 7453 | */ |
| 7454 | VOS_STATUS WDA_RemBeaconFilterReq(tWDA_CbContext *pWDA, |
| 7455 | tRemBeaconFilterMsg* pBeaconFilterInfo) |
| 7456 | { |
| 7457 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7458 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7459 | WDI_RemBeaconFilterReqParamsType *wdiBeaconFilterInfo = |
| 7460 | (WDI_RemBeaconFilterReqParamsType *)vos_mem_malloc( |
| 7461 | sizeof(WDI_RemBeaconFilterReqParamsType) + pBeaconFilterInfo->ucIeCount) ; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7462 | tWDA_ReqParams *pWdaParams ; |
| 7463 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7464 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7465 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7466 | if(NULL == wdiBeaconFilterInfo) |
| 7467 | { |
| 7468 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7469 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7470 | VOS_ASSERT(0); |
| 7471 | return VOS_STATUS_E_NOMEM; |
| 7472 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7473 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.ucIeCount = |
| 7474 | pBeaconFilterInfo->ucIeCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7475 | //Fill structure with info contained in the ucRemIeId |
| 7476 | vos_mem_copy(wdiBeaconFilterInfo->wdiBeaconFilterInfo.ucRemIeId, |
| 7477 | pBeaconFilterInfo->ucRemIeId, |
| 7478 | wdiBeaconFilterInfo->wdiBeaconFilterInfo.ucIeCount); |
| 7479 | wdiBeaconFilterInfo->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7480 | |
| 7481 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7482 | if(NULL == pWdaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7483 | { |
| 7484 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7485 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7486 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7487 | vos_mem_free(wdiBeaconFilterInfo); |
| 7488 | vos_mem_free(pBeaconFilterInfo); |
| 7489 | return VOS_STATUS_E_NOMEM; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7490 | } |
| 7491 | |
| 7492 | /* Store param pointer as passed in by caller */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7493 | pWdaParams->wdaMsgParam = pBeaconFilterInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7494 | /* store Params pass it to WDI */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7495 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiBeaconFilterInfo; |
| 7496 | |
| 7497 | pWdaParams->pWdaContext = pWDA; |
| 7498 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7499 | wstatus = WDI_RemBeaconFilterReq(wdiBeaconFilterInfo, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7500 | (WDI_RemBeaconFilterCb)WDA_RemBeaconFilterReqCallback, pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7501 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7502 | { |
| 7503 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7504 | "Failure in Remove Beacon Filter REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7505 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7506 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7507 | vos_mem_free(pWdaParams->wdaMsgParam); |
Madan Mohan Koyyalamudi | 683acf1 | 2012-10-30 18:10:18 -0700 | [diff] [blame] | 7508 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7509 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7510 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7511 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7512 | /* |
| 7513 | * FUNCTION: WDA_SetRSSIThresholdsReqCallback |
| 7514 | * |
| 7515 | */ |
| 7516 | void WDA_SetRSSIThresholdsReqCallback(WDI_Status status, void* pUserData) |
| 7517 | { |
| 7518 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7519 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7520 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7521 | if(NULL == pWdaParams) |
| 7522 | { |
| 7523 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7524 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7525 | VOS_ASSERT(0) ; |
| 7526 | return ; |
| 7527 | } |
| 7528 | |
| 7529 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7530 | vos_mem_free(pWdaParams) ; |
| 7531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7532 | return ; |
| 7533 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7534 | /* |
| 7535 | * FUNCTION: WDA_SetRSSIThresholdsReq |
| 7536 | * Request to WDI to set the RSSI thresholds (sta mode). |
| 7537 | */ |
| 7538 | VOS_STATUS WDA_SetRSSIThresholdsReq(tpAniSirGlobal pMac, tSirRSSIThresholds *pBmpsThresholds) |
| 7539 | { |
| 7540 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7541 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7542 | tWDA_CbContext *pWDA = NULL ; |
| 7543 | v_PVOID_t pVosContext = NULL; |
| 7544 | WDI_SetRSSIThresholdsReqParamsType *wdiRSSIThresholdsInfo = |
| 7545 | (WDI_SetRSSIThresholdsReqParamsType *)vos_mem_malloc( |
| 7546 | sizeof(WDI_SetRSSIThresholdsReqParamsType)) ; |
| 7547 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7548 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7549 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7550 | if(NULL == wdiRSSIThresholdsInfo) |
| 7551 | { |
| 7552 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7553 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7554 | VOS_ASSERT(0); |
| 7555 | return VOS_STATUS_E_NOMEM; |
| 7556 | } |
| 7557 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7558 | if(NULL == pWdaParams) |
| 7559 | { |
| 7560 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7561 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7562 | VOS_ASSERT(0); |
| 7563 | vos_mem_free(wdiRSSIThresholdsInfo); |
| 7564 | return VOS_STATUS_E_NOMEM; |
| 7565 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7566 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bReserved10 = pBmpsThresholds->bReserved10; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7567 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.ucRssiThreshold1 = pBmpsThresholds->ucRssiThreshold1; |
| 7568 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.ucRssiThreshold2 = pBmpsThresholds->ucRssiThreshold2; |
| 7569 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.ucRssiThreshold3 = pBmpsThresholds->ucRssiThreshold3; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7570 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bRssiThres1NegNotify = pBmpsThresholds->bRssiThres1NegNotify; |
| 7571 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bRssiThres2NegNotify = pBmpsThresholds->bRssiThres2NegNotify; |
| 7572 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bRssiThres3NegNotify = pBmpsThresholds->bRssiThres3NegNotify; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7573 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bRssiThres1PosNotify = pBmpsThresholds->bRssiThres1PosNotify; |
| 7574 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bRssiThres2PosNotify = pBmpsThresholds->bRssiThres2PosNotify; |
| 7575 | wdiRSSIThresholdsInfo->wdiRSSIThresholdsInfo.bRssiThres3PosNotify = pBmpsThresholds->bRssiThres3PosNotify; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7576 | wdiRSSIThresholdsInfo->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7577 | pVosContext = vos_get_global_context(VOS_MODULE_ID_PE, (void *)pMac); |
| 7578 | pWDA = vos_get_context( VOS_MODULE_ID_WDA, pVosContext ); |
| 7579 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7580 | /* Store param pointer as passed in by caller */ |
| 7581 | /* store Params pass it to WDI */ |
| 7582 | pWdaParams->wdaWdiApiMsgParam = wdiRSSIThresholdsInfo; |
| 7583 | pWdaParams->pWdaContext = pWDA; |
| 7584 | pWdaParams->wdaMsgParam = pBmpsThresholds; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7585 | wstatus = WDI_SetRSSIThresholdsReq(wdiRSSIThresholdsInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7586 | (WDI_SetRSSIThresholdsCb)WDA_SetRSSIThresholdsReqCallback, pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7587 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7588 | { |
| 7589 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7590 | "Failure in Set RSSI thresholds REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7591 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7592 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7593 | vos_mem_free(pWdaParams) ; |
| 7594 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7595 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7596 | |
| 7597 | }/*WDA_SetRSSIThresholdsReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7598 | /* |
| 7599 | * FUNCTION: WDA_HostOffloadReqCallback |
| 7600 | * |
| 7601 | */ |
| 7602 | void WDA_HostOffloadReqCallback(WDI_Status status, void* pUserData) |
| 7603 | { |
| 7604 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 7605 | |
| 7606 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7607 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7608 | if(NULL == pWdaParams) |
| 7609 | { |
| 7610 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7611 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7612 | VOS_ASSERT(0) ; |
| 7613 | return ; |
| 7614 | } |
| 7615 | |
| 7616 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7617 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7618 | vos_mem_free(pWdaParams) ; |
| 7619 | |
| 7620 | //print a msg, nothing else to do |
| 7621 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 7622 | "WDA_HostOffloadReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7623 | return ; |
| 7624 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7625 | /* |
| 7626 | * FUNCTION: WDA_ProcessHostOffloadReq |
| 7627 | * Request to WDI to set the filter to minimize unnecessary host wakeup due |
| 7628 | * to broadcast traffic (sta mode). |
| 7629 | */ |
| 7630 | VOS_STATUS WDA_ProcessHostOffloadReq(tWDA_CbContext *pWDA, |
| 7631 | tSirHostOffloadReq *pHostOffloadParams) |
| 7632 | { |
| 7633 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7634 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7635 | WDI_HostOffloadReqParamsType *wdiHostOffloadInfo = |
| 7636 | (WDI_HostOffloadReqParamsType *)vos_mem_malloc( |
| 7637 | sizeof(WDI_HostOffloadReqParamsType)) ; |
| 7638 | tWDA_ReqParams *pWdaParams ; |
| 7639 | |
| 7640 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7641 | "------> %s: offloadType=%x" ,__func__, pHostOffloadParams->offloadType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7642 | |
| 7643 | if(NULL == wdiHostOffloadInfo) |
| 7644 | { |
| 7645 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7646 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7647 | VOS_ASSERT(0); |
| 7648 | return VOS_STATUS_E_NOMEM; |
| 7649 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7650 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7651 | if(NULL == pWdaParams) |
| 7652 | { |
| 7653 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7654 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7655 | VOS_ASSERT(0); |
| 7656 | vos_mem_free(wdiHostOffloadInfo); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7657 | vos_mem_free(pHostOffloadParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7658 | return VOS_STATUS_E_NOMEM; |
| 7659 | } |
| 7660 | |
| 7661 | wdiHostOffloadInfo->wdiHostOffloadInfo.ucOffloadType = |
| 7662 | pHostOffloadParams->offloadType; |
| 7663 | wdiHostOffloadInfo->wdiHostOffloadInfo.ucEnableOrDisable = |
| 7664 | pHostOffloadParams->enableOrDisable; |
| 7665 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7666 | vos_mem_copy(wdiHostOffloadInfo->wdiHostOffloadInfo.bssId, |
| 7667 | pHostOffloadParams->bssId, sizeof(wpt_macAddr)); |
| 7668 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7669 | switch (wdiHostOffloadInfo->wdiHostOffloadInfo.ucOffloadType) |
| 7670 | { |
| 7671 | case SIR_IPV4_ARP_REPLY_OFFLOAD: |
| 7672 | vos_mem_copy(wdiHostOffloadInfo->wdiHostOffloadInfo.params.aHostIpv4Addr, |
| 7673 | pHostOffloadParams->params.hostIpv4Addr, |
| 7674 | 4); |
| 7675 | break; |
| 7676 | case SIR_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD: |
| 7677 | vos_mem_copy(wdiHostOffloadInfo->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 7678 | pHostOffloadParams->params.hostIpv6Addr, |
| 7679 | 16); |
| 7680 | break; |
| 7681 | case SIR_IPV6_NS_OFFLOAD: |
| 7682 | vos_mem_copy(wdiHostOffloadInfo->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 7683 | pHostOffloadParams->params.hostIpv6Addr, |
| 7684 | 16); |
| 7685 | |
| 7686 | #ifdef WLAN_NS_OFFLOAD |
| 7687 | if(pHostOffloadParams->nsOffloadInfo.srcIPv6AddrValid) |
| 7688 | { |
| 7689 | vos_mem_copy(wdiHostOffloadInfo->wdiNsOffloadParams.srcIPv6Addr, |
| 7690 | pHostOffloadParams->nsOffloadInfo.srcIPv6Addr, |
| 7691 | 16); |
| 7692 | wdiHostOffloadInfo->wdiNsOffloadParams.srcIPv6AddrValid = 1; |
| 7693 | } |
| 7694 | else |
| 7695 | { |
| 7696 | wdiHostOffloadInfo->wdiNsOffloadParams.srcIPv6AddrValid = 0; |
| 7697 | } |
| 7698 | |
| 7699 | vos_mem_copy(wdiHostOffloadInfo->wdiNsOffloadParams.selfIPv6Addr, |
| 7700 | pHostOffloadParams->nsOffloadInfo.selfIPv6Addr, |
| 7701 | 16); |
| 7702 | vos_mem_copy(wdiHostOffloadInfo->wdiNsOffloadParams.selfMacAddr, |
| 7703 | pHostOffloadParams->nsOffloadInfo.selfMacAddr, |
| 7704 | 6); |
| 7705 | |
| 7706 | //Only two are supported so let's go through them without a loop |
| 7707 | if(pHostOffloadParams->nsOffloadInfo.targetIPv6AddrValid[0]) |
| 7708 | { |
| 7709 | vos_mem_copy(wdiHostOffloadInfo->wdiNsOffloadParams.targetIPv6Addr1, |
| 7710 | pHostOffloadParams->nsOffloadInfo.targetIPv6Addr[0], |
| 7711 | 16); |
| 7712 | wdiHostOffloadInfo->wdiNsOffloadParams.targetIPv6Addr1Valid = 1; |
| 7713 | } |
| 7714 | else |
| 7715 | { |
| 7716 | wdiHostOffloadInfo->wdiNsOffloadParams.targetIPv6Addr1Valid = 0; |
| 7717 | } |
| 7718 | |
| 7719 | if(pHostOffloadParams->nsOffloadInfo.targetIPv6AddrValid[1]) |
| 7720 | { |
| 7721 | vos_mem_copy(wdiHostOffloadInfo->wdiNsOffloadParams.targetIPv6Addr2, |
| 7722 | pHostOffloadParams->nsOffloadInfo.targetIPv6Addr[1], |
| 7723 | 16); |
| 7724 | wdiHostOffloadInfo->wdiNsOffloadParams.targetIPv6Addr2Valid = 1; |
| 7725 | } |
| 7726 | else |
| 7727 | { |
| 7728 | wdiHostOffloadInfo->wdiNsOffloadParams.targetIPv6Addr2Valid = 0; |
| 7729 | } |
| 7730 | break; |
| 7731 | #endif //WLAN_NS_OFFLOAD |
| 7732 | default: |
| 7733 | { |
| 7734 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7735 | "No Handling for Offload Type %x in WDA " |
| 7736 | , wdiHostOffloadInfo->wdiHostOffloadInfo.ucOffloadType); |
| 7737 | //WDA_VOS_ASSERT(0) ; |
| 7738 | } |
| 7739 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7740 | wdiHostOffloadInfo->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7742 | /* Store param pointer as passed in by caller */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7743 | pWdaParams->wdaMsgParam = pHostOffloadParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7744 | /* store Params pass it to WDI */ |
| 7745 | pWdaParams->wdaWdiApiMsgParam = wdiHostOffloadInfo; |
| 7746 | pWdaParams->pWdaContext = pWDA; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7747 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7748 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7749 | wstatus = WDI_HostOffloadReq(wdiHostOffloadInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7750 | (WDI_HostOffloadCb)WDA_HostOffloadReqCallback, pWdaParams); |
| 7751 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7752 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7753 | { |
| 7754 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7755 | "Failure in host offload REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7756 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7757 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7758 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7759 | vos_mem_free(pWdaParams) ; |
| 7760 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7761 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7762 | |
| 7763 | }/*WDA_HostOffloadReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7764 | /* |
| 7765 | * FUNCTION: WDA_KeepAliveReqCallback |
| 7766 | * |
| 7767 | */ |
| 7768 | void WDA_KeepAliveReqCallback(WDI_Status status, void* pUserData) |
| 7769 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7770 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData ; |
| 7771 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7772 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7773 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7774 | |
| 7775 | if(NULL == pWdaParams) |
| 7776 | { |
| 7777 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7778 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7779 | VOS_ASSERT(0) ; |
| 7780 | return ; |
| 7781 | } |
| 7782 | |
| 7783 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7784 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7785 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7786 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7787 | //print a msg, nothing else to do |
| 7788 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 7789 | "WDA_KeepAliveReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7790 | return ; |
| 7791 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7792 | /* |
| 7793 | * FUNCTION: WDA_ProcessKeepAliveReq |
| 7794 | * Request to WDI to send Keep Alive packets to minimize unnecessary host |
| 7795 | * wakeup due to broadcast traffic (sta mode). |
| 7796 | */ |
| 7797 | VOS_STATUS WDA_ProcessKeepAliveReq(tWDA_CbContext *pWDA, |
| 7798 | tSirKeepAliveReq *pKeepAliveParams) |
| 7799 | { |
| 7800 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7801 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7802 | WDI_KeepAliveReqParamsType *wdiKeepAliveInfo = |
| 7803 | (WDI_KeepAliveReqParamsType *)vos_mem_malloc( |
| 7804 | sizeof(WDI_KeepAliveReqParamsType)) ; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7805 | tWDA_ReqParams *pWdaParams; |
| 7806 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7807 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7808 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7809 | if(NULL == wdiKeepAliveInfo) |
| 7810 | { |
| 7811 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7812 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7813 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7814 | vos_mem_free(pKeepAliveParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7815 | return VOS_STATUS_E_NOMEM; |
| 7816 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7817 | |
| 7818 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7819 | if(NULL == pWdaParams) |
| 7820 | { |
| 7821 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7822 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7823 | VOS_ASSERT(0); |
| 7824 | vos_mem_free(wdiKeepAliveInfo); |
| 7825 | vos_mem_free(pKeepAliveParams); |
| 7826 | return VOS_STATUS_E_NOMEM; |
| 7827 | } |
| 7828 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7829 | wdiKeepAliveInfo->wdiKeepAliveInfo.ucPacketType = |
| 7830 | pKeepAliveParams->packetType; |
| 7831 | wdiKeepAliveInfo->wdiKeepAliveInfo.ucTimePeriod = |
| 7832 | pKeepAliveParams->timePeriod; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7833 | |
| 7834 | vos_mem_copy(&wdiKeepAliveInfo->wdiKeepAliveInfo.bssId, |
| 7835 | pKeepAliveParams->bssId, |
| 7836 | sizeof(wpt_macAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7837 | |
| 7838 | if(pKeepAliveParams->packetType == SIR_KEEP_ALIVE_UNSOLICIT_ARP_RSP) |
| 7839 | { |
| 7840 | vos_mem_copy(&wdiKeepAliveInfo->wdiKeepAliveInfo.aHostIpv4Addr, |
| 7841 | pKeepAliveParams->hostIpv4Addr, |
| 7842 | SIR_IPV4_ADDR_LEN); |
| 7843 | vos_mem_copy(&wdiKeepAliveInfo->wdiKeepAliveInfo.aDestIpv4Addr, |
| 7844 | pKeepAliveParams->destIpv4Addr, |
| 7845 | SIR_IPV4_ADDR_LEN); |
| 7846 | vos_mem_copy(&wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr, |
| 7847 | pKeepAliveParams->destMacAddr, |
| 7848 | SIR_MAC_ADDR_LEN); |
| 7849 | } |
| 7850 | else if(pKeepAliveParams->packetType == SIR_KEEP_ALIVE_NULL_PKT) |
| 7851 | { |
| 7852 | vos_mem_set(&wdiKeepAliveInfo->wdiKeepAliveInfo.aHostIpv4Addr, |
| 7853 | SIR_IPV4_ADDR_LEN, |
| 7854 | 0); |
| 7855 | vos_mem_set(&wdiKeepAliveInfo->wdiKeepAliveInfo.aDestIpv4Addr, |
| 7856 | SIR_IPV4_ADDR_LEN, |
| 7857 | 0); |
| 7858 | vos_mem_set(&wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr, |
| 7859 | SIR_MAC_ADDR_LEN, |
| 7860 | 0); |
| 7861 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7862 | wdiKeepAliveInfo->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7863 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7864 | /* Store param pointer as passed in by caller */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7865 | pWdaParams->wdaMsgParam = pKeepAliveParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7866 | /* store Params pass it to WDI */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7867 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiKeepAliveInfo; |
| 7868 | pWdaParams->pWdaContext = pWDA; |
| 7869 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7870 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,"WDA HIP : %d.%d.%d.%d", |
| 7871 | wdiKeepAliveInfo->wdiKeepAliveInfo.aHostIpv4Addr[0], |
| 7872 | wdiKeepAliveInfo->wdiKeepAliveInfo.aHostIpv4Addr[1], |
| 7873 | wdiKeepAliveInfo->wdiKeepAliveInfo.aHostIpv4Addr[2], |
| 7874 | wdiKeepAliveInfo->wdiKeepAliveInfo.aHostIpv4Addr[3]); |
| 7875 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,"WDA DIP : %d.%d.%d.%d", |
| 7876 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestIpv4Addr[0], |
| 7877 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestIpv4Addr[1], |
| 7878 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestIpv4Addr[2], |
| 7879 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestIpv4Addr[3]); |
| 7880 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 7881 | "WDA DMAC : %d:%d:%d:%d:%d:%d", |
| 7882 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr[0], |
| 7883 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr[1], |
| 7884 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr[2], |
| 7885 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr[3], |
| 7886 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr[4], |
| 7887 | wdiKeepAliveInfo->wdiKeepAliveInfo.aDestMacAddr[5]); |
| 7888 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 7889 | "TimePeriod %d PacketType %d", |
| 7890 | wdiKeepAliveInfo->wdiKeepAliveInfo.ucTimePeriod, |
| 7891 | wdiKeepAliveInfo->wdiKeepAliveInfo.ucPacketType); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7892 | wstatus = WDI_KeepAliveReq(wdiKeepAliveInfo, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7893 | (WDI_KeepAliveCb)WDA_KeepAliveReqCallback, pWdaParams); |
| 7894 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7895 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7896 | { |
| 7897 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 7898 | "Failure in Keep Alive REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7899 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 7900 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 7901 | vos_mem_free(pWdaParams->wdaMsgParam); |
Madan Mohan Koyyalamudi | 683acf1 | 2012-10-30 18:10:18 -0700 | [diff] [blame] | 7902 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7903 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7904 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7905 | |
| 7906 | }/*WDA_KeepAliveReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7907 | /* |
| 7908 | * FUNCTION: WDA_WowlAddBcPtrnReqCallback |
| 7909 | * |
| 7910 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7911 | void WDA_WowlAddBcPtrnReqCallback( |
| 7912 | WDI_WowlAddBcPtrnRspParamsType *pWdiWowlAddBcstPtrRsp, |
| 7913 | void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7914 | { |
| 7915 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7916 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7917 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7918 | if(NULL == pWdaParams) |
| 7919 | { |
| 7920 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7921 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7922 | VOS_ASSERT(0) ; |
| 7923 | return ; |
| 7924 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7925 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 7926 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 7927 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7928 | return ; |
| 7929 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7930 | /* |
| 7931 | * FUNCTION: WDA_ProcessWowlAddBcPtrnReq |
| 7932 | * Request to WDI to add WOWL Bcast pattern |
| 7933 | */ |
| 7934 | VOS_STATUS WDA_ProcessWowlAddBcPtrnReq(tWDA_CbContext *pWDA, |
| 7935 | tSirWowlAddBcastPtrn *pWowlAddBcPtrnParams) |
| 7936 | { |
| 7937 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 7938 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7939 | WDI_WowlAddBcPtrnReqParamsType *wdiWowlAddBcPtrnInfo = |
| 7940 | (WDI_WowlAddBcPtrnReqParamsType *)vos_mem_malloc( |
| 7941 | sizeof(WDI_WowlAddBcPtrnReqParamsType)) ; |
| 7942 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7943 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7944 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7945 | if(NULL == wdiWowlAddBcPtrnInfo) |
| 7946 | { |
| 7947 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7948 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7949 | VOS_ASSERT(0); |
| 7950 | return VOS_STATUS_E_NOMEM; |
| 7951 | } |
| 7952 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 7953 | if(NULL == pWdaParams) |
| 7954 | { |
| 7955 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7956 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7957 | VOS_ASSERT(0); |
| 7958 | vos_mem_free(wdiWowlAddBcPtrnInfo); |
| 7959 | return VOS_STATUS_E_NOMEM; |
| 7960 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7961 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternId = |
| 7962 | pWowlAddBcPtrnParams->ucPatternId; |
| 7963 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternByteOffset = |
| 7964 | pWowlAddBcPtrnParams->ucPatternByteOffset; |
| 7965 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternMaskSize = |
| 7966 | pWowlAddBcPtrnParams->ucPatternMaskSize; |
| 7967 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternSize = |
| 7968 | pWowlAddBcPtrnParams->ucPatternSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7969 | if (wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternSize <= WDI_WOWL_BCAST_PATTERN_MAX_SIZE) |
| 7970 | { |
| 7971 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPattern, |
| 7972 | pWowlAddBcPtrnParams->ucPattern, |
| 7973 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternSize); |
| 7974 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 7975 | pWowlAddBcPtrnParams->ucPatternMask, |
| 7976 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternMaskSize); |
| 7977 | } |
| 7978 | else |
| 7979 | { |
| 7980 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPattern, |
| 7981 | pWowlAddBcPtrnParams->ucPattern, |
| 7982 | WDI_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 7983 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 7984 | pWowlAddBcPtrnParams->ucPatternMask, |
| 7985 | WDI_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 7986 | |
| 7987 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternExt, |
| 7988 | pWowlAddBcPtrnParams->ucPatternExt, |
| 7989 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternSize - WDI_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 7990 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternMaskExt, |
| 7991 | pWowlAddBcPtrnParams->ucPatternMaskExt, |
| 7992 | wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - WDI_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 7993 | } |
| 7994 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7995 | vos_mem_copy(wdiWowlAddBcPtrnInfo->wdiWowlAddBcPtrnInfo.bssId, |
| 7996 | pWowlAddBcPtrnParams->bssId, sizeof(wpt_macAddr)); |
| 7997 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7998 | wdiWowlAddBcPtrnInfo->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7999 | /* Store param pointer as passed in by caller */ |
| 8000 | /* store Params pass it to WDI */ |
| 8001 | pWdaParams->wdaWdiApiMsgParam = wdiWowlAddBcPtrnInfo; |
| 8002 | pWdaParams->pWdaContext = pWDA; |
| 8003 | pWdaParams->wdaMsgParam = pWowlAddBcPtrnParams; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8004 | wstatus = WDI_WowlAddBcPtrnReq(wdiWowlAddBcPtrnInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8005 | (WDI_WowlAddBcPtrnCb)WDA_WowlAddBcPtrnReqCallback, pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8006 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8007 | { |
| 8008 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8009 | "Failure in Wowl add Bcast ptrn REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8010 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8011 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8012 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8013 | vos_mem_free(pWdaParams) ; |
| 8014 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8015 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8016 | |
| 8017 | }/*WDA_ProcessWowlAddBcPtrnReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8018 | /* |
| 8019 | * FUNCTION: WDA_WowlDelBcPtrnReqCallback |
| 8020 | * |
| 8021 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8022 | void WDA_WowlDelBcPtrnReqCallback( |
| 8023 | WDI_WowlDelBcPtrnRspParamsType *pWdiWowlDelBcstPtrRsp, |
| 8024 | void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8025 | { |
| 8026 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8027 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8028 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8029 | if(NULL == pWdaParams) |
| 8030 | { |
| 8031 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8032 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8033 | VOS_ASSERT(0) ; |
| 8034 | return ; |
| 8035 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8036 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8037 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 8038 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8039 | return ; |
| 8040 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8041 | /* |
| 8042 | * FUNCTION: WDA_ProcessWowlDelBcPtrnReq |
| 8043 | * Request to WDI to delete WOWL Bcast pattern |
| 8044 | */ |
| 8045 | VOS_STATUS WDA_ProcessWowlDelBcPtrnReq(tWDA_CbContext *pWDA, |
| 8046 | tSirWowlDelBcastPtrn *pWowlDelBcPtrnParams) |
| 8047 | { |
| 8048 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8049 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8050 | WDI_WowlDelBcPtrnReqParamsType *wdiWowlDelBcPtrnInfo = |
| 8051 | (WDI_WowlDelBcPtrnReqParamsType *)vos_mem_malloc( |
| 8052 | sizeof(WDI_WowlDelBcPtrnReqParamsType)) ; |
| 8053 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8054 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8055 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8056 | if(NULL == wdiWowlDelBcPtrnInfo) |
| 8057 | { |
| 8058 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8059 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8060 | VOS_ASSERT(0); |
| 8061 | return VOS_STATUS_E_NOMEM; |
| 8062 | } |
| 8063 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8064 | if(NULL == pWdaParams) |
| 8065 | { |
| 8066 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8067 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8068 | VOS_ASSERT(0); |
| 8069 | vos_mem_free(wdiWowlDelBcPtrnInfo); |
| 8070 | return VOS_STATUS_E_NOMEM; |
| 8071 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8072 | wdiWowlDelBcPtrnInfo->wdiWowlDelBcPtrnInfo.ucPatternId = |
| 8073 | pWowlDelBcPtrnParams->ucPatternId; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8074 | |
| 8075 | vos_mem_copy(wdiWowlDelBcPtrnInfo->wdiWowlDelBcPtrnInfo.bssId, |
| 8076 | pWowlDelBcPtrnParams->bssId, sizeof(wpt_macAddr)); |
| 8077 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8078 | wdiWowlDelBcPtrnInfo->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8079 | /* Store param pointer as passed in by caller */ |
| 8080 | /* store Params pass it to WDI */ |
| 8081 | pWdaParams->wdaWdiApiMsgParam = wdiWowlDelBcPtrnInfo; |
| 8082 | pWdaParams->pWdaContext = pWDA; |
| 8083 | pWdaParams->wdaMsgParam = pWowlDelBcPtrnParams; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8084 | wstatus = WDI_WowlDelBcPtrnReq(wdiWowlDelBcPtrnInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8085 | (WDI_WowlDelBcPtrnCb)WDA_WowlDelBcPtrnReqCallback, pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8086 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8087 | { |
| 8088 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8089 | "Failure in Wowl delete Bcast ptrn REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8090 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8091 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8092 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8093 | vos_mem_free(pWdaParams) ; |
| 8094 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8095 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8096 | |
| 8097 | }/*WDA_ProcessWowlDelBcPtrnReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8098 | /* |
| 8099 | * FUNCTION: WDA_WowlEnterReqCallback |
| 8100 | * |
| 8101 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8102 | void WDA_WowlEnterReqCallback(WDI_WowlEnterRspParamsType *pwdiWowlEnterRspParam, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8103 | { |
| 8104 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8105 | tWDA_CbContext *pWDA; |
| 8106 | tSirHalWowlEnterParams *pWowlEnterParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8107 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8108 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8109 | if(NULL == pWdaParams) |
| 8110 | { |
| 8111 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8112 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8113 | VOS_ASSERT(0) ; |
| 8114 | return ; |
| 8115 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8116 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext ; |
| 8117 | pWowlEnterParams = (tSirHalWowlEnterParams *)pWdaParams->wdaMsgParam ; |
| 8118 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8119 | pWowlEnterParams->bssIdx = pwdiWowlEnterRspParam->bssIdx; |
| 8120 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8121 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8122 | vos_mem_free(pWdaParams) ; |
| 8123 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8124 | pWowlEnterParams->status = |
| 8125 | CONVERT_WDI2SIR_STATUS(pwdiWowlEnterRspParam->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8126 | WDA_SendMsg(pWDA, WDA_WOWL_ENTER_RSP, (void *)pWowlEnterParams , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8127 | return ; |
| 8128 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8129 | /* |
| 8130 | * FUNCTION: WDA_ProcessWowlEnterReq |
| 8131 | * Request to WDI to enter WOWL |
| 8132 | */ |
| 8133 | VOS_STATUS WDA_ProcessWowlEnterReq(tWDA_CbContext *pWDA, |
| 8134 | tSirHalWowlEnterParams *pWowlEnterParams) |
| 8135 | { |
| 8136 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8137 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8138 | WDI_WowlEnterReqParamsType *wdiWowlEnterInfo = |
| 8139 | (WDI_WowlEnterReqParamsType *)vos_mem_malloc( |
| 8140 | sizeof(WDI_WowlEnterReqParamsType)) ; |
| 8141 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8142 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8143 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8144 | if(NULL == wdiWowlEnterInfo) |
| 8145 | { |
| 8146 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8147 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8148 | VOS_ASSERT(0); |
| 8149 | return VOS_STATUS_E_NOMEM; |
| 8150 | } |
| 8151 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8152 | if(NULL == pWdaParams) |
| 8153 | { |
| 8154 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8155 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8156 | VOS_ASSERT(0); |
| 8157 | vos_mem_free(wdiWowlEnterInfo); |
| 8158 | return VOS_STATUS_E_NOMEM; |
| 8159 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8160 | vos_mem_copy(wdiWowlEnterInfo->wdiWowlEnterInfo.magicPtrn, |
| 8161 | pWowlEnterParams->magicPtrn, |
| 8162 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8163 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucMagicPktEnable = |
| 8164 | pWowlEnterParams->ucMagicPktEnable; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8165 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucPatternFilteringEnable = |
| 8166 | pWowlEnterParams->ucPatternFilteringEnable; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8167 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucUcastPatternFilteringEnable = |
| 8168 | pWowlEnterParams->ucUcastPatternFilteringEnable; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8169 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowChnlSwitchRcv = |
| 8170 | pWowlEnterParams->ucWowChnlSwitchRcv; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8171 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowDeauthRcv = |
| 8172 | pWowlEnterParams->ucWowDeauthRcv; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8173 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowDisassocRcv = |
| 8174 | pWowlEnterParams->ucWowDisassocRcv; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8175 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowMaxMissedBeacons = |
| 8176 | pWowlEnterParams->ucWowMaxMissedBeacons; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8177 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowMaxSleepUsec = |
| 8178 | pWowlEnterParams->ucWowMaxSleepUsec; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8179 | #ifdef WLAN_WAKEUP_EVENTS |
| 8180 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable = |
| 8181 | pWowlEnterParams->ucWoWEAPIDRequestEnable; |
| 8182 | |
| 8183 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable = |
| 8184 | pWowlEnterParams->ucWoWEAPOL4WayEnable; |
| 8185 | |
| 8186 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowNetScanOffloadMatch = |
| 8187 | pWowlEnterParams->ucWowNetScanOffloadMatch; |
| 8188 | |
| 8189 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWowGTKRekeyError = |
| 8190 | pWowlEnterParams->ucWowGTKRekeyError; |
| 8191 | |
| 8192 | wdiWowlEnterInfo->wdiWowlEnterInfo.ucWoWBSSConnLoss = |
| 8193 | pWowlEnterParams->ucWoWBSSConnLoss; |
| 8194 | #endif // WLAN_WAKEUP_EVENTS |
| 8195 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8196 | wdiWowlEnterInfo->wdiWowlEnterInfo.bssIdx = |
| 8197 | pWowlEnterParams->bssIdx; |
| 8198 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8199 | wdiWowlEnterInfo->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8200 | /* Store param pointer as passed in by caller */ |
| 8201 | /* store Params pass it to WDI */ |
| 8202 | pWdaParams->wdaWdiApiMsgParam = wdiWowlEnterInfo; |
| 8203 | pWdaParams->pWdaContext = pWDA; |
| 8204 | pWdaParams->wdaMsgParam = pWowlEnterParams; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8205 | wstatus = WDI_WowlEnterReq(wdiWowlEnterInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8206 | (WDI_WowlEnterReqCb)WDA_WowlEnterReqCallback, pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8207 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8208 | { |
| 8209 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8210 | "Failure in Wowl enter REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8211 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8212 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8213 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8214 | vos_mem_free(pWdaParams) ; |
| 8215 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8216 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8217 | |
| 8218 | }/*WDA_ProcessWowlEnterReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8219 | /* |
| 8220 | * FUNCTION: WDA_WowlExitReqCallback |
| 8221 | * |
| 8222 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8223 | void WDA_WowlExitReqCallback( WDI_WowlExitRspParamsType *pwdiWowlExitRsp, void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8224 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8225 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8226 | tWDA_CbContext *pWDA; |
| 8227 | tSirHalWowlExitParams *pWowlExitParams; |
| 8228 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8229 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8230 | if(NULL == pWdaParams) |
| 8231 | { |
| 8232 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8233 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8234 | VOS_ASSERT(0) ; |
| 8235 | return ; |
| 8236 | } |
| 8237 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext ; |
| 8238 | pWowlExitParams = (tSirHalWowlExitParams *)pWdaParams->wdaMsgParam ; |
| 8239 | |
| 8240 | pWowlExitParams->bssIdx = pwdiWowlExitRsp->bssIdx; |
| 8241 | pWowlExitParams->status = CONVERT_WDI2SIR_STATUS(pwdiWowlExitRsp->status); |
| 8242 | |
| 8243 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8244 | vos_mem_free(pWdaParams) ; |
| 8245 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8246 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8247 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8248 | WDA_SendMsg(pWDA, WDA_WOWL_EXIT_RSP, (void *)pWowlExitParams, 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8249 | return ; |
| 8250 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8251 | /* |
| 8252 | * FUNCTION: WDA_ProcessWowlExitReq |
| 8253 | * Request to WDI to add WOWL Bcast pattern |
| 8254 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8255 | VOS_STATUS WDA_ProcessWowlExitReq(tWDA_CbContext *pWDA, |
| 8256 | tSirHalWowlExitParams *pWowlExitParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8257 | { |
| 8258 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8259 | WDI_Status wstatus; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8260 | WDI_WowlExitReqParamsType *wdiWowlExitInfo = |
| 8261 | (WDI_WowlExitReqParamsType *)vos_mem_malloc( |
| 8262 | sizeof(WDI_WowlExitReqParamsType)) ; |
| 8263 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8264 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8265 | "------> %s " ,__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8266 | if(NULL == wdiWowlExitInfo) |
| 8267 | { |
| 8268 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8269 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8270 | VOS_ASSERT(0); |
| 8271 | return VOS_STATUS_E_NOMEM; |
| 8272 | } |
| 8273 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8274 | if(NULL == pWdaParams) |
| 8275 | { |
| 8276 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8277 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8278 | VOS_ASSERT(0); |
| 8279 | vos_mem_free(wdiWowlExitInfo); |
| 8280 | return VOS_STATUS_E_NOMEM; |
| 8281 | } |
| 8282 | |
| 8283 | wdiWowlExitInfo->wdiWowlExitInfo.bssIdx = |
| 8284 | pWowlExitParams->bssIdx; |
| 8285 | |
| 8286 | wdiWowlExitInfo->wdiReqStatusCB = NULL; |
| 8287 | |
| 8288 | /* Store param pointer as passed in by caller */ |
| 8289 | /* store Params pass it to WDI */ |
| 8290 | pWdaParams->wdaWdiApiMsgParam = wdiWowlExitInfo; |
| 8291 | pWdaParams->pWdaContext = pWDA; |
| 8292 | pWdaParams->wdaMsgParam = pWowlExitParams; |
| 8293 | |
| 8294 | wstatus = WDI_WowlExitReq(wdiWowlExitInfo, |
| 8295 | (WDI_WowlExitReqCb)WDA_WowlExitReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8296 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8297 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8298 | { |
| 8299 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8300 | "Failure in Wowl exit REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8301 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8302 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 8303 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 8304 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8305 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8306 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8307 | }/*WDA_ProcessWowlExitReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8308 | /* |
| 8309 | * FUNCTION: WDA_IsHwFrameTxTranslationCapable |
| 8310 | * Request to WDI to determine whether a given station is capable of |
| 8311 | * using HW-based frame translation |
| 8312 | */ |
| 8313 | v_BOOL_t WDA_IsHwFrameTxTranslationCapable(v_PVOID_t pVosGCtx, |
| 8314 | tANI_U8 staIdx) |
| 8315 | { |
| 8316 | return WDI_IsHwFrameTxTranslationCapable(staIdx); |
| 8317 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8318 | /* |
| 8319 | * FUNCTION: WDA_NvDownloadReqCallback |
| 8320 | * send NV Download RSP back to PE |
| 8321 | */ |
| 8322 | void WDA_NvDownloadReqCallback(WDI_NvDownloadRspInfoType *pNvDownloadRspParams, |
| 8323 | void* pUserData) |
| 8324 | { |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8325 | |
| 8326 | tWDA_ReqParams *pWdaParams= ( tWDA_ReqParams *)pUserData; |
| 8327 | tWDA_CbContext *pWDA; |
| 8328 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8329 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8330 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8331 | |
| 8332 | if(NULL == pWdaParams) |
| 8333 | { |
| 8334 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8335 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8336 | VOS_ASSERT(0) ; |
| 8337 | return ; |
| 8338 | } |
| 8339 | |
| 8340 | pWDA = pWdaParams->pWdaContext; |
| 8341 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8342 | /*Cleaning */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8343 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 8344 | vos_mem_free(pWdaParams); |
| 8345 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8346 | vos_WDAComplete_cback(pWDA->pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8347 | return ; |
| 8348 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8349 | /* |
| 8350 | * FUNCTION: WDA_ProcessNvDownloadReq |
| 8351 | * Read the NV blob to a buffer and send a request to WDI to download the blob to NV memory. |
| 8352 | */ |
| 8353 | VOS_STATUS WDA_NVDownload_Start(v_PVOID_t pVosContext) |
| 8354 | { |
| 8355 | /* Initialize the local Variables*/ |
| 8356 | tWDA_CbContext *pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
| 8357 | v_VOID_t *pNvBuffer=NULL; |
| 8358 | v_SIZE_t bufferSize = 0; |
| 8359 | WDI_Status status = WDI_STATUS_E_FAILURE; |
| 8360 | WDI_NvDownloadReqParamsType * wdiNvDownloadReqParam =NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8361 | tWDA_ReqParams *pWdaParams ; |
| 8362 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8363 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8364 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8365 | if(NULL == pWDA) |
| 8366 | { |
| 8367 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8368 | "%s:pWDA is NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8369 | VOS_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8370 | return VOS_STATUS_E_FAILURE; |
| 8371 | } |
| 8372 | |
| 8373 | /* Get the NV structure base address and size from VOS */ |
| 8374 | vos_nv_getNVBuffer(&pNvBuffer,&bufferSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8375 | wdiNvDownloadReqParam = (WDI_NvDownloadReqParamsType *)vos_mem_malloc( |
| 8376 | sizeof(WDI_NvDownloadReqParamsType)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8377 | if(NULL == wdiNvDownloadReqParam) |
| 8378 | { |
| 8379 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8380 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8381 | VOS_ASSERT(0); |
| 8382 | return VOS_STATUS_E_NOMEM; |
| 8383 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8384 | /* Copy Params to wdiNvDownloadReqParam*/ |
| 8385 | wdiNvDownloadReqParam->wdiBlobInfo.pBlobAddress = pNvBuffer; |
| 8386 | wdiNvDownloadReqParam->wdiBlobInfo.uBlobSize = bufferSize; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8387 | |
| 8388 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8389 | if(NULL == pWdaParams) |
| 8390 | { |
| 8391 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8392 | "%s: VOS MEM Alloc Failure", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8393 | VOS_ASSERT(0); |
| 8394 | vos_mem_free(wdiNvDownloadReqParam); |
| 8395 | return VOS_STATUS_E_NOMEM; |
| 8396 | } |
| 8397 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8398 | /* store Params pass it to WDI */ |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8399 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiNvDownloadReqParam ; |
| 8400 | pWdaParams->wdaMsgParam = NULL; |
| 8401 | pWdaParams->pWdaContext = pWDA; |
| 8402 | |
| 8403 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8404 | wdiNvDownloadReqParam->wdiReqStatusCB = NULL ; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8406 | status = WDI_NvDownloadReq(wdiNvDownloadReqParam, |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8407 | (WDI_NvDownloadRspCb)WDA_NvDownloadReqCallback,(void *)pWdaParams); |
| 8408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8409 | if(IS_WDI_STATUS_FAILURE(status)) |
| 8410 | { |
| 8411 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8412 | "Failure in NV Download REQ Params WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8413 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 8414 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8415 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8416 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8417 | } |
| 8418 | /* |
| 8419 | * FUNCTION: WDA_FlushAcReqCallback |
| 8420 | * send Flush AC RSP back to TL |
| 8421 | */ |
| 8422 | void WDA_FlushAcReqCallback(WDI_Status status, void* pUserData) |
| 8423 | { |
| 8424 | vos_msg_t wdaMsg = {0} ; |
| 8425 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8426 | tFlushACReq *pFlushACReqParams; |
| 8427 | tFlushACRsp *pFlushACRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8428 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8429 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8430 | if(NULL == pWdaParams) |
| 8431 | { |
| 8432 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8433 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8434 | VOS_ASSERT(0) ; |
| 8435 | return ; |
| 8436 | } |
| 8437 | |
| 8438 | pFlushACReqParams = (tFlushACReq *)pWdaParams->wdaMsgParam; |
| 8439 | pFlushACRspParams = vos_mem_malloc(sizeof(tFlushACRsp)); |
| 8440 | if(NULL == pFlushACRspParams) |
| 8441 | { |
| 8442 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8443 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8444 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 8445 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8446 | return ; |
| 8447 | } |
| 8448 | vos_mem_zero(pFlushACRspParams,sizeof(tFlushACRsp)); |
| 8449 | pFlushACRspParams->mesgLen = sizeof(tFlushACRsp); |
| 8450 | pFlushACRspParams->mesgType = WDA_TL_FLUSH_AC_RSP; |
| 8451 | pFlushACRspParams->ucSTAId = pFlushACReqParams->ucSTAId; |
| 8452 | pFlushACRspParams->ucTid = pFlushACReqParams->ucTid; |
| 8453 | pFlushACRspParams->status = CONVERT_WDI2SIR_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8454 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8455 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8456 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8457 | wdaMsg.type = WDA_TL_FLUSH_AC_RSP ; |
| 8458 | wdaMsg.bodyptr = (void *)pFlushACRspParams; |
| 8459 | // POST message to TL |
| 8460 | vos_mq_post_message(VOS_MQ_ID_TL, (vos_msg_t *) &wdaMsg); |
| 8461 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8462 | return ; |
| 8463 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8464 | /* |
| 8465 | * FUNCTION: WDA_ProcessFlushAcReq |
| 8466 | * Request to WDI to Update the DELBA REQ params. |
| 8467 | */ |
| 8468 | VOS_STATUS WDA_ProcessFlushAcReq(tWDA_CbContext *pWDA, |
| 8469 | tFlushACReq *pFlushAcReqParams) |
| 8470 | { |
| 8471 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 8472 | WDI_FlushAcReqParamsType *wdiFlushAcReqParam = |
| 8473 | (WDI_FlushAcReqParamsType *)vos_mem_malloc( |
| 8474 | sizeof(WDI_FlushAcReqParamsType)) ; |
| 8475 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8476 | if(NULL == wdiFlushAcReqParam) |
| 8477 | { |
| 8478 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8479 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8480 | VOS_ASSERT(0); |
| 8481 | return VOS_STATUS_E_NOMEM; |
| 8482 | } |
| 8483 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8484 | if(NULL == pWdaParams) |
| 8485 | { |
| 8486 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8487 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8488 | VOS_ASSERT(0); |
| 8489 | vos_mem_free(wdiFlushAcReqParam); |
| 8490 | return VOS_STATUS_E_NOMEM; |
| 8491 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8492 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8493 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8494 | wdiFlushAcReqParam->wdiFlushAcInfo.ucSTAId = pFlushAcReqParams->ucSTAId; |
| 8495 | wdiFlushAcReqParam->wdiFlushAcInfo.ucTid = pFlushAcReqParams->ucTid; |
| 8496 | wdiFlushAcReqParam->wdiFlushAcInfo.usMesgLen = pFlushAcReqParams->mesgLen; |
| 8497 | wdiFlushAcReqParam->wdiFlushAcInfo.usMesgType = pFlushAcReqParams->mesgType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8498 | /* Store Flush AC pointer, as this will be used for response */ |
| 8499 | /* store Params pass it to WDI */ |
| 8500 | pWdaParams->pWdaContext = pWDA; |
| 8501 | pWdaParams->wdaMsgParam = pFlushAcReqParams; |
| 8502 | pWdaParams->wdaWdiApiMsgParam = wdiFlushAcReqParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8503 | status = WDI_FlushAcReq(wdiFlushAcReqParam, |
| 8504 | (WDI_FlushAcRspCb)WDA_FlushAcReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8505 | if(IS_WDI_STATUS_FAILURE(status)) |
| 8506 | { |
| 8507 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8508 | "Failure in Flush AC REQ Params WDI API, free all the memory " ); |
| 8509 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8510 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8511 | vos_mem_free(pWdaParams) ; |
| 8512 | //TODO: respond to TL with failure |
| 8513 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8514 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8515 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8516 | /* |
| 8517 | * FUNCTION: WDA_BtAmpEventReqCallback |
| 8518 | * |
| 8519 | */ |
| 8520 | void WDA_BtAmpEventReqCallback(WDI_Status status, void* pUserData) |
| 8521 | { |
| 8522 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8523 | tWDA_CbContext *pWDA; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8524 | WDI_BtAmpEventParamsType *wdiBtAmpEventParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8525 | |
| 8526 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8527 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8528 | if(NULL == pWdaParams) |
| 8529 | { |
| 8530 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8531 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8532 | VOS_ASSERT(0) ; |
| 8533 | return ; |
| 8534 | } |
| 8535 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 8536 | wdiBtAmpEventParam = (WDI_BtAmpEventParamsType *)pWdaParams->wdaWdiApiMsgParam; |
| 8537 | if(BTAMP_EVENT_CONNECTION_TERMINATED == |
| 8538 | wdiBtAmpEventParam->wdiBtAmpEventInfo.ucBtAmpEventType) |
| 8539 | { |
| 8540 | pWDA->wdaAmpSessionOn = VOS_FALSE; |
| 8541 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8542 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8543 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8544 | vos_mem_free(pWdaParams) ; |
| 8545 | /* |
| 8546 | * No respone required for WDA_SIGNAL_BTAMP_EVENT so just free the request |
| 8547 | * param here |
| 8548 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8549 | return ; |
| 8550 | } |
| 8551 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8552 | /* |
| 8553 | * FUNCTION: WDA_ProcessBtAmpEventReq |
| 8554 | * Request to WDI to Update with BT AMP events. |
| 8555 | */ |
| 8556 | VOS_STATUS WDA_ProcessBtAmpEventReq(tWDA_CbContext *pWDA, |
| 8557 | tSmeBtAmpEvent *pBtAmpEventParams) |
| 8558 | { |
| 8559 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 8560 | WDI_BtAmpEventParamsType *wdiBtAmpEventParam = |
| 8561 | (WDI_BtAmpEventParamsType *)vos_mem_malloc( |
| 8562 | sizeof(WDI_BtAmpEventParamsType)) ; |
| 8563 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8564 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8565 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8566 | if(NULL == wdiBtAmpEventParam) |
| 8567 | { |
| 8568 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8569 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8570 | VOS_ASSERT(0); |
| 8571 | return VOS_STATUS_E_NOMEM; |
| 8572 | } |
| 8573 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8574 | if(NULL == pWdaParams) |
| 8575 | { |
| 8576 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8577 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8578 | VOS_ASSERT(0); |
| 8579 | vos_mem_free(wdiBtAmpEventParam); |
| 8580 | return VOS_STATUS_E_NOMEM; |
| 8581 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8582 | wdiBtAmpEventParam->wdiBtAmpEventInfo.ucBtAmpEventType = |
| 8583 | pBtAmpEventParams->btAmpEventType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8584 | wdiBtAmpEventParam->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8585 | /* Store BT AMP event pointer, as this will be used for response */ |
| 8586 | /* store Params pass it to WDI */ |
| 8587 | pWdaParams->pWdaContext = pWDA; |
| 8588 | pWdaParams->wdaMsgParam = pBtAmpEventParams; |
| 8589 | pWdaParams->wdaWdiApiMsgParam = wdiBtAmpEventParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8590 | status = WDI_BtAmpEventReq(wdiBtAmpEventParam, |
| 8591 | (WDI_BtAmpEventRspCb)WDA_BtAmpEventReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8592 | if(IS_WDI_STATUS_FAILURE(status)) |
| 8593 | { |
| 8594 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8595 | "Failure in BT AMP event REQ Params WDI API, free all the memory " ); |
| 8596 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8597 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8598 | vos_mem_free(pWdaParams) ; |
| 8599 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8600 | if(BTAMP_EVENT_CONNECTION_START == wdiBtAmpEventParam->wdiBtAmpEventInfo.ucBtAmpEventType) |
| 8601 | { |
| 8602 | pWDA->wdaAmpSessionOn = VOS_TRUE; |
| 8603 | } |
| 8604 | return CONVERT_WDI2VOS_STATUS(status) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8605 | } |
| 8606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8607 | #ifdef ANI_MANF_DIAG |
| 8608 | /* |
| 8609 | * FUNCTION: WDA_FTMCommandReqCallback |
| 8610 | * Handle FTM CMD response came from HAL |
| 8611 | * Route responce to HDD FTM |
| 8612 | */ |
| 8613 | void WDA_FTMCommandReqCallback(void *ftmCmdRspData, |
| 8614 | void *usrData) |
| 8615 | { |
| 8616 | tWDA_CbContext *pWDA = (tWDA_CbContext *)usrData ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8617 | if((NULL == pWDA) || (NULL == ftmCmdRspData)) |
| 8618 | { |
| 8619 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8620 | "%s, invalid input 0x%x, 0x%x",__func__, pWDA, ftmCmdRspData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8621 | return; |
| 8622 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8623 | /* Release Current FTM Command Request */ |
| 8624 | vos_mem_free(pWDA->wdaFTMCmdReq); |
| 8625 | pWDA->wdaFTMCmdReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8626 | #ifndef WLAN_FTM_STUB |
| 8627 | /* Post FTM Responce to HDD FTM */ |
| 8628 | wlan_sys_ftm(ftmCmdRspData); |
| 8629 | #endif /* WLAN_FTM_STUB */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8630 | return; |
| 8631 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8632 | /* |
| 8633 | * FUNCTION: WDA_ProcessFTMCommand |
| 8634 | * Send FTM command to WDI |
| 8635 | */ |
| 8636 | VOS_STATUS WDA_ProcessFTMCommand(tWDA_CbContext *pWDA, |
| 8637 | tPttMsgbuffer *pPTTFtmCmd) |
| 8638 | { |
| 8639 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 8640 | WDI_FTMCommandReqType *ftmCMDReq = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8641 | ftmCMDReq = (WDI_FTMCommandReqType *) |
| 8642 | vos_mem_malloc(sizeof(WDI_FTMCommandReqType)); |
| 8643 | if(NULL == ftmCMDReq) |
| 8644 | { |
| 8645 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8646 | "WDA FTM Command buffer alloc fail"); |
| 8647 | return VOS_STATUS_E_NOMEM; |
| 8648 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8649 | ftmCMDReq->bodyLength = pPTTFtmCmd->msgBodyLength; |
| 8650 | ftmCMDReq->FTMCommandBody = (void *)pPTTFtmCmd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8651 | pWDA->wdaFTMCmdReq = (void *)ftmCMDReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8652 | /* Send command to WDI */ |
| 8653 | status = WDI_FTMCommandReq(ftmCMDReq, WDA_FTMCommandReqCallback, pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8654 | return status; |
| 8655 | } |
| 8656 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8657 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 8658 | /* |
| 8659 | * FUNCTION: WDA_StartOemDataReqCallback |
| 8660 | * |
| 8661 | */ |
| 8662 | void WDA_StartOemDataReqCallback( |
| 8663 | WDI_oemDataRspParamsType *wdiOemDataRspParams, |
| 8664 | void* pUserData) |
| 8665 | { |
| 8666 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8667 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8668 | tWDA_CbContext *pWDA; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8669 | tStartOemDataRsp *pOemDataRspParams = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8670 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8671 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8672 | "<------ %s " ,__func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8673 | |
| 8674 | if(NULL == pWdaParams) |
| 8675 | { |
| 8676 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8677 | "%s: pWdaParams received NULL", __func__); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8678 | VOS_ASSERT(0) ; |
| 8679 | return ; |
| 8680 | } |
| 8681 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
| 8682 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8683 | if(NULL == pWDA) |
| 8684 | { |
| 8685 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8686 | "%s:pWDA is NULL", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8687 | VOS_ASSERT(0); |
| 8688 | return ; |
| 8689 | } |
| 8690 | |
| 8691 | /* |
| 8692 | * Allocate memory for response params sent to PE |
| 8693 | */ |
| 8694 | pOemDataRspParams = vos_mem_malloc(sizeof(tStartOemDataRsp)); |
| 8695 | |
| 8696 | // Check if memory is allocated for OemdataMeasRsp Params. |
| 8697 | if(NULL == pOemDataRspParams) |
| 8698 | { |
| 8699 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8700 | "OEM DATA WDA callback alloc fail"); |
| 8701 | VOS_ASSERT(0) ; |
| 8702 | return; |
| 8703 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8705 | // Free the memory allocated during request. |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8706 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 8707 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 8708 | vos_mem_free(pWdaParams) ; |
| 8709 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8710 | /* |
Jeff Johnson | 3d30ed1 | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 8711 | * Now go ahead and copy other stuff for PE in incase of success only |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8712 | * Also, here success always means that we have atleast one BSSID. |
| 8713 | */ |
| 8714 | vos_mem_copy(pOemDataRspParams->oemDataRsp, wdiOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); |
| 8715 | |
| 8716 | //enable Tx |
| 8717 | status = WDA_ResumeDataTx(pWDA); |
| 8718 | if(status != VOS_STATUS_SUCCESS) |
| 8719 | { |
| 8720 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL, "WDA Resume Data Tx fail"); |
| 8721 | } |
| 8722 | WDA_SendMsg(pWDA, WDA_START_OEM_DATA_RSP, (void *)pOemDataRspParams, 0) ; |
| 8723 | return ; |
| 8724 | } |
| 8725 | /* |
| 8726 | * FUNCTION: WDA_ProcessStartOemDataReq |
| 8727 | * Send Start Oem Data Req to WDI |
| 8728 | */ |
| 8729 | VOS_STATUS WDA_ProcessStartOemDataReq(tWDA_CbContext *pWDA, |
| 8730 | tStartOemDataReq *pOemDataReqParams) |
| 8731 | { |
| 8732 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 8733 | WDI_oemDataReqParamsType *wdiOemDataReqParams = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8734 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8735 | |
| 8736 | wdiOemDataReqParams = (WDI_oemDataReqParamsType*)vos_mem_malloc(sizeof(WDI_oemDataReqParamsType)) ; |
| 8737 | |
| 8738 | if(NULL == wdiOemDataReqParams) |
| 8739 | { |
| 8740 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8741 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8742 | VOS_ASSERT(0); |
| 8743 | return VOS_STATUS_E_NOMEM; |
| 8744 | } |
| 8745 | |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8746 | vos_mem_copy(wdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, |
| 8747 | pOemDataReqParams->selfMacAddr, sizeof(tSirMacAddr)); |
| 8748 | vos_mem_copy(wdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, |
| 8749 | pOemDataReqParams->oemDataReq, OEM_DATA_REQ_SIZE); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8750 | |
| 8751 | wdiOemDataReqParams->wdiReqStatusCB = NULL; |
| 8752 | |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8753 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8754 | if(NULL == pWdaParams) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8755 | { |
| 8756 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8757 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8758 | vos_mem_free(wdiOemDataReqParams); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8759 | vos_mem_free(pOemDataReqParams); |
| 8760 | VOS_ASSERT(0); |
| 8761 | return VOS_STATUS_E_NOMEM; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8762 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8763 | |
Bernal | 9088f0b | 2013-01-09 08:30:39 -0800 | [diff] [blame] | 8764 | pWdaParams->pWdaContext = (void*)pWDA; |
| 8765 | pWdaParams->wdaMsgParam = (void*)pOemDataReqParams; |
| 8766 | pWdaParams->wdaWdiApiMsgParam = (void*)wdiOemDataReqParams; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8767 | |
| 8768 | status = WDI_StartOemDataReq(wdiOemDataReqParams, |
| 8769 | (WDI_oemDataRspCb)WDA_StartOemDataReqCallback, pWdaParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8770 | |
| 8771 | if(IS_WDI_STATUS_FAILURE(status)) |
| 8772 | { |
| 8773 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8774 | "Failure in Start OEM DATA REQ Params WDI API, free all the memory " ); |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 8775 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 8776 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 8777 | vos_mem_free(pWdaParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8778 | } |
| 8779 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 8780 | } |
| 8781 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8782 | /* |
| 8783 | * FUNCTION: WDA_SetTxPerTrackingReqCallback |
| 8784 | * |
| 8785 | */ |
| 8786 | void WDA_SetTxPerTrackingReqCallback(WDI_Status status, void* pUserData) |
| 8787 | { |
| 8788 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8789 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8790 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8791 | if(NULL == pWdaParams) |
| 8792 | { |
| 8793 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8794 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8795 | VOS_ASSERT(0) ; |
| 8796 | return ; |
| 8797 | } |
| 8798 | |
| 8799 | if(NULL != pWdaParams->wdaMsgParam) |
| 8800 | { |
| 8801 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 8802 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8803 | if(NULL != pWdaParams->wdaWdiApiMsgParam) |
| 8804 | { |
| 8805 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8806 | } |
| 8807 | |
| 8808 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8809 | return ; |
| 8810 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8811 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 8812 | /* |
| 8813 | * FUNCTION: WDA_HostOffloadReqCallback |
| 8814 | * |
| 8815 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8816 | void WDA_GTKOffloadReqCallback( WDI_GtkOffloadRspParams *pwdiGtkOffloadRsparams, |
| 8817 | void* pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8818 | { |
| 8819 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8820 | |
| 8821 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8822 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8823 | |
| 8824 | VOS_ASSERT(NULL != pWdaParams); |
| 8825 | |
| 8826 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8827 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8828 | vos_mem_free(pWdaParams) ; |
| 8829 | |
| 8830 | //print a msg, nothing else to do |
| 8831 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 8832 | "WDA_GTKOffloadReqCallback invoked " ); |
| 8833 | |
| 8834 | return ; |
| 8835 | } |
| 8836 | |
| 8837 | /* |
| 8838 | * FUNCTION: WDA_ProcessGTKOffloadReq |
| 8839 | * Request to WDI to set the filter to minimize unnecessary host wakeup due |
| 8840 | * to broadcast traffic (sta mode). |
| 8841 | */ |
| 8842 | VOS_STATUS WDA_ProcessGTKOffloadReq(tWDA_CbContext *pWDA, |
| 8843 | tpSirGtkOffloadParams pGtkOffloadParams) |
| 8844 | { |
| 8845 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 8846 | WDI_GtkOffloadReqMsg *wdiGtkOffloadReqMsg = |
| 8847 | (WDI_GtkOffloadReqMsg *)vos_mem_malloc( |
| 8848 | sizeof(WDI_GtkOffloadReqMsg)) ; |
| 8849 | tWDA_ReqParams *pWdaParams ; |
| 8850 | |
| 8851 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8852 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8853 | |
| 8854 | if(NULL == wdiGtkOffloadReqMsg) |
| 8855 | { |
| 8856 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8857 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8858 | VOS_ASSERT(0); |
| 8859 | return VOS_STATUS_E_NOMEM; |
| 8860 | } |
| 8861 | |
| 8862 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8863 | if(NULL == pWdaParams) |
| 8864 | { |
| 8865 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8866 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8867 | VOS_ASSERT(0); |
| 8868 | vos_mem_free(wdiGtkOffloadReqMsg); |
| 8869 | return VOS_STATUS_E_NOMEM; |
| 8870 | } |
| 8871 | |
| 8872 | // |
| 8873 | // Fill wdiGtkOffloadInfo from pGtkOffloadParams |
| 8874 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8875 | |
| 8876 | vos_mem_copy(wdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId, |
| 8877 | pGtkOffloadParams->bssId, sizeof(wpt_macAddr)) |
| 8878 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8879 | wdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags = pGtkOffloadParams->ulFlags; |
| 8880 | // Copy KCK |
| 8881 | vos_mem_copy(&(wdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), &(pGtkOffloadParams->aKCK[0]), 16); |
| 8882 | // Copy KEK |
| 8883 | vos_mem_copy(&(wdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), &(pGtkOffloadParams->aKEK[0]), 16); |
| 8884 | // Copy KeyReplayCounter |
| 8885 | vos_mem_copy(&(wdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), |
| 8886 | &(pGtkOffloadParams->ullKeyReplayCounter), sizeof(v_U64_t)); |
| 8887 | |
| 8888 | wdiGtkOffloadReqMsg->wdiReqStatusCB = NULL; |
| 8889 | |
| 8890 | VOS_ASSERT((NULL == pWDA->wdaMsgParam) && |
| 8891 | (NULL == pWDA->wdaWdiApiMsgParam)); |
| 8892 | |
| 8893 | /* Store Params pass it to WDI */ |
| 8894 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiGtkOffloadReqMsg; |
| 8895 | pWdaParams->pWdaContext = pWDA; |
| 8896 | /* Store param pointer as passed in by caller */ |
| 8897 | pWdaParams->wdaMsgParam = pGtkOffloadParams; |
| 8898 | |
| 8899 | status = WDI_GTKOffloadReq(wdiGtkOffloadReqMsg, (WDI_GtkOffloadCb)WDA_GTKOffloadReqCallback, pWdaParams); |
| 8900 | |
| 8901 | if(IS_WDI_STATUS_FAILURE(status)) |
| 8902 | { |
| 8903 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 8904 | "Failure in WDA_ProcessGTKOffloadReq(), free all the memory " ); |
| 8905 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 8906 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 8907 | vos_mem_free(pWdaParams); |
| 8908 | } |
| 8909 | |
| 8910 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 8911 | } |
| 8912 | |
| 8913 | /* |
| 8914 | * FUNCTION: WDA_GtkOffloadGetInfoCallback |
| 8915 | * |
| 8916 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8917 | void WDA_GtkOffloadGetInfoCallback( WDI_GtkOffloadGetInfoRspParams *pwdiGtkOffloadGetInfoRsparams, |
| 8918 | void * pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8919 | { |
| 8920 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 8921 | tWDA_CbContext *pWDA; |
| 8922 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoReq; |
| 8923 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp = vos_mem_malloc(sizeof(tpSirGtkOffloadGetInfoRspParams)) ; |
| 8924 | tANI_U8 i; |
| 8925 | vos_msg_t vosMsg; |
| 8926 | |
| 8927 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8928 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8929 | |
| 8930 | VOS_ASSERT(NULL != pWdaParams); |
| 8931 | |
| 8932 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext ; |
| 8933 | pGtkOffloadGetInfoReq = (tpSirGtkOffloadGetInfoRspParams)pWdaParams->wdaMsgParam; |
| 8934 | |
| 8935 | // Fill pGtkOffloadGetInfoRsp from tSirGtkOffloadGetInfoRspParams |
| 8936 | vos_mem_zero(pGtkOffloadGetInfoRsp, sizeof(tSirGtkOffloadGetInfoRspParams)); |
| 8937 | |
| 8938 | /* Message Header */ |
| 8939 | pGtkOffloadGetInfoRsp->mesgType = eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP; |
| 8940 | pGtkOffloadGetInfoRsp->mesgLen = sizeof(tpSirGtkOffloadGetInfoRspParams); |
| 8941 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8942 | pGtkOffloadGetInfoRsp->ulStatus = pwdiGtkOffloadGetInfoRsparams->ulStatus; |
| 8943 | pGtkOffloadGetInfoRsp->ullKeyReplayCounter = pwdiGtkOffloadGetInfoRsparams->ullKeyReplayCounter; |
| 8944 | pGtkOffloadGetInfoRsp->ulTotalRekeyCount = pwdiGtkOffloadGetInfoRsparams->ulTotalRekeyCount; |
| 8945 | pGtkOffloadGetInfoRsp->ulGTKRekeyCount = pwdiGtkOffloadGetInfoRsparams->ulGTKRekeyCount; |
| 8946 | pGtkOffloadGetInfoRsp->ulIGTKRekeyCount = pwdiGtkOffloadGetInfoRsparams->ulIGTKRekeyCount; |
| 8947 | pGtkOffloadGetInfoRsp->bssIdx = pwdiGtkOffloadGetInfoRsparams->bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8948 | |
| 8949 | /* VOS message wrapper */ |
| 8950 | vosMsg.type = eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP; |
| 8951 | vosMsg.bodyptr = (void *)pGtkOffloadGetInfoRsp; |
| 8952 | vosMsg.bodyval = 0; |
| 8953 | |
| 8954 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) |
| 8955 | { |
| 8956 | /* free the mem and return */ |
| 8957 | vos_mem_free((v_VOID_t *) pGtkOffloadGetInfoRsp); |
| 8958 | } |
| 8959 | |
| 8960 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 8961 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 8962 | vos_mem_free(pWdaParams) ; |
| 8963 | } |
| 8964 | #endif |
| 8965 | |
| 8966 | /* |
| 8967 | * FUNCTION: WDA_ProcessSetTxPerTrackingReq |
| 8968 | * Request to WDI to set Tx Per Tracking configurations |
| 8969 | */ |
| 8970 | VOS_STATUS WDA_ProcessSetTxPerTrackingReq(tWDA_CbContext *pWDA, tSirTxPerTrackingParam *pTxPerTrackingParams) |
| 8971 | { |
| 8972 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 8973 | WDI_Status wstatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8974 | WDI_SetTxPerTrackingReqParamsType *pwdiSetTxPerTrackingReqParams = |
| 8975 | (WDI_SetTxPerTrackingReqParamsType *)vos_mem_malloc( |
| 8976 | sizeof(WDI_SetTxPerTrackingReqParamsType)) ; |
| 8977 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8978 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8979 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8980 | if(NULL == pwdiSetTxPerTrackingReqParams) |
| 8981 | { |
| 8982 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8983 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8984 | vos_mem_free(pTxPerTrackingParams); |
| 8985 | VOS_ASSERT(0); |
| 8986 | return VOS_STATUS_E_NOMEM; |
| 8987 | } |
| 8988 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 8989 | if(NULL == pWdaParams) |
| 8990 | { |
| 8991 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8992 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8993 | vos_mem_free(pwdiSetTxPerTrackingReqParams); |
| 8994 | vos_mem_free(pTxPerTrackingParams); |
| 8995 | VOS_ASSERT(0); |
| 8996 | return VOS_STATUS_E_NOMEM; |
| 8997 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8998 | pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable = |
| 8999 | pTxPerTrackingParams->ucTxPerTrackingEnable; |
| 9000 | pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod = |
| 9001 | pTxPerTrackingParams->ucTxPerTrackingPeriod; |
| 9002 | pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio = |
| 9003 | pTxPerTrackingParams->ucTxPerTrackingRatio; |
| 9004 | pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark = |
| 9005 | pTxPerTrackingParams->uTxPerTrackingWatermark; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9006 | pwdiSetTxPerTrackingReqParams->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9007 | /* Store param pointer as passed in by caller */ |
| 9008 | /* store Params pass it to WDI |
| 9009 | Ideally, the memory allocated here will be free at WDA_SetTxPerTrackingReqCallback */ |
| 9010 | pWdaParams->wdaWdiApiMsgParam = pwdiSetTxPerTrackingReqParams; |
| 9011 | pWdaParams->pWdaContext = pWDA; |
| 9012 | pWdaParams->wdaMsgParam = pTxPerTrackingParams; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 9013 | wstatus = WDI_SetTxPerTrackingReq(pwdiSetTxPerTrackingReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9014 | (WDI_SetTxPerTrackingRspCb)WDA_SetTxPerTrackingReqCallback, pWdaParams); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 9015 | if(IS_WDI_STATUS_FAILURE(wstatus)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9016 | { |
| 9017 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9018 | "Failure in Set Tx PER REQ WDI API, free all the memory " ); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 9019 | status = CONVERT_WDI2VOS_STATUS(wstatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9020 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 9021 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 9022 | vos_mem_free(pWdaParams) ; |
| 9023 | } |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 9024 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9025 | |
| 9026 | }/*WDA_ProcessSetTxPerTrackingReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9027 | /* |
| 9028 | * FUNCTION: WDA_HALDumpCmdCallback |
| 9029 | * Send the VOS complete . |
| 9030 | */ |
| 9031 | void WDA_HALDumpCmdCallback(WDI_HALDumpCmdRspParamsType *wdiRspParams, |
| 9032 | void* pUserData) |
| 9033 | { |
| 9034 | tANI_U8 *buffer = NULL; |
| 9035 | tWDA_CbContext *pWDA = NULL; |
| 9036 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9037 | if(NULL == pWdaParams) |
| 9038 | { |
| 9039 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9040 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9041 | VOS_ASSERT(0) ; |
| 9042 | return ; |
| 9043 | } |
| 9044 | |
| 9045 | pWDA = pWdaParams->pWdaContext; |
| 9046 | buffer = (tANI_U8 *)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9047 | if(wdiRspParams->usBufferLen > 0) |
| 9048 | { |
| 9049 | /*Copy the Resp data to UMAC supplied buffer*/ |
| 9050 | vos_mem_copy(buffer, wdiRspParams->pBuffer, wdiRspParams->usBufferLen); |
| 9051 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9052 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 9053 | vos_mem_free(pWdaParams); |
| 9054 | |
| 9055 | /* Indicate VOSS about the start complete */ |
| 9056 | vos_WDAComplete_cback(pWDA->pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9057 | return ; |
| 9058 | } |
| 9059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9060 | /* |
| 9061 | * FUNCTION: WDA_ProcessHALDumpCmdReq |
| 9062 | * Send Dump command to WDI |
| 9063 | */ |
| 9064 | VOS_STATUS WDA_HALDumpCmdReq(tpAniSirGlobal pMac, tANI_U32 cmd, |
| 9065 | tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, |
| 9066 | tANI_U32 arg4, tANI_U8 *pBuffer) |
| 9067 | { |
| 9068 | WDI_Status status = WDI_STATUS_SUCCESS; |
| 9069 | WDI_HALDumpCmdReqParamsType *wdiHALDumpCmdReqParam = NULL; |
| 9070 | WDI_HALDumpCmdReqInfoType *wdiHalDumpCmdInfo = NULL ; |
| 9071 | tWDA_ReqParams *pWdaParams ; |
| 9072 | pVosContextType pVosContext = NULL; |
| 9073 | VOS_STATUS vStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9074 | pVosContext = (pVosContextType)vos_get_global_context(VOS_MODULE_ID_PE, |
| 9075 | (void *)pMac); |
| 9076 | |
| 9077 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 9078 | if(NULL == pWdaParams) |
| 9079 | { |
| 9080 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9081 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9082 | return VOS_STATUS_E_NOMEM; |
| 9083 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9084 | /* Allocate memory WDI request structure*/ |
| 9085 | wdiHALDumpCmdReqParam = (WDI_HALDumpCmdReqParamsType *) |
| 9086 | vos_mem_malloc(sizeof(WDI_HALDumpCmdReqParamsType)); |
| 9087 | if(NULL == wdiHALDumpCmdReqParam) |
| 9088 | { |
| 9089 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9090 | "WDA HAL DUMP Command buffer alloc fail"); |
| 9091 | vos_mem_free(pWdaParams); |
| 9092 | return WDI_STATUS_E_FAILURE; |
| 9093 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9094 | wdiHalDumpCmdInfo = &wdiHALDumpCmdReqParam->wdiHALDumpCmdInfoType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9095 | /* Extract the arguments */ |
| 9096 | wdiHalDumpCmdInfo->command = cmd; |
| 9097 | wdiHalDumpCmdInfo->argument1 = arg1; |
| 9098 | wdiHalDumpCmdInfo->argument2 = arg2; |
| 9099 | wdiHalDumpCmdInfo->argument3 = arg3; |
| 9100 | wdiHalDumpCmdInfo->argument4 = arg4; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9101 | wdiHALDumpCmdReqParam->wdiReqStatusCB = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9102 | pWdaParams->pWdaContext = pVosContext->pWDAContext; |
| 9103 | |
| 9104 | /* Response message will be passed through the buffer */ |
| 9105 | pWdaParams->wdaMsgParam = (void *)pBuffer; |
| 9106 | |
| 9107 | /* store Params pass it to WDI */ |
| 9108 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiHALDumpCmdReqParam ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9109 | /* Send command to WDI */ |
| 9110 | status = WDI_HALDumpCmdReq(wdiHALDumpCmdReqParam, WDA_HALDumpCmdCallback, pWdaParams); |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 9111 | vStatus = vos_wait_single_event( &(pVosContext->wdaCompleteEvent), WDA_DUMPCMD_WAIT_TIMEOUT ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9112 | if ( vStatus != VOS_STATUS_SUCCESS ) |
| 9113 | { |
| 9114 | if ( vStatus == VOS_STATUS_E_TIMEOUT ) |
| 9115 | { |
| 9116 | VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 1920a72 | 2012-12-10 14:28:09 -0800 | [diff] [blame] | 9117 | "%s: Timeout occurred before WDA_HALDUMP complete\n",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9118 | } |
| 9119 | else |
| 9120 | { |
| 9121 | VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9122 | "%s: WDA_HALDUMP reporting other error \n",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9123 | } |
| 9124 | VOS_ASSERT(0); |
| 9125 | } |
| 9126 | return status; |
| 9127 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9128 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 9129 | /* |
| 9130 | * FUNCTION: WDA_ProcessGTKOffloadgetInfoReq |
| 9131 | * Request to WDI to get GTK Offload Information |
| 9132 | */ |
| 9133 | VOS_STATUS WDA_ProcessGTKOffloadGetInfoReq(tWDA_CbContext *pWDA, |
| 9134 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 9135 | { |
| 9136 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9137 | WDI_GtkOffloadGetInfoReqMsg *pwdiGtkOffloadGetInfoReqMsg = |
| 9138 | (WDI_GtkOffloadGetInfoReqMsg *)vos_mem_malloc(sizeof(WDI_GtkOffloadGetInfoReqMsg)); |
| 9139 | tWDA_ReqParams *pWdaParams ; |
| 9140 | |
| 9141 | if(NULL == pwdiGtkOffloadGetInfoReqMsg) |
| 9142 | { |
| 9143 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9144 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9145 | VOS_ASSERT(0); |
| 9146 | return VOS_STATUS_E_NOMEM; |
| 9147 | } |
| 9148 | |
| 9149 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 9150 | if(NULL == pWdaParams) |
| 9151 | { |
| 9152 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9153 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9154 | VOS_ASSERT(0); |
| 9155 | vos_mem_free(pwdiGtkOffloadGetInfoReqMsg); |
| 9156 | return VOS_STATUS_E_NOMEM; |
| 9157 | } |
| 9158 | |
| 9159 | pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB = NULL; |
| 9160 | |
| 9161 | VOS_ASSERT((NULL == pWDA->wdaMsgParam) && |
| 9162 | (NULL == pWDA->wdaWdiApiMsgParam)); |
| 9163 | |
| 9164 | /* Store Params pass it to WDI */ |
| 9165 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiGtkOffloadGetInfoReqMsg; |
| 9166 | pWdaParams->pWdaContext = pWDA; |
| 9167 | /* Store param pointer as passed in by caller */ |
| 9168 | pWdaParams->wdaMsgParam = pGtkOffloadGetInfoRsp; |
| 9169 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9170 | vos_mem_copy(pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId, |
| 9171 | pGtkOffloadGetInfoRsp->bssId, sizeof(wpt_macAddr)) |
| 9172 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9173 | status = WDI_GTKOffloadGetInfoReq(pwdiGtkOffloadGetInfoReqMsg, (WDI_GtkOffloadGetInfoCb)WDA_GtkOffloadGetInfoCallback, pWdaParams); |
| 9174 | |
| 9175 | if(IS_WDI_STATUS_FAILURE(status)) |
| 9176 | { |
| 9177 | /* failure returned by WDI API */ |
| 9178 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9179 | "Failure in WDA_ProcessGTKOffloadGetInfoReq(), free all the memory " ); |
| 9180 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 9181 | vos_mem_free(pWdaParams) ; |
| 9182 | pGtkOffloadGetInfoRsp->ulStatus = eSIR_FAILURE ; |
| 9183 | WDA_SendMsg(pWDA, WDA_GTK_OFFLOAD_GETINFO_RSP, (void *)pGtkOffloadGetInfoRsp, 0) ; |
| 9184 | } |
| 9185 | |
| 9186 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 9187 | } |
| 9188 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 9189 | |
| 9190 | /* |
| 9191 | * ------------------------------------------------------------------------- |
| 9192 | * DATA interface with WDI for Mgmt Frames |
| 9193 | * ------------------------------------------------------------------------- |
| 9194 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9195 | /* |
| 9196 | * FUNCTION: WDA_TxComplete |
| 9197 | * Callback function for the WDA_TxPacket |
| 9198 | */ |
| 9199 | VOS_STATUS WDA_TxComplete( v_PVOID_t pVosContext, vos_pkt_t *pData, |
| 9200 | VOS_STATUS status ) |
| 9201 | { |
| 9202 | |
| 9203 | tWDA_CbContext *wdaContext= (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
| 9204 | tpAniSirGlobal pMac = (tpAniSirGlobal)VOS_GET_MAC_CTXT((void *)pVosContext) ; |
Madan Mohan Koyyalamudi | 85cc1d7 | 2012-10-30 18:28:37 -0700 | [diff] [blame] | 9205 | tANI_U32 uUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9206 | |
| 9207 | if(NULL == wdaContext) |
| 9208 | { |
| 9209 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9210 | "%s:pWDA is NULL", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9211 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9212 | VOS_ASSERT(0); |
| 9213 | return VOS_STATUS_E_FAILURE; |
| 9214 | } |
Madan Mohan Koyyalamudi | 85cc1d7 | 2012-10-30 18:28:37 -0700 | [diff] [blame] | 9215 | |
| 9216 | /*Check if frame was timed out or not*/ |
| 9217 | vos_pkt_get_user_data_ptr( pData, VOS_PKT_USER_DATA_ID_WDA, |
| 9218 | (v_PVOID_t)&uUserData); |
| 9219 | |
| 9220 | if ( WDA_TL_TX_MGMT_TIMED_OUT == uUserData ) |
| 9221 | { |
| 9222 | /*Discard frame - no further processing is needed*/ |
| 9223 | vos_pkt_return_packet(pData); |
| 9224 | return VOS_STATUS_SUCCESS; |
| 9225 | } |
| 9226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9227 | /*check whether the callback is null or not,made null during WDA_TL_TX_FRAME_TIMEOUT timeout*/ |
| 9228 | if( NULL!=wdaContext->pTxCbFunc) |
| 9229 | { |
| 9230 | /*check if packet is freed already*/ |
| 9231 | if(vos_atomic_set_U32(&wdaContext->VosPacketToFree, (v_U32_t)WDA_TX_PACKET_FREED) == (v_U32_t)pData) |
| 9232 | { |
| 9233 | wdaContext->pTxCbFunc(pMac, pData); |
| 9234 | } |
| 9235 | else |
| 9236 | { |
| 9237 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, |
| 9238 | "%s:packet (0x%X) is already freed", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9239 | __func__, pData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9240 | //Return from here since we reaching here because the packet already timeout |
| 9241 | return status; |
| 9242 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9243 | } |
| 9244 | |
| 9245 | /* |
| 9246 | * Trigger the event to bring the HAL TL Tx complete function to come |
| 9247 | * out of wait |
| 9248 | * Let the coe above to complete the packet first. When this event is set, |
| 9249 | * the thread waiting for the event may run and set Vospacket_freed causing the original |
| 9250 | * packet not being freed. |
| 9251 | */ |
| 9252 | status = vos_event_set(&wdaContext->txFrameEvent); |
| 9253 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 9254 | { |
| 9255 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9256 | "NEW VOS Event Set failed - status = %d \n", status); |
| 9257 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9258 | return status; |
| 9259 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9260 | /* |
| 9261 | * FUNCTION: WDA_TxPacket |
| 9262 | * Forward TX management frame to WDI |
| 9263 | */ |
| 9264 | VOS_STATUS WDA_TxPacket(tWDA_CbContext *pWDA, |
| 9265 | void *pFrmBuf, |
| 9266 | tANI_U16 frmLen, |
| 9267 | eFrameType frmType, |
| 9268 | eFrameTxDir txDir, |
| 9269 | tANI_U8 tid, |
| 9270 | pWDATxRxCompFunc pCompFunc, |
| 9271 | void *pData, |
| 9272 | pWDAAckFnTxComp pAckTxComp, |
| 9273 | tANI_U8 txFlag) |
| 9274 | { |
| 9275 | VOS_STATUS status = VOS_STATUS_SUCCESS ; |
| 9276 | tpSirMacFrameCtl pFc = (tpSirMacFrameCtl ) pData; |
| 9277 | tANI_U8 ucTypeSubType = pFc->type <<4 | pFc->subType; |
| 9278 | tANI_U8 eventIdx = 0; |
| 9279 | tBssSystemRole systemRole = eSYSTEM_UNKNOWN_ROLE; |
| 9280 | tpAniSirGlobal pMac; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9281 | if((NULL == pWDA)||(NULL == pFrmBuf)) |
| 9282 | { |
| 9283 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9284 | "%s:pWDA %x or pFrmBuf %x is NULL", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9285 | __func__,pWDA,pFrmBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9286 | VOS_ASSERT(0); |
| 9287 | return VOS_STATUS_E_FAILURE; |
| 9288 | } |
| 9289 | |
| 9290 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_HIGH, |
| 9291 | "Tx Mgmt Frame Subtype: %d alloc(%x)\n", pFc->subType, pFrmBuf); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9292 | pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); |
| 9293 | if(NULL == pMac) |
| 9294 | { |
| 9295 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9296 | "%s:pMac is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9297 | VOS_ASSERT(0); |
| 9298 | return VOS_STATUS_E_FAILURE; |
| 9299 | } |
| 9300 | |
| 9301 | |
| 9302 | |
| 9303 | /* store the call back function in WDA context */ |
| 9304 | pWDA->pTxCbFunc = pCompFunc; |
| 9305 | /* store the call back for the function of ackTxComplete */ |
| 9306 | if( pAckTxComp ) |
| 9307 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9308 | if( NULL != pWDA->pAckTxCbFunc ) |
| 9309 | { |
| 9310 | /* Already TxComp is active no need to active again */ |
| 9311 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9312 | "There is already one request pending for tx complete\n"); |
| 9313 | pWDA->pAckTxCbFunc( pMac, 0); |
| 9314 | pWDA->pAckTxCbFunc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9315 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9316 | if( VOS_STATUS_SUCCESS != |
| 9317 | WDA_STOP_TIMER(&pWDA->wdaTimers.TxCompleteTimer)) |
| 9318 | { |
| 9319 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9320 | "Tx Complete timeout Timer Stop Failed "); |
| 9321 | } |
| 9322 | else |
| 9323 | { |
| 9324 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 3d30ed1 | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 9325 | "Tx Complete timeout Timer Stop Success "); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9326 | } |
| 9327 | } |
| 9328 | |
| 9329 | txFlag |= HAL_TXCOMP_REQUESTED_MASK; |
| 9330 | pWDA->pAckTxCbFunc = pAckTxComp; |
| 9331 | if( VOS_STATUS_SUCCESS != |
| 9332 | WDA_START_TIMER(&pWDA->wdaTimers.TxCompleteTimer) ) |
| 9333 | { |
| 9334 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9335 | "Tx Complete Timer Start Failed "); |
| 9336 | pWDA->pAckTxCbFunc = NULL; |
| 9337 | return eHAL_STATUS_FAILURE; |
| 9338 | } |
| 9339 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9340 | /* Reset the event to be not signalled */ |
| 9341 | status = vos_event_reset(&pWDA->txFrameEvent); |
| 9342 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 9343 | { |
| 9344 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9345 | "VOS Event reset failed - status = %d\n",status); |
| 9346 | pCompFunc(pWDA->pVosContext, (vos_pkt_t *)pFrmBuf); |
| 9347 | if( pAckTxComp ) |
| 9348 | { |
| 9349 | pWDA->pAckTxCbFunc = NULL; |
| 9350 | if( VOS_STATUS_SUCCESS != |
| 9351 | WDA_STOP_TIMER(&pWDA->wdaTimers.TxCompleteTimer)) |
| 9352 | { |
| 9353 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9354 | "Tx Complete timeout Timer Stop Failed "); |
| 9355 | } |
| 9356 | } |
| 9357 | return VOS_STATUS_E_FAILURE; |
| 9358 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 9359 | |
| 9360 | /* If Peer Sta mask is set don't overwrite to self sta */ |
| 9361 | if(txFlag & HAL_USE_PEER_STA_REQUESTED_MASK) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9362 | { |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 9363 | txFlag &= ~HAL_USE_PEER_STA_REQUESTED_MASK; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9364 | } |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 9365 | else |
| 9366 | { |
Madan Mohan Koyyalamudi | 4a3b2f1 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 9367 | /* Get system role, use the self station if in unknown role or STA role */ |
| 9368 | systemRole = wdaGetGlobalSystemRole(pMac); |
| 9369 | if (( eSYSTEM_UNKNOWN_ROLE == systemRole ) || |
| 9370 | (( eSYSTEM_STA_ROLE == systemRole ) |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9371 | #if defined FEATURE_WLAN_CCX || defined FEATURE_WLAN_TDLS |
Madan Mohan Koyyalamudi | 4a3b2f1 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 9372 | && frmType == HAL_TXRX_FRM_802_11_MGMT |
Madan Mohan Koyyalamudi | 7ff89c1 | 2012-11-28 15:50:13 -0800 | [diff] [blame] | 9373 | #endif |
Madan Mohan Koyyalamudi | 4a3b2f1 | 2012-12-13 15:04:41 -0800 | [diff] [blame] | 9374 | )) |
| 9375 | { |
| 9376 | txFlag |= HAL_USE_SELF_STA_REQUESTED_MASK; |
| 9377 | } |
Madan Mohan Koyyalamudi | 33df569 | 2012-12-07 14:24:14 -0800 | [diff] [blame] | 9378 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9379 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9380 | /* Divert Disassoc/Deauth frames thru self station, as by the time unicast |
| 9381 | disassoc frame reaches the HW, HAL has already deleted the peer station */ |
| 9382 | if ((pFc->type == SIR_MAC_MGMT_FRAME)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9383 | { |
Madan Mohan Koyyalamudi | 521ff19 | 2012-11-15 17:13:08 -0800 | [diff] [blame] | 9384 | if ((pFc->subType == SIR_MAC_MGMT_REASSOC_RSP) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9385 | (pFc->subType == SIR_MAC_MGMT_PROBE_REQ)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9386 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9387 | /*Send Probe request frames on self sta idx*/ |
| 9388 | txFlag |= HAL_USE_SELF_STA_REQUESTED_MASK; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9389 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9390 | /* Since we donot want probe responses to be retried, send probe responses |
| 9391 | through the NO_ACK queues */ |
| 9392 | if (pFc->subType == SIR_MAC_MGMT_PROBE_RSP) |
| 9393 | { |
| 9394 | //probe response is sent out using self station and no retries options. |
| 9395 | txFlag |= (HAL_USE_NO_ACK_REQUESTED_MASK | HAL_USE_SELF_STA_REQUESTED_MASK); |
| 9396 | } |
| 9397 | if(VOS_TRUE == pWDA->wdaAmpSessionOn) |
| 9398 | { |
| 9399 | txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; |
| 9400 | } |
| 9401 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9402 | vos_atomic_set_U32(&pWDA->VosPacketToFree, (v_U32_t)pFrmBuf);/*set VosPacket_freed to pFrmBuf*/ |
| 9403 | |
| 9404 | /*Set frame tag to 0 |
| 9405 | We will use the WDA user data in order to tag a frame as expired*/ |
| 9406 | vos_pkt_set_user_data_ptr( (vos_pkt_t *)pFrmBuf, VOS_PKT_USER_DATA_ID_WDA, |
| 9407 | (v_PVOID_t)0); |
| 9408 | |
| 9409 | |
| 9410 | if((status = WLANTL_TxMgmtFrm(pWDA->pVosContext, (vos_pkt_t *)pFrmBuf, |
| 9411 | frmLen, ucTypeSubType, tid, |
| 9412 | WDA_TxComplete, NULL, txFlag)) != VOS_STATUS_SUCCESS) |
| 9413 | { |
| 9414 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9415 | "Sending Mgmt Frame failed - status = %d\n", status); |
| 9416 | pCompFunc(VOS_GET_MAC_CTXT(pWDA->pVosContext), (vos_pkt_t *)pFrmBuf); |
| 9417 | vos_atomic_set_U32(&pWDA->VosPacketToFree, (v_U32_t)WDA_TX_PACKET_FREED);/*reset the VosPacket_freed*/ |
| 9418 | if( pAckTxComp ) |
| 9419 | { |
| 9420 | pWDA->pAckTxCbFunc = NULL; |
| 9421 | if( VOS_STATUS_SUCCESS != |
| 9422 | WDA_STOP_TIMER(&pWDA->wdaTimers.TxCompleteTimer)) |
| 9423 | { |
| 9424 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9425 | "Tx Complete timeout Timer Stop Failed "); |
| 9426 | } |
| 9427 | } |
| 9428 | return VOS_STATUS_E_FAILURE; |
| 9429 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9430 | /* |
| 9431 | * Wait for the event to be set by the TL, to get the response of TX |
| 9432 | * complete, this event should be set by the Callback function called by TL |
| 9433 | */ |
| 9434 | status = vos_wait_events(&pWDA->txFrameEvent, 1, WDA_TL_TX_FRAME_TIMEOUT, |
| 9435 | &eventIdx); |
| 9436 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 9437 | { |
| 9438 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9439 | "%s: Status %d when waiting for TX Frame Event", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9440 | __func__, status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9441 | pWDA->pTxCbFunc = NULL; /*To stop the limTxComplete being called again , |
| 9442 | after the packet gets completed(packet freed once)*/ |
| 9443 | |
Madan Mohan Koyyalamudi | ea77701 | 2012-10-31 14:22:34 -0700 | [diff] [blame] | 9444 | /* TX MGMT fail with COMP timeout, try to detect DXE stall */ |
Gopichand Nakkala | 742df6c | 2012-12-21 15:34:30 -0800 | [diff] [blame] | 9445 | WDA_TransportChannelDebug(1, 0); |
Madan Mohan Koyyalamudi | ea77701 | 2012-10-31 14:22:34 -0700 | [diff] [blame] | 9446 | |
Madan Mohan Koyyalamudi | 85cc1d7 | 2012-10-30 18:28:37 -0700 | [diff] [blame] | 9447 | /*Tag Frame as timed out for later deletion*/ |
| 9448 | vos_pkt_set_user_data_ptr( (vos_pkt_t *)pFrmBuf, VOS_PKT_USER_DATA_ID_WDA, |
| 9449 | (v_PVOID_t)WDA_TL_TX_MGMT_TIMED_OUT); |
| 9450 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9451 | /* check whether the packet was freed already,so need not free again when |
| 9452 | * TL calls the WDA_Txcomplete routine |
| 9453 | */ |
Madan Mohan Koyyalamudi | 85cc1d7 | 2012-10-30 18:28:37 -0700 | [diff] [blame] | 9454 | vos_atomic_set_U32(&pWDA->VosPacketToFree, (v_U32_t)WDA_TX_PACKET_FREED); |
| 9455 | /*if(vos_atomic_set_U32(&pWDA->VosPacketToFree, (v_U32_t)WDA_TX_PACKET_FREED) == (v_U32_t)pFrmBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9456 | { |
| 9457 | pCompFunc(VOS_GET_MAC_CTXT(pWDA->pVosContext), (vos_pkt_t *)pFrmBuf); |
Madan Mohan Koyyalamudi | 85cc1d7 | 2012-10-30 18:28:37 -0700 | [diff] [blame] | 9458 | } */ |
| 9459 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9460 | if( pAckTxComp ) |
| 9461 | { |
| 9462 | pWDA->pAckTxCbFunc = NULL; |
| 9463 | if( VOS_STATUS_SUCCESS != |
| 9464 | WDA_STOP_TIMER(&pWDA->wdaTimers.TxCompleteTimer)) |
| 9465 | { |
| 9466 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9467 | "Tx Complete timeout Timer Stop Failed "); |
| 9468 | } |
| 9469 | } |
| 9470 | status = VOS_STATUS_E_FAILURE; |
| 9471 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9472 | return status; |
| 9473 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9474 | /* |
| 9475 | * FUNCTION: WDA_McProcessMsg |
| 9476 | * Trigger DAL-AL to start CFG download |
| 9477 | */ |
| 9478 | VOS_STATUS WDA_McProcessMsg( v_CONTEXT_t pVosContext, vos_msg_t *pMsg ) |
| 9479 | { |
| 9480 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9481 | tWDA_CbContext *pWDA = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9482 | if(NULL == pMsg) |
| 9483 | { |
| 9484 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9485 | "%s:pMsg is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9486 | VOS_ASSERT(0); |
| 9487 | return VOS_STATUS_E_FAILURE; |
| 9488 | } |
| 9489 | |
| 9490 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_LOW, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9491 | "=========> %s msgType: %x " ,__func__, pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9492 | |
| 9493 | pWDA = (tWDA_CbContext *)vos_get_context( VOS_MODULE_ID_WDA, pVosContext ); |
| 9494 | if(NULL == pWDA ) |
| 9495 | { |
| 9496 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9497 | "%s:pWDA is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9498 | VOS_ASSERT(0); |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 9499 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9500 | return VOS_STATUS_E_FAILURE; |
| 9501 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9502 | /* Process all the WDA messages.. */ |
| 9503 | switch( pMsg->type ) |
| 9504 | { |
| 9505 | case WNI_CFG_DNLD_REQ: |
| 9506 | { |
| 9507 | status = WDA_WniCfgDnld(pWDA); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9508 | /* call WDA complete event if config download success */ |
| 9509 | if( VOS_IS_STATUS_SUCCESS(status) ) |
| 9510 | { |
| 9511 | vos_WDAComplete_cback(pVosContext); |
| 9512 | } |
| 9513 | else |
| 9514 | { |
| 9515 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 9516 | "WDA Config Download failure" ); |
| 9517 | } |
| 9518 | break ; |
| 9519 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9520 | /* |
| 9521 | * Init SCAN request from PE, convert it into DAL format |
| 9522 | * and send it to DAL |
| 9523 | */ |
| 9524 | case WDA_INIT_SCAN_REQ: |
| 9525 | { |
| 9526 | WDA_ProcessInitScanReq(pWDA, (tInitScanParams *)pMsg->bodyptr) ; |
| 9527 | break ; |
| 9528 | } |
| 9529 | /* start SCAN request from PE */ |
| 9530 | case WDA_START_SCAN_REQ: |
| 9531 | { |
| 9532 | WDA_ProcessStartScanReq(pWDA, (tStartScanParams *)pMsg->bodyptr) ; |
| 9533 | break ; |
| 9534 | } |
| 9535 | /* end SCAN request from PE */ |
| 9536 | case WDA_END_SCAN_REQ: |
| 9537 | { |
| 9538 | WDA_ProcessEndScanReq(pWDA, (tEndScanParams *)pMsg->bodyptr) ; |
| 9539 | break ; |
| 9540 | } |
| 9541 | /* end SCAN request from PE */ |
| 9542 | case WDA_FINISH_SCAN_REQ: |
| 9543 | { |
| 9544 | WDA_ProcessFinishScanReq(pWDA, (tFinishScanParams *)pMsg->bodyptr) ; |
| 9545 | break ; |
| 9546 | } |
| 9547 | /* join request from PE */ |
| 9548 | case WDA_CHNL_SWITCH_REQ: |
| 9549 | { |
| 9550 | if(WDA_PRE_ASSOC_STATE == pWDA->wdaState) |
| 9551 | { |
| 9552 | WDA_ProcessJoinReq(pWDA, (tSwitchChannelParams *)pMsg->bodyptr) ; |
| 9553 | } |
| 9554 | else |
| 9555 | { |
| 9556 | WDA_ProcessChannelSwitchReq(pWDA, |
| 9557 | (tSwitchChannelParams*)pMsg->bodyptr) ; |
| 9558 | } |
| 9559 | break ; |
| 9560 | } |
| 9561 | /* ADD BSS request from PE */ |
| 9562 | case WDA_ADD_BSS_REQ: |
| 9563 | { |
| 9564 | WDA_ProcessConfigBssReq(pWDA, (tAddBssParams*)pMsg->bodyptr) ; |
| 9565 | break ; |
| 9566 | } |
| 9567 | case WDA_ADD_STA_REQ: |
| 9568 | { |
| 9569 | WDA_ProcessAddStaReq(pWDA, (tAddStaParams *)pMsg->bodyptr) ; |
| 9570 | break ; |
| 9571 | } |
| 9572 | case WDA_DELETE_BSS_REQ: |
| 9573 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9574 | WDA_ProcessDelBssReq(pWDA, (tDeleteBssParams *)pMsg->bodyptr) ; |
| 9575 | break ; |
| 9576 | } |
| 9577 | case WDA_DELETE_STA_REQ: |
| 9578 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9579 | WDA_ProcessDelStaReq(pWDA, (tDeleteStaParams *)pMsg->bodyptr) ; |
| 9580 | break ; |
| 9581 | } |
| 9582 | case WDA_CONFIG_PARAM_UPDATE_REQ: |
| 9583 | { |
| 9584 | WDA_UpdateCfg(pWDA, (tSirMsgQ *)pMsg) ; |
| 9585 | break ; |
| 9586 | } |
| 9587 | case WDA_SET_BSSKEY_REQ: |
| 9588 | { |
| 9589 | WDA_ProcessSetBssKeyReq(pWDA, (tSetBssKeyParams *)pMsg->bodyptr); |
| 9590 | break ; |
| 9591 | } |
| 9592 | case WDA_SET_STAKEY_REQ: |
| 9593 | { |
| 9594 | WDA_ProcessSetStaKeyReq(pWDA, (tSetStaKeyParams *)pMsg->bodyptr); |
| 9595 | break ; |
| 9596 | } |
| 9597 | case WDA_SET_STA_BCASTKEY_REQ: |
| 9598 | { |
| 9599 | WDA_ProcessSetBcastStaKeyReq(pWDA, (tSetStaKeyParams *)pMsg->bodyptr); |
| 9600 | break ; |
| 9601 | } |
| 9602 | case WDA_REMOVE_BSSKEY_REQ: |
| 9603 | { |
| 9604 | WDA_ProcessRemoveBssKeyReq(pWDA, |
| 9605 | (tRemoveBssKeyParams *)pMsg->bodyptr); |
| 9606 | break ; |
| 9607 | } |
| 9608 | case WDA_REMOVE_STAKEY_REQ: |
| 9609 | { |
| 9610 | WDA_ProcessRemoveStaKeyReq(pWDA, |
| 9611 | (tRemoveStaKeyParams *)pMsg->bodyptr); |
| 9612 | break ; |
| 9613 | } |
| 9614 | case WDA_REMOVE_STA_BCASTKEY_REQ: |
| 9615 | { |
| 9616 | /* TODO: currently UMAC is not sending this request, Add the code for |
| 9617 | handling this request when UMAC supports */ |
| 9618 | break; |
| 9619 | } |
| 9620 | #ifdef FEATURE_WLAN_CCX |
| 9621 | case WDA_TSM_STATS_REQ: |
| 9622 | { |
| 9623 | WDA_ProcessTsmStatsReq(pWDA, (tTSMStats *)pMsg->bodyptr); |
| 9624 | break; |
| 9625 | } |
| 9626 | #endif |
| 9627 | case WDA_UPDATE_EDCA_PROFILE_IND: |
| 9628 | { |
| 9629 | WDA_ProcessUpdateEDCAParamReq(pWDA, (tEdcaParams *)pMsg->bodyptr); |
| 9630 | break; |
| 9631 | } |
| 9632 | case WDA_ADD_TS_REQ: |
| 9633 | { |
| 9634 | WDA_ProcessAddTSReq(pWDA, (tAddTsParams *)pMsg->bodyptr); |
| 9635 | break; |
| 9636 | } |
| 9637 | case WDA_DEL_TS_REQ: |
| 9638 | { |
| 9639 | WDA_ProcessDelTSReq(pWDA, (tDelTsParams *)pMsg->bodyptr); |
| 9640 | break; |
| 9641 | } |
| 9642 | case WDA_ADDBA_REQ: |
| 9643 | { |
| 9644 | WDA_ProcessAddBASessionReq(pWDA, (tAddBAParams *)pMsg->bodyptr); |
| 9645 | break; |
| 9646 | } |
| 9647 | case WDA_DELBA_IND: |
| 9648 | { |
| 9649 | WDA_ProcessDelBAReq(pWDA, (tDelBAParams *)pMsg->bodyptr); |
| 9650 | break; |
| 9651 | } |
| 9652 | case WDA_SET_LINK_STATE: |
| 9653 | { |
| 9654 | WDA_ProcessSetLinkState(pWDA, (tLinkStateParams *)pMsg->bodyptr); |
| 9655 | break; |
| 9656 | } |
| 9657 | case WDA_GET_STATISTICS_REQ: |
| 9658 | { |
| 9659 | WDA_ProcessGetStatsReq(pWDA, (tAniGetPEStatsReq *)pMsg->bodyptr); |
| 9660 | break; |
| 9661 | } |
| 9662 | case WDA_PWR_SAVE_CFG: |
| 9663 | { |
| 9664 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9665 | { |
| 9666 | WDA_ProcessSetPwrSaveCfgReq(pWDA, (tSirPowerSaveCfg *)pMsg->bodyptr); |
| 9667 | } |
| 9668 | else |
| 9669 | { |
| 9670 | if(NULL != pMsg->bodyptr) |
| 9671 | { |
| 9672 | vos_mem_free(pMsg->bodyptr); |
| 9673 | } |
| 9674 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9675 | "WDA_PWR_SAVE_CFG req in wrong state %d", pWDA->wdaState ); |
| 9676 | } |
| 9677 | break; |
| 9678 | } |
| 9679 | case WDA_ENTER_IMPS_REQ: |
| 9680 | { |
| 9681 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9682 | { |
| 9683 | WDA_ProcessEnterImpsReq(pWDA); |
| 9684 | } |
| 9685 | else |
| 9686 | { |
| 9687 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9688 | "WDA_ENTER_IMPS_REQ req in wrong state %d", pWDA->wdaState ); |
| 9689 | } |
| 9690 | break; |
| 9691 | } |
| 9692 | case WDA_EXIT_IMPS_REQ: |
| 9693 | { |
| 9694 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9695 | { |
| 9696 | WDA_ProcessExitImpsReq(pWDA); |
| 9697 | } |
| 9698 | else |
| 9699 | { |
| 9700 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9701 | "WDA_EXIT_IMPS_REQ req in wrong state %d", pWDA->wdaState ); |
| 9702 | } |
| 9703 | break; |
| 9704 | } |
| 9705 | case WDA_ENTER_BMPS_REQ: |
| 9706 | { |
| 9707 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9708 | { |
| 9709 | WDA_ProcessEnterBmpsReq(pWDA, (tEnterBmpsParams *)pMsg->bodyptr); |
| 9710 | } |
| 9711 | else |
| 9712 | { |
| 9713 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9714 | "WDA_ENTER_BMPS_REQ req in wrong state %d", pWDA->wdaState ); |
| 9715 | } |
| 9716 | break; |
| 9717 | } |
| 9718 | case WDA_EXIT_BMPS_REQ: |
| 9719 | { |
| 9720 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9721 | { |
| 9722 | WDA_ProcessExitBmpsReq(pWDA, (tExitBmpsParams *)pMsg->bodyptr); |
| 9723 | } |
| 9724 | else |
| 9725 | { |
| 9726 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9727 | "WDA_EXIT_BMPS_REQ req in wrong state %d", pWDA->wdaState ); |
| 9728 | } |
| 9729 | break; |
| 9730 | } |
| 9731 | case WDA_ENTER_UAPSD_REQ: |
| 9732 | { |
| 9733 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9734 | { |
| 9735 | WDA_ProcessEnterUapsdReq(pWDA, (tUapsdParams *)pMsg->bodyptr); |
| 9736 | } |
| 9737 | else |
| 9738 | { |
| 9739 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9740 | "WDA_ENTER_UAPSD_REQ req in wrong state %d", pWDA->wdaState ); |
| 9741 | } |
| 9742 | break; |
| 9743 | } |
| 9744 | case WDA_EXIT_UAPSD_REQ: |
| 9745 | { |
| 9746 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9747 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9748 | WDA_ProcessExitUapsdReq(pWDA, (tExitUapsdParams *)pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9749 | } |
| 9750 | else |
| 9751 | { |
| 9752 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9753 | "WDA_EXIT_UAPSD_REQ req in wrong state %d", pWDA->wdaState ); |
| 9754 | } |
| 9755 | break; |
| 9756 | } |
| 9757 | case WDA_UPDATE_UAPSD_IND: |
| 9758 | { |
| 9759 | if(pWDA->wdaState == WDA_READY_STATE) |
| 9760 | { |
| 9761 | WDA_UpdateUapsdParamsReq(pWDA, (tUpdateUapsdParams *)pMsg->bodyptr); |
| 9762 | } |
| 9763 | else |
| 9764 | { |
| 9765 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 9766 | "WDA_UPDATE_UAPSD_IND req in wrong state %d", pWDA->wdaState ); |
| 9767 | } |
| 9768 | break; |
| 9769 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9770 | case WDA_REGISTER_PE_CALLBACK : |
| 9771 | { |
| 9772 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_HIGH, |
| 9773 | "Handling msg type WDA_REGISTER_PE_CALLBACK " ); |
| 9774 | /*TODO: store the PE callback */ |
| 9775 | /* Do Nothing? MSG Body should be freed at here */ |
| 9776 | if(NULL != pMsg->bodyptr) |
| 9777 | { |
| 9778 | vos_mem_free(pMsg->bodyptr); |
| 9779 | } |
| 9780 | break; |
| 9781 | } |
| 9782 | case WDA_SYS_READY_IND : |
| 9783 | { |
| 9784 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_HIGH, |
| 9785 | "Handling msg type WDA_SYS_READY_IND " ); |
| 9786 | pWDA->wdaState = WDA_READY_STATE; |
| 9787 | if(NULL != pMsg->bodyptr) |
| 9788 | { |
| 9789 | vos_mem_free(pMsg->bodyptr); |
| 9790 | } |
| 9791 | break; |
| 9792 | } |
| 9793 | case WDA_BEACON_FILTER_IND : |
| 9794 | { |
| 9795 | WDA_SetBeaconFilterReq(pWDA, (tBeaconFilterMsg *)pMsg->bodyptr); |
| 9796 | break; |
| 9797 | } |
| 9798 | case WDA_BTC_SET_CFG: |
| 9799 | { |
| 9800 | /*TODO: handle this while dealing with BTC */ |
| 9801 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_HIGH, |
| 9802 | "Handling msg type WDA_BTC_SET_CFG " ); |
| 9803 | /* Do Nothing? MSG Body should be freed at here */ |
| 9804 | if(NULL != pMsg->bodyptr) |
| 9805 | { |
| 9806 | vos_mem_free(pMsg->bodyptr); |
| 9807 | } |
| 9808 | break; |
| 9809 | } |
| 9810 | case WDA_SIGNAL_BT_EVENT: |
| 9811 | { |
| 9812 | /*TODO: handle this while dealing with BTC */ |
| 9813 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_HIGH, |
| 9814 | "Handling msg type WDA_SIGNAL_BT_EVENT " ); |
| 9815 | /* Do Nothing? MSG Body should be freed at here */ |
| 9816 | if(NULL != pMsg->bodyptr) |
| 9817 | { |
| 9818 | vos_mem_free(pMsg->bodyptr); |
| 9819 | } |
| 9820 | break; |
| 9821 | } |
| 9822 | case WDA_CFG_RXP_FILTER_REQ: |
| 9823 | { |
| 9824 | WDA_ProcessConfigureRxpFilterReq(pWDA, |
| 9825 | (tSirWlanSetRxpFilters *)pMsg->bodyptr); |
| 9826 | break; |
| 9827 | } |
| 9828 | case WDA_SET_HOST_OFFLOAD: |
| 9829 | { |
| 9830 | WDA_ProcessHostOffloadReq(pWDA, (tSirHostOffloadReq *)pMsg->bodyptr); |
| 9831 | break; |
| 9832 | } |
| 9833 | case WDA_SET_KEEP_ALIVE: |
| 9834 | { |
| 9835 | WDA_ProcessKeepAliveReq(pWDA, (tSirKeepAliveReq *)pMsg->bodyptr); |
| 9836 | break; |
| 9837 | } |
| 9838 | #ifdef WLAN_NS_OFFLOAD |
| 9839 | case WDA_SET_NS_OFFLOAD: |
| 9840 | { |
| 9841 | WDA_ProcessHostOffloadReq(pWDA, (tSirHostOffloadReq *)pMsg->bodyptr); |
| 9842 | break; |
| 9843 | } |
| 9844 | #endif //WLAN_NS_OFFLOAD |
| 9845 | case WDA_ADD_STA_SELF_REQ: |
| 9846 | { |
| 9847 | WDA_ProcessAddStaSelfReq(pWDA, (tAddStaSelfParams *)pMsg->bodyptr); |
| 9848 | break; |
| 9849 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9850 | case WDA_DEL_STA_SELF_REQ: |
| 9851 | { |
| 9852 | WDA_ProcessDelSTASelfReq(pWDA, (tDelStaSelfParams *)pMsg->bodyptr); |
| 9853 | break; |
| 9854 | } |
| 9855 | case WDA_WOWL_ADD_BCAST_PTRN: |
| 9856 | { |
| 9857 | WDA_ProcessWowlAddBcPtrnReq(pWDA, (tSirWowlAddBcastPtrn *)pMsg->bodyptr); |
| 9858 | break; |
| 9859 | } |
| 9860 | case WDA_WOWL_DEL_BCAST_PTRN: |
| 9861 | { |
| 9862 | WDA_ProcessWowlDelBcPtrnReq(pWDA, (tSirWowlDelBcastPtrn *)pMsg->bodyptr); |
| 9863 | break; |
| 9864 | } |
| 9865 | case WDA_WOWL_ENTER_REQ: |
| 9866 | { |
| 9867 | WDA_ProcessWowlEnterReq(pWDA, (tSirHalWowlEnterParams *)pMsg->bodyptr); |
| 9868 | break; |
| 9869 | } |
| 9870 | case WDA_WOWL_EXIT_REQ: |
| 9871 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 9872 | WDA_ProcessWowlExitReq(pWDA, (tSirHalWowlExitParams *)pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9873 | break; |
| 9874 | } |
| 9875 | case WDA_TL_FLUSH_AC_REQ: |
| 9876 | { |
| 9877 | WDA_ProcessFlushAcReq(pWDA, (tFlushACReq *)pMsg->bodyptr); |
| 9878 | break; |
| 9879 | } |
| 9880 | case WDA_SIGNAL_BTAMP_EVENT: |
| 9881 | { |
| 9882 | WDA_ProcessBtAmpEventReq(pWDA, (tSmeBtAmpEvent *)pMsg->bodyptr); |
| 9883 | break; |
| 9884 | } |
| 9885 | #ifdef WDA_UT |
| 9886 | case WDA_WDI_EVENT_MSG: |
| 9887 | { |
| 9888 | WDI_processEvent(pMsg->bodyptr,(void *)pMsg->bodyval); |
| 9889 | break ; |
| 9890 | } |
| 9891 | #endif |
| 9892 | case WDA_UPDATE_BEACON_IND: |
| 9893 | { |
| 9894 | WDA_ProcessUpdateBeaconParams(pWDA, |
| 9895 | (tUpdateBeaconParams *)pMsg->bodyptr); |
| 9896 | break; |
| 9897 | } |
| 9898 | case WDA_SEND_BEACON_REQ: |
| 9899 | { |
| 9900 | WDA_ProcessSendBeacon(pWDA, (tSendbeaconParams *)pMsg->bodyptr); |
| 9901 | break; |
| 9902 | } |
| 9903 | case WDA_UPDATE_PROBE_RSP_TEMPLATE_IND: |
| 9904 | { |
| 9905 | WDA_ProcessUpdateProbeRspTemplate(pWDA, |
| 9906 | (tSendProbeRespParams *)pMsg->bodyptr); |
| 9907 | break; |
| 9908 | } |
| 9909 | #if defined(WLAN_FEATURE_VOWIFI) || defined(FEATURE_WLAN_CCX) |
| 9910 | case WDA_SET_MAX_TX_POWER_REQ: |
| 9911 | { |
| 9912 | WDA_ProcessSetMaxTxPowerReq(pWDA, |
| 9913 | (tMaxTxPowerParams *)pMsg->bodyptr); |
| 9914 | break; |
| 9915 | } |
| 9916 | #endif |
| 9917 | #ifdef WLAN_FEATURE_P2P |
| 9918 | case WDA_SET_P2P_GO_NOA_REQ: |
| 9919 | { |
| 9920 | WDA_ProcessSetP2PGONOAReq(pWDA, |
| 9921 | (tP2pPsParams *)pMsg->bodyptr); |
| 9922 | break; |
| 9923 | } |
| 9924 | #endif |
| 9925 | /* timer related messages */ |
| 9926 | case WDA_TIMER_BA_ACTIVITY_REQ: |
| 9927 | { |
| 9928 | WDA_BaCheckActivity(pWDA) ; |
| 9929 | break ; |
| 9930 | } |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 9931 | |
| 9932 | /* timer related messages */ |
| 9933 | case WDA_TIMER_TRAFFIC_STATS_IND: |
| 9934 | { |
| 9935 | WDA_TimerTrafficStatsInd(pWDA); |
| 9936 | break; |
| 9937 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9938 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 9939 | case WDA_AGGR_QOS_REQ: |
| 9940 | { |
| 9941 | WDA_ProcessAggrAddTSReq(pWDA, (tAggrAddTsParams *)pMsg->bodyptr); |
| 9942 | break; |
| 9943 | } |
| 9944 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9945 | #ifdef ANI_MANF_DIAG |
| 9946 | case WDA_FTM_CMD_REQ: |
| 9947 | { |
| 9948 | WDA_ProcessFTMCommand(pWDA, (tPttMsgbuffer *)pMsg->bodyptr) ; |
| 9949 | break ; |
| 9950 | } |
| 9951 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9952 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 9953 | case WDA_START_OEM_DATA_REQ: |
| 9954 | { |
| 9955 | WDA_ProcessStartOemDataReq(pWDA, (tStartOemDataReq *)pMsg->bodyptr) ; |
| 9956 | break; |
| 9957 | } |
| 9958 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9959 | /* Tx Complete Time out Indication */ |
| 9960 | case WDA_TX_COMPLETE_TIMEOUT_IND: |
| 9961 | { |
| 9962 | WDA_ProcessTxCompleteTimeOutInd(pWDA); |
| 9963 | break; |
| 9964 | } |
| 9965 | case WDA_WLAN_SUSPEND_IND: |
| 9966 | { |
| 9967 | WDA_ProcessWlanSuspendInd(pWDA, |
| 9968 | (tSirWlanSuspendParam *)pMsg->bodyptr) ; |
| 9969 | break; |
| 9970 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9971 | case WDA_WLAN_RESUME_REQ: |
| 9972 | { |
| 9973 | WDA_ProcessWlanResumeReq(pWDA, |
| 9974 | (tSirWlanResumeParam *)pMsg->bodyptr) ; |
| 9975 | break; |
| 9976 | } |
| 9977 | |
| 9978 | case WDA_UPDATE_CF_IND: |
| 9979 | { |
| 9980 | vos_mem_free((v_VOID_t*)pMsg->bodyptr); |
| 9981 | pMsg->bodyptr = NULL; |
| 9982 | break; |
| 9983 | } |
| 9984 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 9985 | case WDA_SET_PNO_REQ: |
| 9986 | { |
| 9987 | WDA_ProcessSetPrefNetworkReq(pWDA, (tSirPNOScanReq *)pMsg->bodyptr); |
| 9988 | break; |
| 9989 | } |
| 9990 | case WDA_UPDATE_SCAN_PARAMS_REQ: |
| 9991 | { |
| 9992 | WDA_ProcessUpdateScanParams(pWDA, (tSirUpdateScanParams *)pMsg->bodyptr); |
| 9993 | break; |
| 9994 | } |
| 9995 | case WDA_SET_RSSI_FILTER_REQ: |
| 9996 | { |
| 9997 | WDA_ProcessSetRssiFilterReq(pWDA, (tSirSetRSSIFilterReq *)pMsg->bodyptr); |
| 9998 | break; |
| 9999 | } |
| 10000 | #endif // FEATURE_WLAN_SCAN_PNO |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10001 | case WDA_SET_TX_PER_TRACKING_REQ: |
| 10002 | { |
| 10003 | WDA_ProcessSetTxPerTrackingReq(pWDA, (tSirTxPerTrackingParam *)pMsg->bodyptr); |
| 10004 | break; |
| 10005 | } |
| 10006 | |
| 10007 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 10008 | case WDA_8023_MULTICAST_LIST_REQ: |
| 10009 | { |
| 10010 | WDA_Process8023MulticastListReq(pWDA, (tSirRcvFltMcAddrList *)pMsg->bodyptr); |
| 10011 | break; |
| 10012 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10013 | case WDA_RECEIVE_FILTER_SET_FILTER_REQ: |
| 10014 | { |
| 10015 | WDA_ProcessReceiveFilterSetFilterReq(pWDA, (tSirRcvPktFilterCfgType *)pMsg->bodyptr); |
| 10016 | break; |
| 10017 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10018 | case WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 10019 | { |
| 10020 | WDA_ProcessPacketFilterMatchCountReq(pWDA, (tpSirRcvFltPktMatchRsp)pMsg->bodyptr); |
| 10021 | break; |
| 10022 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10023 | case WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 10024 | { |
| 10025 | WDA_ProcessReceiveFilterClearFilterReq(pWDA, (tSirRcvFltPktClearParam *)pMsg->bodyptr); |
| 10026 | break; |
| 10027 | } |
| 10028 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 10029 | |
| 10030 | |
| 10031 | case WDA_TRANSMISSION_CONTROL_IND: |
| 10032 | { |
| 10033 | WDA_ProcessTxControlInd(pWDA, (tpTxControlParams)pMsg->bodyptr); |
| 10034 | break; |
| 10035 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10036 | case WDA_SET_POWER_PARAMS_REQ: |
| 10037 | { |
| 10038 | WDA_ProcessSetPowerParamsReq(pWDA, (tSirSetPowerParamsReq *)pMsg->bodyptr); |
| 10039 | break; |
| 10040 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10041 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 10042 | case WDA_GTK_OFFLOAD_REQ: |
| 10043 | { |
| 10044 | WDA_ProcessGTKOffloadReq(pWDA, (tpSirGtkOffloadParams)pMsg->bodyptr); |
| 10045 | break; |
| 10046 | } |
| 10047 | |
| 10048 | case WDA_GTK_OFFLOAD_GETINFO_REQ: |
| 10049 | { |
| 10050 | WDA_ProcessGTKOffloadGetInfoReq(pWDA, (tpSirGtkOffloadGetInfoRspParams)pMsg->bodyptr); |
| 10051 | break; |
| 10052 | } |
| 10053 | #endif //WLAN_FEATURE_GTK_OFFLOAD |
| 10054 | |
| 10055 | case WDA_SET_TM_LEVEL_REQ: |
| 10056 | { |
| 10057 | WDA_ProcessSetTmLevelReq(pWDA, (tAniSetTmLevelReq *)pMsg->bodyptr); |
| 10058 | break; |
| 10059 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 10060 | #ifdef WLAN_FEATURE_11AC |
| 10061 | case WDA_UPDATE_OP_MODE: |
| 10062 | { |
| 10063 | if(WDA_getHostWlanFeatCaps(DOT11AC) && WDA_getFwWlanFeatCaps(DOT11AC)) |
| 10064 | { |
| 10065 | if(WDA_getHostWlanFeatCaps(DOT11AC_OPMODE) && WDA_getFwWlanFeatCaps(DOT11AC_OPMODE)) |
| 10066 | WDA_ProcessUpdateOpMode(pWDA, (tUpdateVHTOpMode *)pMsg->bodyptr); |
| 10067 | else |
| 10068 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10069 | " VHT OpMode Feature is Not Supported \n"); |
| 10070 | } |
| 10071 | else |
| 10072 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10073 | " 11AC Feature is Not Supported \n"); |
| 10074 | break; |
| 10075 | } |
| 10076 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10077 | default: |
| 10078 | { |
| 10079 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10080 | "No Handling for msg type %x in WDA " |
| 10081 | ,pMsg->type); |
| 10082 | /* Do Nothing? MSG Body should be freed at here */ |
| 10083 | if(NULL != pMsg->bodyptr) |
| 10084 | { |
| 10085 | vos_mem_free(pMsg->bodyptr); |
| 10086 | } |
| 10087 | //WDA_VOS_ASSERT(0) ; |
| 10088 | } |
| 10089 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10090 | return status ; |
| 10091 | } |
| 10092 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10093 | /* |
| 10094 | * FUNCTION: WDA_LowLevelIndCallback |
| 10095 | * IND API callback from WDI, send Ind to PE |
| 10096 | */ |
| 10097 | void WDA_lowLevelIndCallback(WDI_LowLevelIndType *wdiLowLevelInd, |
| 10098 | void* pUserData ) |
| 10099 | { |
| 10100 | tWDA_CbContext *pWDA = (tWDA_CbContext *)pUserData; |
| 10101 | #if defined WLAN_FEATURE_NEIGHBOR_ROAMING |
| 10102 | tSirRSSINotification rssiNotification; |
| 10103 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10104 | if(NULL == pWDA) |
| 10105 | { |
| 10106 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10107 | "%s:pWDA is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10108 | VOS_ASSERT(0); |
| 10109 | return ; |
| 10110 | } |
| 10111 | |
| 10112 | switch(wdiLowLevelInd->wdiIndicationType) |
| 10113 | { |
| 10114 | case WDI_RSSI_NOTIFICATION_IND: |
| 10115 | { |
| 10116 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10117 | "Received WDI_HAL_RSSI_NOTIFICATION_IND from WDI "); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10118 | #if defined WLAN_FEATURE_NEIGHBOR_ROAMING |
| 10119 | rssiNotification.bReserved = |
| 10120 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bReserved; |
| 10121 | rssiNotification.bRssiThres1NegCross = |
| 10122 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross; |
| 10123 | rssiNotification.bRssiThres1PosCross = |
| 10124 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross; |
| 10125 | rssiNotification.bRssiThres2NegCross = |
| 10126 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross; |
| 10127 | rssiNotification.bRssiThres2PosCross = |
| 10128 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross; |
| 10129 | rssiNotification.bRssiThres3NegCross = |
| 10130 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross; |
| 10131 | rssiNotification.bRssiThres3PosCross = |
| 10132 | wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross; |
Madan Mohan Koyyalamudi | 313a593 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 10133 | rssiNotification.avgRssi = (v_S7_t) |
| 10134 | ((-1)*wdiLowLevelInd->wdiIndicationData.wdiLowRSSIInfo.avgRssi); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10135 | WLANTL_BMPSRSSIRegionChangedNotification( |
| 10136 | pWDA->pVosContext, |
| 10137 | &rssiNotification); |
| 10138 | #endif |
| 10139 | break ; |
| 10140 | } |
| 10141 | case WDI_MISSED_BEACON_IND: |
| 10142 | { |
| 10143 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10144 | "Received WDI_MISSED_BEACON_IND from WDI "); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10145 | /* send IND to PE */ |
| 10146 | WDA_SendMsg(pWDA, WDA_MISSED_BEACON_IND, NULL, 0) ; |
| 10147 | break ; |
| 10148 | } |
| 10149 | case WDI_UNKNOWN_ADDR2_FRAME_RX_IND: |
| 10150 | { |
| 10151 | /* TODO: Decode Ind and send Ind to PE */ |
| 10152 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10153 | "Received WDI_UNKNOWN_ADDR2_FRAME_RX_IND from WDI "); |
| 10154 | break ; |
| 10155 | } |
| 10156 | |
| 10157 | case WDI_MIC_FAILURE_IND: |
| 10158 | { |
| 10159 | tpSirSmeMicFailureInd pMicInd = |
| 10160 | (tpSirSmeMicFailureInd)vos_mem_malloc(sizeof(tSirSmeMicFailureInd)); |
| 10161 | |
| 10162 | if(NULL == pMicInd) |
| 10163 | { |
| 10164 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10165 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10166 | break; |
| 10167 | } |
| 10168 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10169 | "Received WDI_MIC_FAILURE_IND from WDI "); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10170 | pMicInd->messageType = eWNI_SME_MIC_FAILURE_IND; |
| 10171 | pMicInd->length = sizeof(tSirSmeMicFailureInd); |
| 10172 | vos_mem_copy(pMicInd->bssId, |
| 10173 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.bssId, |
| 10174 | sizeof(tSirMacAddr)); |
| 10175 | vos_mem_copy(pMicInd->info.srcMacAddr, |
| 10176 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.macSrcAddr, |
| 10177 | sizeof(tSirMacAddr)); |
| 10178 | vos_mem_copy(pMicInd->info.taMacAddr, |
| 10179 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.macTaAddr, |
| 10180 | sizeof(tSirMacAddr)); |
| 10181 | vos_mem_copy(pMicInd->info.dstMacAddr, |
| 10182 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.macDstAddr, |
| 10183 | sizeof(tSirMacAddr)); |
| 10184 | vos_mem_copy(pMicInd->info.rxMacAddr, |
| 10185 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.macRxAddr, |
| 10186 | sizeof(tSirMacAddr)); |
| 10187 | pMicInd->info.multicast = |
| 10188 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.ucMulticast; |
| 10189 | pMicInd->info.keyId= |
| 10190 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.keyId; |
| 10191 | pMicInd->info.IV1= |
| 10192 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.ucIV1; |
| 10193 | vos_mem_copy(pMicInd->info.TSC, |
| 10194 | wdiLowLevelInd->wdiIndicationData.wdiMICFailureInfo.TSC,SIR_CIPHER_SEQ_CTR_SIZE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10195 | WDA_SendMsg(pWDA, SIR_HAL_MIC_FAILURE_IND, |
| 10196 | (void *)pMicInd , 0) ; |
| 10197 | break ; |
| 10198 | } |
| 10199 | case WDI_FATAL_ERROR_IND: |
| 10200 | { |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 10201 | pWDA->wdiFailed = true; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10202 | /* TODO: Decode Ind and send Ind to PE */ |
| 10203 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10204 | "Received WDI_FATAL_ERROR_IND from WDI "); |
| 10205 | break ; |
| 10206 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10207 | case WDI_DEL_STA_IND: |
| 10208 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10209 | tpDeleteStaContext pDelSTACtx = |
| 10210 | (tpDeleteStaContext)vos_mem_malloc(sizeof(tDeleteStaContext)); |
| 10211 | |
| 10212 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10213 | "Received WDI_DEL_STA_IND from WDI "); |
| 10214 | if(NULL == pDelSTACtx) |
| 10215 | { |
| 10216 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10217 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10218 | break; |
| 10219 | } |
| 10220 | vos_mem_copy(pDelSTACtx->addr2, |
| 10221 | wdiLowLevelInd->wdiIndicationData.wdiDeleteSTAIndType.macADDR2, |
| 10222 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10223 | vos_mem_copy(pDelSTACtx->bssId, |
| 10224 | wdiLowLevelInd->wdiIndicationData.wdiDeleteSTAIndType.macBSSID, |
| 10225 | sizeof(tSirMacAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10226 | pDelSTACtx->assocId = |
| 10227 | wdiLowLevelInd->wdiIndicationData.wdiDeleteSTAIndType.usAssocId; |
| 10228 | pDelSTACtx->reasonCode = |
| 10229 | wdiLowLevelInd->wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode; |
| 10230 | pDelSTACtx->staId = |
| 10231 | wdiLowLevelInd->wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10232 | WDA_SendMsg(pWDA, SIR_LIM_DELETE_STA_CONTEXT_IND, |
| 10233 | (void *)pDelSTACtx , 0) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10234 | break ; |
| 10235 | } |
| 10236 | case WDI_COEX_IND: |
| 10237 | { |
| 10238 | tANI_U32 index; |
| 10239 | vos_msg_t vosMsg; |
| 10240 | tSirSmeCoexInd *pSmeCoexInd = (tSirSmeCoexInd *)vos_mem_malloc(sizeof(tSirSmeCoexInd)); |
| 10241 | if(NULL == pSmeCoexInd) |
| 10242 | { |
| 10243 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10244 | "%s: VOS MEM Alloc Failure-pSmeCoexInd", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10245 | break; |
| 10246 | } |
| 10247 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10248 | "Received WDI_COEX_IND from WDI "); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10249 | /* Message Header */ |
| 10250 | pSmeCoexInd->mesgType = eWNI_SME_COEX_IND; |
| 10251 | pSmeCoexInd->mesgLen = sizeof(tSirSmeCoexInd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10252 | /* Info from WDI Indication */ |
| 10253 | pSmeCoexInd->coexIndType = wdiLowLevelInd->wdiIndicationData.wdiCoexInfo.coexIndType; |
| 10254 | for (index = 0; index < SIR_COEX_IND_DATA_SIZE; index++) |
| 10255 | { |
| 10256 | pSmeCoexInd->coexIndData[index] = wdiLowLevelInd->wdiIndicationData.wdiCoexInfo.coexIndData[index]; |
| 10257 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10258 | /* VOS message wrapper */ |
| 10259 | vosMsg.type = eWNI_SME_COEX_IND; |
| 10260 | vosMsg.bodyptr = (void *)pSmeCoexInd; |
| 10261 | vosMsg.bodyval = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10262 | /* Send message to SME */ |
| 10263 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) |
| 10264 | { |
| 10265 | /* free the mem and return */ |
| 10266 | vos_mem_free((v_VOID_t *)pSmeCoexInd); |
| 10267 | } |
| 10268 | else |
| 10269 | { |
| 10270 | /* DEBUG */ |
| 10271 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10272 | "[COEX WDA] Coex Ind Type (%x) data (%x %x %x %x)", |
| 10273 | pSmeCoexInd->coexIndType, |
| 10274 | pSmeCoexInd->coexIndData[0], |
| 10275 | pSmeCoexInd->coexIndData[1], |
| 10276 | pSmeCoexInd->coexIndData[2], |
| 10277 | pSmeCoexInd->coexIndData[3]); |
| 10278 | } |
| 10279 | break; |
| 10280 | } |
| 10281 | case WDI_TX_COMPLETE_IND: |
| 10282 | { |
| 10283 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext) ; |
| 10284 | /* Calling TxCompleteAck Indication from wda context*/ |
| 10285 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10286 | "Complete Indication received from HAL"); |
| 10287 | if( pWDA->pAckTxCbFunc ) |
| 10288 | { |
| 10289 | if( VOS_STATUS_SUCCESS != |
| 10290 | WDA_STOP_TIMER(&pWDA->wdaTimers.TxCompleteTimer)) |
| 10291 | { |
| 10292 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10293 | "Tx Complete timeout Timer Stop Failed "); |
| 10294 | } |
| 10295 | pWDA->pAckTxCbFunc( pMac, wdiLowLevelInd->wdiIndicationData.tx_complete_status); |
| 10296 | pWDA->pAckTxCbFunc = NULL; |
| 10297 | } |
| 10298 | else |
| 10299 | { |
| 10300 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10301 | "Tx Complete Indication is received after timeout "); |
| 10302 | } |
| 10303 | break; |
| 10304 | } |
| 10305 | #ifdef WLAN_FEATURE_P2P |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 10306 | case WDI_P2P_NOA_START_IND : |
| 10307 | { |
| 10308 | tSirP2PNoaStart *pP2pNoaStart = |
| 10309 | (tSirP2PNoaStart *)vos_mem_malloc(sizeof(tSirP2PNoaStart)); |
| 10310 | |
| 10311 | if (NULL == pP2pNoaStart) |
| 10312 | { |
| 10313 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10314 | "Memory allocation failure, " |
| 10315 | "WDI_P2P_NOA_START_IND not forwarded"); |
| 10316 | break; |
| 10317 | } |
| 10318 | pP2pNoaStart->status = |
| 10319 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaStartInfo.status; |
| 10320 | pP2pNoaStart->bssIdx = |
| 10321 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaStartInfo.bssIdx; |
| 10322 | WDA_SendMsg(pWDA, SIR_HAL_P2P_NOA_START_IND, |
| 10323 | (void *)pP2pNoaStart , 0) ; |
| 10324 | break; |
| 10325 | } |
| 10326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10327 | case WDI_P2P_NOA_ATTR_IND : |
| 10328 | { |
| 10329 | tSirP2PNoaAttr *pP2pNoaAttr = |
| 10330 | (tSirP2PNoaAttr *)vos_mem_malloc(sizeof(tSirP2PNoaAttr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10331 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10332 | "Received WDI_P2P_NOA_ATTR_IND from WDI"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10333 | if (NULL == pP2pNoaAttr) |
| 10334 | { |
| 10335 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10336 | "Memory allocation failure, " |
| 10337 | "WDI_P2P_NOA_ATTR_IND not forwarded"); |
| 10338 | break; |
| 10339 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10340 | pP2pNoaAttr->index = |
| 10341 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex; |
| 10342 | pP2pNoaAttr->oppPsFlag = |
| 10343 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag; |
| 10344 | pP2pNoaAttr->ctWin = |
| 10345 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin; |
| 10346 | |
| 10347 | pP2pNoaAttr->uNoa1IntervalCnt = |
| 10348 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt; |
| 10349 | pP2pNoaAttr->uNoa1Duration = |
| 10350 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration; |
| 10351 | pP2pNoaAttr->uNoa1Interval = |
| 10352 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval; |
| 10353 | pP2pNoaAttr->uNoa1StartTime = |
| 10354 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10355 | pP2pNoaAttr->uNoa2IntervalCnt = |
| 10356 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt; |
| 10357 | pP2pNoaAttr->uNoa2Duration = |
| 10358 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration; |
| 10359 | pP2pNoaAttr->uNoa2Interval = |
| 10360 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval; |
| 10361 | pP2pNoaAttr->uNoa2StartTime = |
| 10362 | wdiLowLevelInd->wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10363 | WDA_SendMsg(pWDA, SIR_HAL_P2P_NOA_ATTR_IND, |
| 10364 | (void *)pP2pNoaAttr , 0) ; |
| 10365 | break; |
| 10366 | } |
| 10367 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10368 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 10369 | case WDI_PREF_NETWORK_FOUND_IND: |
| 10370 | { |
| 10371 | vos_msg_t vosMsg; |
| 10372 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)vos_mem_malloc(sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10373 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10374 | "Received WDI_PREF_NETWORK_FOUND_IND from WDI"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10375 | if (NULL == pPrefNetworkFoundInd) |
| 10376 | { |
| 10377 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10378 | "Memory allocation failure, " |
| 10379 | "WDI_PREF_NETWORK_FOUND_IND not forwarded"); |
| 10380 | break; |
| 10381 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10382 | /* Message Header */ |
| 10383 | pPrefNetworkFoundInd->mesgType = eWNI_SME_PREF_NETWORK_FOUND_IND; |
| 10384 | pPrefNetworkFoundInd->mesgLen = sizeof(*pPrefNetworkFoundInd); |
| 10385 | |
| 10386 | /* Info from WDI Indication */ |
| 10387 | pPrefNetworkFoundInd->ssId.length = |
| 10388 | wdiLowLevelInd->wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10389 | vos_mem_set( pPrefNetworkFoundInd->ssId.ssId, 32, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10390 | vos_mem_copy( pPrefNetworkFoundInd->ssId.ssId, |
| 10391 | wdiLowLevelInd->wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 10392 | pPrefNetworkFoundInd->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10393 | pPrefNetworkFoundInd ->rssi = wdiLowLevelInd->wdiIndicationData.wdiPrefNetworkFoundInd.rssi; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10394 | /* VOS message wrapper */ |
| 10395 | vosMsg.type = eWNI_SME_PREF_NETWORK_FOUND_IND; |
| 10396 | vosMsg.bodyptr = (void *) pPrefNetworkFoundInd; |
| 10397 | vosMsg.bodyval = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10398 | /* Send message to SME */ |
| 10399 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) |
| 10400 | { |
| 10401 | /* free the mem and return */ |
| 10402 | vos_mem_free((v_VOID_t *) pPrefNetworkFoundInd); |
| 10403 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10404 | break; |
| 10405 | } |
| 10406 | #endif // FEATURE_WLAN_SCAN_PNO |
| 10407 | |
| 10408 | #ifdef WLAN_WAKEUP_EVENTS |
| 10409 | case WDI_WAKE_REASON_IND: |
| 10410 | { |
| 10411 | vos_msg_t vosMsg; |
| 10412 | tANI_U32 allocSize = sizeof(tSirWakeReasonInd) |
| 10413 | + (wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen - 1); |
| 10414 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)vos_mem_malloc(allocSize); |
| 10415 | |
| 10416 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10417 | "[WAKE_REASON WDI] WAKE_REASON_IND Type (0x%x) data (ulReason=0x%x, ulReasonArg=0x%x, ulStoredDataLen=0x%x)", |
| 10418 | wdiLowLevelInd->wdiIndicationType, |
| 10419 | wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulReason, |
| 10420 | wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg, |
| 10421 | wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen); |
| 10422 | |
| 10423 | if (NULL == pWakeReasonInd) |
| 10424 | { |
| 10425 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10426 | "Memory allocation failure, " |
| 10427 | "WDI_WAKE_REASON_IND not forwarded"); |
| 10428 | break; |
| 10429 | } |
| 10430 | |
| 10431 | vos_mem_zero(pWakeReasonInd, allocSize); |
| 10432 | |
| 10433 | /* Message Header */ |
| 10434 | pWakeReasonInd->mesgType = eWNI_SME_WAKE_REASON_IND; |
| 10435 | pWakeReasonInd->mesgLen = allocSize; |
| 10436 | |
| 10437 | /* Info from WDI Indication */ |
| 10438 | // Fill pWakeReasonInd structure from wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd |
| 10439 | pWakeReasonInd->ulReason = wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulReason; |
| 10440 | pWakeReasonInd->ulReasonArg = wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg; |
| 10441 | pWakeReasonInd->ulStoredDataLen = wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen; |
| 10442 | pWakeReasonInd->ulActualDataLen = wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen; |
| 10443 | vos_mem_copy( (void *)&(pWakeReasonInd->aDataStart[0]), |
| 10444 | &(wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]), |
| 10445 | wdiLowLevelInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen); |
| 10446 | |
| 10447 | /* VOS message wrapper */ |
| 10448 | vosMsg.type = eWNI_SME_WAKE_REASON_IND; |
| 10449 | vosMsg.bodyptr = (void *) pWakeReasonInd; |
| 10450 | vosMsg.bodyval = 0; |
| 10451 | |
| 10452 | /* Send message to SME */ |
| 10453 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) |
| 10454 | { |
| 10455 | /* free the mem and return */ |
| 10456 | vos_mem_free((v_VOID_t *) pWakeReasonInd); |
| 10457 | } |
| 10458 | |
| 10459 | break; |
| 10460 | } |
| 10461 | #endif // WLAN_WAKEUP_EVENTS |
| 10462 | |
| 10463 | case WDI_TX_PER_HIT_IND: |
| 10464 | { |
| 10465 | vos_msg_t vosMsg; |
| 10466 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, "Get WDI_TX_PER_HIT_IND"); |
| 10467 | /* send IND to PE eWNI_SME_TX_PER_HIT_IND*/ |
| 10468 | /* VOS message wrapper */ |
| 10469 | vosMsg.type = eWNI_SME_TX_PER_HIT_IND; |
| 10470 | vosMsg.bodyptr = NULL; |
| 10471 | vosMsg.bodyval = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10472 | /* Send message to SME */ |
| 10473 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) |
| 10474 | { |
| 10475 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, "post eWNI_SME_TX_PER_HIT_IND to SME Failed"); |
| 10476 | } |
| 10477 | break; |
| 10478 | } |
| 10479 | |
| 10480 | default: |
| 10481 | { |
| 10482 | /* TODO error */ |
| 10483 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10484 | "Received UNKNOWN Indication from WDI "); |
| 10485 | } |
| 10486 | } |
| 10487 | return ; |
| 10488 | } |
| 10489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10490 | /* |
| 10491 | * BA related processing in WDA. |
| 10492 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10493 | void WDA_TriggerBaReqCallback(WDI_TriggerBARspParamsType *wdiTriggerBaRsp, |
| 10494 | void* pUserData) |
| 10495 | { |
| 10496 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 10497 | tWDA_CbContext *pWDA; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10498 | if(NULL == pWdaParams) |
| 10499 | { |
| 10500 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10501 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10502 | VOS_ASSERT(0) ; |
| 10503 | return ; |
| 10504 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10505 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10506 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 10507 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 10508 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10509 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10510 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10511 | if(WDI_STATUS_SUCCESS == wdiTriggerBaRsp->wdiStatus) |
| 10512 | { |
| 10513 | tANI_U8 i = 0 ; |
| 10514 | tBaActivityInd *baActivityInd = NULL ; |
| 10515 | tANI_U8 baCandidateCount = wdiTriggerBaRsp->usBaCandidateCnt ; |
| 10516 | tANI_U8 allocSize = sizeof(tBaActivityInd) |
| 10517 | + sizeof(tAddBaCandidate) * (baCandidateCount) ; |
| 10518 | WDI_TriggerBARspCandidateType *wdiBaCandidate = NULL ; |
| 10519 | tAddBaCandidate *baCandidate = NULL ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10520 | baActivityInd = (tBaActivityInd *)vos_mem_malloc(allocSize) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10521 | if(NULL == baActivityInd) |
| 10522 | { |
| 10523 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10524 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10525 | VOS_ASSERT(0) ; |
| 10526 | return; |
| 10527 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10528 | vos_mem_copy(baActivityInd->bssId, wdiTriggerBaRsp->macBSSID, |
| 10529 | sizeof(tSirMacAddr)) ; |
| 10530 | baActivityInd->baCandidateCnt = baCandidateCount ; |
| 10531 | |
| 10532 | wdiBaCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBaRsp + 1) ; |
| 10533 | baCandidate = (tAddBaCandidate*)(baActivityInd + 1) ; |
| 10534 | |
| 10535 | for(i = 0 ; i < baCandidateCount ; i++) |
| 10536 | { |
| 10537 | tANI_U8 tid = 0 ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10538 | vos_mem_copy(baCandidate->staAddr, wdiBaCandidate->macSTA, |
| 10539 | sizeof(tSirMacAddr)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10540 | for(tid = 0 ; tid < STACFG_MAX_TC; tid++) |
| 10541 | { |
| 10542 | baCandidate->baInfo[tid].fBaEnable = |
| 10543 | wdiBaCandidate->wdiBAInfo[tid].fBaEnable ; |
| 10544 | baCandidate->baInfo[tid].startingSeqNum = |
| 10545 | wdiBaCandidate->wdiBAInfo[tid].startingSeqNum ; |
| 10546 | } |
Madan Mohan Koyyalamudi | 5eec74a | 2012-09-28 14:59:25 -0700 | [diff] [blame] | 10547 | wdiBaCandidate++ ; |
| 10548 | baCandidate++ ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10549 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10550 | WDA_SendMsg(pWDA, SIR_LIM_ADD_BA_IND, (void *)baActivityInd , 0) ; |
| 10551 | } |
| 10552 | else |
| 10553 | { |
| 10554 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10555 | "BA Trigger RSP with Failure received "); |
| 10556 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10557 | return ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10558 | } |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 10559 | |
| 10560 | |
| 10561 | /* |
| 10562 | * API to activate/deactivate Traffic Stats timer. Traffic stats timer is only needed |
| 10563 | * during MCC |
| 10564 | */ |
| 10565 | void WDA_TrafficStatsTimerActivate(wpt_boolean activate) |
| 10566 | { |
| 10567 | wpt_uint32 enabled; |
| 10568 | v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); |
| 10569 | tWDA_CbContext *pWDA = vos_get_context(VOS_MODULE_ID_WDA, pVosContext); |
| 10570 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pVosContext); |
| 10571 | |
| 10572 | if(wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, &enabled) |
| 10573 | != eSIR_SUCCESS) |
| 10574 | { |
| 10575 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10576 | "Failed to get WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED"); |
| 10577 | return; |
| 10578 | } |
| 10579 | |
| 10580 | if(!enabled) |
| 10581 | { |
| 10582 | return; |
| 10583 | } |
| 10584 | |
| 10585 | if(NULL == pWDA) |
| 10586 | { |
| 10587 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10588 | "%s:WDA context is NULL", __func__); |
| 10589 | VOS_ASSERT(0); |
| 10590 | return; |
| 10591 | } |
| 10592 | |
| 10593 | if(activate) |
| 10594 | { |
| 10595 | if( VOS_STATUS_SUCCESS != |
| 10596 | WDA_START_TIMER(&pWDA->wdaTimers.trafficStatsTimer)) |
| 10597 | { |
| 10598 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10599 | "Traffic Stats Timer Start Failed "); |
| 10600 | return; |
| 10601 | } |
| 10602 | WDI_DS_ActivateTrafficStats(); |
| 10603 | } |
| 10604 | else |
| 10605 | { |
| 10606 | WDI_DS_DeactivateTrafficStats(); |
| 10607 | WDI_DS_ClearTrafficStats(); |
| 10608 | |
| 10609 | if( VOS_STATUS_SUCCESS != |
| 10610 | WDA_STOP_TIMER(&pWDA->wdaTimers.trafficStatsTimer)) |
| 10611 | { |
| 10612 | VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10613 | "Traffic Stats Timer Stop Failed "); |
| 10614 | return; |
| 10615 | } |
| 10616 | } |
| 10617 | } |
| 10618 | |
| 10619 | /* |
| 10620 | * Traffic Stats Timer handler |
| 10621 | */ |
| 10622 | void WDA_TimerTrafficStatsInd(tWDA_CbContext *pWDA) |
| 10623 | { |
| 10624 | WDI_Status wdiStatus; |
| 10625 | WDI_TrafficStatsType *pWdiTrafficStats = NULL; |
| 10626 | WDI_TrafficStatsIndType trafficStatsIndParams; |
| 10627 | wpt_uint32 length, enabled; |
| 10628 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); |
| 10629 | |
| 10630 | if(wlan_cfgGetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, &enabled) |
| 10631 | != eSIR_SUCCESS) |
| 10632 | { |
| 10633 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10634 | "Failed to get WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED"); |
| 10635 | return; |
| 10636 | } |
| 10637 | |
| 10638 | if(!enabled) |
| 10639 | { |
| 10640 | WDI_DS_DeactivateTrafficStats(); |
| 10641 | return; |
| 10642 | } |
| 10643 | |
| 10644 | WDI_DS_GetTrafficStats(&pWdiTrafficStats, &length); |
| 10645 | |
| 10646 | if(pWdiTrafficStats != NULL) |
| 10647 | { |
| 10648 | trafficStatsIndParams.pTrafficStats = pWdiTrafficStats; |
| 10649 | trafficStatsIndParams.length = length; |
| 10650 | trafficStatsIndParams.duration = |
Kumar Anand | 817c2a7 | 2013-01-18 15:24:47 -0800 | [diff] [blame] | 10651 | pWDA->wdaTimers.trafficStatsTimer.initScheduleTimeInMsecs; |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 10652 | trafficStatsIndParams.wdiReqStatusCB = WDA_WdiIndicationCallback; |
| 10653 | trafficStatsIndParams.pUserData = pWDA; |
| 10654 | |
| 10655 | wdiStatus = WDI_TrafficStatsInd(&trafficStatsIndParams); |
| 10656 | |
| 10657 | if(WDI_STATUS_PENDING == wdiStatus) |
| 10658 | { |
| 10659 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10660 | "Pending received for %s:%d ",__func__,__LINE__ ); |
| 10661 | } |
| 10662 | else if( WDI_STATUS_SUCCESS_SYNC != wdiStatus ) |
| 10663 | { |
| 10664 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10665 | "Failure in %s:%d ",__func__,__LINE__ ); |
| 10666 | } |
| 10667 | |
| 10668 | WDI_DS_ClearTrafficStats(); |
| 10669 | } |
| 10670 | else |
| 10671 | { |
| 10672 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, |
| 10673 | "pWdiTrafficStats is Null"); |
| 10674 | } |
| 10675 | |
| 10676 | if( VOS_STATUS_SUCCESS != |
| 10677 | WDA_START_TIMER(&pWDA->wdaTimers.trafficStatsTimer)) |
| 10678 | { |
| 10679 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_WARN, |
| 10680 | "Traffic Stats Timer Start Failed "); |
| 10681 | return; |
| 10682 | } |
| 10683 | } |
| 10684 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10685 | /* |
| 10686 | * BA Activity check timer handler |
| 10687 | */ |
| 10688 | void WDA_BaCheckActivity(tWDA_CbContext *pWDA) |
| 10689 | { |
| 10690 | tANI_U8 curSta = 0 ; |
| 10691 | tANI_U8 tid = 0 ; |
| 10692 | tANI_U8 size = 0 ; |
| 10693 | tANI_U8 baCandidateCount = 0 ; |
| 10694 | tANI_U8 newBaCandidate = 0 ; |
| 10695 | WDI_TriggerBAReqCandidateType baCandidate[WDA_MAX_STA] = {{0}} ; |
| 10696 | |
| 10697 | if(NULL == pWDA) |
| 10698 | { |
| 10699 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10700 | "%s:pWDA is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10701 | VOS_ASSERT(0); |
| 10702 | return ; |
| 10703 | } |
| 10704 | if(WDA_MAX_STA < pWDA->wdaMaxSta) |
| 10705 | { |
| 10706 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10707 | "Inconsistent STA entries in WDA"); |
| 10708 | VOS_ASSERT(0) ; |
| 10709 | } |
| 10710 | /* walk through all STA entries and find out TX packet count */ |
| 10711 | for(curSta = 0 ; curSta < pWDA->wdaMaxSta ; curSta++) |
| 10712 | { |
Gopichand Nakkala | ba26127 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 10713 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 10714 | // We can only do BA on "hard" STAs. |
| 10715 | if (!(IS_HWSTA_IDX(curSta))) |
| 10716 | { |
| 10717 | continue; |
| 10718 | } |
| 10719 | #endif //WLAN_SOFTAP_VSTA_FEATURE |
| 10720 | for(tid = 0 ; tid < STACFG_MAX_TC ; tid++) |
| 10721 | { |
Madan Mohan Koyyalamudi | fc1d1fe | 2012-10-18 15:07:12 -0700 | [diff] [blame] | 10722 | WLANTL_STAStateType tlSTAState ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10723 | tANI_U32 txPktCount = 0 ; |
| 10724 | tANI_U8 validStaIndex = pWDA->wdaStaInfo[curSta].ucValidStaIndex ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10725 | if((WDA_VALID_STA_INDEX == validStaIndex) && |
Madan Mohan Koyyalamudi | fc1d1fe | 2012-10-18 15:07:12 -0700 | [diff] [blame] | 10726 | (VOS_STATUS_SUCCESS == WDA_TL_GET_STA_STATE( pWDA->pVosContext, |
| 10727 | curSta, &tlSTAState)) && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10728 | (VOS_STATUS_SUCCESS == WDA_TL_GET_TX_PKTCOUNT( pWDA->pVosContext, |
| 10729 | curSta, tid, &txPktCount))) |
| 10730 | { |
| 10731 | #if 0 |
| 10732 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_LOW, |
| 10733 | "************* %d:%d, %d ",curSta, txPktCount, |
| 10734 | pWDA->wdaStaInfo[curSta].framesTxed[tid]); |
| 10735 | #endif |
| 10736 | if(!WDA_GET_BA_TXFLAG(pWDA, curSta, tid) |
Madan Mohan Koyyalamudi | fc1d1fe | 2012-10-18 15:07:12 -0700 | [diff] [blame] | 10737 | && (WLANTL_STA_AUTHENTICATED == tlSTAState) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10738 | && (txPktCount >= WDA_LAST_POLLED_THRESHOLD(pWDA, |
| 10739 | curSta, tid))) |
| 10740 | { |
| 10741 | /* get prepare for sending message to HAL */ |
| 10742 | //baCandidate[baCandidateCount].staIdx = curSta ; |
| 10743 | baCandidate[baCandidateCount].ucTidBitmap |= 1 << tid ; |
| 10744 | newBaCandidate = WDA_ENABLE_BA ; |
| 10745 | } |
| 10746 | pWDA->wdaStaInfo[curSta].framesTxed[tid] = txPktCount ; |
| 10747 | } |
| 10748 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10749 | /* fill the entry for all the sta with given TID's */ |
| 10750 | if(WDA_ENABLE_BA == newBaCandidate) |
| 10751 | { |
| 10752 | /* move to next BA candidate */ |
| 10753 | baCandidate[baCandidateCount].ucSTAIdx = curSta ; |
| 10754 | size += sizeof(WDI_TriggerBAReqCandidateType) ; |
| 10755 | baCandidateCount++ ; |
| 10756 | newBaCandidate = WDA_DISABLE_BA ; |
| 10757 | } |
| 10758 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10759 | /* prepare and send message to hal */ |
| 10760 | if( 0 < baCandidateCount) |
| 10761 | { |
| 10762 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 10763 | WDI_TriggerBAReqParamsType *wdiTriggerBaReq; |
| 10764 | tWDA_ReqParams *pWdaParams = |
| 10765 | (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10766 | if(NULL == pWdaParams) |
| 10767 | { |
| 10768 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10769 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10770 | VOS_ASSERT(0) ; |
| 10771 | return; |
| 10772 | } |
| 10773 | wdiTriggerBaReq = (WDI_TriggerBAReqParamsType *) |
| 10774 | vos_mem_malloc(sizeof(WDI_TriggerBAReqParamsType) + size) ; |
| 10775 | if(NULL == wdiTriggerBaReq) |
| 10776 | { |
| 10777 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10778 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10779 | VOS_ASSERT(0) ; |
| 10780 | vos_mem_free(pWdaParams); |
| 10781 | return; |
| 10782 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10783 | do |
| 10784 | { |
| 10785 | WDI_TriggerBAReqinfoType *triggerBaInfo = |
| 10786 | &wdiTriggerBaReq->wdiTriggerBAInfoType ; |
| 10787 | triggerBaInfo->usBACandidateCnt = baCandidateCount ; |
| 10788 | /* TEMP_FIX: Need to see if WDI need check for assoc session for |
| 10789 | * for each request */ |
| 10790 | triggerBaInfo->ucSTAIdx = baCandidate[0].ucSTAIdx ; |
| 10791 | triggerBaInfo->ucBASessionID = 0; |
| 10792 | vos_mem_copy((wdiTriggerBaReq + 1), baCandidate, size) ; |
| 10793 | } while(0) ; |
| 10794 | wdiTriggerBaReq->wdiReqStatusCB = NULL ; |
| 10795 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10796 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10797 | pWdaParams->pWdaContext = pWDA; |
| 10798 | pWdaParams->wdaWdiApiMsgParam = wdiTriggerBaReq ; |
| 10799 | pWdaParams->wdaMsgParam = NULL; |
| 10800 | status = WDI_TriggerBAReq(wdiTriggerBaReq, |
| 10801 | WDA_TriggerBaReqCallback, pWdaParams) ; |
| 10802 | if(IS_WDI_STATUS_FAILURE(status)) |
| 10803 | { |
| 10804 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10805 | "Failure in Trigger BA REQ Params WDI API, free all the memory " ); |
| 10806 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 10807 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 10808 | vos_mem_free(pWdaParams) ; |
| 10809 | } |
| 10810 | } |
| 10811 | else |
| 10812 | { |
| 10813 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO_LOW, |
| 10814 | "There is no TID for initiating BA"); |
| 10815 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10816 | if( VOS_STATUS_SUCCESS != |
| 10817 | WDA_STOP_TIMER(&pWDA->wdaTimers.baActivityChkTmr)) |
| 10818 | { |
| 10819 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10820 | "BA Activity Timer Stop Failed "); |
| 10821 | return ; |
| 10822 | } |
| 10823 | if( VOS_STATUS_SUCCESS != |
| 10824 | WDA_START_TIMER(&pWDA->wdaTimers.baActivityChkTmr)) |
| 10825 | { |
| 10826 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 10827 | "BA Activity Timer Start Failed "); |
| 10828 | return; |
| 10829 | } |
| 10830 | return ; |
| 10831 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10832 | /* |
| 10833 | * WDA common routine to create timer used by WDA. |
| 10834 | */ |
| 10835 | static VOS_STATUS wdaCreateTimers(tWDA_CbContext *pWDA) |
| 10836 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10837 | VOS_STATUS status = VOS_STATUS_SUCCESS ; |
| 10838 | tANI_U32 val = 0 ; |
| 10839 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext); |
| 10840 | |
| 10841 | if(NULL == pMac) |
| 10842 | { |
| 10843 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10844 | "%s:MAC context is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10845 | VOS_ASSERT(0); |
| 10846 | return VOS_STATUS_E_FAILURE; |
| 10847 | } |
| 10848 | if(wlan_cfgGetInt(pMac, WNI_CFG_BA_ACTIVITY_CHECK_TIMEOUT, &val ) |
| 10849 | != eSIR_SUCCESS) |
| 10850 | { |
| 10851 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10852 | "Failed to get value for WNI_CFG_CURRENT_TX_ANTENNA"); |
| 10853 | return VOS_STATUS_E_FAILURE; |
| 10854 | } |
| 10855 | val = SYS_MS_TO_TICKS(val) ; |
| 10856 | |
| 10857 | /* BA activity check timer */ |
| 10858 | status = WDA_CREATE_TIMER(&pWDA->wdaTimers.baActivityChkTmr, |
| 10859 | "BA Activity Check timer", WDA_TimerHandler, |
| 10860 | WDA_TIMER_BA_ACTIVITY_REQ, val, val, TX_NO_ACTIVATE) ; |
| 10861 | if(status != TX_SUCCESS) |
| 10862 | { |
| 10863 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10864 | "Unable to create BA activity timer"); |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 10865 | return VOS_STATUS_E_FAILURE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10866 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10867 | val = SYS_MS_TO_TICKS( WDA_TX_COMPLETE_TIME_OUT_VALUE ) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10868 | /* Tx Complete Timeout timer */ |
| 10869 | status = WDA_CREATE_TIMER(&pWDA->wdaTimers.TxCompleteTimer, |
| 10870 | "Tx Complete Check timer", WDA_TimerHandler, |
| 10871 | WDA_TX_COMPLETE_TIMEOUT_IND, val, val, TX_NO_ACTIVATE) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10872 | if(status != TX_SUCCESS) |
| 10873 | { |
| 10874 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10875 | "Unable to create Tx Complete Timeout timer"); |
| 10876 | /* Destroy timer of BA activity check timer */ |
| 10877 | status = WDA_DESTROY_TIMER(&pWDA->wdaTimers.baActivityChkTmr); |
| 10878 | if(status != TX_SUCCESS) |
| 10879 | { |
| 10880 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10881 | "Unable to Destroy BA activity timer"); |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 10882 | return VOS_STATUS_E_FAILURE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10883 | } |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 10884 | return VOS_STATUS_E_FAILURE ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10885 | } |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 10886 | |
| 10887 | val = SYS_MS_TO_TICKS( WDA_TRAFFIC_STATS_TIME_OUT_VALUE ); |
| 10888 | |
| 10889 | /* Traffic Stats timer */ |
| 10890 | status = WDA_CREATE_TIMER(&pWDA->wdaTimers.trafficStatsTimer, |
| 10891 | "Traffic Stats timer", WDA_TimerHandler, |
| 10892 | WDA_TIMER_TRAFFIC_STATS_IND, val, val, TX_NO_ACTIVATE) ; |
| 10893 | if(status != TX_SUCCESS) |
| 10894 | { |
| 10895 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10896 | "Unable to create traffic stats timer"); |
| 10897 | /* Destroy timer of BA activity check timer */ |
| 10898 | status = WDA_DESTROY_TIMER(&pWDA->wdaTimers.baActivityChkTmr); |
| 10899 | if(status != TX_SUCCESS) |
| 10900 | { |
| 10901 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10902 | "Unable to Destroy BA activity timer"); |
| 10903 | } |
| 10904 | /* Destroy timer of tx complete timer */ |
| 10905 | status = WDA_DESTROY_TIMER(&pWDA->wdaTimers.TxCompleteTimer); |
| 10906 | if(status != TX_SUCCESS) |
| 10907 | { |
| 10908 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10909 | "Unable to Tx complete timer"); |
| 10910 | } |
| 10911 | return VOS_STATUS_E_FAILURE ; |
| 10912 | } |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 10913 | return VOS_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10914 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10915 | /* |
| 10916 | * WDA common routine to destroy timer used by WDA. |
| 10917 | */ |
| 10918 | static VOS_STATUS wdaDestroyTimers(tWDA_CbContext *pWDA) |
| 10919 | { |
| 10920 | VOS_STATUS status = VOS_STATUS_SUCCESS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10921 | status = WDA_DESTROY_TIMER(&pWDA->wdaTimers.TxCompleteTimer); |
| 10922 | if(status != TX_SUCCESS) |
| 10923 | { |
| 10924 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10925 | "Unable to Destroy Tx Complete Timeout timer"); |
| 10926 | return eSIR_FAILURE ; |
| 10927 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10928 | status = WDA_DESTROY_TIMER(&pWDA->wdaTimers.baActivityChkTmr); |
| 10929 | if(status != TX_SUCCESS) |
| 10930 | { |
| 10931 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10932 | "Unable to Destroy BA activity timer"); |
| 10933 | return eSIR_FAILURE ; |
| 10934 | } |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 10935 | status = WDA_DESTROY_TIMER(&pWDA->wdaTimers.trafficStatsTimer); |
| 10936 | if(status != TX_SUCCESS) |
| 10937 | { |
| 10938 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10939 | "Unable to Destroy traffic stats timer"); |
| 10940 | return eSIR_FAILURE ; |
| 10941 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10942 | return eSIR_SUCCESS ; |
| 10943 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10944 | /* |
| 10945 | * WDA timer handler. |
| 10946 | */ |
| 10947 | void WDA_TimerHandler(v_VOID_t* pContext, tANI_U32 timerInfo) |
| 10948 | { |
| 10949 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 10950 | vos_msg_t wdaMsg = {0} ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10951 | /* |
| 10952 | * trigger CFG download in WDA by sending WDA_CFG_DNLD message |
| 10953 | */ |
| 10954 | wdaMsg.type = timerInfo ; |
| 10955 | wdaMsg.bodyptr = NULL; |
| 10956 | wdaMsg.bodyval = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10957 | /* post the message.. */ |
| 10958 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &wdaMsg ); |
| 10959 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 10960 | { |
| 10961 | vosStatus = VOS_STATUS_E_BADMSG; |
| 10962 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10963 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10964 | /* |
| 10965 | * WDA Tx Complete timeout Indication. |
| 10966 | */ |
| 10967 | void WDA_ProcessTxCompleteTimeOutInd(tWDA_CbContext* pWDA) |
| 10968 | { |
| 10969 | tpAniSirGlobal pMac = (tpAniSirGlobal )VOS_GET_MAC_CTXT(pWDA->pVosContext) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10970 | if( pWDA->pAckTxCbFunc ) |
| 10971 | { |
| 10972 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10973 | "TxComplete timer expired\n"); |
| 10974 | pWDA->pAckTxCbFunc( pMac, 0); |
| 10975 | pWDA->pAckTxCbFunc = NULL; |
| 10976 | } |
| 10977 | else |
| 10978 | { |
| 10979 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 10980 | "There is no request pending for TxComplete and wait timer expired\n"); |
| 10981 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10982 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10983 | /* |
| 10984 | * WDA Set REG Domain to VOS NV |
| 10985 | */ |
| 10986 | eHalStatus WDA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId) |
| 10987 | { |
| 10988 | if(VOS_STATUS_SUCCESS != vos_nv_setRegDomain(clientCtxt, regId)) |
| 10989 | { |
| 10990 | return eHAL_STATUS_INVALID_PARAMETER; |
| 10991 | } |
| 10992 | return eHAL_STATUS_SUCCESS; |
| 10993 | } |
| 10994 | #endif /* FEATURE_WLAN_INTEGRATED_SOC */ |
| 10995 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10996 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 10997 | /* |
| 10998 | * FUNCTION: WDA_PNOScanReqCallback |
| 10999 | * |
| 11000 | */ |
| 11001 | void WDA_PNOScanReqCallback(WDI_Status status, void* pUserData) |
| 11002 | { |
| 11003 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11004 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11005 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11006 | if(NULL == pWdaParams) |
| 11007 | { |
| 11008 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11009 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11010 | VOS_ASSERT(0) ; |
| 11011 | return ; |
| 11012 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11013 | if( pWdaParams != NULL ) |
| 11014 | { |
| 11015 | if( pWdaParams->wdaWdiApiMsgParam != NULL ) |
| 11016 | { |
| 11017 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11018 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11019 | if( pWdaParams->wdaMsgParam != NULL) |
| 11020 | { |
| 11021 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11022 | } |
| 11023 | |
| 11024 | vos_mem_free(pWdaParams) ; |
| 11025 | } |
| 11026 | |
| 11027 | return ; |
| 11028 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11029 | /* |
| 11030 | * FUNCTION: WDA_UpdateScanParamsCallback |
| 11031 | * |
| 11032 | */ |
| 11033 | void WDA_UpdateScanParamsCallback(WDI_Status status, void* pUserData) |
| 11034 | { |
| 11035 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11036 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11037 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11038 | if(NULL == pWdaParams) |
| 11039 | { |
| 11040 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11041 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11042 | VOS_ASSERT(0) ; |
| 11043 | return ; |
| 11044 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11045 | if( pWdaParams != NULL ) |
| 11046 | { |
| 11047 | if( pWdaParams->wdaWdiApiMsgParam != NULL ) |
| 11048 | { |
| 11049 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11050 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11051 | if( pWdaParams->wdaMsgParam != NULL) |
| 11052 | { |
| 11053 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11054 | } |
| 11055 | vos_mem_free(pWdaParams) ; |
| 11056 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11057 | return ; |
| 11058 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11059 | /* |
| 11060 | * FUNCTION: WDA_SetPowerParamsCallback |
| 11061 | * |
| 11062 | */ |
| 11063 | void WDA_SetPowerParamsCallback(WDI_Status status, void* pUserData) |
| 11064 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11065 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11066 | |
| 11067 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11068 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11069 | if(NULL == pWdaParams) |
| 11070 | { |
| 11071 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11072 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11073 | VOS_ASSERT(0) ; |
| 11074 | return ; |
| 11075 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11076 | if( pWdaParams != NULL ) |
| 11077 | { |
| 11078 | if( pWdaParams->wdaWdiApiMsgParam != NULL ) |
| 11079 | { |
| 11080 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11081 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11082 | if( pWdaParams->wdaMsgParam != NULL) |
| 11083 | { |
| 11084 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11085 | } |
| 11086 | vos_mem_free(pWdaParams) ; |
| 11087 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11088 | return ; |
| 11089 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11090 | /* |
| 11091 | * FUNCTION: WDA_ProcessSetPreferredNetworkList |
| 11092 | * Request to WDI to set Preferred Network List.Offload |
| 11093 | */ |
| 11094 | VOS_STATUS WDA_ProcessSetPrefNetworkReq(tWDA_CbContext *pWDA, |
| 11095 | tSirPNOScanReq *pPNOScanReqParams) |
| 11096 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11097 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11098 | WDI_PNOScanReqParamsType *pwdiPNOScanReqInfo = |
| 11099 | (WDI_PNOScanReqParamsType *)vos_mem_malloc(sizeof(WDI_PNOScanReqParamsType)) ; |
| 11100 | tWDA_ReqParams *pWdaParams ; |
| 11101 | v_U8_t i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11102 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11103 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11104 | if(NULL == pwdiPNOScanReqInfo) |
| 11105 | { |
| 11106 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11107 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11108 | VOS_ASSERT(0); |
| 11109 | return VOS_STATUS_E_NOMEM; |
| 11110 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11111 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11112 | if(NULL == pWdaParams) |
| 11113 | { |
| 11114 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11115 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11116 | VOS_ASSERT(0); |
| 11117 | vos_mem_free(pwdiPNOScanReqInfo); |
| 11118 | return VOS_STATUS_E_NOMEM; |
| 11119 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11120 | // |
| 11121 | // Fill wdiPNOScanReqInfo->wdiPNOScanInfo from pPNOScanReqParams |
| 11122 | // |
| 11123 | pwdiPNOScanReqInfo->wdiPNOScanInfo.bEnable = pPNOScanReqParams->enable; |
| 11124 | pwdiPNOScanReqInfo->wdiPNOScanInfo.wdiModePNO = pPNOScanReqParams->modePNO; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11125 | pwdiPNOScanReqInfo->wdiPNOScanInfo.ucNetworksCount = |
| 11126 | ( pPNOScanReqParams->ucNetworksCount < WDI_PNO_MAX_SUPP_NETWORKS )? |
| 11127 | pPNOScanReqParams->ucNetworksCount : WDI_PNO_MAX_SUPP_NETWORKS ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11128 | for ( i = 0; i < pwdiPNOScanReqInfo->wdiPNOScanInfo.ucNetworksCount ; i++) |
| 11129 | { |
| 11130 | vos_mem_copy(&pwdiPNOScanReqInfo->wdiPNOScanInfo.aNetworks[i], |
| 11131 | &pPNOScanReqParams->aNetworks[i], |
| 11132 | sizeof(pwdiPNOScanReqInfo->wdiPNOScanInfo.aNetworks[i])); |
| 11133 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11134 | /*Scan timer intervals*/ |
| 11135 | vos_mem_copy(&pwdiPNOScanReqInfo->wdiPNOScanInfo.scanTimers, |
| 11136 | &pPNOScanReqParams->scanTimers, |
| 11137 | sizeof(pwdiPNOScanReqInfo->wdiPNOScanInfo.scanTimers)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11138 | /*Probe template for 2.4GHz band*/ |
| 11139 | pwdiPNOScanReqInfo->wdiPNOScanInfo.us24GProbeSize = |
| 11140 | (pPNOScanReqParams->us24GProbeTemplateLen<WDI_PNO_MAX_PROBE_SIZE)? |
| 11141 | pPNOScanReqParams->us24GProbeTemplateLen:WDI_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11142 | vos_mem_copy( &pwdiPNOScanReqInfo->wdiPNOScanInfo.a24GProbeTemplate, |
| 11143 | pPNOScanReqParams->p24GProbeTemplate, |
| 11144 | pwdiPNOScanReqInfo->wdiPNOScanInfo.us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11145 | /*Probe template for 5GHz band*/ |
| 11146 | pwdiPNOScanReqInfo->wdiPNOScanInfo.us5GProbeSize = |
| 11147 | (pPNOScanReqParams->us5GProbeTemplateLen<WDI_PNO_MAX_PROBE_SIZE)? |
| 11148 | pPNOScanReqParams->us5GProbeTemplateLen:WDI_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11149 | vos_mem_copy( &pwdiPNOScanReqInfo->wdiPNOScanInfo.a5GProbeTemplate, |
| 11150 | pPNOScanReqParams->p5GProbeTemplate, |
| 11151 | pwdiPNOScanReqInfo->wdiPNOScanInfo.us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11152 | pwdiPNOScanReqInfo->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11153 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11154 | /* Store Params pass it to WDI */ |
| 11155 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiPNOScanReqInfo; |
| 11156 | pWdaParams->pWdaContext = pWDA; |
| 11157 | /* Store param pointer as passed in by caller */ |
| 11158 | pWdaParams->wdaMsgParam = pPNOScanReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11159 | status = WDI_SetPreferredNetworkReq(pwdiPNOScanReqInfo, |
| 11160 | (WDI_PNOScanCb)WDA_PNOScanReqCallback, pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11161 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11162 | { |
| 11163 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11164 | "Failure in Set PNO REQ WDI API, free all the memory " ); |
| 11165 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 11166 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11167 | pWdaParams->wdaWdiApiMsgParam = NULL; |
| 11168 | pWdaParams->wdaMsgParam = NULL; |
| 11169 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11170 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11171 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11172 | /* |
| 11173 | * FUNCTION: WDA_RssiFilterCallback |
| 11174 | * |
| 11175 | */ |
| 11176 | void WDA_RssiFilterCallback(WDI_Status status, void* pUserData) |
| 11177 | { |
| 11178 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 11179 | |
| 11180 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11181 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11182 | |
| 11183 | VOS_ASSERT(NULL != pWdaParams); |
| 11184 | |
| 11185 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11186 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11187 | vos_mem_free(pWdaParams) ; |
| 11188 | |
| 11189 | return ; |
| 11190 | } |
| 11191 | /* |
| 11192 | * FUNCTION: WDA_ProcessSetPreferredNetworkList |
| 11193 | * Request to WDI to set Preferred Network List.Offload |
| 11194 | */ |
| 11195 | VOS_STATUS WDA_ProcessSetRssiFilterReq(tWDA_CbContext *pWDA, |
| 11196 | tSirSetRSSIFilterReq* pRssiFilterParams) |
| 11197 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11198 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11199 | WDI_SetRssiFilterReqParamsType *pwdiSetRssiFilterReqInfo = |
| 11200 | (WDI_SetRssiFilterReqParamsType *)vos_mem_malloc(sizeof(WDI_SetRssiFilterReqParamsType)) ; |
| 11201 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11202 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11203 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11204 | if(NULL == pwdiSetRssiFilterReqInfo) |
| 11205 | { |
| 11206 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11207 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11208 | VOS_ASSERT(0); |
| 11209 | return VOS_STATUS_E_NOMEM; |
| 11210 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11211 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11212 | if(NULL == pWdaParams) |
| 11213 | { |
| 11214 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11215 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11216 | VOS_ASSERT(0); |
| 11217 | vos_mem_free(pwdiSetRssiFilterReqInfo); |
| 11218 | return VOS_STATUS_E_NOMEM; |
| 11219 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11220 | pwdiSetRssiFilterReqInfo->rssiThreshold = pRssiFilterParams->rssiThreshold; |
| 11221 | pwdiSetRssiFilterReqInfo->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11222 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11223 | /* Store Params pass it to WDI */ |
| 11224 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiSetRssiFilterReqInfo; |
| 11225 | pWdaParams->pWdaContext = pWDA; |
| 11226 | /* Store param pointer as passed in by caller */ |
| 11227 | pWdaParams->wdaMsgParam = pRssiFilterParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11228 | status = WDI_SetRssiFilterReq( pwdiSetRssiFilterReqInfo, |
| 11229 | (WDI_PNOScanCb)WDA_RssiFilterCallback, |
| 11230 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11231 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11232 | { |
| 11233 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11234 | "Failure in Set RSSI Filter REQ WDI API, free all the memory " ); |
| 11235 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 11236 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11237 | pWdaParams->wdaWdiApiMsgParam = NULL; |
| 11238 | pWdaParams->wdaMsgParam = NULL; |
| 11239 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11240 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11241 | } |
| 11242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11243 | /* |
| 11244 | * FUNCTION: WDA_ProcessUpdateScanParams |
| 11245 | * Request to WDI to update Scan Parameters |
| 11246 | */ |
| 11247 | VOS_STATUS WDA_ProcessUpdateScanParams(tWDA_CbContext *pWDA, |
| 11248 | tSirUpdateScanParams *pUpdateScanParams) |
| 11249 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11250 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11251 | WDI_UpdateScanParamsInfoType *wdiUpdateScanParamsInfoType = |
| 11252 | (WDI_UpdateScanParamsInfoType *)vos_mem_malloc( |
| 11253 | sizeof(WDI_UpdateScanParamsInfoType)) ; |
| 11254 | tWDA_ReqParams *pWdaParams ; |
| 11255 | v_U8_t i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11256 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11257 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11258 | if(NULL == wdiUpdateScanParamsInfoType) |
| 11259 | { |
| 11260 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11261 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11262 | VOS_ASSERT(0); |
| 11263 | return VOS_STATUS_E_NOMEM; |
| 11264 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11265 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11266 | if ( NULL == pWdaParams ) |
| 11267 | { |
| 11268 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11269 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11270 | VOS_ASSERT(0); |
| 11271 | vos_mem_free(wdiUpdateScanParamsInfoType); |
| 11272 | return VOS_STATUS_E_NOMEM; |
| 11273 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11274 | // |
| 11275 | // Fill wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo from pUpdateScanParams |
| 11276 | // |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11277 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11278 | "Update Scan Parameters b11dEnabled %d b11dResolved %d " |
| 11279 | "ucChannelCount %d usPassiveMinChTime %d usPassiveMaxChTime" |
| 11280 | " %d usActiveMinChTime %d usActiveMaxChTime %d sizeof " |
| 11281 | "sir struct %d wdi struct %d", |
| 11282 | pUpdateScanParams->b11dEnabled, |
| 11283 | pUpdateScanParams->b11dResolved, |
| 11284 | pUpdateScanParams->ucChannelCount, |
| 11285 | pUpdateScanParams->usPassiveMinChTime, |
| 11286 | pUpdateScanParams->usPassiveMaxChTime, |
| 11287 | pUpdateScanParams->usActiveMinChTime, |
| 11288 | pUpdateScanParams->usActiveMaxChTime, |
| 11289 | sizeof(tSirUpdateScanParams), |
| 11290 | sizeof(wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo) ); |
| 11291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11292 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.b11dEnabled = |
| 11293 | pUpdateScanParams->b11dEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11294 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.b11dResolved = |
| 11295 | pUpdateScanParams->b11dResolved; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11296 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.cbState = |
| 11297 | pUpdateScanParams->ucCBState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11298 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.usActiveMaxChTime = |
| 11299 | pUpdateScanParams->usActiveMaxChTime; |
| 11300 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.usActiveMinChTime = |
| 11301 | pUpdateScanParams->usActiveMinChTime; |
| 11302 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.usPassiveMaxChTime = |
| 11303 | pUpdateScanParams->usPassiveMaxChTime; |
| 11304 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.usPassiveMinChTime = |
| 11305 | pUpdateScanParams->usPassiveMinChTime; |
| 11306 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11307 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.ucChannelCount = |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 11308 | (pUpdateScanParams->ucChannelCount < WDI_PNO_MAX_NETW_CHANNELS_EX)? |
| 11309 | pUpdateScanParams->ucChannelCount:WDI_PNO_MAX_NETW_CHANNELS_EX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11310 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11311 | for ( i = 0; i < |
| 11312 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.ucChannelCount ; |
| 11313 | i++) |
| 11314 | { |
| 11315 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11316 | "Update Scan Parameters channel: %d", |
| 11317 | pUpdateScanParams->aChannels[i]); |
| 11318 | |
| 11319 | wdiUpdateScanParamsInfoType->wdiUpdateScanParamsInfo.aChannels[i] = |
| 11320 | pUpdateScanParams->aChannels[i]; |
| 11321 | } |
| 11322 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11323 | wdiUpdateScanParamsInfoType->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11324 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11325 | /* Store Params pass it to WDI */ |
| 11326 | pWdaParams->wdaWdiApiMsgParam = wdiUpdateScanParamsInfoType; |
| 11327 | pWdaParams->pWdaContext = pWDA; |
| 11328 | /* Store param pointer as passed in by caller */ |
| 11329 | pWdaParams->wdaMsgParam = pUpdateScanParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11330 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11331 | |
| 11332 | |
| 11333 | status = WDI_UpdateScanParamsReq(wdiUpdateScanParamsInfoType, |
| 11334 | (WDI_UpdateScanParamsCb)WDA_UpdateScanParamsCallback, |
| 11335 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11336 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11337 | { |
| 11338 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11339 | "Failure in Update Scan Params EQ WDI API, free all the memory " ); |
| 11340 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 11341 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11342 | vos_mem_free(pWdaParams); |
| 11343 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11344 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11345 | } |
| 11346 | #endif // FEATURE_WLAN_SCAN_PNO |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11347 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 11348 | /* |
| 11349 | * FUNCTION: WDA_8023MulticastListReqCallback |
| 11350 | * |
| 11351 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11352 | void WDA_8023MulticastListReqCallback( |
| 11353 | WDI_RcvFltPktSetMcListRspParamsType *pwdiRcvFltPktSetMcListRspInfo, |
| 11354 | void * pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11355 | { |
| 11356 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11357 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11358 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11359 | if(NULL == pWdaParams) |
| 11360 | { |
| 11361 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11362 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11363 | VOS_ASSERT(0) ; |
| 11364 | return ; |
| 11365 | } |
| 11366 | |
| 11367 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11368 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11369 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11370 | //print a msg, nothing else to do |
| 11371 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11372 | "WDA_8023MulticastListReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11373 | return ; |
| 11374 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11375 | /* |
| 11376 | * FUNCTION: WDA_Process8023MulticastListReq |
| 11377 | * Request to WDI to add 8023 Multicast List |
| 11378 | */ |
| 11379 | VOS_STATUS WDA_Process8023MulticastListReq (tWDA_CbContext *pWDA, |
| 11380 | tSirRcvFltMcAddrList *pRcvFltMcAddrList) |
| 11381 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11382 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11383 | WDI_RcvFltPktSetMcListReqParamsType *pwdiFltPktSetMcListReqParamsType = NULL; |
| 11384 | tWDA_ReqParams *pWdaParams ; |
| 11385 | tANI_U8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11386 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11387 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11388 | pwdiFltPktSetMcListReqParamsType = |
| 11389 | (WDI_RcvFltPktSetMcListReqParamsType *)vos_mem_malloc( |
| 11390 | sizeof(WDI_RcvFltPktSetMcListReqParamsType) |
| 11391 | ) ; |
| 11392 | if(NULL == pwdiFltPktSetMcListReqParamsType) |
| 11393 | { |
| 11394 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11395 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11396 | return VOS_STATUS_E_NOMEM; |
| 11397 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11398 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11399 | if(NULL == pWdaParams) |
| 11400 | { |
| 11401 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11402 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11403 | vos_mem_free(pwdiFltPktSetMcListReqParamsType); |
| 11404 | return VOS_STATUS_E_NOMEM; |
| 11405 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11407 | // |
| 11408 | // Fill pwdiFltPktSetMcListReqParamsType from pRcvFltMcAddrList |
| 11409 | // |
| 11410 | pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11411 | pRcvFltMcAddrList->ulMulticastAddrCnt; |
| 11412 | |
| 11413 | vos_mem_copy(pwdiFltPktSetMcListReqParamsType->mcAddrList.selfMacAddr, |
| 11414 | pRcvFltMcAddrList->selfMacAddr, sizeof(tSirMacAddr)); |
| 11415 | vos_mem_copy(pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId, |
| 11416 | pRcvFltMcAddrList->bssId, sizeof(tSirMacAddr)); |
| 11417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11418 | for( i = 0; i < pRcvFltMcAddrList->ulMulticastAddrCnt; i++ ) |
| 11419 | { |
| 11420 | vos_mem_copy(&(pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i]), |
| 11421 | &(pRcvFltMcAddrList->multicastAddr[i]), |
| 11422 | sizeof(tSirMacAddr)); |
| 11423 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11424 | pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11425 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11426 | /* Store Params pass it to WDI */ |
| 11427 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiFltPktSetMcListReqParamsType; |
| 11428 | pWdaParams->pWdaContext = pWDA; |
| 11429 | /* Store param pointer as passed in by caller */ |
| 11430 | pWdaParams->wdaMsgParam = pRcvFltMcAddrList; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11431 | status = WDI_8023MulticastListReq( |
| 11432 | pwdiFltPktSetMcListReqParamsType, |
| 11433 | (WDI_8023MulticastListCb)WDA_8023MulticastListReqCallback, |
| 11434 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11435 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11436 | { |
| 11437 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11438 | "Failure in WDA_Process8023MulticastListReq(), free all the memory " ); |
| 11439 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 11440 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11441 | vos_mem_free(pWdaParams); |
| 11442 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11443 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11444 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11445 | /* |
| 11446 | * FUNCTION: WDA_ReceiveFilterSetFilterReqCallback |
| 11447 | * |
| 11448 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11449 | void WDA_ReceiveFilterSetFilterReqCallback( |
| 11450 | WDI_SetRcvPktFilterRspParamsType *pwdiSetRcvPktFilterRspInfo, |
| 11451 | void * pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11452 | { |
| 11453 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11454 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11455 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11456 | /*WDA_VOS_ASSERT(NULL != pWdaParams);*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11457 | if(NULL == pWdaParams) |
| 11458 | { |
| 11459 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11460 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11461 | VOS_ASSERT(0) ; |
| 11462 | return ; |
| 11463 | } |
| 11464 | |
| 11465 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11466 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11467 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11468 | //print a msg, nothing else to do |
| 11469 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11470 | "WDA_ReceiveFilterSetFilterReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11471 | return ; |
| 11472 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11473 | /* |
| 11474 | * FUNCTION: WDA_ProcessReceiveFilterSetFilterReq |
| 11475 | * Request to WDI to set Receive Filters |
| 11476 | */ |
| 11477 | VOS_STATUS WDA_ProcessReceiveFilterSetFilterReq (tWDA_CbContext *pWDA, |
| 11478 | tSirRcvPktFilterCfgType *pRcvPktFilterCfg) |
| 11479 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11480 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11481 | v_SIZE_t allocSize = sizeof(WDI_SetRcvPktFilterReqParamsType) + |
| 11482 | ((pRcvPktFilterCfg->numFieldParams - 1) * sizeof(tSirRcvPktFilterFieldParams)); |
| 11483 | WDI_SetRcvPktFilterReqParamsType *pwdiSetRcvPktFilterReqParamsType = |
| 11484 | (WDI_SetRcvPktFilterReqParamsType *)vos_mem_malloc(allocSize) ; |
| 11485 | tWDA_ReqParams *pWdaParams ; |
| 11486 | tANI_U8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11487 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11488 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11489 | if(NULL == pwdiSetRcvPktFilterReqParamsType) |
| 11490 | { |
| 11491 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11492 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11493 | VOS_ASSERT(0); |
| 11494 | return VOS_STATUS_E_NOMEM; |
| 11495 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11496 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11497 | if(NULL == pWdaParams) |
| 11498 | { |
| 11499 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11500 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11501 | VOS_ASSERT(0); |
| 11502 | vos_mem_free(pwdiSetRcvPktFilterReqParamsType); |
| 11503 | return VOS_STATUS_E_NOMEM; |
| 11504 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11505 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.filterId = pRcvPktFilterCfg->filterId; |
| 11506 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.filterType = pRcvPktFilterCfg->filterType; |
| 11507 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.numFieldParams = pRcvPktFilterCfg->numFieldParams; |
| 11508 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.coalesceTime = pRcvPktFilterCfg->coalesceTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11509 | vos_mem_copy(pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.selfMacAddr, |
| 11510 | pRcvPktFilterCfg->selfMacAddr, sizeof(wpt_macAddr)); |
| 11511 | |
| 11512 | vos_mem_copy(pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.bssId, |
| 11513 | pRcvPktFilterCfg->bssId, sizeof(wpt_macAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11514 | |
| 11515 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11516 | "FID %d FT %d NParams %d CT %d", |
| 11517 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.filterId, |
| 11518 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.filterType, |
| 11519 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.numFieldParams, |
| 11520 | pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11521 | for ( i = 0; i < pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.numFieldParams; i++ ) |
| 11522 | { |
| 11523 | wpalMemoryCopy(&pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.paramsData[i], |
| 11524 | &pRcvPktFilterCfg->paramsData[i], |
| 11525 | sizeof(pwdiSetRcvPktFilterReqParamsType->wdiPktFilterCfg.paramsData[i])); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11526 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11527 | "Proto %d Comp Flag %d \n", |
| 11528 | pwdiSetRcvPktFilterReqParamsType-> |
| 11529 | wdiPktFilterCfg.paramsData[i].protocolLayer, |
| 11530 | pwdiSetRcvPktFilterReqParamsType-> |
| 11531 | wdiPktFilterCfg.paramsData[i].cmpFlag); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11532 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11533 | "Data Offset %d Data Len %d\n", |
| 11534 | pwdiSetRcvPktFilterReqParamsType-> |
| 11535 | wdiPktFilterCfg.paramsData[i].dataOffset, |
| 11536 | pwdiSetRcvPktFilterReqParamsType-> |
| 11537 | wdiPktFilterCfg.paramsData[i].dataLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11538 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11539 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 11540 | pwdiSetRcvPktFilterReqParamsType-> |
| 11541 | wdiPktFilterCfg.paramsData[i].compareData[0], |
| 11542 | pwdiSetRcvPktFilterReqParamsType-> |
| 11543 | wdiPktFilterCfg.paramsData[i].compareData[1], |
| 11544 | pwdiSetRcvPktFilterReqParamsType-> |
| 11545 | wdiPktFilterCfg.paramsData[i].compareData[2], |
| 11546 | pwdiSetRcvPktFilterReqParamsType-> |
| 11547 | wdiPktFilterCfg.paramsData[i].compareData[3], |
| 11548 | pwdiSetRcvPktFilterReqParamsType-> |
| 11549 | wdiPktFilterCfg.paramsData[i].compareData[4], |
| 11550 | pwdiSetRcvPktFilterReqParamsType-> |
| 11551 | wdiPktFilterCfg.paramsData[i].compareData[5]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11552 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11553 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 11554 | pwdiSetRcvPktFilterReqParamsType-> |
| 11555 | wdiPktFilterCfg.paramsData[i].dataMask[0], |
| 11556 | pwdiSetRcvPktFilterReqParamsType-> |
| 11557 | wdiPktFilterCfg.paramsData[i].dataMask[1], |
| 11558 | pwdiSetRcvPktFilterReqParamsType-> |
| 11559 | wdiPktFilterCfg.paramsData[i].dataMask[2], |
| 11560 | pwdiSetRcvPktFilterReqParamsType-> |
| 11561 | wdiPktFilterCfg.paramsData[i].dataMask[3], |
| 11562 | pwdiSetRcvPktFilterReqParamsType-> |
| 11563 | wdiPktFilterCfg.paramsData[i].dataMask[4], |
| 11564 | pwdiSetRcvPktFilterReqParamsType-> |
| 11565 | wdiPktFilterCfg.paramsData[i].dataMask[5]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11566 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11567 | pwdiSetRcvPktFilterReqParamsType->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11568 | /* Store Params pass it to WDI */ |
| 11569 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiSetRcvPktFilterReqParamsType; |
| 11570 | pWdaParams->pWdaContext = pWDA; |
| 11571 | /* Store param pointer as passed in by caller */ |
| 11572 | pWdaParams->wdaMsgParam = pRcvPktFilterCfg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11573 | status = WDI_ReceiveFilterSetFilterReq(pwdiSetRcvPktFilterReqParamsType, |
| 11574 | (WDI_ReceiveFilterSetFilterCb)WDA_ReceiveFilterSetFilterReqCallback, |
| 11575 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11576 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11577 | { |
| 11578 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11579 | "Failure in SetFilter(),free all the memory,status %d ",status); |
| 11580 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 11581 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11582 | vos_mem_free(pWdaParams); |
| 11583 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11584 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11585 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11586 | /* |
| 11587 | * FUNCTION: WDA_FilterMatchCountReqCallback |
| 11588 | * |
| 11589 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11590 | void WDA_FilterMatchCountReqCallback( |
| 11591 | WDI_RcvFltPktMatchCntRspParamsType *pwdiRcvFltPktMatchRspParams, |
| 11592 | void * pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11593 | { |
| 11594 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 11595 | tWDA_CbContext *pWDA; |
| 11596 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchCntReq; |
| 11597 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchCntRsp = |
| 11598 | vos_mem_malloc(sizeof(tSirRcvFltPktMatchRsp)); |
| 11599 | tANI_U8 i; |
| 11600 | vos_msg_t vosMsg; |
| 11601 | |
| 11602 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11603 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11604 | /*WDA_VOS_ASSERT(NULL != pWdaParams);*/ |
| 11605 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11606 | if(NULL == pRcvFltPktMatchCntRsp) |
| 11607 | { |
| 11608 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11609 | "%s: pRcvFltPktMatchCntRsp is NULL", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11610 | VOS_ASSERT(0) ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11611 | vos_mem_free(pWdaParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11612 | return ; |
| 11613 | } |
| 11614 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11615 | if(NULL == pWdaParams) |
| 11616 | { |
| 11617 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11618 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11619 | VOS_ASSERT(0) ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11620 | vos_mem_free(pRcvFltPktMatchCntRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11621 | return ; |
| 11622 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11623 | pWDA = (tWDA_CbContext *)pWdaParams->pWdaContext ; |
| 11624 | pRcvFltPktMatchCntReq = (tpSirRcvFltPktMatchRsp)pWdaParams->wdaMsgParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11625 | // Fill pRcvFltPktMatchCntRsp from pRcvFltPktMatchCntReq |
| 11626 | vos_mem_zero(pRcvFltPktMatchCntRsp,sizeof(tSirRcvFltPktMatchRsp)); |
| 11627 | |
| 11628 | /* Message Header */ |
| 11629 | pRcvFltPktMatchCntRsp->mesgType = eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP; |
| 11630 | pRcvFltPktMatchCntRsp->mesgLen = sizeof(tSirRcvFltPktMatchRsp); |
| 11631 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11632 | pRcvFltPktMatchCntRsp->status = pwdiRcvFltPktMatchRspParams->wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11633 | |
| 11634 | for (i = 0; i < SIR_MAX_NUM_FILTERS; i++) |
| 11635 | { |
| 11636 | pRcvFltPktMatchCntRsp->filterMatchCnt[i].filterId = pRcvFltPktMatchCntReq->filterMatchCnt[i].filterId; |
| 11637 | pRcvFltPktMatchCntRsp->filterMatchCnt[i].matchCnt = pRcvFltPktMatchCntReq->filterMatchCnt[i].matchCnt; |
| 11638 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11639 | /* VOS message wrapper */ |
| 11640 | vosMsg.type = eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP; |
| 11641 | vosMsg.bodyptr = (void *)pRcvFltPktMatchCntRsp; |
| 11642 | vosMsg.bodyval = 0; |
| 11643 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, (vos_msg_t*)&vosMsg)) |
| 11644 | { |
| 11645 | /* free the mem and return */ |
| 11646 | vos_mem_free((v_VOID_t *)pRcvFltPktMatchCntRsp); |
| 11647 | } |
| 11648 | |
| 11649 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11650 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11651 | vos_mem_free(pWdaParams) ; |
| 11652 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11653 | /* |
| 11654 | * FUNCTION: WDA_ProcessPacketFilterMatchCountReq |
| 11655 | * Request to WDI to get PC Filter Match Count |
| 11656 | */ |
| 11657 | VOS_STATUS WDA_ProcessPacketFilterMatchCountReq (tWDA_CbContext *pWDA, tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp) |
| 11658 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11659 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11660 | WDI_RcvFltPktMatchCntReqParamsType *pwdiRcvFltPktMatchCntReqParamsType = |
| 11661 | (WDI_RcvFltPktMatchCntReqParamsType *)vos_mem_malloc(sizeof(WDI_RcvFltPktMatchCntReqParamsType)); |
| 11662 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11663 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11664 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11665 | if(NULL == pwdiRcvFltPktMatchCntReqParamsType) |
| 11666 | { |
| 11667 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11668 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11669 | VOS_ASSERT(0); |
| 11670 | return VOS_STATUS_E_NOMEM; |
| 11671 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11672 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11673 | if(NULL == pWdaParams) |
| 11674 | { |
| 11675 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11676 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11677 | VOS_ASSERT(0); |
| 11678 | vos_mem_free(pwdiRcvFltPktMatchCntReqParamsType); |
| 11679 | return VOS_STATUS_E_NOMEM; |
| 11680 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11681 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11682 | pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB = NULL; |
| 11683 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11684 | vos_mem_copy( pwdiRcvFltPktMatchCntReqParamsType->bssId, |
| 11685 | pRcvFltPktMatchRsp->bssId, |
| 11686 | sizeof(wpt_macAddr)); |
| 11687 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11688 | /* Store Params pass it to WDI */ |
| 11689 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiRcvFltPktMatchCntReqParamsType; |
| 11690 | pWdaParams->pWdaContext = pWDA; |
| 11691 | /* Store param pointer as passed in by caller */ |
| 11692 | pWdaParams->wdaMsgParam = pRcvFltPktMatchRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11693 | status = WDI_FilterMatchCountReq(pwdiRcvFltPktMatchCntReqParamsType, |
| 11694 | (WDI_FilterMatchCountCb)WDA_FilterMatchCountReqCallback, |
| 11695 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11696 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11697 | { |
| 11698 | /* failure returned by WDI API */ |
| 11699 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11700 | "Failure in WDI_FilterMatchCountReq(), free all the memory " ); |
| 11701 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11702 | vos_mem_free(pWdaParams) ; |
| 11703 | pRcvFltPktMatchRsp->status = eSIR_FAILURE ; |
| 11704 | WDA_SendMsg(pWDA, WDA_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP, (void *)pRcvFltPktMatchRsp, 0) ; |
| 11705 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11706 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11707 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11708 | /* |
| 11709 | * FUNCTION: WDA_ReceiveFilterSetFilterReqCallback |
| 11710 | * |
| 11711 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 11712 | void WDA_ReceiveFilterClearFilterReqCallback( |
| 11713 | WDI_RcvFltPktClearRspParamsType *pwdiRcvFltPktClearRspParamsType, |
| 11714 | void * pUserData) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11715 | { |
| 11716 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11717 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11718 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11719 | /* WDA_VOS_ASSERT(NULL != pWdaParams); */ |
| 11720 | if(NULL == pWdaParams) |
| 11721 | { |
| 11722 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11723 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11724 | VOS_ASSERT(0) ; |
| 11725 | return ; |
| 11726 | } |
| 11727 | |
| 11728 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11729 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11730 | vos_mem_free(pWdaParams) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11731 | //print a msg, nothing else to do |
| 11732 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11733 | "WDA_ReceiveFilterClearFilterReqCallback invoked " ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11734 | return ; |
| 11735 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11736 | /* |
| 11737 | * FUNCTION: WDA_ProcessReceiveFilterClearFilterReq |
| 11738 | * Request to WDI to clear Receive Filters |
| 11739 | */ |
| 11740 | VOS_STATUS WDA_ProcessReceiveFilterClearFilterReq (tWDA_CbContext *pWDA, |
| 11741 | tSirRcvFltPktClearParam *pRcvFltPktClearParam) |
| 11742 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11743 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11744 | WDI_RcvFltPktClearReqParamsType *pwdiRcvFltPktClearReqParamsType = |
| 11745 | (WDI_RcvFltPktClearReqParamsType *)vos_mem_malloc(sizeof(WDI_RcvFltPktClearReqParamsType)); |
| 11746 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11747 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11748 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11749 | if(NULL == pwdiRcvFltPktClearReqParamsType) |
| 11750 | { |
| 11751 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11752 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11753 | VOS_ASSERT(0); |
| 11754 | return VOS_STATUS_E_NOMEM; |
| 11755 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11756 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11757 | if(NULL == pWdaParams) |
| 11758 | { |
| 11759 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11760 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11761 | VOS_ASSERT(0); |
| 11762 | vos_mem_free(pwdiRcvFltPktClearReqParamsType); |
| 11763 | return VOS_STATUS_E_NOMEM; |
| 11764 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11765 | pwdiRcvFltPktClearReqParamsType->filterClearParam.status = pRcvFltPktClearParam->status; |
| 11766 | pwdiRcvFltPktClearReqParamsType->filterClearParam.filterId = pRcvFltPktClearParam->filterId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11767 | vos_mem_copy(pwdiRcvFltPktClearReqParamsType->filterClearParam.selfMacAddr, |
| 11768 | pRcvFltPktClearParam->selfMacAddr, sizeof(wpt_macAddr)); |
| 11769 | vos_mem_copy(pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId, |
| 11770 | pRcvFltPktClearParam->bssId, sizeof(wpt_macAddr)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11771 | |
| 11772 | pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11773 | /* Store Params pass it to WDI */ |
| 11774 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiRcvFltPktClearReqParamsType; |
| 11775 | pWdaParams->pWdaContext = pWDA; |
| 11776 | /* Store param pointer as passed in by caller */ |
| 11777 | pWdaParams->wdaMsgParam = pRcvFltPktClearParam; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11778 | status = WDI_ReceiveFilterClearFilterReq(pwdiRcvFltPktClearReqParamsType, |
| 11779 | (WDI_ReceiveFilterClearFilterCb)WDA_ReceiveFilterClearFilterReqCallback, |
| 11780 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11781 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11782 | { |
| 11783 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11784 | "Failure in WDA_ProcessReceiveFilterClearFilterReq(), free all the memory " ); |
| 11785 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
Venkata Prathyusha Kuntupalli | 8bb81f6 | 2013-02-05 11:39:32 -0800 | [diff] [blame] | 11786 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11787 | vos_mem_free(pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11788 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11789 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11790 | } |
| 11791 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 11792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11793 | /* |
| 11794 | * FUNCTION: WDA_ProcessSetPowerParamsReq |
| 11795 | * Request to WDI to set power params |
| 11796 | */ |
| 11797 | VOS_STATUS WDA_ProcessSetPowerParamsReq(tWDA_CbContext *pWDA, |
| 11798 | tSirSetPowerParamsReq *pPowerParams) |
| 11799 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11800 | WDI_Status status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11801 | WDI_SetPowerParamsReqParamsType *pwdiSetPowerParamsReqInfo = |
| 11802 | (WDI_SetPowerParamsReqParamsType *)vos_mem_malloc(sizeof(WDI_SetPowerParamsReqParamsType)) ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11803 | tWDA_ReqParams *pWdaParams ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11804 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11805 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11806 | if(NULL == pwdiSetPowerParamsReqInfo) |
| 11807 | { |
| 11808 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11809 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11810 | VOS_ASSERT(0); |
| 11811 | return VOS_STATUS_E_NOMEM; |
| 11812 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11813 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11814 | if(NULL == pWdaParams) |
| 11815 | { |
| 11816 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11817 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11818 | VOS_ASSERT(0); |
| 11819 | vos_mem_free(pwdiSetPowerParamsReqInfo); |
| 11820 | return VOS_STATUS_E_NOMEM; |
| 11821 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11823 | |
| 11824 | pwdiSetPowerParamsReqInfo->wdiSetPowerParamsInfo.uIgnoreDTIM = |
| 11825 | pPowerParams->uIgnoreDTIM; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11826 | pwdiSetPowerParamsReqInfo->wdiSetPowerParamsInfo.uDTIMPeriod = |
| 11827 | pPowerParams->uDTIMPeriod; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11828 | pwdiSetPowerParamsReqInfo->wdiSetPowerParamsInfo.uListenInterval = |
| 11829 | pPowerParams->uListenInterval; |
| 11830 | pwdiSetPowerParamsReqInfo->wdiSetPowerParamsInfo.uBcastMcastFilter = |
| 11831 | pPowerParams->uBcastMcastFilter; |
| 11832 | pwdiSetPowerParamsReqInfo->wdiSetPowerParamsInfo.uEnableBET = |
| 11833 | pPowerParams->uEnableBET; |
| 11834 | pwdiSetPowerParamsReqInfo->wdiSetPowerParamsInfo.uBETInterval = |
| 11835 | pPowerParams->uBETInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11836 | pwdiSetPowerParamsReqInfo->wdiReqStatusCB = NULL; |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 11837 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11838 | /* Store Params pass it to WDI */ |
| 11839 | pWdaParams->wdaWdiApiMsgParam = (void *)pwdiSetPowerParamsReqInfo; |
| 11840 | pWdaParams->pWdaContext = pWDA; |
| 11841 | /* Store param pointer as passed in by caller */ |
| 11842 | pWdaParams->wdaMsgParam = pPowerParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11843 | status = WDI_SetPowerParamsReq( pwdiSetPowerParamsReqInfo, |
| 11844 | (WDI_SetPowerParamsCb)WDA_SetPowerParamsCallback, |
| 11845 | pWdaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11846 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11847 | { |
| 11848 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 11849 | "Failure in Set power params REQ WDI API, free all the memory " ); |
| 11850 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 11851 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 11852 | pWdaParams->wdaWdiApiMsgParam = NULL; |
| 11853 | pWdaParams->wdaMsgParam = NULL; |
| 11854 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11855 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11856 | } |
| 11857 | |
| 11858 | /* |
| 11859 | * FUNCTION: WDA_SetTmLevelRspCallback |
| 11860 | * Set TM Level response |
| 11861 | */ |
| 11862 | void WDA_SetTmLevelRspCallback(WDI_Status status, void* pUserData) |
| 11863 | { |
| 11864 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 11865 | |
| 11866 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11867 | "<------ %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11868 | |
| 11869 | if(NULL == pWdaParams) |
| 11870 | { |
| 11871 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11872 | "%s: pWdaParams received NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11873 | VOS_ASSERT(0) ; |
| 11874 | return ; |
| 11875 | } |
| 11876 | |
| 11877 | /* Dose not need to send notification to upper layer |
| 11878 | * Just free allocated resources */ |
| 11879 | if( pWdaParams != NULL ) |
| 11880 | { |
| 11881 | if( pWdaParams->wdaWdiApiMsgParam != NULL ) |
| 11882 | { |
| 11883 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11884 | } |
| 11885 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11886 | vos_mem_free(pWdaParams) ; |
| 11887 | } |
| 11888 | } |
| 11889 | |
| 11890 | /* |
| 11891 | * FUNCTION: WDA_ProcessSetTmLevelReq |
| 11892 | * Set TM Level request |
| 11893 | */ |
| 11894 | VOS_STATUS WDA_ProcessSetTmLevelReq(tWDA_CbContext *pWDA, |
| 11895 | tAniSetTmLevelReq *setTmLevelReq) |
| 11896 | { |
| 11897 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 11898 | tWDA_ReqParams *pWdaParams ; |
| 11899 | WDI_SetTmLevelReqType *wdiSetTmLevelReq = |
| 11900 | (WDI_SetTmLevelReqType *)vos_mem_malloc( |
| 11901 | sizeof(WDI_SetTmLevelReqType)) ; |
| 11902 | if(NULL == wdiSetTmLevelReq) |
| 11903 | { |
| 11904 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11905 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11906 | VOS_ASSERT(0); |
| 11907 | return VOS_STATUS_E_NOMEM; |
| 11908 | } |
| 11909 | |
| 11910 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 11911 | if(NULL == pWdaParams) |
| 11912 | { |
| 11913 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11914 | "%s: VOS MEM Alloc Failure", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11915 | VOS_ASSERT(0); |
| 11916 | vos_mem_free(wdiSetTmLevelReq); |
| 11917 | return VOS_STATUS_E_NOMEM; |
| 11918 | } |
| 11919 | |
| 11920 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11921 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11922 | |
| 11923 | wdiSetTmLevelReq->tmMode = setTmLevelReq->tmMode; |
| 11924 | wdiSetTmLevelReq->tmLevel = setTmLevelReq->newTmLevel; |
| 11925 | |
| 11926 | pWdaParams->pWdaContext = pWDA; |
| 11927 | pWdaParams->wdaMsgParam = setTmLevelReq; |
| 11928 | pWdaParams->wdaWdiApiMsgParam = wdiSetTmLevelReq; |
| 11929 | |
| 11930 | status = WDI_SetTmLevelReq(wdiSetTmLevelReq, |
| 11931 | (WDI_SetTmLevelCb)WDA_SetTmLevelRspCallback, pWdaParams); |
| 11932 | |
| 11933 | if(IS_WDI_STATUS_FAILURE(status)) |
| 11934 | { |
| 11935 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | 1920a72 | 2012-12-10 14:28:09 -0800 | [diff] [blame] | 11936 | "Failure setting thermal mitigation level, freeing memory" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11937 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 11938 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 11939 | vos_mem_free(pWdaParams) ; |
| 11940 | } |
| 11941 | |
| 11942 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 11943 | } |
| 11944 | |
| 11945 | VOS_STATUS WDA_ProcessTxControlInd(tWDA_CbContext *pWDA, |
| 11946 | tpTxControlParams pTxCtrlParam) |
| 11947 | { |
| 11948 | VOS_STATUS wdaStatus; |
| 11949 | |
| 11950 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11951 | "------> %s " ,__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11952 | if( pTxCtrlParam == NULL ) |
| 11953 | { |
| 11954 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11955 | "%s: Input tpTxControlParams is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11956 | return VOS_STATUS_E_FAILURE; |
| 11957 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11958 | if( pTxCtrlParam->stopTx == eANI_BOOLEAN_TRUE ) |
| 11959 | { |
| 11960 | wdaStatus = WDA_SuspendDataTx(pWDA); |
| 11961 | } |
| 11962 | else /* pTxCtrlParam->stopTx == eANI_BOOLEAN_FALSE */ |
| 11963 | { |
| 11964 | wdaStatus = WDA_ResumeDataTx(pWDA); |
| 11965 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11966 | return wdaStatus; |
| 11967 | } |
| 11968 | |
| 11969 | /* FUNCTION WDA_featureCapsExchange |
| 11970 | * WDA API to invoke capability exchange between host and FW. |
| 11971 | */ |
| 11972 | void WDA_featureCapsExchange(v_PVOID_t pVosContext) |
| 11973 | { |
| 11974 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11975 | "%s:enter", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11976 | WDI_featureCapsExchangeReq( NULL, pVosContext); |
| 11977 | } |
| 11978 | |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 11979 | /* FUNCTION WDA_disableCapablityFeature |
| 11980 | * WDA API to diable Active mode offload in host. |
| 11981 | */ |
| 11982 | void WDA_disableCapablityFeature(tANI_U8 feature_index) |
| 11983 | { |
| 11984 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
| 11985 | "%s:enter", __func__ ); |
| 11986 | WDI_disableCapablityFeature(feature_index); |
| 11987 | } |
| 11988 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11989 | /* FUNCTION WDA_getHostWlanFeatCaps |
| 11990 | * Wrapper for WDI API, that will return if the feature (enum value).passed |
| 11991 | * to this API is supported or not in Host |
| 11992 | * return value |
| 11993 | * 0 - implies feature is NOT Supported |
| 11994 | * any non zero value - implies feature is SUPPORTED |
| 11995 | */ |
| 11996 | tANI_U8 WDA_getHostWlanFeatCaps(tANI_U8 featEnumValue) |
| 11997 | { |
| 11998 | return WDI_getHostWlanFeatCaps(featEnumValue); |
| 11999 | } |
| 12000 | |
| 12001 | /* FUNCTION WDA_getFwWlanFeatCaps |
| 12002 | * Wrapper for WDI API, that will return if the feature (enum value).passed |
| 12003 | * to this API is supported or not in FW |
| 12004 | * return value |
| 12005 | * 0 - implies feature is NOT Supported |
| 12006 | * any non zero value - implies feature is SUPPORTED |
| 12007 | */ |
| 12008 | tANI_U8 WDA_getFwWlanFeatCaps(tANI_U8 featEnumValue) |
| 12009 | { |
| 12010 | return WDI_getFwWlanFeatCaps(featEnumValue); |
| 12011 | } |
| 12012 | |
| 12013 | /* |
| 12014 | * FUNCTION: WDA_shutdown |
| 12015 | * Shutdown WDA/WDI without handshaking with Riva. |
| 12016 | * Synchronous function. |
| 12017 | */ |
| 12018 | VOS_STATUS WDA_shutdown(v_PVOID_t pVosContext, wpt_boolean closeTransport) |
| 12019 | { |
| 12020 | WDI_Status wdiStatus; |
| 12021 | //tANI_U8 eventIdx = 0; |
| 12022 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 12023 | tWDA_CbContext *pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12024 | if (NULL == pWDA) |
| 12025 | { |
| 12026 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12027 | "%s: Invoked with invalid pWDA", __func__ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12028 | VOS_ASSERT(0); |
| 12029 | return VOS_STATUS_E_FAILURE; |
| 12030 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12031 | /* FTM mode stay START_STATE */ |
| 12032 | if( (WDA_READY_STATE != pWDA->wdaState) && |
| 12033 | (WDA_INIT_STATE != pWDA->wdaState) && |
| 12034 | (WDA_START_STATE != pWDA->wdaState) ) |
| 12035 | { |
| 12036 | VOS_ASSERT(0); |
| 12037 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 12038 | |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 12039 | if ( (eDRIVER_TYPE_MFG != pWDA->driverMode) && |
| 12040 | (VOS_TRUE == pWDA->wdaTimersCreated)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12041 | { |
| 12042 | wdaDestroyTimers(pWDA); |
Madan Mohan Koyyalamudi | d57ae63 | 2012-11-06 18:42:48 -0800 | [diff] [blame] | 12043 | pWDA->wdaTimersCreated = VOS_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12044 | } |
Madan Mohan Koyyalamudi | da61e7e | 2012-10-30 18:08:14 -0700 | [diff] [blame] | 12045 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12046 | /* call WDI shutdown */ |
| 12047 | wdiStatus = WDI_Shutdown(closeTransport); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12048 | if (IS_WDI_STATUS_FAILURE(wdiStatus) ) |
| 12049 | { |
| 12050 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12051 | "error in WDA Stop" ); |
| 12052 | status = VOS_STATUS_E_FAILURE; |
| 12053 | } |
| 12054 | /* WDI stop is synchrnous, shutdown is complete when it returns */ |
| 12055 | pWDA->wdaState = WDA_STOP_STATE; |
| 12056 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12057 | /* shutdown should perform the stop & close actions. */ |
| 12058 | /* Destroy the event */ |
| 12059 | status = vos_event_destroy(&pWDA->txFrameEvent); |
| 12060 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 12061 | { |
| 12062 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12063 | "VOS Event destroy failed - status = %d\n", status); |
| 12064 | status = VOS_STATUS_E_FAILURE; |
| 12065 | } |
| 12066 | status = vos_event_destroy(&pWDA->suspendDataTxEvent); |
| 12067 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 12068 | { |
| 12069 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12070 | "VOS Event destroy failed - status = %d\n", status); |
| 12071 | status = VOS_STATUS_E_FAILURE; |
| 12072 | } |
| 12073 | status = vos_event_destroy(&pWDA->waitOnWdiIndicationCallBack); |
| 12074 | if(!VOS_IS_STATUS_SUCCESS(status)) |
| 12075 | { |
| 12076 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12077 | "VOS Event destroy failed - status = %d\n", status); |
| 12078 | status = VOS_STATUS_E_FAILURE; |
| 12079 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12080 | /* free WDA context */ |
| 12081 | status = vos_free_context(pVosContext,VOS_MODULE_ID_WDA,pWDA); |
| 12082 | if ( !VOS_IS_STATUS_SUCCESS(status) ) |
| 12083 | { |
| 12084 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12085 | "error in WDA close " ); |
| 12086 | status = VOS_STATUS_E_FAILURE; |
| 12087 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12088 | return status; |
| 12089 | } |
Madan Mohan Koyyalamudi | 9d7a27f | 2012-11-28 15:55:25 -0800 | [diff] [blame] | 12090 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12091 | /* |
Madan Mohan Koyyalamudi | 9d7a27f | 2012-11-28 15:55:25 -0800 | [diff] [blame] | 12092 | * FUNCTION: WDA_setNeedShutdown |
| 12093 | * WDA stop failed or WDA NVDownload failed |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12094 | */ |
| 12095 | |
Madan Mohan Koyyalamudi | 9d7a27f | 2012-11-28 15:55:25 -0800 | [diff] [blame] | 12096 | void WDA_setNeedShutdown(v_PVOID_t pVosContext) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12097 | { |
| 12098 | tWDA_CbContext *pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 12099 | if(pWDA == NULL) |
| 12100 | { |
| 12101 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12102 | "Could not get the WDA Context pointer" ); |
| 12103 | return; |
| 12104 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12105 | pWDA->needShutdown = TRUE; |
| 12106 | } |
| 12107 | /* |
| 12108 | * FUNCTION: WDA_needShutdown |
| 12109 | * WDA needs a shutdown |
| 12110 | */ |
| 12111 | |
| 12112 | v_BOOL_t WDA_needShutdown(v_PVOID_t pVosContext) |
| 12113 | { |
| 12114 | tWDA_CbContext *pWDA = (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext); |
Madan Mohan Koyyalamudi | 33ef6a2 | 2012-10-30 17:44:43 -0700 | [diff] [blame] | 12115 | if(pWDA == NULL) |
| 12116 | { |
| 12117 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12118 | "Could not get the WDA Context pointer" ); |
| 12119 | return 0; |
| 12120 | } |
| 12121 | return pWDA->needShutdown; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12122 | } |
| 12123 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 12124 | #ifdef WLAN_FEATURE_11AC |
| 12125 | /* |
| 12126 | * FUNCTION: WDA_SetBeaconFilterReqCallback |
| 12127 | * |
| 12128 | */ |
| 12129 | void WDA_SetUpdateOpModeReqCallback(WDI_Status status, void* pUserData) |
| 12130 | { |
| 12131 | tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData; |
| 12132 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12133 | "<------ %s " ,__func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 12134 | if(NULL == pWdaParams) |
| 12135 | { |
| 12136 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12137 | "%s: pWdaParams received NULL", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 12138 | VOS_ASSERT(0) ; |
| 12139 | return ; |
| 12140 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12141 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 12142 | vos_mem_free(pWdaParams->wdaMsgParam) ; |
| 12143 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam); |
| 12144 | vos_mem_free(pWdaParams) ; |
| 12145 | /* |
| 12146 | * No respone required for SetBeaconFilter req so just free the request |
| 12147 | * param here |
| 12148 | */ |
| 12149 | |
| 12150 | return ; |
| 12151 | } |
| 12152 | |
| 12153 | VOS_STATUS WDA_ProcessUpdateOpMode(tWDA_CbContext *pWDA, |
| 12154 | tUpdateVHTOpMode *pData) |
| 12155 | { |
| 12156 | WDI_Status status = WDI_STATUS_SUCCESS ; |
| 12157 | tWDA_ReqParams *pWdaParams ; |
| 12158 | WDI_UpdateVHTOpMode *wdiTemp = (WDI_UpdateVHTOpMode *)vos_mem_malloc( |
| 12159 | sizeof(WDI_UpdateVHTOpMode)) ; |
| 12160 | if(NULL == wdiTemp) |
| 12161 | { |
| 12162 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12163 | "%s: VOS MEM Alloc Failure", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 12164 | VOS_ASSERT(0); |
| 12165 | return VOS_STATUS_E_NOMEM; |
| 12166 | } |
| 12167 | pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ; |
| 12168 | if(NULL == pWdaParams) |
| 12169 | { |
| 12170 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12171 | "%s: VOS MEM Alloc Failure", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 12172 | VOS_ASSERT(0); |
| 12173 | vos_mem_free(wdiTemp); |
| 12174 | return VOS_STATUS_E_NOMEM; |
| 12175 | } |
| 12176 | |
| 12177 | wdiTemp->opMode = pData->opMode; |
| 12178 | wdiTemp->staId = pData->staId; |
| 12179 | |
| 12180 | pWdaParams->pWdaContext = pWDA; |
| 12181 | /* Store Req pointer, as this will be used for response */ |
| 12182 | pWdaParams->wdaMsgParam = (void *)pData; |
| 12183 | /* store Params pass it to WDI */ |
| 12184 | pWdaParams->wdaWdiApiMsgParam = (void *)wdiTemp ; |
| 12185 | |
| 12186 | status = WDI_UpdateVHTOpModeReq( wdiTemp, (WDI_UpdateVHTOpModeCb) WDA_SetUpdateOpModeReqCallback, pWdaParams); |
| 12187 | |
| 12188 | if(IS_WDI_STATUS_FAILURE(status)) |
| 12189 | { |
| 12190 | VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, |
| 12191 | "Failure in UPDATE VHT OP_MODE REQ Params WDI API, free all the memory " ); |
| 12192 | vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ; |
| 12193 | vos_mem_free(pWdaParams->wdaMsgParam); |
| 12194 | vos_mem_free(pWdaParams); |
| 12195 | } |
| 12196 | return CONVERT_WDI2VOS_STATUS(status) ; |
| 12197 | } |
| 12198 | #endif |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 12199 | |
| 12200 | /*========================================================================== |
| 12201 | FUNCTION WDA_TransportChannelDebug |
| 12202 | |
Madan Mohan Koyyalamudi | d93f494 | 2012-10-05 15:05:40 -0700 | [diff] [blame] | 12203 | DESCRIPTION |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 12204 | Display Transport Channel debugging information |
| 12205 | User may request to display DXE channel snapshot |
| 12206 | Or if host driver detects any abnormal stcuk may display |
| 12207 | |
| 12208 | PARAMETERS |
Jeff Johnson | bf9616f | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 12209 | displaySnapshot : Display DXE snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 12210 | enableStallDetect : Enable stall detect feature |
| 12211 | This feature will take effect to data performance |
| 12212 | Not integrate till fully verification |
| 12213 | |
| 12214 | RETURN VALUE |
| 12215 | NONE |
| 12216 | |
| 12217 | ===========================================================================*/ |
| 12218 | void WDA_TransportChannelDebug |
| 12219 | ( |
| 12220 | v_BOOL_t displaySnapshot, |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 12221 | v_BOOL_t toggleStallDetect |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 12222 | ) |
| 12223 | { |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 12224 | WDI_TransportChannelDebug(displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 12225 | return; |
Madan Mohan Koyyalamudi | 5eec74a | 2012-09-28 14:59:25 -0700 | [diff] [blame] | 12226 | } |