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 | /*=========================================================================== |
| 43 | |
| 44 | W L A N _ Q C T _ W D I. C |
| 45 | |
| 46 | OVERVIEW: |
| 47 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 48 | This software unit holds the implementation of the WLAN Device Abstraction |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 49 | Layer Interface. |
| 50 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 51 | The functions externalized by this module are to be called by any upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 52 | MAC implementation that wishes to use the WLAN Device. |
| 53 | |
| 54 | DEPENDENCIES: |
| 55 | |
| 56 | Are listed for each API below. |
| 57 | |
| 58 | |
| 59 | Copyright (c) 2008 QUALCOMM Incorporated. |
| 60 | All Rights Reserved. |
| 61 | Qualcomm Confidential and Proprietary |
| 62 | ===========================================================================*/ |
| 63 | |
| 64 | /*=========================================================================== |
| 65 | |
| 66 | EDIT HISTORY FOR FILE |
| 67 | |
| 68 | |
| 69 | This section contains comments describing changes made to the module. |
| 70 | Notice that changes are listed in reverse chronological order. |
| 71 | |
| 72 | |
| 73 | $Header$$DateTime$$Author$ |
| 74 | |
| 75 | |
| 76 | when who what, where, why |
| 77 | ---------- --- -------------------------------------------------------- |
| 78 | 10/05/11 hap Adding support for Keep Alive |
| 79 | 2010-08-09 lti Created module |
| 80 | |
| 81 | ===========================================================================*/ |
| 82 | |
| 83 | /*---------------------------------------------------------------------------- |
| 84 | * Include Files |
| 85 | * -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 86 | #include "wlan_qct_wdi.h" |
| 87 | #include "wlan_qct_wdi_i.h" |
| 88 | #include "wlan_qct_wdi_sta.h" |
| 89 | #include "wlan_qct_wdi_dp.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 90 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 91 | #include "wlan_qct_wdi_cts.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 92 | |
| 93 | #include "wlan_qct_pal_api.h" |
| 94 | #include "wlan_qct_pal_type.h" |
| 95 | #include "wlan_qct_pal_status.h" |
| 96 | #include "wlan_qct_pal_sync.h" |
| 97 | #include "wlan_qct_pal_msg.h" |
| 98 | #include "wlan_qct_pal_trace.h" |
| 99 | #include "wlan_qct_pal_packet.h" |
| 100 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 101 | #include "wlan_qct_wdi_dts.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | |
| 103 | #include "wlan_hal_msg.h" |
| 104 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 105 | #include "pttMsgApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 106 | |
| 107 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 108 | WLAN DAL Control Path Internal Data Definitions and Declarations |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 109 | ===========================================================================*/ |
| 110 | #define WDI_WCTS_ACTION_TIMEOUT 2000 /* in msec a very high upper limit */ |
| 111 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 112 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 113 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 114 | |
Yue Ma | 7062749 | 2013-03-28 11:33:46 -0700 | [diff] [blame] | 115 | #define FEATURE_NOT_SUPPORTED 127 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 116 | |
| 117 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 118 | #define WDI_PNO_VERSION_MASK 0x8000 |
| 119 | #endif |
| 120 | |
| 121 | /* host capability bitmap global */ |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 122 | static tWlanFeatCaps *gpHostWlanFeatCaps; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 123 | /* FW capability bitmap global */ |
Madan Mohan Koyyalamudi | dfd6aa8 | 2012-10-18 20:18:43 -0700 | [diff] [blame] | 124 | static tWlanFeatCaps *gpFwWlanFeatCaps; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 125 | /* array of features supported. Need to add a new feature |
| 126 | * and other two places - wlan_hal_msg.h and halMsg.c (FW file) |
| 127 | */ |
| 128 | static placeHolderInCapBitmap supportEnabledFeatures[] = |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 129 | {MCC, P2P, DOT11AC, SLM_SESSIONIZATION, DOT11AC_OPMODE |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 130 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 131 | ,SAP32STA |
| 132 | #else |
| 133 | ,FEATURE_NOT_SUPPORTED |
| 134 | #endif |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 135 | #ifdef FEATURE_WLAN_TDLS |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 136 | ,TDLS |
| 137 | #else |
| 138 | ,FEATURE_NOT_SUPPORTED |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 139 | #endif |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 140 | ,P2P_GO_NOA_DECOUPLE_INIT_SCAN |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 141 | #ifdef WLAN_ACTIVEMODE_OFFLOAD_FEATURE |
| 142 | ,WLANACTIVE_OFFLOAD |
| 143 | #else |
| 144 | ,FEATURE_NOT_SUPPORTED |
| 145 | #endif |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 146 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 147 | ,WLAN_ROAM_SCAN_OFFLOAD |
| 148 | #else |
| 149 | ,FEATURE_NOT_SUPPORTED |
| 150 | #endif |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 151 | }; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 152 | |
| 153 | /*-------------------------------------------------------------------------- |
| 154 | WLAN DAL State Machine |
| 155 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 156 | WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 157 | { |
| 158 | /*WDI_INIT_ST*/ |
| 159 | {{ |
| 160 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 161 | NULL, /*WDI_STOP_EVENT*/ |
| 162 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 163 | WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/ |
| 164 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
| 165 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 166 | }}, |
| 167 | |
| 168 | /*WDI_STARTED_ST*/ |
| 169 | {{ |
| 170 | WDI_MainStartStarted, /*WDI_START_EVENT*/ |
| 171 | WDI_MainStopStarted, /*WDI_STOP_EVENT*/ |
| 172 | WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/ |
| 173 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 174 | NULL, /*WDI_CLOSE_EVENT*/ |
| 175 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 176 | }}, |
| 177 | |
| 178 | /*WDI_STOPPED_ST*/ |
| 179 | {{ |
| 180 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 181 | WDI_MainStopStopped, /*WDI_STOP_EVENT*/ |
| 182 | NULL, /*WDI_REQUEST_EVENT*/ |
| 183 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 184 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 185 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 186 | }}, |
| 187 | |
| 188 | /*WDI_BUSY_ST*/ |
| 189 | {{ |
| 190 | WDI_MainStartBusy, /*WDI_START_EVENT*/ |
| 191 | WDI_MainStopBusy, /*WDI_STOP_EVENT*/ |
| 192 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 193 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 194 | WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/ |
| 195 | WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/ |
| 196 | }} |
| 197 | }; |
| 198 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 199 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 200 | DAL Request Processing Array - the functions in this table will only be |
| 201 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 202 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 203 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 204 | WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 205 | { |
| 206 | /*INIT*/ |
| 207 | WDI_ProcessStartReq, /* WDI_START_REQ */ |
| 208 | WDI_ProcessStopReq, /* WDI_STOP_REQ */ |
| 209 | WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */ |
| 210 | |
| 211 | /*SCAN*/ |
| 212 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */ |
| 213 | WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */ |
| 214 | WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */ |
| 215 | WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */ |
| 216 | |
| 217 | /*ASSOCIATION*/ |
| 218 | WDI_ProcessJoinReq, /* WDI_JOIN_REQ */ |
| 219 | WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */ |
| 220 | WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */ |
| 221 | WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */ |
| 222 | WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */ |
| 223 | |
| 224 | /* Security */ |
| 225 | WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */ |
| 226 | WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 227 | WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */ |
| 228 | WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 229 | |
| 230 | /* QoS and BA APIs */ |
| 231 | WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */ |
| 232 | WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */ |
| 233 | WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */ |
| 234 | WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */ |
| 235 | WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */ |
| 236 | |
| 237 | /* Miscellaneous Control APIs */ |
| 238 | WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */ |
| 239 | WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */ |
| 240 | WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */ |
| 241 | WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */ |
| 242 | WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */ |
| 243 | |
| 244 | /*BA APIs*/ |
| 245 | WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */ |
| 246 | WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */ |
| 247 | |
| 248 | /*Beacon processing APIs*/ |
| 249 | WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */ |
| 250 | WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */ |
| 251 | |
| 252 | WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */ |
| 253 | WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */ |
| 254 | WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */ |
| 255 | WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 257 | /* PowerSave APIs */ |
| 258 | WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */ |
| 259 | WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */ |
| 260 | WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */ |
| 261 | WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */ |
| 262 | WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */ |
| 263 | WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */ |
| 264 | WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */ |
| 265 | WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */ |
| 266 | WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */ |
| 267 | WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */ |
| 268 | WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */ |
| 269 | WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */ |
| 270 | WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */ |
| 271 | WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */ |
| 272 | WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */ |
| 273 | WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */ |
| 274 | WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */ |
| 275 | WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */ |
| 276 | /*NV Download APIs*/ |
| 277 | WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/ |
| 278 | WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */ |
| 279 | WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */ |
| 280 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 281 | WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */ |
| 282 | #else |
| 283 | NULL, |
| 284 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 285 | WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */ |
| 286 | WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 287 | WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 288 | |
| 289 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 290 | WDI_ProcessStartOemDataReq, /*WDI_START_OEM_DATA_REQ*/ |
| 291 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 293 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 295 | |
| 296 | WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 297 | |
| 298 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 299 | WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */ |
| 300 | WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */ |
| 301 | WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */ |
| 302 | #else |
| 303 | NULL, |
| 304 | NULL, |
| 305 | NULL, |
| 306 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 307 | |
| 308 | WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 309 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 310 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 311 | /* WDI_8023_MULTICAST_LIST_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 312 | WDI_Process8023MulticastListReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 313 | /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 314 | WDI_ProcessReceiveFilterSetFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 315 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 316 | WDI_ProcessFilterMatchCountReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 317 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 318 | WDI_ProcessReceiveFilterClearFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 319 | #else |
| 320 | NULL, |
| 321 | NULL, |
| 322 | NULL, |
| 323 | NULL, |
| 324 | #endif // WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 325 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 326 | WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */ |
| 327 | WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */ |
| 328 | |
| 329 | WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/ |
| 330 | #ifdef FEATURE_WLAN_CCX |
| 331 | WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */ |
| 332 | #else |
| 333 | NULL, |
| 334 | #endif |
| 335 | |
| 336 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 337 | WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */ |
| 338 | WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */ |
| 339 | #else |
| 340 | NULL, |
| 341 | NULL, |
| 342 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 343 | |
| 344 | WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/ |
| 345 | WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 346 | #ifdef WLAN_FEATURE_11AC |
| 347 | WDI_ProcessUpdateVHTOpModeReq, /* WDI_UPDATE_VHT_OP_MODE_REQ */ |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 348 | #else |
| 349 | NULL, |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 350 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 351 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 352 | WDI_ProcessGetRoamRssiReq, /* WDI_GET_ROAM_RSSI_REQ */ |
| 353 | #else |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 354 | NULL, |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 355 | #endif |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 356 | WDI_ProcessSetTxPowerReq, /* WDI_SET_TX_POWER_REQ*/ |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 357 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 358 | WDI_ProcessRoamScanOffloadReq, /* WDI_ROAM_SCAN_OFFLOAD_REQ */ |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 359 | #else |
| 360 | NULL, |
| 361 | #endif /* WLAN_FEATURE_ROAM_SCAN_OFFLOAD */ |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 362 | #ifdef FEATURE_WLAN_TDLS |
| 363 | WDI_ProcessTdlsLinkEstablishReq, /* WDI_TDLS_LINK_ESTABLISH_REQ */ |
| 364 | #else |
| 365 | NULL, |
| 366 | #endif |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 367 | /*------------------------------------------------------------------------- |
| 368 | Indications |
| 369 | -------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 370 | WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/ |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 371 | WDI_ProcessTrafficStatsInd, /* WDI_TRAFFIC_STATS_IND*/ |
Sundaresan Ramachandran | 811a2f9 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 372 | WDI_ProcessDHCPStartInd, /* WDI_DHCP_START_IND*/ |
| 373 | WDI_ProcessDHCPStopInd, /* WDI_DHCP_STOP_IND*/ |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 374 | #ifdef WLAN_FEATURE_11W |
| 375 | WDI_ProcessExcludeUnencryptInd, /* WDI_EXCLUDE_UNENCRYPTED_IND */ |
| 376 | #else |
| 377 | NULL, |
| 378 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | }; |
| 380 | |
| 381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 382 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | DAL Request Processing Array - the functions in this table will only be |
| 384 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 385 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 386 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 387 | WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | { |
| 389 | /*INIT*/ |
| 390 | WDI_ProcessStartRsp, /* WDI_START_RESP */ |
| 391 | WDI_ProcessStopRsp, /* WDI_STOP_RESP */ |
| 392 | WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */ |
| 393 | |
| 394 | /*SCAN*/ |
| 395 | WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */ |
| 396 | WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */ |
| 397 | WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */ |
| 398 | WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */ |
| 399 | |
| 400 | /* ASSOCIATION*/ |
| 401 | WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */ |
| 402 | WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */ |
| 403 | WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */ |
| 404 | WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */ |
| 405 | WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */ |
| 406 | |
| 407 | /* Security */ |
| 408 | WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */ |
| 409 | WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 410 | WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */ |
| 411 | WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 412 | |
| 413 | /* QoS and BA APIs */ |
| 414 | WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */ |
| 415 | WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */ |
| 416 | WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */ |
| 417 | WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */ |
| 418 | WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */ |
| 419 | |
| 420 | /* Miscellaneous Control APIs */ |
| 421 | WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */ |
| 422 | WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */ |
| 423 | WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */ |
| 424 | WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */ |
| 425 | WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */ |
| 426 | |
| 427 | /* BA APIs*/ |
| 428 | WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */ |
| 429 | WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 430 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 431 | /* IBSS APIs*/ |
| 432 | WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */ |
| 433 | WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */ |
| 434 | |
| 435 | /*Soft AP APIs*/ |
| 436 | WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */ |
| 437 | WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */ |
| 438 | WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */ |
| 439 | WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */ |
| 440 | |
| 441 | /* PowerSave APIs */ |
| 442 | WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */ |
| 443 | WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */ |
| 444 | WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */ |
| 445 | WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */ |
| 446 | WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */ |
| 447 | WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */ |
| 448 | WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */ |
| 449 | WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */ |
| 450 | WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */ |
| 451 | WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */ |
| 452 | WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */ |
| 453 | WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */ |
| 454 | WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */ |
| 455 | WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */ |
| 456 | WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */ |
| 457 | WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */ |
| 458 | WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */ |
| 459 | WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 461 | |
| 462 | WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/ |
| 463 | |
| 464 | WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */ |
| 465 | WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */ |
| 466 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 467 | WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */ |
| 468 | #else |
| 469 | NULL, |
| 470 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 471 | WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */ |
| 472 | WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 473 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 474 | WDI_ProcessStartOemDataRsp, /*WDI_START_OEM_DATA_RESP*/ |
| 475 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 476 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 477 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 478 | WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/ |
| 479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 480 | WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 483 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 484 | WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */ |
| 485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 486 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 487 | WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */ |
| 488 | WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */ |
| 489 | WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */ |
| 490 | #else |
| 491 | NULL, |
| 492 | NULL, |
| 493 | NULL, |
| 494 | #endif // FEATURE_WLAN_SCAN_PNO |
| 495 | |
| 496 | WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */ |
| 497 | |
| 498 | /*--------------------------------------------------------------------- |
| 499 | Indications |
| 500 | ---------------------------------------------------------------------*/ |
| 501 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 502 | /* WDI_8023_MULTICAST_LIST_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 503 | WDI_Process8023MulticastListRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 504 | /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 505 | WDI_ProcessReceiveFilterSetFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 506 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 507 | WDI_ProcessFilterMatchCountRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 508 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 509 | WDI_ProcessReceiveFilterClearFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 510 | #else |
| 511 | NULL, |
| 512 | NULL, |
| 513 | NULL, |
| 514 | NULL, |
| 515 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 516 | |
| 517 | WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */ |
| 518 | WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */ |
| 519 | |
| 520 | WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/ |
| 521 | #ifdef FEATURE_WLAN_CCX |
| 522 | WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */ |
| 523 | #else |
| 524 | NULL, |
| 525 | #endif |
| 526 | |
| 527 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 528 | WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */ |
| 529 | WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | #else |
| 531 | NULL, |
| 532 | NULL, |
| 533 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 534 | WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */ |
| 535 | WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 536 | #ifdef WLAN_FEATURE_11AC |
| 537 | WDI_ProcessUpdateVHTOpModeRsp, /* WDI_UPDATE_VHT_OP_MODE_RESP */ |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 538 | #else |
| 539 | NULL, |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 540 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 541 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 542 | WDI_ProcessGetRoamRssiRsp, /* WDI_GET_ROAM_RSSI_RESP */ |
| 543 | #else |
| 544 | NULL, |
| 545 | #endif |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 546 | WDI_ProcessSetTxPowerRsp, /* WDI_SET_TX_POWER_RESP */ |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 547 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 548 | WDI_ProcessRoamScanOffloadRsp, /* WDI_ROAM_SCAN_OFFLOAD_RESP */ |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 549 | #else |
| 550 | NULL, |
| 551 | #endif |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 552 | #ifdef FEATURE_WLAN_TDLS |
| 553 | WDI_ProcessLinkEstablishReqRsp, /*WDI_TDLS_LINK_ESTABLISH_REQ_RESP*/ |
| 554 | #else |
| 555 | NULL, |
| 556 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 557 | /*--------------------------------------------------------------------- |
| 558 | Indications |
| 559 | ---------------------------------------------------------------------*/ |
| 560 | WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */ |
| 561 | WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */ |
| 562 | WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */ |
| 563 | WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */ |
| 564 | WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */ |
| 565 | WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */ |
| 566 | |
| 567 | WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */ |
| 568 | |
| 569 | WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */ |
| 570 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 571 | WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 572 | |
| 573 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 574 | WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */ |
| 575 | #else |
| 576 | NULL, |
| 577 | #endif // FEATURE_WLAN_SCAN_PNO |
| 578 | |
| 579 | #ifdef WLAN_WAKEUP_EVENTS |
| 580 | WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */ |
| 581 | #else // WLAN_WAKEUP_EVENTS |
| 582 | NULL, |
| 583 | #endif // WLAN_WAKEUP_EVENTS |
| 584 | |
| 585 | WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */ |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 586 | |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 587 | WDI_ProcessP2pNoaStartInd, /* WDI_NOA_START_IND */ |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 588 | #ifdef FEATURE_WLAN_TDLS |
| 589 | WDI_ProcessTdlsInd, /* WDI_HAL_TDLS_IND */ |
| 590 | #else |
| 591 | NULL, |
| 592 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 593 | }; |
| 594 | |
| 595 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 596 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 597 | WLAN DAL Global Control Block |
| 598 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 599 | WDI_ControlBlockType gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 600 | static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE; |
| 601 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 602 | const wpt_uint8 szTransportChName[] = "WLAN_CTRL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | |
| 604 | /*Helper routine for retrieving the PAL Context from WDI*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 605 | WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 606 | void* WDI_GET_PAL_CTX( void ) |
| 607 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 608 | return gWDICb.pPALContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 609 | }/*WDI_GET_PAL_CTX*/ |
| 610 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 611 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 612 | Helper inline converters |
| 613 | ============================================================================*/ |
| 614 | /*Convert WDI driver type into HAL driver type*/ |
| 615 | WPT_STATIC WPT_INLINE WDI_Status |
| 616 | WDI_HAL_2_WDI_STATUS |
| 617 | ( |
| 618 | eHalStatus halStatus |
| 619 | ); |
| 620 | |
| 621 | /*Convert WDI request type into HAL request type*/ |
| 622 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 623 | WDI_2_HAL_REQ_TYPE |
| 624 | ( |
| 625 | WDI_RequestEnumType wdiReqType |
| 626 | ); |
| 627 | |
| 628 | /*Convert WDI response type into HAL response type*/ |
| 629 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 630 | HAL_2_WDI_RSP_TYPE |
| 631 | ( |
| 632 | tHalHostMsgType halMsg |
| 633 | ); |
| 634 | |
| 635 | /*Convert WDI driver type into HAL driver type*/ |
| 636 | WPT_STATIC WPT_INLINE tDriverType |
| 637 | WDI_2_HAL_DRV_TYPE |
| 638 | ( |
| 639 | WDI_DriverType wdiDriverType |
| 640 | ); |
| 641 | |
| 642 | /*Convert WDI stop reason into HAL stop reason*/ |
| 643 | WPT_STATIC WPT_INLINE tHalStopType |
| 644 | WDI_2_HAL_STOP_REASON |
| 645 | ( |
| 646 | WDI_StopType wdiStopType |
| 647 | ); |
| 648 | |
| 649 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 650 | WPT_STATIC WPT_INLINE eHalSysMode |
| 651 | WDI_2_HAL_SCAN_MODE |
| 652 | ( |
| 653 | WDI_ScanMode wdiScanMode |
| 654 | ); |
| 655 | |
| 656 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 657 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 658 | WDI_2_HAL_SEC_CH_OFFSET |
| 659 | ( |
| 660 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 661 | ); |
| 662 | |
| 663 | /*Convert WDI BSS type into HAL BSS type*/ |
| 664 | WPT_STATIC WPT_INLINE tSirBssType |
| 665 | WDI_2_HAL_BSS_TYPE |
| 666 | ( |
| 667 | WDI_BssType wdiBSSType |
| 668 | ); |
| 669 | |
| 670 | /*Convert WDI NW type into HAL NW type*/ |
| 671 | WPT_STATIC WPT_INLINE tSirNwType |
| 672 | WDI_2_HAL_NW_TYPE |
| 673 | ( |
| 674 | WDI_NwType wdiNWType |
| 675 | ); |
| 676 | |
| 677 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 678 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 679 | WDI_2_HAL_CB_STATE |
| 680 | ( |
| 681 | WDI_PhyChanBondState wdiCbState |
| 682 | ); |
| 683 | |
| 684 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 685 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 686 | WDI_2_HAL_HT_OPER_MODE |
| 687 | ( |
| 688 | WDI_HTOperatingMode wdiHTOperMode |
| 689 | ); |
| 690 | |
| 691 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 692 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 693 | WDI_2_HAL_MIMO_PS |
| 694 | ( |
| 695 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 696 | ); |
| 697 | |
| 698 | /*Convert WDI ENC type into HAL ENC type*/ |
| 699 | WPT_STATIC WPT_INLINE tAniEdType |
| 700 | WDI_2_HAL_ENC_TYPE |
| 701 | ( |
| 702 | WDI_EncryptType wdiEncType |
| 703 | ); |
| 704 | |
| 705 | /*Convert WDI WEP type into HAL WEP type*/ |
| 706 | WPT_STATIC WPT_INLINE tAniWepType |
| 707 | WDI_2_HAL_WEP_TYPE |
| 708 | ( |
| 709 | WDI_WepType wdiWEPType |
| 710 | ); |
| 711 | |
| 712 | /*Convert WDI Link State into HAL Link State*/ |
| 713 | WPT_STATIC WPT_INLINE tSirLinkState |
| 714 | WDI_2_HAL_LINK_STATE |
| 715 | ( |
| 716 | WDI_LinkStateType wdiLinkState |
| 717 | ); |
| 718 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 719 | /*Translate a STA Context from WDI into HAL*/ |
| 720 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 721 | void |
| 722 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 723 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 724 | tConfigStaParams* phalConfigSta, |
| 725 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 726 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 727 | |
| 728 | /*Translate a Rate set info from WDI into HAL*/ |
| 729 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 731 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | tSirMacRateSet* pHalRateSet, |
| 733 | WDI_RateSet* pwdiRateSet |
| 734 | ); |
| 735 | |
| 736 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 737 | WPT_STATIC WPT_INLINE void |
| 738 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 739 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 740 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 741 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 742 | ); |
| 743 | |
| 744 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 745 | WPT_STATIC WPT_INLINE void |
| 746 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 747 | ( |
| 748 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 749 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 750 | ); |
| 751 | |
| 752 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 753 | WPT_STATIC WPT_INLINE void |
| 754 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 755 | ( |
| 756 | tConfigBssParams* phalConfigBSS, |
| 757 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 758 | ); |
| 759 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 760 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 761 | pointed to by user data */ |
| 762 | WPT_STATIC WPT_INLINE void |
| 763 | WDI_ExtractRequestCBFromEvent |
| 764 | ( |
| 765 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 766 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 767 | void** ppUserData |
| 768 | ); |
| 769 | |
| 770 | wpt_uint8 |
| 771 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 772 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 773 | WDI_ControlBlockType* pWDICtx, |
| 774 | WDI_BSSSessionType** ppSession |
| 775 | ); |
| 776 | |
| 777 | void |
| 778 | WDI_AddBcastSTAtoSTATable |
| 779 | ( |
| 780 | WDI_ControlBlockType* pWDICtx, |
| 781 | WDI_AddStaParams * staParams, |
| 782 | wpt_uint16 usBcastStaIdx |
| 783 | ); |
| 784 | |
| 785 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 786 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 787 | WDI_ControlBlockType* pWDICtx, |
| 788 | WDI_EventInfoType* pEventData |
| 789 | ); |
| 790 | |
| 791 | void |
| 792 | WDI_SetPowerStateCb |
| 793 | ( |
| 794 | wpt_status status, |
| 795 | unsigned int dxePhyAddr, |
| 796 | void *pContext |
| 797 | ); |
| 798 | |
| 799 | #define CASE_RETURN_STRING( str ) \ |
| 800 | case ( ( str ) ): return( #str ); break \ |
| 801 | |
| 802 | /** |
| 803 | @brief WDI_getReqMsgString prints the WDI request message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 804 | |
| 805 | @param wdiReqMsgId: WDI Message request Id |
| 806 | |
| 807 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 808 | @return Result of the function call |
| 809 | */ |
| 810 | static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId) |
| 811 | { |
| 812 | switch (wdiReqMsgId) |
| 813 | { |
| 814 | CASE_RETURN_STRING( WDI_START_REQ ); |
| 815 | CASE_RETURN_STRING( WDI_STOP_REQ ); |
| 816 | CASE_RETURN_STRING( WDI_CLOSE_REQ ); |
| 817 | CASE_RETURN_STRING( WDI_INIT_SCAN_REQ ); |
| 818 | CASE_RETURN_STRING( WDI_START_SCAN_REQ ); |
| 819 | CASE_RETURN_STRING( WDI_END_SCAN_REQ ); |
| 820 | CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ ); |
| 821 | CASE_RETURN_STRING( WDI_JOIN_REQ ); |
| 822 | CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ ); |
| 823 | CASE_RETURN_STRING( WDI_DEL_BSS_REQ ); |
| 824 | CASE_RETURN_STRING( WDI_POST_ASSOC_REQ ); |
| 825 | CASE_RETURN_STRING( WDI_DEL_STA_REQ ); |
| 826 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ ); |
| 827 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ ); |
| 828 | CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ ); |
| 829 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ ); |
| 830 | CASE_RETURN_STRING( WDI_ADD_TS_REQ ); |
| 831 | CASE_RETURN_STRING( WDI_DEL_TS_REQ ); |
| 832 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ ); |
| 833 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ ); |
| 834 | CASE_RETURN_STRING( WDI_DEL_BA_REQ ); |
| 835 | CASE_RETURN_STRING( WDI_CH_SWITCH_REQ ); |
| 836 | CASE_RETURN_STRING( WDI_CONFIG_STA_REQ ); |
| 837 | CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ ); |
| 838 | CASE_RETURN_STRING( WDI_GET_STATS_REQ ); |
| 839 | CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ ); |
| 840 | CASE_RETURN_STRING( WDI_ADD_BA_REQ ); |
| 841 | CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ ); |
| 842 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ ); |
| 843 | CASE_RETURN_STRING( WDI_SND_BCON_REQ ); |
| 844 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ ); |
| 845 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ ); |
| 846 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ ); |
| 847 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ ); |
| 848 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ ); |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 849 | #ifdef FEATURE_WLAN_TDLS |
| 850 | CASE_RETURN_STRING( WDI_TDLS_LINK_ESTABLISH_REQ ); |
| 851 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 852 | CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ ); |
| 853 | CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ ); |
| 854 | CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ ); |
| 855 | CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ ); |
| 856 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ ); |
| 857 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ ); |
| 858 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ ); |
| 859 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ ); |
| 860 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ ); |
| 861 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ); |
| 862 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ ); |
| 863 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ ); |
| 864 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ ); |
| 865 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ ); |
| 866 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ ); |
| 867 | CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ ); |
| 868 | CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ ); |
| 869 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ ); |
| 870 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ ); |
| 871 | CASE_RETURN_STRING( WDI_FLUSH_AC_REQ ); |
| 872 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ ); |
| 873 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ ); |
| 874 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ ); |
| 875 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ ); |
| 876 | CASE_RETURN_STRING( WDI_FTM_CMD_REQ ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 877 | CASE_RETURN_STRING( WDI_START_OEM_DATA_REQ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 878 | CASE_RETURN_STRING( WDI_HOST_RESUME_REQ ); |
| 879 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ); |
| 880 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 881 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ ); |
| 882 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ ); |
| 883 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ ); |
| 884 | #endif |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 885 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 886 | CASE_RETURN_STRING( WDI_ROAM_SCAN_OFFLOAD_REQ ); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 887 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 888 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ ); |
| 889 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ ); |
| 890 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ ); |
| 891 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ ); |
| 892 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ ); |
| 893 | CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ ); |
| 894 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ ); |
| 895 | CASE_RETURN_STRING( WDI_SHUTDOWN_REQ ); |
| 896 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ ); |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 897 | CASE_RETURN_STRING( WDI_TRAFFIC_STATS_IND ); |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 898 | CASE_RETURN_STRING( WDI_GET_ROAM_RSSI_REQ ); |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 899 | #ifdef WLAN_FEATURE_11W |
| 900 | CASE_RETURN_STRING( WDI_EXCLUDE_UNENCRYPTED_IND ); |
| 901 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 902 | default: |
| 903 | return "Unknown WDI MessageId"; |
| 904 | } |
| 905 | } |
| 906 | |
| 907 | |
| 908 | |
| 909 | /** |
| 910 | @brief WDI_getRespMsgString prints the WDI resonse message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 911 | |
| 912 | @param wdiRespMsgId: WDI Message response Id |
| 913 | |
| 914 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 915 | @return Result of the function call |
| 916 | */ |
| 917 | static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId) |
| 918 | { |
| 919 | switch (wdiRespMsgId) |
| 920 | { |
| 921 | CASE_RETURN_STRING( WDI_START_RESP ); |
| 922 | CASE_RETURN_STRING( WDI_STOP_RESP ); |
| 923 | CASE_RETURN_STRING( WDI_CLOSE_RESP ); |
| 924 | CASE_RETURN_STRING( WDI_INIT_SCAN_RESP ); |
| 925 | CASE_RETURN_STRING( WDI_START_SCAN_RESP ); |
| 926 | CASE_RETURN_STRING( WDI_END_SCAN_RESP ); |
| 927 | CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP ); |
| 928 | CASE_RETURN_STRING( WDI_JOIN_RESP ); |
| 929 | CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP ); |
| 930 | CASE_RETURN_STRING( WDI_DEL_BSS_RESP ); |
| 931 | CASE_RETURN_STRING( WDI_POST_ASSOC_RESP ); |
| 932 | CASE_RETURN_STRING( WDI_DEL_STA_RESP ); |
| 933 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP ); |
| 934 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP ); |
| 935 | CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP ); |
| 936 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP ); |
| 937 | CASE_RETURN_STRING( WDI_ADD_TS_RESP ); |
| 938 | CASE_RETURN_STRING( WDI_DEL_TS_RESP ); |
| 939 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP ); |
| 940 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP ); |
| 941 | CASE_RETURN_STRING( WDI_DEL_BA_RESP ); |
| 942 | CASE_RETURN_STRING( WDI_CH_SWITCH_RESP ); |
| 943 | CASE_RETURN_STRING( WDI_CONFIG_STA_RESP ); |
| 944 | CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP ); |
| 945 | CASE_RETURN_STRING( WDI_GET_STATS_RESP ); |
| 946 | CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP ); |
| 947 | CASE_RETURN_STRING( WDI_ADD_BA_RESP ); |
| 948 | CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP ); |
| 949 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP ); |
| 950 | CASE_RETURN_STRING( WDI_SND_BCON_RESP ); |
| 951 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP ); |
| 952 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP ); |
| 953 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP ); |
| 954 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP ); |
| 955 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP ); |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 956 | #ifdef FEATURE_WLAN_TDLS |
| 957 | CASE_RETURN_STRING( WDI_TDLS_LINK_ESTABLISH_REQ_RESP ); |
| 958 | CASE_RETURN_STRING( WDI_HAL_TDLS_IND ); |
| 959 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 960 | CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP ); |
| 961 | CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP ); |
| 962 | CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP ); |
| 963 | CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP ); |
| 964 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP ); |
| 965 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP ); |
| 966 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP ); |
| 967 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP ); |
| 968 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP ); |
| 969 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP); |
| 970 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP ); |
| 971 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP ); |
| 972 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP ); |
| 973 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP ); |
| 974 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP ); |
| 975 | CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP ); |
| 976 | CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP ); |
| 977 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP ); |
| 978 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP ); |
| 979 | CASE_RETURN_STRING( WDI_FLUSH_AC_RESP ); |
| 980 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP ); |
| 981 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP ); |
| 982 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP ); |
| 983 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP ); |
| 984 | CASE_RETURN_STRING( WDI_FTM_CMD_RESP ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 985 | CASE_RETURN_STRING( WDI_START_OEM_DATA_RESP ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 986 | CASE_RETURN_STRING( WDI_HOST_RESUME_RESP ); |
| 987 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP); |
| 988 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 989 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP ); |
| 990 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP ); |
| 991 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP ); |
| 992 | #endif |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 993 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 994 | CASE_RETURN_STRING( WDI_ROAM_SCAN_OFFLOAD_RESP ); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 995 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 996 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP ); |
| 997 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP ); |
| 998 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP ); |
| 999 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP ); |
| 1000 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP ); |
| 1001 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP ); |
| 1002 | CASE_RETURN_STRING( WDI_SHUTDOWN_RESP ); |
| 1003 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP ); |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 1004 | CASE_RETURN_STRING( WDI_GET_ROAM_RSSI_RESP ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1005 | default: |
| 1006 | return "Unknown WDI MessageId"; |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | /** |
| 1011 | @brief WDI_getHALStatusMsgString prints the HAL status in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1012 | |
| 1013 | @param halStatusId: HAL status Id |
| 1014 | |
| 1015 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1016 | @return Result of the function call |
| 1017 | */ |
| 1018 | static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId) |
| 1019 | { |
| 1020 | switch (halStatusId) |
| 1021 | { |
| 1022 | CASE_RETURN_STRING( eHAL_STATUS_SUCCESS ); |
| 1023 | CASE_RETURN_STRING( PAL_STATUS_INVAL ); |
| 1024 | CASE_RETURN_STRING( PAL_STATUS_ALREADY ); |
| 1025 | CASE_RETURN_STRING( PAL_STATUS_EMPTY ); |
| 1026 | CASE_RETURN_STRING( PAL_STATUS_FAILURE ); |
| 1027 | CASE_RETURN_STRING( eHAL_STATUS_FAILURE ); |
| 1028 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER ); |
| 1029 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX ); |
| 1030 | CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL ); |
| 1031 | CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS ); |
| 1032 | CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT ); |
| 1033 | CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL ); |
| 1034 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA ); |
| 1035 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID ); |
| 1036 | CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID ); |
| 1037 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID ); |
| 1038 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX ); |
| 1039 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL ); |
| 1040 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE ); |
| 1041 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID ); |
| 1042 | CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN ); |
| 1043 | CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL ); |
| 1044 | CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL ); |
| 1045 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL ); |
| 1046 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED ); |
| 1047 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID ); |
| 1048 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED ); |
| 1049 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED ); |
| 1050 | CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC ); |
| 1051 | CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL ); |
| 1052 | CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 1053 | CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 1054 | CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED ); |
| 1055 | default: |
| 1056 | return "Unknown HAL status"; |
| 1057 | } |
| 1058 | } |
| 1059 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1060 | /*======================================================================== |
| 1061 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1062 | INITIALIZATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1063 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1064 | ==========================================================================*/ |
| 1065 | |
| 1066 | /** |
| 1067 | @brief WDI_Init is used to initialize the DAL. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1068 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1069 | DAL will allocate all the resources it needs. It will open PAL, it will also |
| 1070 | open both the data and the control transport which in their turn will open |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1071 | DXE/SMD or any other drivers that they need. |
| 1072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1073 | @param pOSContext: pointer to the OS context provided by the UMAC |
| 1074 | will be passed on to PAL on Open |
| 1075 | ppWDIGlobalCtx: output pointer of Global Context |
| 1076 | pWdiDevCapability: output pointer of device capability |
| 1077 | |
| 1078 | @return Result of the function call |
| 1079 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1080 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1081 | WDI_Init |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1082 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1083 | void* pOSContext, |
| 1084 | void** ppWDIGlobalCtx, |
| 1085 | WDI_DeviceCapabilityType* pWdiDevCapability, |
| 1086 | unsigned int driverType |
| 1087 | ) |
| 1088 | { |
| 1089 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1090 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1091 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1092 | WCTS_TransportCBsType wctsCBs; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1093 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 1094 | |
| 1095 | /*--------------------------------------------------------------------- |
| 1096 | Sanity check |
| 1097 | ---------------------------------------------------------------------*/ |
| 1098 | if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability )) |
| 1099 | { |
| 1100 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1101 | "Invalid input parameters in WDI_Init"); |
| 1102 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1103 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1104 | } |
| 1105 | |
| 1106 | /*--------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1107 | Check to see if the module has already been initialized or not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1108 | ---------------------------------------------------------------------*/ |
| 1109 | if ( eWLAN_PAL_FALSE != gWDIInitialized ) |
| 1110 | { |
| 1111 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1112 | "WDI module already initialized - return"); |
| 1113 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1114 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1115 | } |
| 1116 | |
| 1117 | /*Module is now initialized - this flag is to ensure the fact that multiple |
| 1118 | init will not happen on WDI |
| 1119 | !! - potential race does exist because read and set are not atomic, |
| 1120 | however an atomic operation would be closely here - reanalyze if necessary*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1121 | gWDIInitialized = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1122 | |
| 1123 | /*Setup the control block */ |
| 1124 | WDI_CleanCB(&gWDICb); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1125 | gWDICb.pOSContext = pOSContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1126 | |
| 1127 | /*Setup the STA Table*/ |
| 1128 | wdiStatus = WDI_STATableInit(&gWDICb); |
| 1129 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1130 | { |
| 1131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1132 | "%s: Failure while initializing STA Table, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1133 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1134 | goto fail_STATableInit; |
| 1135 | } |
| 1136 | |
| 1137 | /*------------------------------------------------------------------------ |
| 1138 | Open the PAL |
| 1139 | ------------------------------------------------------------------------*/ |
| 1140 | wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext); |
| 1141 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1142 | { |
| 1143 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1144 | "%s: Failed to open PAL, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1145 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1146 | goto fail_wpalOpen; |
| 1147 | } |
| 1148 | |
| 1149 | /*Initialize main synchro mutex - it will be used to ensure integrity of |
| 1150 | the main WDI Control Block*/ |
| 1151 | wptStatus = wpalMutexInit(&gWDICb.wptMutex); |
| 1152 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1153 | { |
| 1154 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1155 | "%s: Failed to init mutex, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1156 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1157 | goto fail_mutex; |
| 1158 | } |
| 1159 | |
| 1160 | /*Initialize the response timer - it will be used to time all messages |
| 1161 | expected as response from device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1162 | wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer, |
| 1163 | WDI_ResponseTimerCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1164 | &gWDICb); |
| 1165 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1166 | { |
| 1167 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1168 | "%s: Failed to init response timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1169 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1170 | goto fail_timer; |
| 1171 | } |
| 1172 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1173 | wptStatus = wpalTimerInit( &gWDICb.ssrTimer, |
| 1174 | WDI_SsrTimerCB, |
| 1175 | &gWDICb); |
| 1176 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1177 | { |
| 1178 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1179 | "%s: Failed to init SSR timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1180 | __func__, wptStatus); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1181 | goto fail_timer2; |
| 1182 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1183 | /* Initialize the WDI Pending Request Queue*/ |
| 1184 | wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue)); |
| 1185 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1186 | { |
| 1187 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1188 | "%s: Failed to init pending request queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1189 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | goto fail_pend_queue; |
| 1191 | } |
| 1192 | |
| 1193 | /*Init WDI Pending Assoc Id Queue */ |
| 1194 | wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1195 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1196 | { |
| 1197 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1198 | "%s: Failed to init assoc session queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1199 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1200 | goto fail_assoc_queue; |
| 1201 | } |
| 1202 | |
| 1203 | /*Initialize the BSS sessions pending Queue */ |
| 1204 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1205 | { |
| 1206 | wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1207 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1208 | { |
| 1209 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1210 | "%s: Failed to init BSS %d pending queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1211 | __func__, i, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1212 | goto fail_bss_queue; |
| 1213 | } |
| 1214 | } |
| 1215 | |
| 1216 | /*Indicate the control block is sufficiently initialized for callbacks*/ |
| 1217 | gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC; |
| 1218 | |
| 1219 | /*------------------------------------------------------------------------ |
| 1220 | Initialize the Data Path Utility Module |
| 1221 | ------------------------------------------------------------------------*/ |
| 1222 | wdiStatus = WDI_DP_UtilsInit(&gWDICb); |
| 1223 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1224 | { |
| 1225 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1226 | "%s: Failed to initialize the DP Util Module, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1227 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1228 | goto fail_dp_util_init; |
| 1229 | } |
| 1230 | |
| 1231 | /* Init Set power state event */ |
| 1232 | wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1233 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1234 | { |
| 1235 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1236 | "%s: Failed to initialize power state event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1237 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1238 | goto fail_power_event; |
| 1239 | } |
| 1240 | |
| 1241 | /* Init WCTS action event */ |
| 1242 | wptStatus = wpalEventInit(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1243 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1244 | { |
| 1245 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1246 | "%s: Failed to initialize WCTS action event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1247 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1248 | goto fail_wcts_event; |
| 1249 | } |
| 1250 | |
| 1251 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1252 | Open the Transport Services for Control and Data |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1253 | ------------------------------------------------------------------------*/ |
| 1254 | wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB; |
| 1255 | wctsCBs.wctsNotifyCBData = &gWDICb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1256 | wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1257 | wctsCBs.wctsRxMsgCBData = &gWDICb; |
| 1258 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1259 | gWDICb.bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1260 | gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1261 | WDI_CT_CHANNEL_SIZE, |
| 1262 | &wctsCBs ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1263 | |
| 1264 | if ( NULL == gWDICb.wctsHandle ) |
| 1265 | { |
| 1266 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1267 | "%s: Failed to open WCTS transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1268 | goto fail_wcts_open; |
| 1269 | } |
| 1270 | |
| 1271 | gWDICb.driverMode = (tDriverType)driverType; |
| 1272 | /* FTM mode not need to open Transport Driver */ |
| 1273 | if(eDRIVER_TYPE_MFG != (tDriverType)driverType) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1274 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1275 | /*------------------------------------------------------------------------ |
| 1276 | Open the Data Transport |
| 1277 | ------------------------------------------------------------------------*/ |
| 1278 | if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb)) |
| 1279 | { |
| 1280 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1281 | "%s: Failed to open the DT Transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1282 | goto fail_wdts_open; |
| 1283 | } |
| 1284 | } |
| 1285 | |
| 1286 | /*The WDI is initialized - set state to init */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1287 | gWDICb.uGlobalState = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1288 | |
| 1289 | /*Send the context as a ptr to the global WDI Control Block*/ |
| 1290 | *ppWDIGlobalCtx = &gWDICb; |
| 1291 | |
| 1292 | /*Fill in the device capabilities*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1293 | pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1294 | pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations; |
| 1295 | pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids; |
| 1296 | return WDI_STATUS_SUCCESS; |
| 1297 | |
| 1298 | /* ERROR handlers |
| 1299 | Undo everything that completed successfully */ |
| 1300 | |
| 1301 | fail_wdts_open: |
| 1302 | { |
| 1303 | wpt_status eventStatus; |
| 1304 | |
| 1305 | /* Closing WCTS in this scenario is tricky since it has to close |
| 1306 | the SMD channel and then we get notified asynchronously when |
| 1307 | the channel has been closed. So we take some of the logic from |
| 1308 | the "normal" close procedure in WDI_Close() |
| 1309 | */ |
| 1310 | |
| 1311 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1312 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1313 | { |
| 1314 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1315 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1316 | } |
| 1317 | |
| 1318 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1319 | |
| 1320 | /* Wait for WCTS to close the control transport. If we were able |
| 1321 | to reset the event flag, then we'll wait for the event, |
| 1322 | otherwise we'll wait for a maximum amount of time required for |
| 1323 | the channel to be closed */ |
| 1324 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1325 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1326 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1327 | WDI_WCTS_ACTION_TIMEOUT); |
| 1328 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1329 | { |
| 1330 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1331 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1332 | } |
| 1333 | } |
| 1334 | else |
| 1335 | { |
| 1336 | wpalSleep(WDI_WCTS_ACTION_TIMEOUT); |
| 1337 | } |
| 1338 | } |
| 1339 | fail_wcts_open: |
| 1340 | wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1341 | fail_wcts_event: |
| 1342 | wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1343 | fail_power_event: |
| 1344 | WDI_DP_UtilsExit(&gWDICb); |
| 1345 | fail_dp_util_init: |
| 1346 | gWDICb.magic = 0; |
| 1347 | fail_bss_queue: |
| 1348 | /* entries 0 thru i-1 were successfully initialized */ |
| 1349 | while (0 < i) |
| 1350 | { |
| 1351 | i--; |
| 1352 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1353 | } |
| 1354 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1355 | fail_assoc_queue: |
| 1356 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1357 | fail_pend_queue: |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1358 | wpalTimerDelete(&gWDICb.ssrTimer); |
| 1359 | fail_timer2: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1360 | wpalTimerDelete(&gWDICb.wptResponseTimer); |
| 1361 | fail_timer: |
| 1362 | wpalMutexDelete(&gWDICb.wptMutex); |
| 1363 | fail_mutex: |
| 1364 | wpalClose(gWDICb.pPALContext); |
| 1365 | fail_wpalOpen: |
| 1366 | WDI_STATableClose(&gWDICb); |
| 1367 | fail_STATableInit: |
| 1368 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1369 | |
| 1370 | return WDI_STATUS_E_FAILURE; |
| 1371 | |
| 1372 | }/*WDI_Init*/; |
| 1373 | |
| 1374 | /** |
| 1375 | @brief WDI_Start will be called when the upper MAC is ready to |
| 1376 | commence operation with the WLAN Device. Upon the call |
| 1377 | of this API the WLAN DAL will pack and send a HAL Start |
| 1378 | message to the lower RIVA sub-system if the SMD channel |
| 1379 | has been fully opened and the RIVA subsystem is up. |
| 1380 | |
| 1381 | If the RIVA sub-system is not yet up and running DAL |
| 1382 | will queue the request for Open and will wait for the |
| 1383 | SMD notification before attempting to send down the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1384 | message to HAL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1385 | |
| 1386 | WDI_Init must have been called. |
| 1387 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1388 | @param wdiStartParams: the start parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1389 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1390 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1391 | wdiStartRspCb: callback for passing back the response of |
| 1392 | the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1393 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1394 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1395 | callback |
| 1396 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1397 | @see WDI_Start |
| 1398 | @return Result of the function call |
| 1399 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1400 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1401 | WDI_Start |
| 1402 | ( |
| 1403 | WDI_StartReqParamsType* pwdiStartParams, |
| 1404 | WDI_StartRspCb wdiStartRspCb, |
| 1405 | void* pUserData |
| 1406 | ) |
| 1407 | { |
| 1408 | WDI_EventInfoType wdiEventData; |
| 1409 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1410 | |
| 1411 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1412 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1413 | ------------------------------------------------------------------------*/ |
| 1414 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1415 | { |
| 1416 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1417 | "WDI API call before module is initialized - Fail request"); |
| 1418 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1419 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1420 | } |
| 1421 | |
| 1422 | /*------------------------------------------------------------------------ |
| 1423 | Fill in Event data and post to the Main FSM |
| 1424 | ------------------------------------------------------------------------*/ |
| 1425 | wdiEventData.wdiRequest = WDI_START_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1426 | wdiEventData.pEventData = pwdiStartParams; |
| 1427 | wdiEventData.uEventDataSize = sizeof(*pwdiStartParams); |
| 1428 | wdiEventData.pCBfnc = wdiStartRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1429 | wdiEventData.pUserData = pUserData; |
| 1430 | |
| 1431 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1432 | |
| 1433 | }/*WDI_Start*/ |
| 1434 | |
| 1435 | /** |
| 1436 | @brief WDI_Stop will be called when the upper MAC is ready to |
| 1437 | stop any operation with the WLAN Device. Upon the call |
| 1438 | of this API the WLAN DAL will pack and send a HAL Stop |
| 1439 | message to the lower RIVA sub-system if the DAL Core is |
| 1440 | in started state. |
| 1441 | |
| 1442 | In state BUSY this request will be queued. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1443 | |
| 1444 | Request will not be accepted in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1445 | |
| 1446 | WDI_Start must have been called. |
| 1447 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1448 | @param wdiStopParams: the stop parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1449 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1450 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1451 | wdiStopRspCb: callback for passing back the response of |
| 1452 | the stop operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1453 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1455 | callback |
| 1456 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1457 | @see WDI_Start |
| 1458 | @return Result of the function call |
| 1459 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1460 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1461 | WDI_Stop |
| 1462 | ( |
| 1463 | WDI_StopReqParamsType* pwdiStopParams, |
| 1464 | WDI_StopRspCb wdiStopRspCb, |
| 1465 | void* pUserData |
| 1466 | ) |
| 1467 | { |
| 1468 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1469 | WDI_ControlBlockType* pWDICtx = &gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1470 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1471 | |
| 1472 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1473 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1474 | ------------------------------------------------------------------------*/ |
| 1475 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1476 | { |
| 1477 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1478 | "WDI API call before module is initialized - Fail request"); |
| 1479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1480 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1481 | } |
| 1482 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1483 | /*Access to the global state must be locked before cleaning */ |
| 1484 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 1485 | |
| 1486 | /*Clear all pending request*/ |
| 1487 | WDI_ClearPendingRequests(pWDICtx); |
| 1488 | |
| 1489 | /*We have completed cleaning unlock now*/ |
| 1490 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 1491 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1492 | /* Free the global variables */ |
| 1493 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1494 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1495 | gpHostWlanFeatCaps = NULL; |
| 1496 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1497 | |
| 1498 | /*------------------------------------------------------------------------ |
| 1499 | Fill in Event data and post to the Main FSM |
| 1500 | ------------------------------------------------------------------------*/ |
| 1501 | wdiEventData.wdiRequest = WDI_STOP_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1502 | wdiEventData.pEventData = pwdiStopParams; |
| 1503 | wdiEventData.uEventDataSize = sizeof(*pwdiStopParams); |
| 1504 | wdiEventData.pCBfnc = wdiStopRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1505 | wdiEventData.pUserData = pUserData; |
| 1506 | |
| 1507 | return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData); |
| 1508 | |
| 1509 | }/*WDI_Stop*/ |
| 1510 | |
| 1511 | |
| 1512 | |
| 1513 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1514 | @brief WDI_Close will be called when the upper MAC no longer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1515 | needs to interact with DAL. DAL will free its control |
| 1516 | block. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1517 | |
| 1518 | It is only accepted in state STOPPED. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1519 | |
| 1520 | WDI_Stop must have been called. |
| 1521 | |
| 1522 | @param none |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1523 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1524 | @see WDI_Stop |
| 1525 | @return Result of the function call |
| 1526 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1527 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1528 | WDI_Close |
| 1529 | ( |
| 1530 | void |
| 1531 | ) |
| 1532 | { |
| 1533 | wpt_uint8 i; |
| 1534 | WDI_EventInfoType wdiEventData; |
| 1535 | wpt_status wptStatus; |
| 1536 | wpt_status eventStatus; |
| 1537 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1538 | |
| 1539 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1540 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1541 | ------------------------------------------------------------------------*/ |
| 1542 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1543 | { |
| 1544 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1545 | "WDI API call before module is initialized - Fail request"); |
| 1546 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1547 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1548 | } |
| 1549 | |
| 1550 | /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ |
| 1551 | (the control transport will be closed by the FSM and we'll want |
| 1552 | to wait until that completes)*/ |
| 1553 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1554 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1555 | { |
| 1556 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1557 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1558 | /* fall through and try to finish closing via the FSM */ |
| 1559 | } |
| 1560 | |
| 1561 | /*------------------------------------------------------------------------ |
| 1562 | Fill in Event data and post to the Main FSM |
| 1563 | ------------------------------------------------------------------------*/ |
| 1564 | wdiEventData.wdiRequest = WDI_CLOSE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1565 | wdiEventData.pEventData = NULL; |
| 1566 | wdiEventData.uEventDataSize = 0; |
| 1567 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1568 | wdiEventData.pUserData = NULL; |
| 1569 | |
| 1570 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1571 | |
| 1572 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData); |
| 1573 | |
| 1574 | /*Wait for WCTS to close the control transport |
| 1575 | (but only if we were able to reset the event flag*/ |
| 1576 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1577 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1578 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1579 | WDI_WCTS_ACTION_TIMEOUT); |
| 1580 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1581 | { |
| 1582 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1583 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1584 | } |
| 1585 | } |
| 1586 | |
| 1587 | /* Destroy the WCTS action event */ |
| 1588 | wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1589 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1590 | { |
| 1591 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1592 | "WDI Close failed to destroy an event"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1593 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1594 | } |
| 1595 | |
| 1596 | /* Destroy the Set Power State event */ |
| 1597 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1598 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1599 | { |
| 1600 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1601 | "WDI Close failed to destroy an event"); |
| 1602 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1603 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1604 | } |
| 1605 | |
| 1606 | /*------------------------------------------------------------------------ |
| 1607 | Closes the Data Path Utility Module |
| 1608 | ------------------------------------------------------------------------*/ |
| 1609 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1610 | { |
| 1611 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1612 | "WDI Init failed to close the DP Util Module"); |
| 1613 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1614 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1615 | } |
| 1616 | |
| 1617 | /*destroy the BSS sessions pending Queue */ |
| 1618 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1619 | { |
| 1620 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1621 | } |
| 1622 | |
| 1623 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1624 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1625 | |
| 1626 | /* destroy the WDI Pending Request Queue*/ |
| 1627 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1628 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1629 | /*destroy the response timer */ |
| 1630 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
| 1631 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1632 | /*destroy the SSR timer */ |
| 1633 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
| 1634 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1635 | /*invalidate the main synchro mutex */ |
| 1636 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1637 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1638 | { |
| 1639 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1640 | "Failed to delete mutex %d", wptStatus); |
| 1641 | WDI_ASSERT(0); |
| 1642 | } |
| 1643 | |
| 1644 | /*Clear control block. note that this will clear the "magic" |
| 1645 | which will inhibit all asynchronous callbacks*/ |
| 1646 | WDI_CleanCB(&gWDICb); |
| 1647 | |
| 1648 | return wptStatus; |
| 1649 | |
| 1650 | }/*WDI_Close*/ |
| 1651 | |
| 1652 | /** |
| 1653 | @brief WDI_Shutdown will be called during 'SSR shutdown' operation. |
| 1654 | This will do most of the WDI stop & close |
| 1655 | operations without doing any handshake with Riva |
| 1656 | |
| 1657 | This will also make sure that the control transport |
| 1658 | will NOT be closed. |
| 1659 | |
| 1660 | This request will not be queued. |
| 1661 | |
| 1662 | |
| 1663 | WDI_Start must have been called. |
| 1664 | |
| 1665 | @param closeTransport: Close control channel if this is set |
| 1666 | |
| 1667 | @return Result of the function call |
| 1668 | */ |
| 1669 | WDI_Status |
| 1670 | WDI_Shutdown |
| 1671 | ( |
| 1672 | wpt_boolean closeTransport |
| 1673 | ) |
| 1674 | { |
| 1675 | WDI_EventInfoType wdiEventData; |
| 1676 | wpt_status wptStatus; |
| 1677 | int i = 0; |
| 1678 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1679 | |
| 1680 | /*------------------------------------------------------------------------ |
| 1681 | Sanity Check |
| 1682 | ------------------------------------------------------------------------*/ |
| 1683 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1684 | { |
| 1685 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1686 | "WDI API call before module is initialized - Fail request"); |
| 1687 | |
| 1688 | return WDI_STATUS_E_NOT_ALLOWED; |
| 1689 | } |
| 1690 | |
| 1691 | /*------------------------------------------------------------------------ |
| 1692 | Fill in Event data and post to the Main FSM |
| 1693 | ------------------------------------------------------------------------*/ |
| 1694 | wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ; |
| 1695 | wdiEventData.pEventData = NULL; |
| 1696 | wdiEventData.uEventDataSize = 0; |
| 1697 | |
| 1698 | /* Shutdown will not be queued, if the state is busy timer will be |
| 1699 | * stopped & this message will be processed.*/ |
| 1700 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData); |
| 1701 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1702 | { |
| 1703 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1704 | "%s: Failed to process shutdown event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1705 | } |
| 1706 | /* Destroy the Set Power State event */ |
| 1707 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1708 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1709 | { |
| 1710 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1711 | "WDI Close failed to destroy an event"); |
| 1712 | |
| 1713 | WDI_ASSERT(0); |
| 1714 | } |
| 1715 | /*------------------------------------------------------------------------ |
| 1716 | Closes the Data Path Utility Module |
| 1717 | ------------------------------------------------------------------------*/ |
| 1718 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1719 | { |
| 1720 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1721 | "WDI Init failed to close the DP Util Module"); |
| 1722 | |
| 1723 | WDI_ASSERT(0); |
| 1724 | } |
| 1725 | if ( closeTransport ) |
| 1726 | { |
| 1727 | /* Close control transport, called from module unload */ |
| 1728 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1729 | } |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1730 | else |
| 1731 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 1732 | /* Riva is crashed then SMD is already closed so cleaning all |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1733 | the pending messages in the transport queue */ |
| 1734 | WCTS_ClearPendingQueue(gWDICb.wctsHandle); |
| 1735 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1736 | /*destroy the BSS sessions pending Queue */ |
| 1737 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1738 | { |
| 1739 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1740 | } |
| 1741 | |
| 1742 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1743 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1744 | /* destroy the WDI Pending Request Queue*/ |
| 1745 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1746 | /*destroy the response timer */ |
| 1747 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1748 | /*destroy the SSR timer */ |
| 1749 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1750 | |
| 1751 | /*invalidate the main synchro mutex */ |
| 1752 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1753 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1754 | { |
| 1755 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1756 | "%s: Failed to delete mutex %d", __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1757 | WDI_ASSERT(0); |
| 1758 | } |
Madan Mohan Koyyalamudi | 3513bf5 | 2012-09-18 17:35:53 -0700 | [diff] [blame] | 1759 | /* Free the global variables */ |
| 1760 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1761 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1762 | gpHostWlanFeatCaps = NULL; |
| 1763 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1764 | /*Clear control block. note that this will clear the "magic" |
| 1765 | which will inhibit all asynchronous callbacks*/ |
| 1766 | WDI_CleanCB(&gWDICb); |
| 1767 | return wptStatus; |
| 1768 | |
| 1769 | }/*WDI_Shutdown*/ |
| 1770 | |
| 1771 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1772 | /*======================================================================== |
| 1773 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1774 | SCAN APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1775 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1776 | ==========================================================================*/ |
| 1777 | |
| 1778 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1779 | @brief WDI_InitScanReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1780 | the WLAN Device to get ready for a scan procedure. Upon |
| 1781 | the call of this API the WLAN DAL will pack and send a |
| 1782 | HAL Init Scan request message to the lower RIVA |
| 1783 | sub-system if DAL is in state STARTED. |
| 1784 | |
| 1785 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1786 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1787 | |
| 1788 | WDI_Start must have been called. |
| 1789 | |
| 1790 | @param wdiInitScanParams: the init scan parameters as specified |
| 1791 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1793 | wdiInitScanRspCb: callback for passing back the response |
| 1794 | of the init scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1795 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1796 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1797 | callback |
| 1798 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1799 | @see WDI_Start |
| 1800 | @return Result of the function call |
| 1801 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1802 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1803 | WDI_InitScanReq |
| 1804 | ( |
| 1805 | WDI_InitScanReqParamsType* pwdiInitScanParams, |
| 1806 | WDI_InitScanRspCb wdiInitScanRspCb, |
| 1807 | void* pUserData |
| 1808 | ) |
| 1809 | { |
| 1810 | WDI_EventInfoType wdiEventData; |
| 1811 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1812 | |
| 1813 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1814 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1815 | ------------------------------------------------------------------------*/ |
| 1816 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1817 | { |
| 1818 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1819 | "WDI API call before module is initialized - Fail request"); |
| 1820 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1821 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1822 | } |
| 1823 | |
| 1824 | /*------------------------------------------------------------------------ |
| 1825 | Fill in Event data and post to the Main FSM |
| 1826 | ------------------------------------------------------------------------*/ |
| 1827 | wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1828 | wdiEventData.pEventData = pwdiInitScanParams; |
| 1829 | wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams); |
| 1830 | wdiEventData.pCBfnc = wdiInitScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1831 | wdiEventData.pUserData = pUserData; |
| 1832 | |
| 1833 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1834 | |
| 1835 | }/*WDI_InitScanReq*/ |
| 1836 | |
| 1837 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1838 | @brief WDI_StartScanReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1839 | wishes to change the Scan channel on the WLAN Device. |
| 1840 | Upon the call of this API the WLAN DAL will pack and |
| 1841 | send a HAL Start Scan request message to the lower RIVA |
| 1842 | sub-system if DAL is in state STARTED. |
| 1843 | |
| 1844 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1845 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1846 | |
| 1847 | WDI_InitScanReq must have been called. |
| 1848 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1849 | @param wdiStartScanParams: the start scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1850 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1851 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1852 | wdiStartScanRspCb: callback for passing back the |
| 1853 | response of the start scan operation received from the |
| 1854 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1855 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1856 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1857 | callback |
| 1858 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1859 | @see WDI_InitScanReq |
| 1860 | @return Result of the function call |
| 1861 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1862 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1863 | WDI_StartScanReq |
| 1864 | ( |
| 1865 | WDI_StartScanReqParamsType* pwdiStartScanParams, |
| 1866 | WDI_StartScanRspCb wdiStartScanRspCb, |
| 1867 | void* pUserData |
| 1868 | ) |
| 1869 | { |
| 1870 | WDI_EventInfoType wdiEventData; |
| 1871 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1872 | |
| 1873 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1874 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1875 | ------------------------------------------------------------------------*/ |
| 1876 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1877 | { |
| 1878 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1879 | "WDI API call before module is initialized - Fail request"); |
| 1880 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1881 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1882 | } |
| 1883 | |
| 1884 | /*------------------------------------------------------------------------ |
| 1885 | Fill in Event data and post to the Main FSM |
| 1886 | ------------------------------------------------------------------------*/ |
| 1887 | wdiEventData.wdiRequest = WDI_START_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1888 | wdiEventData.pEventData = pwdiStartScanParams; |
| 1889 | wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams); |
| 1890 | wdiEventData.pCBfnc = wdiStartScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1891 | wdiEventData.pUserData = pUserData; |
| 1892 | |
| 1893 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1894 | |
| 1895 | }/*WDI_StartScanReq*/ |
| 1896 | |
| 1897 | |
| 1898 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1899 | @brief WDI_EndScanReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1900 | wants to end scanning for a particular channel that it |
| 1901 | had set before by calling Scan Start on the WLAN Device. |
| 1902 | Upon the call of this API the WLAN DAL will pack and |
| 1903 | send a HAL End Scan request message to the lower RIVA |
| 1904 | sub-system if DAL is in state STARTED. |
| 1905 | |
| 1906 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1907 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1908 | |
| 1909 | WDI_StartScanReq must have been called. |
| 1910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1911 | @param wdiEndScanParams: the end scan parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1912 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1913 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1914 | wdiEndScanRspCb: callback for passing back the response |
| 1915 | of the end scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1917 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1918 | callback |
| 1919 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1920 | @see WDI_StartScanReq |
| 1921 | @return Result of the function call |
| 1922 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1923 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1924 | WDI_EndScanReq |
| 1925 | ( |
| 1926 | WDI_EndScanReqParamsType* pwdiEndScanParams, |
| 1927 | WDI_EndScanRspCb wdiEndScanRspCb, |
| 1928 | void* pUserData |
| 1929 | ) |
| 1930 | { |
| 1931 | WDI_EventInfoType wdiEventData; |
| 1932 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1933 | |
| 1934 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1935 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1936 | ------------------------------------------------------------------------*/ |
| 1937 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1938 | { |
| 1939 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1940 | "WDI API call before module is initialized - Fail request"); |
| 1941 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1942 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1943 | } |
| 1944 | |
| 1945 | /*------------------------------------------------------------------------ |
| 1946 | Fill in Event data and post to the Main FSM |
| 1947 | ------------------------------------------------------------------------*/ |
| 1948 | wdiEventData.wdiRequest = WDI_END_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1949 | wdiEventData.pEventData = pwdiEndScanParams; |
| 1950 | wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams); |
| 1951 | wdiEventData.pCBfnc = wdiEndScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1952 | wdiEventData.pUserData = pUserData; |
| 1953 | |
| 1954 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1955 | |
| 1956 | }/*WDI_EndScanReq*/ |
| 1957 | |
| 1958 | |
| 1959 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1960 | @brief WDI_FinishScanReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1961 | completed the scan process on the WLAN Device. Upon the |
| 1962 | call of this API the WLAN DAL will pack and send a HAL |
| 1963 | Finish Scan Request request message to the lower RIVA |
| 1964 | sub-system if DAL is in state STARTED. |
| 1965 | |
| 1966 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1967 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1968 | |
| 1969 | WDI_InitScanReq must have been called. |
| 1970 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1971 | @param wdiFinishScanParams: the finish scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1972 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1974 | wdiFinishScanRspCb: callback for passing back the |
| 1975 | response of the finish scan operation received from the |
| 1976 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1977 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1978 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1979 | callback |
| 1980 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1981 | @see WDI_InitScanReq |
| 1982 | @return Result of the function call |
| 1983 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1984 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1985 | WDI_FinishScanReq |
| 1986 | ( |
| 1987 | WDI_FinishScanReqParamsType* pwdiFinishScanParams, |
| 1988 | WDI_FinishScanRspCb wdiFinishScanRspCb, |
| 1989 | void* pUserData |
| 1990 | ) |
| 1991 | { |
| 1992 | WDI_EventInfoType wdiEventData; |
| 1993 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1994 | |
| 1995 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1996 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1997 | ------------------------------------------------------------------------*/ |
| 1998 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1999 | { |
| 2000 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2001 | "WDI API call before module is initialized - Fail request"); |
| 2002 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2003 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | } |
| 2005 | |
| 2006 | /*------------------------------------------------------------------------ |
| 2007 | Fill in Event data and post to the Main FSM |
| 2008 | ------------------------------------------------------------------------*/ |
| 2009 | wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2010 | wdiEventData.pEventData = pwdiFinishScanParams; |
| 2011 | wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams); |
| 2012 | wdiEventData.pCBfnc = wdiFinishScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2013 | wdiEventData.pUserData = pUserData; |
| 2014 | |
| 2015 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2016 | |
| 2017 | }/*WDI_FinishScanReq*/ |
| 2018 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2019 | /*======================================================================== |
| 2020 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2021 | ASSOCIATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2022 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2023 | ==========================================================================*/ |
| 2024 | |
| 2025 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2026 | @brief WDI_JoinReq will be called when the upper MAC is ready |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2027 | to start an association procedure to a BSS. Upon the |
| 2028 | call of this API the WLAN DAL will pack and send a HAL |
| 2029 | Join request message to the lower RIVA sub-system if |
| 2030 | DAL is in state STARTED. |
| 2031 | |
| 2032 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2033 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2034 | |
| 2035 | WDI_Start must have been called. |
| 2036 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2037 | @param wdiJoinParams: the join parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2039 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2040 | wdiJoinRspCb: callback for passing back the response of |
| 2041 | the join operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2042 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2043 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2044 | callback |
| 2045 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2046 | @see WDI_Start |
| 2047 | @return Result of the function call |
| 2048 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2049 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2050 | WDI_JoinReq |
| 2051 | ( |
| 2052 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 2053 | WDI_JoinRspCb wdiJoinRspCb, |
| 2054 | void* pUserData |
| 2055 | ) |
| 2056 | { |
| 2057 | WDI_EventInfoType wdiEventData; |
| 2058 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2059 | |
| 2060 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2061 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2062 | ------------------------------------------------------------------------*/ |
| 2063 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2064 | { |
| 2065 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2066 | "WDI API call before module is initialized - Fail request"); |
| 2067 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2068 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2069 | } |
| 2070 | |
| 2071 | /*------------------------------------------------------------------------ |
| 2072 | Fill in Event data and post to the Main FSM |
| 2073 | ------------------------------------------------------------------------*/ |
| 2074 | wdiEventData.wdiRequest = WDI_JOIN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2075 | wdiEventData.pEventData = pwdiJoinParams; |
| 2076 | wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams); |
| 2077 | wdiEventData.pCBfnc = wdiJoinRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2078 | wdiEventData.pUserData = pUserData; |
| 2079 | |
| 2080 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2081 | |
| 2082 | }/*WDI_JoinReq*/ |
| 2083 | |
| 2084 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2085 | @brief WDI_ConfigBSSReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2086 | wishes to configure the newly acquired or in process of |
| 2087 | being acquired BSS to the HW . Upon the call of this API |
| 2088 | the WLAN DAL will pack and send a HAL Config BSS request |
| 2089 | message to the lower RIVA sub-system if DAL is in state |
| 2090 | STARTED. |
| 2091 | |
| 2092 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2093 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2094 | |
| 2095 | WDI_JoinReq must have been called. |
| 2096 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2097 | @param wdiConfigBSSParams: the config BSS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2098 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2099 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2100 | wdiConfigBSSRspCb: callback for passing back the |
| 2101 | response of the config BSS operation received from the |
| 2102 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2103 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2104 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2105 | callback |
| 2106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2107 | @see WDI_JoinReq |
| 2108 | @return Result of the function call |
| 2109 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2110 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2111 | WDI_ConfigBSSReq |
| 2112 | ( |
| 2113 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams, |
| 2114 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb, |
| 2115 | void* pUserData |
| 2116 | ) |
| 2117 | { |
| 2118 | WDI_EventInfoType wdiEventData; |
| 2119 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2120 | |
| 2121 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2122 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2123 | ------------------------------------------------------------------------*/ |
| 2124 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2125 | { |
| 2126 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2127 | "WDI API call before module is initialized - Fail request"); |
| 2128 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2129 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2130 | } |
| 2131 | |
| 2132 | /*------------------------------------------------------------------------ |
| 2133 | Fill in Event data and post to the Main FSM |
| 2134 | ------------------------------------------------------------------------*/ |
| 2135 | wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2136 | wdiEventData.pEventData = pwdiConfigBSSParams; |
| 2137 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams); |
| 2138 | wdiEventData.pCBfnc = wdiConfigBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2139 | wdiEventData.pUserData = pUserData; |
| 2140 | |
| 2141 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2142 | |
| 2143 | }/*WDI_ConfigBSSReq*/ |
| 2144 | |
| 2145 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2146 | @brief WDI_DelBSSReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2147 | disassociating from the BSS and wishes to notify HW. |
| 2148 | Upon the call of this API the WLAN DAL will pack and |
| 2149 | send a HAL Del BSS request message to the lower RIVA |
| 2150 | sub-system if DAL is in state STARTED. |
| 2151 | |
| 2152 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2153 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2154 | |
| 2155 | WDI_ConfigBSSReq or WDI_PostAssocReq must have been called. |
| 2156 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2157 | @param wdiDelBSSParams: the del BSS parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2158 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2159 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2160 | wdiDelBSSRspCb: callback for passing back the response |
| 2161 | of the del bss operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2162 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2163 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2164 | callback |
| 2165 | |
| 2166 | @see WDI_ConfigBSSReq, WDI_PostAssocReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2167 | @return Result of the function call |
| 2168 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2169 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2170 | WDI_DelBSSReq |
| 2171 | ( |
| 2172 | WDI_DelBSSReqParamsType* pwdiDelBSSParams, |
| 2173 | WDI_DelBSSRspCb wdiDelBSSRspCb, |
| 2174 | void* pUserData |
| 2175 | ) |
| 2176 | { |
| 2177 | WDI_EventInfoType wdiEventData; |
| 2178 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2179 | |
| 2180 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2181 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2182 | ------------------------------------------------------------------------*/ |
| 2183 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2184 | { |
| 2185 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2186 | "WDI API call before module is initialized - Fail request"); |
| 2187 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2188 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2189 | } |
| 2190 | |
| 2191 | /*------------------------------------------------------------------------ |
| 2192 | Fill in Event data and post to the Main FSM |
| 2193 | ------------------------------------------------------------------------*/ |
| 2194 | wdiEventData.wdiRequest = WDI_DEL_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2195 | wdiEventData.pEventData = pwdiDelBSSParams; |
| 2196 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams); |
| 2197 | wdiEventData.pCBfnc = wdiDelBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2198 | wdiEventData.pUserData = pUserData; |
| 2199 | |
| 2200 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2201 | |
| 2202 | }/*WDI_DelBSSReq*/ |
| 2203 | |
| 2204 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2205 | @brief WDI_PostAssocReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2206 | associated to a BSS and wishes to configure HW for |
| 2207 | associated state. Upon the call of this API the WLAN DAL |
| 2208 | will pack and send a HAL Post Assoc request message to |
| 2209 | the lower RIVA sub-system if DAL is in state STARTED. |
| 2210 | |
| 2211 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2212 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2213 | |
| 2214 | WDI_JoinReq must have been called. |
| 2215 | |
| 2216 | @param wdiPostAssocReqParams: the assoc parameters as specified |
| 2217 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2218 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2219 | wdiPostAssocRspCb: callback for passing back the |
| 2220 | response of the post assoc operation received from the |
| 2221 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2222 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2223 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2224 | callback |
| 2225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2226 | @see WDI_JoinReq |
| 2227 | @return Result of the function call |
| 2228 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2229 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2230 | WDI_PostAssocReq |
| 2231 | ( |
| 2232 | WDI_PostAssocReqParamsType* pwdiPostAssocReqParams, |
| 2233 | WDI_PostAssocRspCb wdiPostAssocRspCb, |
| 2234 | void* pUserData |
| 2235 | ) |
| 2236 | { |
| 2237 | WDI_EventInfoType wdiEventData; |
| 2238 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2239 | |
| 2240 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2241 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2242 | ------------------------------------------------------------------------*/ |
| 2243 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2244 | { |
| 2245 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2246 | "WDI API call before module is initialized - Fail request"); |
| 2247 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2248 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2249 | } |
| 2250 | |
| 2251 | /*------------------------------------------------------------------------ |
| 2252 | Fill in Event data and post to the Main FSM |
| 2253 | ------------------------------------------------------------------------*/ |
| 2254 | wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2255 | wdiEventData.pEventData = pwdiPostAssocReqParams; |
| 2256 | wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams); |
| 2257 | wdiEventData.pCBfnc = wdiPostAssocRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2258 | wdiEventData.pUserData = pUserData; |
| 2259 | |
| 2260 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2261 | |
| 2262 | }/*WDI_PostAssocReq*/ |
| 2263 | |
| 2264 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2265 | @brief WDI_DelSTAReq will be called when the upper MAC when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2266 | association with another STA has ended and the station |
| 2267 | must be deleted from HW. Upon the call of this API the |
| 2268 | WLAN DAL will pack and send a HAL Del STA request |
| 2269 | message to the lower RIVA sub-system if DAL is in state |
| 2270 | STARTED. |
| 2271 | |
| 2272 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2273 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2274 | |
| 2275 | WDI_PostAssocReq must have been called. |
| 2276 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2277 | @param wdiDelSTAParams: the Del STA parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2278 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2279 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2280 | wdiDelSTARspCb: callback for passing back the response |
| 2281 | of the del STA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2284 | callback |
| 2285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2286 | @see WDI_PostAssocReq |
| 2287 | @return Result of the function call |
| 2288 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2289 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2290 | WDI_DelSTAReq |
| 2291 | ( |
| 2292 | WDI_DelSTAReqParamsType* pwdiDelSTAParams, |
| 2293 | WDI_DelSTARspCb wdiDelSTARspCb, |
| 2294 | void* pUserData |
| 2295 | ) |
| 2296 | { |
| 2297 | WDI_EventInfoType wdiEventData; |
| 2298 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2299 | |
| 2300 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2301 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2302 | ------------------------------------------------------------------------*/ |
| 2303 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2304 | { |
| 2305 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2306 | "WDI API call before module is initialized - Fail request"); |
| 2307 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2308 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2309 | } |
| 2310 | |
| 2311 | /*------------------------------------------------------------------------ |
| 2312 | Fill in Event data and post to the Main FSM |
| 2313 | ------------------------------------------------------------------------*/ |
| 2314 | wdiEventData.wdiRequest = WDI_DEL_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2315 | wdiEventData.pEventData = pwdiDelSTAParams; |
| 2316 | wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams); |
| 2317 | wdiEventData.pCBfnc = wdiDelSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2318 | wdiEventData.pUserData = pUserData; |
| 2319 | |
| 2320 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2321 | |
| 2322 | }/*WDI_DelSTAReq*/ |
| 2323 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2324 | /*======================================================================== |
| 2325 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2326 | SECURITY APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2328 | ==========================================================================*/ |
| 2329 | |
| 2330 | /** |
| 2331 | @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to |
| 2332 | install a BSS encryption key on the HW. Upon the call of this |
| 2333 | API the WLAN DAL will pack and send a Set BSS Key request |
| 2334 | message to the lower RIVA sub-system if DAL is in state |
| 2335 | STARTED. |
| 2336 | |
| 2337 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2338 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2339 | |
| 2340 | WDI_PostAssocReq must have been called. |
| 2341 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2342 | @param wdiSetBSSKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2343 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2344 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2345 | wdiSetBSSKeyRspCb: callback for passing back the |
| 2346 | response of the set BSS Key operation received from the |
| 2347 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2348 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2349 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2350 | callback |
| 2351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2352 | @see WDI_PostAssocReq |
| 2353 | @return Result of the function call |
| 2354 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2355 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2356 | WDI_SetBSSKeyReq |
| 2357 | ( |
| 2358 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams, |
| 2359 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb, |
| 2360 | void* pUserData |
| 2361 | ) |
| 2362 | { |
| 2363 | WDI_EventInfoType wdiEventData; |
| 2364 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2365 | |
| 2366 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2367 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2368 | ------------------------------------------------------------------------*/ |
| 2369 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2370 | { |
| 2371 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2372 | "WDI API call before module is initialized - Fail request"); |
| 2373 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2374 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2375 | } |
| 2376 | |
| 2377 | /*------------------------------------------------------------------------ |
| 2378 | Fill in Event data and post to the Main FSM |
| 2379 | ------------------------------------------------------------------------*/ |
| 2380 | wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2381 | wdiEventData.pEventData = pwdiSetBSSKeyParams; |
| 2382 | wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams); |
| 2383 | wdiEventData.pCBfnc = wdiSetBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2384 | wdiEventData.pUserData = pUserData; |
| 2385 | |
| 2386 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2387 | |
| 2388 | }/*WDI_SetBSSKeyReq*/ |
| 2389 | |
| 2390 | /** |
| 2391 | @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to |
| 2392 | uninstall a BSS key from HW. Upon the call of this API the |
| 2393 | WLAN DAL will pack and send a HAL Remove BSS Key request |
| 2394 | message to the lower RIVA sub-system if DAL is in state |
| 2395 | STARTED. |
| 2396 | |
| 2397 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2398 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2399 | |
| 2400 | WDI_SetBSSKeyReq must have been called. |
| 2401 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2402 | @param wdiRemoveBSSKeyParams: the remove BSS key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2403 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2404 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2405 | wdiRemoveBSSKeyRspCb: callback for passing back the |
| 2406 | response of the remove BSS key operation received from |
| 2407 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2408 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2409 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2410 | callback |
| 2411 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2412 | @see WDI_SetBSSKeyReq |
| 2413 | @return Result of the function call |
| 2414 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2415 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2416 | WDI_RemoveBSSKeyReq |
| 2417 | ( |
| 2418 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams, |
| 2419 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb, |
| 2420 | void* pUserData |
| 2421 | ) |
| 2422 | { |
| 2423 | WDI_EventInfoType wdiEventData; |
| 2424 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2425 | |
| 2426 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2427 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2428 | ------------------------------------------------------------------------*/ |
| 2429 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2430 | { |
| 2431 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2432 | "WDI API call before module is initialized - Fail request"); |
| 2433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2434 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2435 | } |
| 2436 | |
| 2437 | /*------------------------------------------------------------------------ |
| 2438 | Fill in Event data and post to the Main FSM |
| 2439 | ------------------------------------------------------------------------*/ |
| 2440 | wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2441 | wdiEventData.pEventData = pwdiRemoveBSSKeyParams; |
| 2442 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams); |
| 2443 | wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2444 | wdiEventData.pUserData = pUserData; |
| 2445 | |
| 2446 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2447 | |
| 2448 | }/*WDI_RemoveBSSKeyReq*/ |
| 2449 | |
| 2450 | |
| 2451 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2452 | @brief WDI_SetSTAKeyReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2453 | ready to install a STA(ast) encryption key in HW. Upon |
| 2454 | the call of this API the WLAN DAL will pack and send a |
| 2455 | HAL Set STA Key request message to the lower RIVA |
| 2456 | sub-system if DAL is in state STARTED. |
| 2457 | |
| 2458 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2459 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2460 | |
| 2461 | WDI_PostAssocReq must have been called. |
| 2462 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2463 | @param wdiSetSTAKeyParams: the set STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2464 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2465 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2466 | wdiSetSTAKeyRspCb: callback for passing back the |
| 2467 | response of the set STA key operation received from the |
| 2468 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2469 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2470 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2471 | callback |
| 2472 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2473 | @see WDI_PostAssocReq |
| 2474 | @return Result of the function call |
| 2475 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2476 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | WDI_SetSTAKeyReq |
| 2478 | ( |
| 2479 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams, |
| 2480 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb, |
| 2481 | void* pUserData |
| 2482 | ) |
| 2483 | { |
| 2484 | WDI_EventInfoType wdiEventData; |
| 2485 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2486 | |
| 2487 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2488 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2489 | ------------------------------------------------------------------------*/ |
| 2490 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2491 | { |
| 2492 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2493 | "WDI API call before module is initialized - Fail request"); |
| 2494 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2495 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | } |
| 2497 | |
| 2498 | /*------------------------------------------------------------------------ |
| 2499 | Fill in Event data and post to the Main FSM |
| 2500 | ------------------------------------------------------------------------*/ |
| 2501 | wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2502 | wdiEventData.pEventData = pwdiSetSTAKeyParams; |
| 2503 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams); |
| 2504 | wdiEventData.pCBfnc = wdiSetSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2505 | wdiEventData.pUserData = pUserData; |
| 2506 | |
| 2507 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2508 | |
| 2509 | }/*WDI_SetSTAKeyReq*/ |
| 2510 | |
| 2511 | |
| 2512 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2513 | @brief WDI_RemoveSTAKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2514 | wants to uninstall a previously set STA key in HW. Upon |
| 2515 | the call of this API the WLAN DAL will pack and send a |
| 2516 | HAL Remove STA Key request message to the lower RIVA |
| 2517 | sub-system if DAL is in state STARTED. |
| 2518 | |
| 2519 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2520 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2521 | |
| 2522 | WDI_SetSTAKeyReq must have been called. |
| 2523 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2524 | @param wdiRemoveSTAKeyParams: the remove STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2525 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2526 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2527 | wdiRemoveSTAKeyRspCb: callback for passing back the |
| 2528 | response of the remove STA key operation received from |
| 2529 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2531 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2532 | callback |
| 2533 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2534 | @see WDI_SetSTAKeyReq |
| 2535 | @return Result of the function call |
| 2536 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2537 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2538 | WDI_RemoveSTAKeyReq |
| 2539 | ( |
| 2540 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams, |
| 2541 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb, |
| 2542 | void* pUserData |
| 2543 | ) |
| 2544 | { |
| 2545 | WDI_EventInfoType wdiEventData; |
| 2546 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2547 | |
| 2548 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2549 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2550 | ------------------------------------------------------------------------*/ |
| 2551 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2552 | { |
| 2553 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2554 | "WDI API call before module is initialized - Fail request"); |
| 2555 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2556 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2557 | } |
| 2558 | |
| 2559 | /*------------------------------------------------------------------------ |
| 2560 | Fill in Event data and post to the Main FSM |
| 2561 | ------------------------------------------------------------------------*/ |
| 2562 | wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2563 | wdiEventData.pEventData = pwdiRemoveSTAKeyParams; |
| 2564 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams); |
| 2565 | wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2566 | wdiEventData.pUserData = pUserData; |
| 2567 | |
| 2568 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2569 | |
| 2570 | }/*WDI_RemoveSTAKeyReq*/ |
| 2571 | |
| 2572 | |
| 2573 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2574 | @brief WDI_SetSTABcastKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2575 | wants to install a STA Bcast encryption key on the HW. |
| 2576 | Upon the call of this API the WLAN DAL will pack and |
| 2577 | send a HAL Start request message to the lower RIVA |
| 2578 | sub-system if DAL is in state STARTED. |
| 2579 | |
| 2580 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2581 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2582 | |
| 2583 | WDI_PostAssocReq must have been called. |
| 2584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2585 | @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2586 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2587 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2588 | wdiSetSTABcastKeyRspCb: callback for passing back the |
| 2589 | response of the set BSS Key operation received from the |
| 2590 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2591 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2592 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2593 | callback |
| 2594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | @see WDI_PostAssocReq |
| 2596 | @return Result of the function call |
| 2597 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2598 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2599 | WDI_SetSTABcastKeyReq |
| 2600 | ( |
| 2601 | WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams, |
| 2602 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb, |
| 2603 | void* pUserData |
| 2604 | ) |
| 2605 | |
| 2606 | { |
| 2607 | WDI_EventInfoType wdiEventData; |
| 2608 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2609 | |
| 2610 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2611 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2612 | ------------------------------------------------------------------------*/ |
| 2613 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2614 | { |
| 2615 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2616 | "WDI API call before module is initialized - Fail request"); |
| 2617 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2618 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2619 | } |
| 2620 | |
| 2621 | /*------------------------------------------------------------------------ |
| 2622 | Fill in Event data and post to the Main FSM |
| 2623 | ------------------------------------------------------------------------*/ |
| 2624 | wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2625 | wdiEventData.pEventData = pwdiSetSTABcastKeyParams; |
| 2626 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams); |
| 2627 | wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2628 | wdiEventData.pUserData = pUserData; |
| 2629 | |
| 2630 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2631 | |
| 2632 | }/*WDI_SetSTABcastKeyReq*/ |
| 2633 | |
| 2634 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2635 | @brief WDI_RemoveSTABcastKeyReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2636 | MAC wants to uninstall a STA Bcast key from HW. Upon the |
| 2637 | call of this API the WLAN DAL will pack and send a HAL |
| 2638 | Remove STA Bcast Key request message to the lower RIVA |
| 2639 | sub-system if DAL is in state STARTED. |
| 2640 | |
| 2641 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2642 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2643 | |
| 2644 | WDI_SetSTABcastKeyReq must have been called. |
| 2645 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2646 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2647 | parameters as specified by the Device |
| 2648 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2649 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2650 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2651 | response of the remove STA Bcast key operation received |
| 2652 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2654 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2655 | callback |
| 2656 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2657 | @see WDI_SetSTABcastKeyReq |
| 2658 | @return Result of the function call |
| 2659 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2660 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2661 | WDI_RemoveSTABcastKeyReq |
| 2662 | ( |
| 2663 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams, |
| 2664 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb, |
| 2665 | void* pUserData |
| 2666 | ) |
| 2667 | { |
| 2668 | WDI_EventInfoType wdiEventData; |
| 2669 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2670 | |
| 2671 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2672 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2673 | ------------------------------------------------------------------------*/ |
| 2674 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2675 | { |
| 2676 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2677 | "WDI API call before module is initialized - Fail request"); |
| 2678 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2679 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2680 | } |
| 2681 | |
| 2682 | /*------------------------------------------------------------------------ |
| 2683 | Fill in Event data and post to the Main FSM |
| 2684 | ------------------------------------------------------------------------*/ |
| 2685 | wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2686 | wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams; |
| 2687 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams); |
| 2688 | wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2689 | wdiEventData.pUserData = pUserData; |
| 2690 | |
| 2691 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2692 | |
| 2693 | }/*WDI_RemoveSTABcastKeyReq*/ |
| 2694 | |
| 2695 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2696 | @brief WDI_SetMaxTxPowerReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2697 | MAC wants to set Max Tx Power to HW. Upon the |
| 2698 | call of this API the WLAN DAL will pack and send a HAL |
| 2699 | Remove STA Bcast Key request message to the lower RIVA |
| 2700 | sub-system if DAL is in state STARTED. |
| 2701 | |
| 2702 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2703 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2704 | |
| 2705 | WDI_SetSTABcastKeyReq must have been called. |
| 2706 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2707 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2708 | parameters as specified by the Device |
| 2709 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2710 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2711 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2712 | response of the remove STA Bcast key operation received |
| 2713 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2714 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2715 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2716 | callback |
| 2717 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2718 | @see WDI_SetMaxTxPowerReq |
| 2719 | @return Result of the function call |
| 2720 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2721 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2722 | WDI_SetMaxTxPowerReq |
| 2723 | ( |
| 2724 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams, |
| 2725 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb, |
| 2726 | void* pUserData |
| 2727 | ) |
| 2728 | { |
| 2729 | WDI_EventInfoType wdiEventData; |
| 2730 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2731 | |
| 2732 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2733 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2734 | ------------------------------------------------------------------------*/ |
| 2735 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2736 | { |
| 2737 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2738 | "WDI API call before module is initialized - Fail request"); |
| 2739 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2740 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2741 | } |
| 2742 | |
| 2743 | /*------------------------------------------------------------------------ |
| 2744 | Fill in Event data and post to the Main FSM |
| 2745 | ------------------------------------------------------------------------*/ |
| 2746 | wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2747 | wdiEventData.pEventData = pwdiSetMaxTxPowerParams; |
| 2748 | wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams); |
| 2749 | wdiEventData.pCBfnc = wdiReqStatusCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2750 | wdiEventData.pUserData = pUserData; |
| 2751 | |
| 2752 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2753 | } |
| 2754 | |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 2755 | /** |
| 2756 | @brief WDI_SetTxPowerReq will be called when the upper |
| 2757 | MAC wants to set Tx Power to HW. |
| 2758 | In state BUSY this request will be queued. Request won't |
| 2759 | be allowed in any other state. |
| 2760 | |
| 2761 | |
| 2762 | @param pwdiSetTxPowerParams: set TS Power parameters |
| 2763 | BSSID and target TX Power with dbm included |
| 2764 | |
| 2765 | wdiReqStatusCb: callback for passing back the response |
| 2766 | |
| 2767 | pUserData: user data will be passed back with the |
| 2768 | callback |
| 2769 | |
| 2770 | @return Result of the function call |
| 2771 | */ |
| 2772 | WDI_Status |
| 2773 | WDI_SetTxPowerReq |
| 2774 | ( |
| 2775 | WDI_SetTxPowerParamsType* pwdiSetTxPowerParams, |
| 2776 | WDA_SetTxPowerRspCb wdiReqStatusCb, |
| 2777 | void* pUserData |
| 2778 | ) |
| 2779 | { |
| 2780 | WDI_EventInfoType wdiEventData; |
| 2781 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2782 | |
| 2783 | /*------------------------------------------------------------------------ |
| 2784 | Sanity Check |
| 2785 | ------------------------------------------------------------------------*/ |
| 2786 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2787 | { |
| 2788 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2789 | "WDI API call before module is initialized - Fail request"); |
| 2790 | |
| 2791 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2792 | } |
| 2793 | |
| 2794 | /*------------------------------------------------------------------------ |
| 2795 | Fill in Event data and post to the Main FSM |
| 2796 | ------------------------------------------------------------------------*/ |
| 2797 | wdiEventData.wdiRequest = WDI_SET_TX_POWER_REQ; |
| 2798 | wdiEventData.pEventData = pwdiSetTxPowerParams; |
| 2799 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPowerParams); |
| 2800 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2801 | wdiEventData.pUserData = pUserData; |
| 2802 | |
| 2803 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2804 | } |
| 2805 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2806 | #ifdef FEATURE_WLAN_CCX |
| 2807 | WDI_Status |
| 2808 | WDI_TSMStatsReq |
| 2809 | ( |
| 2810 | WDI_TSMStatsReqParamsType* pwdiTsmReqParams, |
| 2811 | WDI_TsmRspCb wdiReqStatusCb, |
| 2812 | void* pUserData |
| 2813 | ) |
| 2814 | { |
| 2815 | WDI_EventInfoType wdiEventData; |
| 2816 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2817 | /*------------------------------------------------------------------------ |
| 2818 | Sanity Check |
| 2819 | ------------------------------------------------------------------------*/ |
| 2820 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2821 | { |
| 2822 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2823 | "WDI API call before module is initialized - Fail request"); |
| 2824 | |
| 2825 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2826 | } |
| 2827 | |
| 2828 | /*------------------------------------------------------------------------ |
| 2829 | Fill in Event data and post to the Main FSM |
| 2830 | ------------------------------------------------------------------------*/ |
| 2831 | wdiEventData.wdiRequest = WDI_TSM_STATS_REQ; |
| 2832 | wdiEventData.pEventData = pwdiTsmReqParams; |
| 2833 | wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams); |
| 2834 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2835 | wdiEventData.pUserData = pUserData; |
| 2836 | |
| 2837 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2838 | |
| 2839 | } |
| 2840 | #endif |
| 2841 | |
| 2842 | /*======================================================================== |
| 2843 | |
| 2844 | QoS and BA APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2845 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2846 | ==========================================================================*/ |
| 2847 | |
| 2848 | /** |
| 2849 | @brief WDI_AddTSReq will be called when the upper MAC to inform |
| 2850 | the device of a successful add TSpec negotiation. HW |
| 2851 | needs to receive the TSpec Info from the UMAC in order |
| 2852 | to configure properly the QoS data traffic. Upon the |
| 2853 | call of this API the WLAN DAL will pack and send a HAL |
| 2854 | Add TS request message to the lower RIVA sub-system if |
| 2855 | DAL is in state STARTED. |
| 2856 | |
| 2857 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2858 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2859 | |
| 2860 | WDI_PostAssocReq must have been called. |
| 2861 | |
| 2862 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 2863 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2864 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2865 | wdiAddTsRspCb: callback for passing back the response of |
| 2866 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2868 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2869 | callback |
| 2870 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2871 | @see WDI_PostAssocReq |
| 2872 | @return Result of the function call |
| 2873 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2874 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2875 | WDI_AddTSReq |
| 2876 | ( |
| 2877 | WDI_AddTSReqParamsType* pwdiAddTsReqParams, |
| 2878 | WDI_AddTsRspCb wdiAddTsRspCb, |
| 2879 | void* pUserData |
| 2880 | ) |
| 2881 | { |
| 2882 | WDI_EventInfoType wdiEventData; |
| 2883 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2884 | |
| 2885 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2886 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2887 | ------------------------------------------------------------------------*/ |
| 2888 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2889 | { |
| 2890 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2891 | "WDI API call before module is initialized - Fail request"); |
| 2892 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2893 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2894 | } |
| 2895 | |
| 2896 | /*------------------------------------------------------------------------ |
| 2897 | Fill in Event data and post to the Main FSM |
| 2898 | ------------------------------------------------------------------------*/ |
| 2899 | wdiEventData.wdiRequest = WDI_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2900 | wdiEventData.pEventData = pwdiAddTsReqParams; |
| 2901 | wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams); |
| 2902 | wdiEventData.pCBfnc = wdiAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2903 | wdiEventData.pUserData = pUserData; |
| 2904 | |
| 2905 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2906 | |
| 2907 | }/*WDI_AddTSReq*/ |
| 2908 | |
| 2909 | |
| 2910 | |
| 2911 | /** |
| 2912 | @brief WDI_DelTSReq will be called when the upper MAC has ended |
| 2913 | admission on a specific AC. This is to inform HW that |
| 2914 | QoS traffic parameters must be rest. Upon the call of |
| 2915 | this API the WLAN DAL will pack and send a HAL Del TS |
| 2916 | request message to the lower RIVA sub-system if DAL is |
| 2917 | in state STARTED. |
| 2918 | |
| 2919 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2920 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2921 | |
| 2922 | WDI_AddTSReq must have been called. |
| 2923 | |
| 2924 | @param wdiDelTsReqParams: the del TS parameters as specified by |
| 2925 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2927 | wdiDelTsRspCb: callback for passing back the response of |
| 2928 | the del TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2929 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2930 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2931 | callback |
| 2932 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2933 | @see WDI_AddTSReq |
| 2934 | @return Result of the function call |
| 2935 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2936 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2937 | WDI_DelTSReq |
| 2938 | ( |
| 2939 | WDI_DelTSReqParamsType* pwdiDelTsReqParams, |
| 2940 | WDI_DelTsRspCb wdiDelTsRspCb, |
| 2941 | void* pUserData |
| 2942 | ) |
| 2943 | { |
| 2944 | WDI_EventInfoType wdiEventData; |
| 2945 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2946 | |
| 2947 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2948 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2949 | ------------------------------------------------------------------------*/ |
| 2950 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2951 | { |
| 2952 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2953 | "WDI API call before module is initialized - Fail request"); |
| 2954 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2955 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2956 | } |
| 2957 | |
| 2958 | /*------------------------------------------------------------------------ |
| 2959 | Fill in Event data and post to the Main FSM |
| 2960 | ------------------------------------------------------------------------*/ |
| 2961 | wdiEventData.wdiRequest = WDI_DEL_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2962 | wdiEventData.pEventData = pwdiDelTsReqParams; |
| 2963 | wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams); |
| 2964 | wdiEventData.pCBfnc = wdiDelTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2965 | wdiEventData.pUserData = pUserData; |
| 2966 | |
| 2967 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2968 | |
| 2969 | }/*WDI_DelTSReq*/ |
| 2970 | |
| 2971 | |
| 2972 | |
| 2973 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2974 | @brief WDI_UpdateEDCAParams will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2975 | wishes to update the EDCA parameters used by HW for QoS |
| 2976 | data traffic. Upon the call of this API the WLAN DAL |
| 2977 | will pack and send a HAL Update EDCA Params request |
| 2978 | message to the lower RIVA sub-system if DAL is in state |
| 2979 | STARTED. |
| 2980 | |
| 2981 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2982 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2983 | |
| 2984 | WDI_PostAssocReq must have been called. |
| 2985 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2986 | @param wdiUpdateEDCAParams: the start parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2987 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2988 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2989 | wdiUpdateEDCAParamsRspCb: callback for passing back the |
| 2990 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2991 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2992 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2993 | callback |
| 2994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2995 | @see WDI_PostAssocReq |
| 2996 | @return Result of the function call |
| 2997 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2998 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2999 | WDI_UpdateEDCAParams |
| 3000 | ( |
| 3001 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams, |
| 3002 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb, |
| 3003 | void* pUserData |
| 3004 | ) |
| 3005 | { |
| 3006 | WDI_EventInfoType wdiEventData; |
| 3007 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3008 | |
| 3009 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3010 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3011 | ------------------------------------------------------------------------*/ |
| 3012 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3013 | { |
| 3014 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3015 | "WDI API call before module is initialized - Fail request"); |
| 3016 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3017 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3018 | } |
| 3019 | |
| 3020 | /*------------------------------------------------------------------------ |
| 3021 | Fill in Event data and post to the Main FSM |
| 3022 | ------------------------------------------------------------------------*/ |
| 3023 | wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3024 | wdiEventData.pEventData = pwdiUpdateEDCAParams; |
| 3025 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams); |
| 3026 | wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3027 | wdiEventData.pUserData = pUserData; |
| 3028 | |
| 3029 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3030 | |
| 3031 | }/*WDI_UpdateEDCAParams*/ |
| 3032 | |
| 3033 | |
| 3034 | /** |
| 3035 | @brief WDI_AddBASessionReq will be called when the upper MAC has setup |
| 3036 | successfully a BA session and needs to notify the HW for |
| 3037 | the appropriate settings to take place. Upon the call of |
| 3038 | this API the WLAN DAL will pack and send a HAL Add BA |
| 3039 | request message to the lower RIVA sub-system if DAL is |
| 3040 | in state STARTED. |
| 3041 | |
| 3042 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3043 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3044 | |
| 3045 | WDI_PostAssocReq must have been called. |
| 3046 | |
| 3047 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 3048 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3049 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3050 | wdiAddBARspCb: callback for passing back the response of |
| 3051 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3053 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3054 | callback |
| 3055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3056 | @see WDI_PostAssocReq |
| 3057 | @return Result of the function call |
| 3058 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3059 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3060 | WDI_AddBASessionReq |
| 3061 | ( |
| 3062 | WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams, |
| 3063 | WDI_AddBASessionRspCb wdiAddBASessionRspCb, |
| 3064 | void* pUserData |
| 3065 | ) |
| 3066 | { |
| 3067 | WDI_EventInfoType wdiEventData; |
| 3068 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3069 | |
| 3070 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3071 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3072 | ------------------------------------------------------------------------*/ |
| 3073 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3074 | { |
| 3075 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3076 | "WDI API call before module is initialized - Fail request"); |
| 3077 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3078 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3079 | } |
| 3080 | |
| 3081 | /*------------------------------------------------------------------------ |
| 3082 | Fill in Event data and post to the Main FSM |
| 3083 | ------------------------------------------------------------------------*/ |
| 3084 | wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3085 | wdiEventData.pEventData = pwdiAddBASessionReqParams; |
| 3086 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams); |
| 3087 | wdiEventData.pCBfnc = wdiAddBASessionRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3088 | wdiEventData.pUserData = pUserData; |
| 3089 | |
| 3090 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3091 | |
| 3092 | }/*WDI_AddBASessionReq*/ |
| 3093 | |
| 3094 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3095 | @brief WDI_DelBAReq will be called when the upper MAC wants to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3096 | inform HW that it has deleted a previously created BA |
| 3097 | session. Upon the call of this API the WLAN DAL will |
| 3098 | pack and send a HAL Del BA request message to the lower |
| 3099 | RIVA sub-system if DAL is in state STARTED. |
| 3100 | |
| 3101 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3102 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3103 | |
| 3104 | WDI_AddBAReq must have been called. |
| 3105 | |
| 3106 | @param wdiDelBAReqParams: the del BA parameters as specified by |
| 3107 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3108 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3109 | wdiDelBARspCb: callback for passing back the response of |
| 3110 | the del BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3111 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3112 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3113 | callback |
| 3114 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3115 | @see WDI_AddBAReq |
| 3116 | @return Result of the function call |
| 3117 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3118 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3119 | WDI_DelBAReq |
| 3120 | ( |
| 3121 | WDI_DelBAReqParamsType* pwdiDelBAReqParams, |
| 3122 | WDI_DelBARspCb wdiDelBARspCb, |
| 3123 | void* pUserData |
| 3124 | ) |
| 3125 | { |
| 3126 | WDI_EventInfoType wdiEventData; |
| 3127 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3128 | |
| 3129 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3130 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3131 | ------------------------------------------------------------------------*/ |
| 3132 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3133 | { |
| 3134 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3135 | "WDI API call before module is initialized - Fail request"); |
| 3136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3137 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3138 | } |
| 3139 | |
| 3140 | /*------------------------------------------------------------------------ |
| 3141 | Fill in Event data and post to the Main FSM |
| 3142 | ------------------------------------------------------------------------*/ |
| 3143 | wdiEventData.wdiRequest = WDI_DEL_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3144 | wdiEventData.pEventData = pwdiDelBAReqParams; |
| 3145 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams); |
| 3146 | wdiEventData.pCBfnc = wdiDelBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3147 | wdiEventData.pUserData = pUserData; |
| 3148 | |
| 3149 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3150 | |
| 3151 | }/*WDI_DelBAReq*/ |
| 3152 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3153 | /*======================================================================== |
| 3154 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3155 | Power Save APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3156 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3157 | ==========================================================================*/ |
| 3158 | |
| 3159 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3160 | @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3161 | wants to set the power save related configurations of |
| 3162 | the WLAN Device. Upon the call of this API the WLAN DAL |
| 3163 | will pack and send a HAL Update CFG request message to |
| 3164 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3165 | |
| 3166 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3167 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3168 | |
| 3169 | WDI_Start must have been called. |
| 3170 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3171 | @param pwdiPowerSaveCfg: the power save cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3172 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3173 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3174 | wdiSetPwrSaveCfgCb: callback for passing back the |
| 3175 | response of the set power save cfg operation received |
| 3176 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3177 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3178 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3179 | callback |
| 3180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3181 | @see WDI_Start |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3182 | @return Result of the function call |
| 3183 | */ |
| 3184 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3185 | WDI_SetPwrSaveCfgReq |
| 3186 | ( |
| 3187 | WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg, |
| 3188 | WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb, |
| 3189 | void* pUserData |
| 3190 | ) |
| 3191 | { |
| 3192 | WDI_EventInfoType wdiEventData; |
| 3193 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3194 | |
| 3195 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3196 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3197 | ------------------------------------------------------------------------*/ |
| 3198 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3199 | { |
| 3200 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3201 | "WDI API call before module is initialized - Fail request"); |
| 3202 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3203 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3204 | } |
| 3205 | |
| 3206 | /*------------------------------------------------------------------------ |
| 3207 | Fill in Event data and post to the Main FSM |
| 3208 | ------------------------------------------------------------------------*/ |
| 3209 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3210 | wdiEventData.pEventData = pwdiPowerSaveCfg; |
| 3211 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg); |
| 3212 | wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3213 | wdiEventData.pUserData = pUserData; |
| 3214 | |
| 3215 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3216 | |
| 3217 | }/*WDI_SetPwrSaveCfgReq*/ |
| 3218 | |
| 3219 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3220 | @brief WDI_EnterImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3221 | request the device to get into IMPS power state. Upon |
| 3222 | the call of this API the WLAN DAL will send a HAL Enter |
| 3223 | IMPS request message to the lower RIVA sub-system if DAL |
| 3224 | is in state STARTED. |
| 3225 | |
| 3226 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3227 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3228 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3229 | |
| 3230 | @param wdiEnterImpsRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3231 | response of the Enter IMPS operation received from the |
| 3232 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3234 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3235 | callback |
| 3236 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3237 | @see WDI_Start |
| 3238 | @return Result of the function call |
| 3239 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3240 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3241 | WDI_EnterImpsReq |
| 3242 | ( |
| 3243 | WDI_EnterImpsRspCb wdiEnterImpsRspCb, |
| 3244 | void* pUserData |
| 3245 | ) |
| 3246 | { |
| 3247 | WDI_EventInfoType wdiEventData; |
| 3248 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3249 | |
| 3250 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3251 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3252 | ------------------------------------------------------------------------*/ |
| 3253 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3254 | { |
| 3255 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3256 | "WDI API call before module is initialized - Fail request"); |
| 3257 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3258 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3259 | } |
| 3260 | |
| 3261 | /*------------------------------------------------------------------------ |
| 3262 | Fill in Event data and post to the Main FSM |
| 3263 | ------------------------------------------------------------------------*/ |
| 3264 | wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3265 | wdiEventData.pEventData = NULL; |
| 3266 | wdiEventData.uEventDataSize = 0; |
| 3267 | wdiEventData.pCBfnc = wdiEnterImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3268 | wdiEventData.pUserData = pUserData; |
| 3269 | |
| 3270 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3271 | |
| 3272 | }/*WDI_EnterImpsReq*/ |
| 3273 | |
| 3274 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3275 | @brief WDI_ExitImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3276 | request the device to get out of IMPS power state. Upon |
| 3277 | the call of this API the WLAN DAL will send a HAL Exit |
| 3278 | IMPS request message to the lower RIVA sub-system if DAL |
| 3279 | is in state STARTED. |
| 3280 | |
| 3281 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3282 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3284 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3285 | |
| 3286 | @param wdiExitImpsRspCb: callback for passing back the response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3287 | of the Exit IMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3288 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3289 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3290 | callback |
| 3291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3292 | @see WDI_Start |
| 3293 | @return Result of the function call |
| 3294 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3295 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3296 | WDI_ExitImpsReq |
| 3297 | ( |
| 3298 | WDI_ExitImpsRspCb wdiExitImpsRspCb, |
| 3299 | void* pUserData |
| 3300 | ) |
| 3301 | { |
| 3302 | WDI_EventInfoType wdiEventData; |
| 3303 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3304 | |
| 3305 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3306 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3307 | ------------------------------------------------------------------------*/ |
| 3308 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3309 | { |
| 3310 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3311 | "WDI API call before module is initialized - Fail request"); |
| 3312 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3313 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3314 | } |
| 3315 | |
| 3316 | /*------------------------------------------------------------------------ |
| 3317 | Fill in Event data and post to the Main FSM |
| 3318 | ------------------------------------------------------------------------*/ |
| 3319 | wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3320 | wdiEventData.pEventData = NULL; |
| 3321 | wdiEventData.uEventDataSize = 0; |
| 3322 | wdiEventData.pCBfnc = wdiExitImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3323 | wdiEventData.pUserData = pUserData; |
| 3324 | |
| 3325 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3326 | |
| 3327 | }/*WDI_ExitImpsReq*/ |
| 3328 | |
| 3329 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3330 | @brief WDI_EnterBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3331 | request the device to get into BMPS power state. Upon |
| 3332 | the call of this API the WLAN DAL will pack and send a |
| 3333 | HAL Enter BMPS request message to the lower RIVA |
| 3334 | sub-system if DAL is in state STARTED. |
| 3335 | |
| 3336 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3337 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3338 | |
| 3339 | WDI_PostAssocReq must have been called. |
| 3340 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3341 | @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3342 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | wdiEnterBmpsRspCb: callback for passing back the |
| 3345 | response of the Enter BMPS operation received from the |
| 3346 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3347 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3348 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3349 | callback |
| 3350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3351 | @see WDI_PostAssocReq |
| 3352 | @return Result of the function call |
| 3353 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3354 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3355 | WDI_EnterBmpsReq |
| 3356 | ( |
| 3357 | WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams, |
| 3358 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb, |
| 3359 | void* pUserData |
| 3360 | ) |
| 3361 | { |
| 3362 | WDI_EventInfoType wdiEventData; |
| 3363 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3364 | |
| 3365 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3366 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3367 | ------------------------------------------------------------------------*/ |
| 3368 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3369 | { |
| 3370 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3371 | "WDI API call before module is initialized - Fail request"); |
| 3372 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3373 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3374 | } |
| 3375 | |
| 3376 | /*------------------------------------------------------------------------ |
| 3377 | Fill in Event data and post to the Main FSM |
| 3378 | ------------------------------------------------------------------------*/ |
| 3379 | wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3380 | wdiEventData.pEventData = pwdiEnterBmpsReqParams; |
| 3381 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams); |
| 3382 | wdiEventData.pCBfnc = wdiEnterBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3383 | wdiEventData.pUserData = pUserData; |
| 3384 | |
| 3385 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3386 | |
| 3387 | }/*WDI_EnterBmpsReq*/ |
| 3388 | |
| 3389 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3390 | @brief WDI_ExitBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3391 | request the device to get out of BMPS power state. Upon |
| 3392 | the call of this API the WLAN DAL will pack and send a |
| 3393 | HAL Exit BMPS request message to the lower RIVA |
| 3394 | sub-system if DAL is in state STARTED. |
| 3395 | |
| 3396 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3397 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3398 | |
| 3399 | WDI_PostAssocReq must have been called. |
| 3400 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3401 | @param pwdiExitBmpsReqParams: the Exit BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3402 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3403 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3404 | wdiExitBmpsRspCb: callback for passing back the response |
| 3405 | of the Exit BMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3407 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3408 | callback |
| 3409 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3410 | @see WDI_PostAssocReq |
| 3411 | @return Result of the function call |
| 3412 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3413 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3414 | WDI_ExitBmpsReq |
| 3415 | ( |
| 3416 | WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams, |
| 3417 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb, |
| 3418 | void* pUserData |
| 3419 | ) |
| 3420 | { |
| 3421 | WDI_EventInfoType wdiEventData; |
| 3422 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3423 | |
| 3424 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3425 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3426 | ------------------------------------------------------------------------*/ |
| 3427 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3428 | { |
| 3429 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3430 | "WDI API call before module is initialized - Fail request"); |
| 3431 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3432 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3433 | } |
| 3434 | |
| 3435 | /*------------------------------------------------------------------------ |
| 3436 | Fill in Event data and post to the Main FSM |
| 3437 | ------------------------------------------------------------------------*/ |
| 3438 | wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3439 | wdiEventData.pEventData = pwdiExitBmpsReqParams; |
| 3440 | wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams); |
| 3441 | wdiEventData.pCBfnc = wdiExitBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3442 | wdiEventData.pUserData = pUserData; |
| 3443 | |
| 3444 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3445 | |
| 3446 | }/*WDI_ExitBmpsReq*/ |
| 3447 | |
| 3448 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3449 | @brief WDI_EnterUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3450 | request the device to get into UAPSD power state. Upon |
| 3451 | the call of this API the WLAN DAL will pack and send a |
| 3452 | HAL Enter UAPSD request message to the lower RIVA |
| 3453 | sub-system if DAL is in state STARTED. |
| 3454 | |
| 3455 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3456 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3457 | |
| 3458 | WDI_PostAssocReq must have been called. |
| 3459 | WDI_SetUapsdAcParamsReq must have been called. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3460 | |
| 3461 | @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3462 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3463 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3464 | wdiEnterUapsdRspCb: callback for passing back the |
| 3465 | response of the Enter UAPSD operation received from the |
| 3466 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3468 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3469 | callback |
| 3470 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3471 | @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq |
| 3472 | @return Result of the function call |
| 3473 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3474 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3475 | WDI_EnterUapsdReq |
| 3476 | ( |
| 3477 | WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams, |
| 3478 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb, |
| 3479 | void* pUserData |
| 3480 | ) |
| 3481 | { |
| 3482 | WDI_EventInfoType wdiEventData; |
| 3483 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3484 | |
| 3485 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3486 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3487 | ------------------------------------------------------------------------*/ |
| 3488 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3489 | { |
| 3490 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3491 | "WDI API call before module is initialized - Fail request"); |
| 3492 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3493 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3494 | } |
| 3495 | |
| 3496 | /*------------------------------------------------------------------------ |
| 3497 | Fill in Event data and post to the Main FSM |
| 3498 | ------------------------------------------------------------------------*/ |
| 3499 | wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3500 | wdiEventData.pEventData = pwdiEnterUapsdReqParams; |
| 3501 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams); |
| 3502 | wdiEventData.pCBfnc = wdiEnterUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3503 | wdiEventData.pUserData = pUserData; |
| 3504 | |
| 3505 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3506 | |
| 3507 | }/*WDI_EnterUapsdReq*/ |
| 3508 | |
| 3509 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3510 | @brief WDI_ExitUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3511 | request the device to get out of UAPSD power state. Upon |
| 3512 | the call of this API the WLAN DAL will send a HAL Exit |
| 3513 | UAPSD request message to the lower RIVA sub-system if |
| 3514 | DAL is in state STARTED. |
| 3515 | |
| 3516 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3517 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3518 | |
| 3519 | WDI_PostAssocReq must have been called. |
| 3520 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3521 | @param wdiExitUapsdRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3522 | response of the Exit UAPSD operation received from the |
| 3523 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3524 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3525 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3526 | callback |
| 3527 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3528 | @see WDI_PostAssocReq |
| 3529 | @return Result of the function call |
| 3530 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3531 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | WDI_ExitUapsdReq |
| 3533 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3534 | WDI_ExitUapsdReqParamsType *pwdiExitUapsdReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3535 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb, |
| 3536 | void* pUserData |
| 3537 | ) |
| 3538 | { |
| 3539 | WDI_EventInfoType wdiEventData; |
| 3540 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3541 | |
| 3542 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3543 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3544 | ------------------------------------------------------------------------*/ |
| 3545 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3546 | { |
| 3547 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3548 | "WDI API call before module is initialized - Fail request"); |
| 3549 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3550 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3551 | } |
| 3552 | |
| 3553 | /*------------------------------------------------------------------------ |
| 3554 | Fill in Event data and post to the Main FSM |
| 3555 | ------------------------------------------------------------------------*/ |
| 3556 | wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3557 | wdiEventData.pEventData = pwdiExitUapsdReqParams; |
| 3558 | wdiEventData.uEventDataSize = sizeof(*pwdiExitUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3559 | wdiEventData.pCBfnc = wdiExitUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3560 | wdiEventData.pUserData = pUserData; |
| 3561 | |
| 3562 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3563 | |
| 3564 | }/*WDI_ExitUapsdReq*/ |
| 3565 | |
| 3566 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3567 | @brief WDI_UpdateUapsdParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3568 | MAC wants to set the UAPSD related configurations |
| 3569 | of an associated STA (while acting as an AP) to the WLAN |
| 3570 | Device. Upon the call of this API the WLAN DAL will pack |
| 3571 | and send a HAL Update UAPSD params request message to |
| 3572 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3573 | |
| 3574 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3575 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3576 | |
| 3577 | WDI_ConfigBSSReq must have been called. |
| 3578 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3579 | @param pwdiUpdateUapsdReqParams: the UAPSD parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3580 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3581 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3582 | wdiUpdateUapsdParamsCb: callback for passing back the |
| 3583 | response of the update UAPSD params operation received |
| 3584 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3585 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3586 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3587 | callback |
| 3588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3589 | @see WDI_ConfigBSSReq |
| 3590 | @return Result of the function call |
| 3591 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3592 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3593 | WDI_UpdateUapsdParamsReq |
| 3594 | ( |
| 3595 | WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams, |
| 3596 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb, |
| 3597 | void* pUserData |
| 3598 | ) |
| 3599 | { |
| 3600 | WDI_EventInfoType wdiEventData; |
| 3601 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3602 | |
| 3603 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3604 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3605 | ------------------------------------------------------------------------*/ |
| 3606 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3607 | { |
| 3608 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3609 | "WDI API call before module is initialized - Fail request"); |
| 3610 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3611 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3612 | } |
| 3613 | |
| 3614 | /*------------------------------------------------------------------------ |
| 3615 | Fill in Event data and post to the Main FSM |
| 3616 | ------------------------------------------------------------------------*/ |
| 3617 | wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3618 | wdiEventData.pEventData = pwdiUpdateUapsdReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3619 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3620 | wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3621 | wdiEventData.pUserData = pUserData; |
| 3622 | |
| 3623 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3624 | |
| 3625 | }/*WDI_UpdateUapsdParamsReq*/ |
| 3626 | |
| 3627 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3628 | @brief WDI_SetUapsdAcParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3629 | MAC wants to set the UAPSD related configurations before |
| 3630 | requesting for enter UAPSD power state to the WLAN |
| 3631 | Device. Upon the call of this API the WLAN DAL will pack |
| 3632 | and send a HAL Set UAPSD params request message to |
| 3633 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3634 | |
| 3635 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3636 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3637 | |
| 3638 | WDI_PostAssocReq must have been called. |
| 3639 | |
| 3640 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3641 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3642 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3643 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3644 | response of the set UAPSD params operation received from |
| 3645 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3646 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3647 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3648 | callback |
| 3649 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3650 | @see WDI_PostAssocReq |
| 3651 | @return Result of the function call |
| 3652 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3653 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3654 | WDI_SetUapsdAcParamsReq |
| 3655 | ( |
| 3656 | WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo, |
| 3657 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb, |
| 3658 | void* pUserData |
| 3659 | ) |
| 3660 | { |
| 3661 | WDI_EventInfoType wdiEventData; |
| 3662 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3663 | |
| 3664 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3665 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3666 | ------------------------------------------------------------------------*/ |
| 3667 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3668 | { |
| 3669 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3670 | "WDI API call before module is initialized - Fail request"); |
| 3671 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3672 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3673 | } |
| 3674 | |
| 3675 | /*------------------------------------------------------------------------ |
| 3676 | Fill in Event data and post to the Main FSM |
| 3677 | ------------------------------------------------------------------------*/ |
| 3678 | wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3679 | wdiEventData.pEventData = pwdiUapsdInfo; |
| 3680 | wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo); |
| 3681 | wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3682 | wdiEventData.pUserData = pUserData; |
| 3683 | |
| 3684 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3685 | |
| 3686 | }/*WDI_SetUapsdAcParamsReq*/ |
| 3687 | |
| 3688 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3689 | @brief WDI_ConfigureRxpFilterReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3690 | MAC wants to set/reset the RXP filters for received pkts |
| 3691 | (MC, BC etc.). Upon the call of this API the WLAN DAL will pack |
| 3692 | and send a HAL configure RXP filter request message to |
| 3693 | the lower RIVA sub-system. |
| 3694 | |
| 3695 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3696 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3697 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3698 | |
| 3699 | @param pwdiConfigureRxpFilterReqParams: the RXP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3700 | filter as specified by the Device |
| 3701 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3703 | wdiConfigureRxpFilterCb: callback for passing back the |
| 3704 | response of the configure RXP filter operation received |
| 3705 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3706 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3707 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3708 | callback |
| 3709 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3710 | @return Result of the function call |
| 3711 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3712 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3713 | WDI_ConfigureRxpFilterReq |
| 3714 | ( |
| 3715 | WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams, |
| 3716 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb, |
| 3717 | void* pUserData |
| 3718 | ) |
| 3719 | { |
| 3720 | WDI_EventInfoType wdiEventData; |
| 3721 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3722 | |
| 3723 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3724 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3725 | ------------------------------------------------------------------------*/ |
| 3726 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3727 | { |
| 3728 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3729 | "WDI API call before module is initialized - Fail request"); |
| 3730 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3731 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3732 | } |
| 3733 | |
| 3734 | /*------------------------------------------------------------------------ |
| 3735 | Fill in Event data and post to the Main FSM |
| 3736 | ------------------------------------------------------------------------*/ |
| 3737 | wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3738 | wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams; |
| 3739 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams); |
| 3740 | wdiEventData.pCBfnc = wdiConfigureRxpFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3741 | wdiEventData.pUserData = pUserData; |
| 3742 | |
| 3743 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3744 | }/*WDI_ConfigureRxpFilterReq*/ |
| 3745 | |
| 3746 | /** |
| 3747 | @brief WDI_SetBeaconFilterReq will be called when the upper MAC |
| 3748 | wants to set the beacon filters while in power save. |
| 3749 | Upon the call of this API the WLAN DAL will pack and |
| 3750 | send a Beacon filter request message to the |
| 3751 | lower RIVA sub-system. |
| 3752 | |
| 3753 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3754 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3755 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3756 | |
| 3757 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3758 | filter as specified by the Device |
| 3759 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3760 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3761 | wdiBeaconFilterCb: callback for passing back the |
| 3762 | response of the set beacon filter operation received |
| 3763 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3765 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3766 | callback |
| 3767 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3768 | @return Result of the function call |
| 3769 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3770 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3771 | WDI_SetBeaconFilterReq |
| 3772 | ( |
| 3773 | WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3774 | WDI_SetBeaconFilterCb wdiBeaconFilterCb, |
| 3775 | void* pUserData |
| 3776 | ) |
| 3777 | { |
| 3778 | WDI_EventInfoType wdiEventData; |
| 3779 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3780 | |
| 3781 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3782 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3783 | ------------------------------------------------------------------------*/ |
| 3784 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3785 | { |
| 3786 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3787 | "WDI API call before module is initialized - Fail request"); |
| 3788 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3789 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3790 | } |
| 3791 | |
| 3792 | /*------------------------------------------------------------------------ |
| 3793 | Fill in Event data and post to the Main FSM |
| 3794 | ------------------------------------------------------------------------*/ |
| 3795 | wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3796 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3797 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3798 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3799 | wdiEventData.pUserData = pUserData; |
| 3800 | |
| 3801 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3802 | }/*WDI_SetBeaconFilterReq*/ |
| 3803 | |
| 3804 | /** |
| 3805 | @brief WDI_RemBeaconFilterReq will be called when the upper MAC |
| 3806 | wants to remove the beacon filter for particular IE |
| 3807 | while in power save. Upon the call of this API the WLAN |
| 3808 | DAL will pack and send a remove Beacon filter request |
| 3809 | message to the lower RIVA sub-system. |
| 3810 | |
| 3811 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3812 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3813 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3814 | |
| 3815 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3816 | filter as specified by the Device |
| 3817 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3818 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3819 | wdiBeaconFilterCb: callback for passing back the |
| 3820 | response of the remove beacon filter operation received |
| 3821 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3823 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3824 | callback |
| 3825 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3826 | @return Result of the function call |
| 3827 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3828 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3829 | WDI_RemBeaconFilterReq |
| 3830 | ( |
| 3831 | WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3832 | WDI_RemBeaconFilterCb wdiBeaconFilterCb, |
| 3833 | void* pUserData |
| 3834 | ) |
| 3835 | { |
| 3836 | WDI_EventInfoType wdiEventData; |
| 3837 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3838 | |
| 3839 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3840 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3841 | ------------------------------------------------------------------------*/ |
| 3842 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3843 | { |
| 3844 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3845 | "WDI API call before module is initialized - Fail request"); |
| 3846 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3847 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3848 | } |
| 3849 | |
| 3850 | /*------------------------------------------------------------------------ |
| 3851 | Fill in Event data and post to the Main FSM |
| 3852 | ------------------------------------------------------------------------*/ |
| 3853 | wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3854 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3855 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3856 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3857 | wdiEventData.pUserData = pUserData; |
| 3858 | |
| 3859 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3860 | }/*WDI_RemBeaconFilterReq*/ |
| 3861 | |
| 3862 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3863 | @brief WDI_SetRSSIThresholdsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3864 | MAC wants to set the RSSI thresholds related |
| 3865 | configurations while in power save. Upon the call of |
| 3866 | this API the WLAN DAL will pack and send a HAL Set RSSI |
| 3867 | thresholds request message to the lower RIVA |
| 3868 | sub-system if DAL is in state STARTED. |
| 3869 | |
| 3870 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3871 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3872 | |
| 3873 | WDI_PostAssocReq must have been called. |
| 3874 | |
| 3875 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3876 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3878 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3879 | response of the set UAPSD params operation received from |
| 3880 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3882 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3883 | callback |
| 3884 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3885 | @see WDI_PostAssocReq |
| 3886 | @return Result of the function call |
| 3887 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3888 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3889 | WDI_SetRSSIThresholdsReq |
| 3890 | ( |
| 3891 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams, |
| 3892 | WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb, |
| 3893 | void* pUserData |
| 3894 | ) |
| 3895 | { |
| 3896 | WDI_EventInfoType wdiEventData; |
| 3897 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3898 | |
| 3899 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3900 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3901 | ------------------------------------------------------------------------*/ |
| 3902 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3903 | { |
| 3904 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3905 | "WDI API call before module is initialized - Fail request"); |
| 3906 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3907 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3908 | } |
| 3909 | |
| 3910 | /*------------------------------------------------------------------------ |
| 3911 | Fill in Event data and post to the Main FSM |
| 3912 | ------------------------------------------------------------------------*/ |
| 3913 | wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3914 | wdiEventData.pEventData = pwdiRSSIThresholdsParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3915 | wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3916 | wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3917 | wdiEventData.pUserData = pUserData; |
| 3918 | |
| 3919 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3920 | }/* WDI_SetRSSIThresholdsReq*/ |
| 3921 | |
| 3922 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3923 | @brief WDI_HostOffloadReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3924 | wants to set the filter to minimize unnecessary host |
| 3925 | wakeup due to broadcast traffic while in power save. |
| 3926 | Upon the call of this API the WLAN DAL will pack and |
| 3927 | send a HAL host offload request message to the |
| 3928 | lower RIVA sub-system if DAL is in state STARTED. |
| 3929 | |
| 3930 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3931 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3932 | |
| 3933 | WDI_PostAssocReq must have been called. |
| 3934 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3935 | @param pwdiHostOffloadParams: the host offload as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3936 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3937 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3938 | wdiHostOffloadCb: callback for passing back the response |
| 3939 | of the host offload operation received from the |
| 3940 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3942 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3943 | callback |
| 3944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3945 | @see WDI_PostAssocReq |
| 3946 | @return Result of the function call |
| 3947 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3948 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3949 | WDI_HostOffloadReq |
| 3950 | ( |
| 3951 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams, |
| 3952 | WDI_HostOffloadCb wdiHostOffloadCb, |
| 3953 | void* pUserData |
| 3954 | ) |
| 3955 | { |
| 3956 | WDI_EventInfoType wdiEventData; |
| 3957 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3958 | |
| 3959 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3960 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3961 | ------------------------------------------------------------------------*/ |
| 3962 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3963 | { |
| 3964 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3965 | "WDI API call before module is initialized - Fail request"); |
| 3966 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3967 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3968 | } |
| 3969 | |
| 3970 | /*------------------------------------------------------------------------ |
| 3971 | Fill in Event data and post to the Main FSM |
| 3972 | ------------------------------------------------------------------------*/ |
| 3973 | wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3974 | wdiEventData.pEventData = pwdiHostOffloadParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3975 | wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3976 | wdiEventData.pCBfnc = wdiHostOffloadCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3977 | wdiEventData.pUserData = pUserData; |
| 3978 | |
| 3979 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3980 | }/*WDI_HostOffloadReq*/ |
| 3981 | |
| 3982 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3983 | @brief WDI_KeepAliveReq will be called when the upper MAC |
| 3984 | wants to set the filter to send NULL or unsolicited ARP responses |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3985 | and minimize unnecessary host wakeups due to while in power save. |
| 3986 | Upon the call of this API the WLAN DAL will pack and |
| 3987 | send a HAL Keep Alive request message to the |
| 3988 | lower RIVA sub-system if DAL is in state STARTED. |
| 3989 | |
| 3990 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3991 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3992 | |
| 3993 | WDI_PostAssocReq must have been called. |
| 3994 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3995 | @param pwdiKeepAliveParams: the Keep Alive as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3996 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3997 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3998 | wdiKeepAliveCb: callback for passing back the response |
| 3999 | of the Keep Alive operation received from the |
| 4000 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4002 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4003 | callback |
| 4004 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4005 | @see WDI_PostAssocReq |
| 4006 | @return Result of the function call |
| 4007 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4008 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4009 | WDI_KeepAliveReq |
| 4010 | ( |
| 4011 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams, |
| 4012 | WDI_KeepAliveCb wdiKeepAliveCb, |
| 4013 | void* pUserData |
| 4014 | ) |
| 4015 | { |
| 4016 | WDI_EventInfoType wdiEventData; |
| 4017 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4018 | |
| 4019 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4020 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4021 | ------------------------------------------------------------------------*/ |
| 4022 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4023 | { |
| 4024 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4025 | "WDI_KeepAliveReq: WDI API call before module " |
| 4026 | "is initialized - Fail request"); |
| 4027 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4028 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4029 | } |
| 4030 | |
| 4031 | /*------------------------------------------------------------------------ |
| 4032 | Fill in Event data and post to the Main FSM |
| 4033 | ------------------------------------------------------------------------*/ |
| 4034 | wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4035 | wdiEventData.pEventData = pwdiKeepAliveParams; |
| 4036 | wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams); |
| 4037 | wdiEventData.pCBfnc = wdiKeepAliveCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4038 | wdiEventData.pUserData = pUserData; |
| 4039 | |
| 4040 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4041 | }/*WDI_KeepAliveReq*/ |
| 4042 | |
| 4043 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4044 | @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4045 | wants to set the Wowl Bcast ptrn to minimize unnecessary |
| 4046 | host wakeup due to broadcast traffic while in power |
| 4047 | save. Upon the call of this API the WLAN DAL will pack |
| 4048 | and send a HAL Wowl Bcast ptrn request message to the |
| 4049 | lower RIVA sub-system if DAL is in state STARTED. |
| 4050 | |
| 4051 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4052 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4053 | |
| 4054 | WDI_PostAssocReq must have been called. |
| 4055 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4056 | @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4057 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4058 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4059 | wdiWowlAddBcPtrnCb: callback for passing back the |
| 4060 | response of the add Wowl bcast ptrn operation received |
| 4061 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4062 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4063 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4064 | callback |
| 4065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4066 | @see WDI_PostAssocReq |
| 4067 | @return Result of the function call |
| 4068 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4069 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4070 | WDI_WowlAddBcPtrnReq |
| 4071 | ( |
| 4072 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams, |
| 4073 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb, |
| 4074 | void* pUserData |
| 4075 | ) |
| 4076 | { |
| 4077 | WDI_EventInfoType wdiEventData; |
| 4078 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4079 | |
| 4080 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4081 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4082 | ------------------------------------------------------------------------*/ |
| 4083 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4084 | { |
| 4085 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4086 | "WDI API call before module is initialized - Fail request"); |
| 4087 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4088 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4089 | } |
| 4090 | |
| 4091 | /*------------------------------------------------------------------------ |
| 4092 | Fill in Event data and post to the Main FSM |
| 4093 | ------------------------------------------------------------------------*/ |
| 4094 | wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4095 | wdiEventData.pEventData = pwdiWowlAddBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4096 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4097 | wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4098 | wdiEventData.pUserData = pUserData; |
| 4099 | |
| 4100 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4101 | }/*WDI_WowlAddBcPtrnReq*/ |
| 4102 | |
| 4103 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4104 | @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4105 | wants to clear the Wowl Bcast ptrn. Upon the call of |
| 4106 | this API the WLAN DAL will pack and send a HAL delete |
| 4107 | Wowl Bcast ptrn request message to the lower RIVA |
| 4108 | sub-system if DAL is in state STARTED. |
| 4109 | |
| 4110 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4111 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4112 | |
| 4113 | WDI_WowlAddBcPtrnReq must have been called. |
| 4114 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4115 | @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4116 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4117 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4118 | wdiWowlDelBcPtrnCb: callback for passing back the |
| 4119 | response of the del Wowl bcast ptrn operation received |
| 4120 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4121 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4122 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4123 | callback |
| 4124 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4125 | @see WDI_WowlAddBcPtrnReq |
| 4126 | @return Result of the function call |
| 4127 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4128 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4129 | WDI_WowlDelBcPtrnReq |
| 4130 | ( |
| 4131 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams, |
| 4132 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb, |
| 4133 | void* pUserData |
| 4134 | ) |
| 4135 | { |
| 4136 | WDI_EventInfoType wdiEventData; |
| 4137 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4138 | |
| 4139 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4140 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4141 | ------------------------------------------------------------------------*/ |
| 4142 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4143 | { |
| 4144 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4145 | "WDI API call before module is initialized - Fail request"); |
| 4146 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4147 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4148 | } |
| 4149 | |
| 4150 | /*------------------------------------------------------------------------ |
| 4151 | Fill in Event data and post to the Main FSM |
| 4152 | ------------------------------------------------------------------------*/ |
| 4153 | wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4154 | wdiEventData.pEventData = pwdiWowlDelBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4155 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4156 | wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4157 | wdiEventData.pUserData = pUserData; |
| 4158 | |
| 4159 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4160 | }/*WDI_WowlDelBcPtrnReq*/ |
| 4161 | |
| 4162 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4163 | @brief WDI_WowlEnterReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4164 | wants to enter the Wowl state to minimize unnecessary |
| 4165 | host wakeup while in power save. Upon the call of this |
| 4166 | API the WLAN DAL will pack and send a HAL Wowl enter |
| 4167 | request message to the lower RIVA sub-system if DAL is |
| 4168 | in state STARTED. |
| 4169 | |
| 4170 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4171 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4172 | |
| 4173 | WDI_PostAssocReq must have been called. |
| 4174 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4175 | @param pwdiWowlEnterReqParams: the Wowl enter info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4176 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4177 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4178 | wdiWowlEnterReqCb: callback for passing back the |
| 4179 | response of the enter Wowl operation received from the |
| 4180 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4182 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4183 | callback |
| 4184 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4185 | @see WDI_PostAssocReq |
| 4186 | @return Result of the function call |
| 4187 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4188 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4189 | WDI_WowlEnterReq |
| 4190 | ( |
| 4191 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams, |
| 4192 | WDI_WowlEnterReqCb wdiWowlEnterCb, |
| 4193 | void* pUserData |
| 4194 | ) |
| 4195 | { |
| 4196 | WDI_EventInfoType wdiEventData; |
| 4197 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4198 | |
| 4199 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4200 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4201 | ------------------------------------------------------------------------*/ |
| 4202 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4203 | { |
| 4204 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4205 | "WDI API call before module is initialized - Fail request"); |
| 4206 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4207 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4208 | } |
| 4209 | |
| 4210 | /*------------------------------------------------------------------------ |
| 4211 | Fill in Event data and post to the Main FSM |
| 4212 | ------------------------------------------------------------------------*/ |
| 4213 | wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4214 | wdiEventData.pEventData = pwdiWowlEnterParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4215 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4216 | wdiEventData.pCBfnc = wdiWowlEnterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4217 | wdiEventData.pUserData = pUserData; |
| 4218 | |
| 4219 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4220 | }/*WDI_WowlEnterReq*/ |
| 4221 | |
| 4222 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4223 | @brief WDI_WowlExitReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4224 | wants to exit the Wowl state. Upon the call of this API |
| 4225 | the WLAN DAL will pack and send a HAL Wowl exit request |
| 4226 | message to the lower RIVA sub-system if DAL is in state |
| 4227 | STARTED. |
| 4228 | |
| 4229 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4230 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4231 | |
| 4232 | WDI_WowlEnterReq must have been called. |
| 4233 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4234 | @param pwdiWowlExitReqParams: the Wowl exit info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4235 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4236 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4237 | wdiWowlExitReqCb: callback for passing back the response |
| 4238 | of the exit Wowl operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4240 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4241 | callback |
| 4242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4243 | @see WDI_WowlEnterReq |
| 4244 | @return Result of the function call |
| 4245 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4246 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4247 | WDI_WowlExitReq |
| 4248 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4249 | WDI_WowlExitReqParamsType* pwdiWowlExitParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4250 | WDI_WowlExitReqCb wdiWowlExitCb, |
| 4251 | void* pUserData |
| 4252 | ) |
| 4253 | { |
| 4254 | WDI_EventInfoType wdiEventData; |
| 4255 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4256 | |
| 4257 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4258 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4259 | ------------------------------------------------------------------------*/ |
| 4260 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4261 | { |
| 4262 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4263 | "WDI API call before module is initialized - Fail request"); |
| 4264 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4265 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4266 | } |
| 4267 | |
| 4268 | /*------------------------------------------------------------------------ |
| 4269 | Fill in Event data and post to the Main FSM |
| 4270 | ------------------------------------------------------------------------*/ |
| 4271 | wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4272 | wdiEventData.pEventData = pwdiWowlExitParams; |
| 4273 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlExitParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4274 | wdiEventData.pCBfnc = wdiWowlExitCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4275 | wdiEventData.pUserData = pUserData; |
| 4276 | |
| 4277 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4278 | }/*WDI_WowlExitReq*/ |
| 4279 | |
| 4280 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4281 | @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4282 | the upper MAC wants to dynamically adjusts the listen |
| 4283 | interval based on the WLAN/MSM activity. Upon the call |
| 4284 | of this API the WLAN DAL will pack and send a HAL |
| 4285 | configure Apps Cpu Wakeup State request message to the |
| 4286 | lower RIVA sub-system. |
| 4287 | |
| 4288 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4289 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4290 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4291 | |
| 4292 | @param pwdiConfigureAppsCpuWakeupStateReqParams: the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4293 | Apps Cpu Wakeup State as specified by the |
| 4294 | Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4296 | wdiConfigureAppsCpuWakeupStateCb: callback for passing |
| 4297 | back the response of the configure Apps Cpu Wakeup State |
| 4298 | operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4300 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4301 | callback |
| 4302 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4303 | @return Result of the function call |
| 4304 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4305 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4306 | WDI_ConfigureAppsCpuWakeupStateReq |
| 4307 | ( |
| 4308 | WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams, |
| 4309 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb, |
| 4310 | void* pUserData |
| 4311 | ) |
| 4312 | { |
| 4313 | WDI_EventInfoType wdiEventData; |
| 4314 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4315 | |
| 4316 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4317 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4318 | ------------------------------------------------------------------------*/ |
| 4319 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4320 | { |
| 4321 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4322 | "WDI API call before module is initialized - Fail request"); |
| 4323 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4324 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4325 | } |
| 4326 | |
| 4327 | /*------------------------------------------------------------------------ |
| 4328 | Fill in Event data and post to the Main FSM |
| 4329 | ------------------------------------------------------------------------*/ |
| 4330 | wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4331 | wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams; |
| 4332 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams); |
| 4333 | wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4334 | wdiEventData.pUserData = pUserData; |
| 4335 | |
| 4336 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4337 | }/*WDI_ConfigureAppsCpuWakeupStateReq*/ |
| 4338 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4339 | @brief WDI_FlushAcReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4340 | to to perform a flush operation on a given AC. Upon the |
| 4341 | call of this API the WLAN DAL will pack and send a HAL |
| 4342 | Flush AC request message to the lower RIVA sub-system if |
| 4343 | DAL is in state STARTED. |
| 4344 | |
| 4345 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4346 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4347 | |
| 4348 | WDI_AddBAReq must have been called. |
| 4349 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4350 | @param pwdiFlushAcReqParams: the Flush AC parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4351 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4352 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4353 | wdiFlushAcRspCb: callback for passing back the response |
| 4354 | of the Flush AC operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4355 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4356 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4357 | callback |
| 4358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4359 | @see WDI_AddBAReq |
| 4360 | @return Result of the function call |
| 4361 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4362 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4363 | WDI_FlushAcReq |
| 4364 | ( |
| 4365 | WDI_FlushAcReqParamsType* pwdiFlushAcReqParams, |
| 4366 | WDI_FlushAcRspCb wdiFlushAcRspCb, |
| 4367 | void* pUserData |
| 4368 | ) |
| 4369 | { |
| 4370 | WDI_EventInfoType wdiEventData; |
| 4371 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4372 | |
| 4373 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4374 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4375 | ------------------------------------------------------------------------*/ |
| 4376 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4377 | { |
| 4378 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4379 | "WDI API call before module is initialized - Fail request"); |
| 4380 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4381 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4382 | } |
| 4383 | |
| 4384 | /*------------------------------------------------------------------------ |
| 4385 | Fill in Event data and post to the Main FSM |
| 4386 | ------------------------------------------------------------------------*/ |
| 4387 | wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4388 | wdiEventData.pEventData = pwdiFlushAcReqParams; |
| 4389 | wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams); |
| 4390 | wdiEventData.pCBfnc = wdiFlushAcRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4391 | wdiEventData.pUserData = pUserData; |
| 4392 | |
| 4393 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4394 | |
| 4395 | }/*WDI_FlushAcReq*/ |
| 4396 | |
| 4397 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4398 | @brief WDI_BtAmpEventReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4399 | wants to notify the lower mac on a BT AMP event. This is |
| 4400 | to inform BTC-SLM that some BT AMP event occurred. Upon |
| 4401 | the call of this API the WLAN DAL will pack and send a |
| 4402 | HAL BT AMP event request message to the lower RIVA |
| 4403 | sub-system if DAL is in state STARTED. |
| 4404 | |
| 4405 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4406 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4407 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4408 | |
| 4409 | @param wdiBtAmpEventReqParams: the BT AMP event parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4410 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4411 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4412 | wdiBtAmpEventRspCb: callback for passing back the |
| 4413 | response of the BT AMP event operation received from the |
| 4414 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4415 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4416 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4417 | callback |
| 4418 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4419 | @return Result of the function call |
| 4420 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4421 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4422 | WDI_BtAmpEventReq |
| 4423 | ( |
| 4424 | WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams, |
| 4425 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb, |
| 4426 | void* pUserData |
| 4427 | ) |
| 4428 | { |
| 4429 | WDI_EventInfoType wdiEventData; |
| 4430 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4431 | |
| 4432 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4433 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4434 | ------------------------------------------------------------------------*/ |
| 4435 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4436 | { |
| 4437 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4438 | "WDI API call before module is initialized - Fail request"); |
| 4439 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4440 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4441 | } |
| 4442 | |
| 4443 | /*------------------------------------------------------------------------ |
| 4444 | Fill in Event data and post to the Main FSM |
| 4445 | ------------------------------------------------------------------------*/ |
| 4446 | wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4447 | wdiEventData.pEventData = pwdiBtAmpEventReqParams; |
| 4448 | wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams); |
| 4449 | wdiEventData.pCBfnc = wdiBtAmpEventRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4450 | wdiEventData.pUserData = pUserData; |
| 4451 | |
| 4452 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4453 | |
| 4454 | }/*WDI_BtAmpEventReq*/ |
| 4455 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4456 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 4457 | /** |
| 4458 | @brief WDI_Start Oem Data Req will be called when the upper MAC |
| 4459 | wants to notify the lower mac on a oem data Req event.Upon |
| 4460 | the call of this API the WLAN DAL will pack and send a |
| 4461 | HAL OEM Data Req event request message to the lower RIVA |
| 4462 | sub-system if DAL is in state STARTED. |
| 4463 | |
| 4464 | In state BUSY this request will be queued. Request won't |
| 4465 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4466 | |
| 4467 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4468 | |
| 4469 | @param pwdiOemDataReqParams: the Oem Data Req as |
| 4470 | specified by the Device Interface |
| 4471 | |
| 4472 | wdiStartOemDataRspCb: callback for passing back the |
| 4473 | response of the Oem Data Req received from the |
| 4474 | device |
| 4475 | |
| 4476 | pUserData: user data will be passed back with the |
| 4477 | callback |
| 4478 | |
| 4479 | @return Result of the function call |
| 4480 | */ |
| 4481 | WDI_Status |
| 4482 | WDI_StartOemDataReq |
| 4483 | ( |
| 4484 | WDI_oemDataReqParamsType* pwdiOemDataReqParams, |
| 4485 | WDI_oemDataRspCb wdiOemDataRspCb, |
| 4486 | void* pUserData |
| 4487 | ) |
| 4488 | { |
| 4489 | WDI_EventInfoType wdiEventData; |
| 4490 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4491 | |
| 4492 | /*------------------------------------------------------------------------ |
| 4493 | Sanity Check |
| 4494 | ------------------------------------------------------------------------*/ |
| 4495 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4496 | { |
| 4497 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4498 | "WDI API call before module is initialized - Fail request"); |
| 4499 | |
| 4500 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4501 | } |
| 4502 | |
| 4503 | /*------------------------------------------------------------------------ |
| 4504 | Fill in Event data and post to the Main FSM |
| 4505 | ------------------------------------------------------------------------*/ |
| 4506 | wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ; |
| 4507 | wdiEventData.pEventData = pwdiOemDataReqParams; |
| 4508 | wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams); |
| 4509 | wdiEventData.pCBfnc = wdiOemDataRspCb; |
| 4510 | wdiEventData.pUserData = pUserData; |
| 4511 | |
| 4512 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4513 | |
| 4514 | |
| 4515 | } |
| 4516 | |
| 4517 | #endif |
| 4518 | |
| 4519 | |
| 4520 | /*======================================================================== |
| 4521 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4522 | CONTROL APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4523 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4524 | ==========================================================================*/ |
| 4525 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4526 | @brief WDI_SwitchChReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4527 | the WLAN HW to change the current channel of operation. |
| 4528 | Upon the call of this API the WLAN DAL will pack and |
| 4529 | send a HAL Start request message to the lower RIVA |
| 4530 | sub-system if DAL is in state STARTED. |
| 4531 | |
| 4532 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4533 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4534 | |
| 4535 | WDI_Start must have been called. |
| 4536 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4537 | @param wdiSwitchChReqParams: the switch ch parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4538 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4539 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4540 | wdiSwitchChRspCb: callback for passing back the response |
| 4541 | of the switch ch operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4542 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4543 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4544 | callback |
| 4545 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4546 | @see WDI_Start |
| 4547 | @return Result of the function call |
| 4548 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4549 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | WDI_SwitchChReq |
| 4551 | ( |
| 4552 | WDI_SwitchChReqParamsType* pwdiSwitchChReqParams, |
| 4553 | WDI_SwitchChRspCb wdiSwitchChRspCb, |
| 4554 | void* pUserData |
| 4555 | ) |
| 4556 | { |
| 4557 | WDI_EventInfoType wdiEventData; |
| 4558 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4559 | |
| 4560 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4561 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4562 | ------------------------------------------------------------------------*/ |
| 4563 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4564 | { |
| 4565 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4566 | "WDI API call before module is initialized - Fail request"); |
| 4567 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4568 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4569 | } |
| 4570 | |
| 4571 | /*------------------------------------------------------------------------ |
| 4572 | Fill in Event data and post to the Main FSM |
| 4573 | ------------------------------------------------------------------------*/ |
| 4574 | wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4575 | wdiEventData.pEventData = pwdiSwitchChReqParams; |
| 4576 | wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams); |
| 4577 | wdiEventData.pCBfnc = wdiSwitchChRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4578 | wdiEventData.pUserData = pUserData; |
| 4579 | |
| 4580 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4581 | |
| 4582 | }/*WDI_SwitchChReq*/ |
| 4583 | |
| 4584 | |
| 4585 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4586 | @brief WDI_ConfigSTAReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4587 | wishes to add or update a STA in HW. Upon the call of |
| 4588 | this API the WLAN DAL will pack and send a HAL Start |
| 4589 | message request message to the lower RIVA sub-system if |
| 4590 | DAL is in state STARTED. |
| 4591 | |
| 4592 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4593 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4594 | |
| 4595 | WDI_Start must have been called. |
| 4596 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4597 | @param wdiConfigSTAReqParams: the config STA parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4598 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4599 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4600 | wdiConfigSTARspCb: callback for passing back the |
| 4601 | response of the config STA operation received from the |
| 4602 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4603 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4604 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4605 | callback |
| 4606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4607 | @see WDI_Start |
| 4608 | @return Result of the function call |
| 4609 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4610 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4611 | WDI_ConfigSTAReq |
| 4612 | ( |
| 4613 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams, |
| 4614 | WDI_ConfigSTARspCb wdiConfigSTARspCb, |
| 4615 | void* pUserData |
| 4616 | ) |
| 4617 | { |
| 4618 | WDI_EventInfoType wdiEventData; |
| 4619 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4620 | |
| 4621 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4622 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4623 | ------------------------------------------------------------------------*/ |
| 4624 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4625 | { |
| 4626 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4627 | "WDI API call before module is initialized - Fail request"); |
| 4628 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4629 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4630 | } |
| 4631 | |
| 4632 | /*------------------------------------------------------------------------ |
| 4633 | Fill in Event data and post to the Main FSM |
| 4634 | ------------------------------------------------------------------------*/ |
| 4635 | wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4636 | wdiEventData.pEventData = pwdiConfigSTAReqParams; |
| 4637 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams); |
| 4638 | wdiEventData.pCBfnc = wdiConfigSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4639 | wdiEventData.pUserData = pUserData; |
| 4640 | |
| 4641 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4642 | |
| 4643 | }/*WDI_ConfigSTAReq*/ |
| 4644 | |
| 4645 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4646 | @brief WDI_SetLinkStateReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4647 | wants to change the state of an ongoing link. Upon the |
| 4648 | call of this API the WLAN DAL will pack and send a HAL |
| 4649 | Start message request message to the lower RIVA |
| 4650 | sub-system if DAL is in state STARTED. |
| 4651 | |
| 4652 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4653 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4654 | |
| 4655 | WDI_JoinStartReq must have been called. |
| 4656 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4657 | @param wdiSetLinkStateReqParams: the set link state parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4658 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4660 | wdiSetLinkStateRspCb: callback for passing back the |
| 4661 | response of the set link state operation received from |
| 4662 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4664 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4665 | callback |
| 4666 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4667 | @see WDI_JoinStartReq |
| 4668 | @return Result of the function call |
| 4669 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4670 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4671 | WDI_SetLinkStateReq |
| 4672 | ( |
| 4673 | WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams, |
| 4674 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb, |
| 4675 | void* pUserData |
| 4676 | ) |
| 4677 | { |
| 4678 | WDI_EventInfoType wdiEventData; |
| 4679 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4680 | |
| 4681 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4682 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4683 | ------------------------------------------------------------------------*/ |
| 4684 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4685 | { |
| 4686 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4687 | "WDI API call before module is initialized - Fail request"); |
| 4688 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4689 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4690 | } |
| 4691 | |
| 4692 | /*------------------------------------------------------------------------ |
| 4693 | Fill in Event data and post to the Main FSM |
| 4694 | ------------------------------------------------------------------------*/ |
| 4695 | wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4696 | wdiEventData.pEventData = pwdiSetLinkStateReqParams; |
| 4697 | wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams); |
| 4698 | wdiEventData.pCBfnc = wdiSetLinkStateRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4699 | wdiEventData.pUserData = pUserData; |
| 4700 | |
| 4701 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4702 | |
| 4703 | }/*WDI_SetLinkStateReq*/ |
| 4704 | |
| 4705 | |
| 4706 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4707 | @brief WDI_GetStatsReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4708 | to get statistics (MIB counters) from the device. Upon |
| 4709 | the call of this API the WLAN DAL will pack and send a |
| 4710 | HAL Start request message to the lower RIVA sub-system |
| 4711 | if DAL is in state STARTED. |
| 4712 | |
| 4713 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4714 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4715 | |
| 4716 | WDI_Start must have been called. |
| 4717 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4718 | @param wdiGetStatsReqParams: the stats parameters to get as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4719 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4720 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4721 | wdiGetStatsRspCb: callback for passing back the response |
| 4722 | of the get stats operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4723 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4724 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4725 | callback |
| 4726 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4727 | @see WDI_Start |
| 4728 | @return Result of the function call |
| 4729 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4730 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4731 | WDI_GetStatsReq |
| 4732 | ( |
| 4733 | WDI_GetStatsReqParamsType* pwdiGetStatsReqParams, |
| 4734 | WDI_GetStatsRspCb wdiGetStatsRspCb, |
| 4735 | void* pUserData |
| 4736 | ) |
| 4737 | { |
| 4738 | WDI_EventInfoType wdiEventData; |
| 4739 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4740 | |
| 4741 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4742 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4743 | ------------------------------------------------------------------------*/ |
| 4744 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4745 | { |
| 4746 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4747 | "WDI API call before module is initialized - Fail request"); |
| 4748 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4749 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4750 | } |
| 4751 | |
| 4752 | /*------------------------------------------------------------------------ |
| 4753 | Fill in Event data and post to the Main FSM |
| 4754 | ------------------------------------------------------------------------*/ |
| 4755 | wdiEventData.wdiRequest = WDI_GET_STATS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4756 | wdiEventData.pEventData = pwdiGetStatsReqParams; |
| 4757 | wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams); |
| 4758 | wdiEventData.pCBfnc = wdiGetStatsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4759 | wdiEventData.pUserData = pUserData; |
| 4760 | |
| 4761 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4762 | |
| 4763 | }/*WDI_GetStatsReq*/ |
| 4764 | |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4765 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 4766 | /** |
| 4767 | @brief WDI_GetRoamRssiReq will be called when the upper MAC wants |
| 4768 | to get roam rssi from the device. Upon |
| 4769 | the call of this API the WLAN DAL will pack and send a |
| 4770 | HAL Start request message to the lower RIVA sub-system |
| 4771 | if DAL is in state STARTED. |
| 4772 | |
| 4773 | In state BUSY this request will be queued. Request won't |
| 4774 | be allowed in any other state. |
| 4775 | |
| 4776 | WDI_Start must have been called. |
| 4777 | |
| 4778 | @param wdiGetRoamRssiReqParams: the stats parameters to get as |
| 4779 | specified by the Device Interface |
| 4780 | |
| 4781 | wdiGetRoamRssiRspCb: callback for passing back the response |
| 4782 | of the get stats operation received from the device |
| 4783 | |
| 4784 | pUserData: user data will be passed back with the |
| 4785 | callback |
| 4786 | |
| 4787 | @see WDI_Start |
| 4788 | @return Result of the function call |
| 4789 | */ |
| 4790 | WDI_Status |
| 4791 | WDI_GetRoamRssiReq |
| 4792 | ( |
| 4793 | WDI_GetRoamRssiReqParamsType* pwdiGetRoamRssiReqParams, |
| 4794 | WDI_GetRoamRssiRspCb wdiGetRoamRssiRspCb, |
| 4795 | void* pUserData |
| 4796 | ) |
| 4797 | { |
| 4798 | WDI_EventInfoType wdiEventData; |
| 4799 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4800 | |
| 4801 | /*------------------------------------------------------------------------ |
| 4802 | Sanity Check |
| 4803 | ------------------------------------------------------------------------*/ |
| 4804 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4805 | { |
| 4806 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4807 | "WDI API call before module is initialized - Fail request"); |
| 4808 | |
| 4809 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4810 | } |
| 4811 | /*------------------------------------------------------------------------ |
| 4812 | Fill in Event data and post to the Main FSM |
| 4813 | ------------------------------------------------------------------------*/ |
| 4814 | wdiEventData.wdiRequest = WDI_GET_ROAM_RSSI_REQ; |
| 4815 | wdiEventData.pEventData = pwdiGetRoamRssiReqParams; |
| 4816 | wdiEventData.uEventDataSize = sizeof(*pwdiGetRoamRssiReqParams); |
| 4817 | wdiEventData.pCBfnc = wdiGetRoamRssiRspCb; |
| 4818 | wdiEventData.pUserData = pUserData; |
| 4819 | |
| 4820 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4821 | |
| 4822 | }/*WDI_GetRoamRssiReq*/ |
| 4823 | #endif |
| 4824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4825 | |
| 4826 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4827 | @brief WDI_UpdateCfgReq will be called when the upper MAC when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4828 | it wishes to change the configuration of the WLAN |
| 4829 | Device. Upon the call of this API the WLAN DAL will pack |
| 4830 | and send a HAL Update CFG request message to the lower |
| 4831 | RIVA sub-system if DAL is in state STARTED. |
| 4832 | |
| 4833 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4834 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4835 | |
| 4836 | WDI_Start must have been called. |
| 4837 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4838 | @param wdiUpdateCfgReqParams: the update cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4839 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4840 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4841 | wdiUpdateCfgsRspCb: callback for passing back the |
| 4842 | response of the update cfg operation received from the |
| 4843 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4844 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4845 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4846 | callback |
| 4847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4848 | @see WDI_Start |
| 4849 | @return Result of the function call |
| 4850 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4851 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4852 | WDI_UpdateCfgReq |
| 4853 | ( |
| 4854 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams, |
| 4855 | WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb, |
| 4856 | void* pUserData |
| 4857 | ) |
| 4858 | { |
| 4859 | WDI_EventInfoType wdiEventData; |
| 4860 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4861 | |
| 4862 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4863 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4864 | ------------------------------------------------------------------------*/ |
| 4865 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4866 | { |
| 4867 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4868 | "WDI API call before module is initialized - Fail request"); |
| 4869 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4870 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4871 | } |
| 4872 | |
| 4873 | /*------------------------------------------------------------------------ |
| 4874 | Fill in Event data and post to the Main FSM |
| 4875 | ------------------------------------------------------------------------*/ |
| 4876 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4877 | wdiEventData.pEventData = pwdiUpdateCfgReqParams; |
| 4878 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams); |
| 4879 | wdiEventData.pCBfnc = wdiUpdateCfgsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4880 | wdiEventData.pUserData = pUserData; |
| 4881 | |
| 4882 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4883 | |
| 4884 | }/*WDI_UpdateCfgReq*/ |
| 4885 | |
| 4886 | |
| 4887 | |
| 4888 | /** |
| 4889 | @brief WDI_AddBAReq will be called when the upper MAC has setup |
| 4890 | successfully a BA session and needs to notify the HW for |
| 4891 | the appropriate settings to take place. Upon the call of |
| 4892 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4893 | request message to the lower RIVA sub-system if DAL is |
| 4894 | in state STARTED. |
| 4895 | |
| 4896 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4897 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4898 | |
| 4899 | WDI_PostAssocReq must have been called. |
| 4900 | |
| 4901 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4902 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4903 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4904 | wdiAddBARspCb: callback for passing back the response of |
| 4905 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4906 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4907 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4908 | callback |
| 4909 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4910 | @see WDI_PostAssocReq |
| 4911 | @return Result of the function call |
| 4912 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4913 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4914 | WDI_AddBAReq |
| 4915 | ( |
| 4916 | WDI_AddBAReqParamsType* pwdiAddBAReqParams, |
| 4917 | WDI_AddBARspCb wdiAddBARspCb, |
| 4918 | void* pUserData |
| 4919 | ) |
| 4920 | { |
| 4921 | WDI_EventInfoType wdiEventData; |
| 4922 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4923 | |
| 4924 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4925 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4926 | ------------------------------------------------------------------------*/ |
| 4927 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4928 | { |
| 4929 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4930 | "WDI API call before module is initialized - Fail request"); |
| 4931 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4932 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4933 | } |
| 4934 | |
| 4935 | /*------------------------------------------------------------------------ |
| 4936 | Fill in Event data and post to the Main FSM |
| 4937 | ------------------------------------------------------------------------*/ |
| 4938 | wdiEventData.wdiRequest = WDI_ADD_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4939 | wdiEventData.pEventData = pwdiAddBAReqParams; |
| 4940 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams); |
| 4941 | wdiEventData.pCBfnc = wdiAddBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4942 | wdiEventData.pUserData = pUserData; |
| 4943 | |
| 4944 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4945 | |
| 4946 | }/*WDI_AddBAReq*/ |
| 4947 | |
| 4948 | |
| 4949 | /** |
| 4950 | @brief WDI_TriggerBAReq will be called when the upper MAC has setup |
| 4951 | successfully a BA session and needs to notify the HW for |
| 4952 | the appropriate settings to take place. Upon the call of |
| 4953 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4954 | request message to the lower RIVA sub-system if DAL is |
| 4955 | in state STARTED. |
| 4956 | |
| 4957 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4958 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4959 | |
| 4960 | WDI_PostAssocReq must have been called. |
| 4961 | |
| 4962 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4963 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4964 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4965 | wdiAddBARspCb: callback for passing back the response of |
| 4966 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4968 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4969 | callback |
| 4970 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4971 | @see WDI_PostAssocReq |
| 4972 | @return Result of the function call |
| 4973 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4974 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4975 | WDI_TriggerBAReq |
| 4976 | ( |
| 4977 | WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams, |
| 4978 | WDI_TriggerBARspCb wdiTriggerBARspCb, |
| 4979 | void* pUserData |
| 4980 | ) |
| 4981 | { |
| 4982 | WDI_EventInfoType wdiEventData; |
| 4983 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4984 | |
| 4985 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4986 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4987 | ------------------------------------------------------------------------*/ |
| 4988 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4989 | { |
| 4990 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4991 | "WDI API call before module is initialized - Fail request"); |
| 4992 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4993 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4994 | } |
| 4995 | |
| 4996 | /*------------------------------------------------------------------------ |
| 4997 | Fill in Event data and post to the Main FSM |
| 4998 | ------------------------------------------------------------------------*/ |
| 4999 | wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5000 | wdiEventData.pEventData = pwdiTriggerBAReqParams; |
| 5001 | wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams); |
| 5002 | wdiEventData.pCBfnc = wdiTriggerBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5003 | wdiEventData.pUserData = pUserData; |
| 5004 | |
| 5005 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5006 | |
| 5007 | }/*WDI_AddBAReq*/ |
| 5008 | |
| 5009 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5010 | @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5011 | wishes to update any of the Beacon parameters used by HW. |
| 5012 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request |
| 5013 | message to the lower RIVA sub-system if DAL is in state |
| 5014 | STARTED. |
| 5015 | |
| 5016 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5017 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5018 | |
| 5019 | WDI_PostAssocReq must have been called. |
| 5020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5021 | @param wdiUpdateBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5022 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5023 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5024 | wdiUpdateBeaconParamsRspCb: callback for passing back the |
| 5025 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5026 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5027 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5028 | callback |
| 5029 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5030 | @see WDI_PostAssocReq |
| 5031 | @return Result of the function call |
| 5032 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5033 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5034 | WDI_UpdateBeaconParamsReq |
| 5035 | ( |
| 5036 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams, |
| 5037 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb, |
| 5038 | void* pUserData |
| 5039 | ) |
| 5040 | { |
| 5041 | WDI_EventInfoType wdiEventData; |
| 5042 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5043 | |
| 5044 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5045 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5046 | ------------------------------------------------------------------------*/ |
| 5047 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5048 | { |
| 5049 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5050 | "WDI API call before module is initialized - Fail request"); |
| 5051 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5052 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5053 | } |
| 5054 | |
| 5055 | /*------------------------------------------------------------------------ |
| 5056 | Fill in Event data and post to the Main FSM |
| 5057 | ------------------------------------------------------------------------*/ |
| 5058 | wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5059 | wdiEventData.pEventData = pwdiUpdateBeaconParams; |
| 5060 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams); |
| 5061 | wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5062 | wdiEventData.pUserData = pUserData; |
| 5063 | |
| 5064 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5065 | |
| 5066 | }/*WDI_UpdateBeaconParamsReq*/ |
| 5067 | |
| 5068 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5069 | @brief WDI_SendBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5070 | wishes to update the Beacon template used by HW. |
| 5071 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request |
| 5072 | message to the lower RIVA sub-system if DAL is in state |
| 5073 | STARTED. |
| 5074 | |
| 5075 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5076 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5077 | |
| 5078 | WDI_PostAssocReq must have been called. |
| 5079 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5080 | @param wdiSendBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5081 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5082 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5083 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5084 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5086 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5087 | callback |
| 5088 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5089 | @see WDI_PostAssocReq |
| 5090 | @return Result of the function call |
| 5091 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5092 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5093 | WDI_SendBeaconParamsReq |
| 5094 | ( |
| 5095 | WDI_SendBeaconParamsType* pwdiSendBeaconParams, |
| 5096 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb, |
| 5097 | void* pUserData |
| 5098 | ) |
| 5099 | { |
| 5100 | WDI_EventInfoType wdiEventData; |
| 5101 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5102 | |
| 5103 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5104 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5105 | ------------------------------------------------------------------------*/ |
| 5106 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5107 | { |
| 5108 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5109 | "WDI API call before module is initialized - Fail request"); |
| 5110 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5111 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5112 | } |
| 5113 | |
| 5114 | /*------------------------------------------------------------------------ |
| 5115 | Fill in Event data and post to the Main FSM |
| 5116 | ------------------------------------------------------------------------*/ |
| 5117 | wdiEventData.wdiRequest = WDI_SND_BCON_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5118 | wdiEventData.pEventData = pwdiSendBeaconParams; |
| 5119 | wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams); |
| 5120 | wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5121 | wdiEventData.pUserData = pUserData; |
| 5122 | |
| 5123 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5124 | |
| 5125 | }/*WDI_SendBeaconParamsReq*/ |
| 5126 | |
| 5127 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5128 | @brief WDI_UpdateProbeRspTemplateReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5129 | upper MAC wants to update the probe response template to |
| 5130 | be transmitted as Soft AP |
| 5131 | Upon the call of this API the WLAN DAL will |
| 5132 | pack and send the probe rsp template message to the |
| 5133 | lower RIVA sub-system if DAL is in state STARTED. |
| 5134 | |
| 5135 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5136 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5137 | |
| 5138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5139 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5140 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5142 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5143 | response of the Send Beacon Params operation received |
| 5144 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5145 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5146 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5147 | callback |
| 5148 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5149 | @see WDI_AddBAReq |
| 5150 | @return Result of the function call |
| 5151 | */ |
| 5152 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5153 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5154 | WDI_UpdateProbeRspTemplateReq |
| 5155 | ( |
| 5156 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams, |
| 5157 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb, |
| 5158 | void* pUserData |
| 5159 | ) |
| 5160 | { |
| 5161 | WDI_EventInfoType wdiEventData; |
| 5162 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5163 | |
| 5164 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5165 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5166 | ------------------------------------------------------------------------*/ |
| 5167 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5168 | { |
| 5169 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5170 | "WDI API call before module is initialized - Fail request"); |
| 5171 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5172 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5173 | } |
| 5174 | |
| 5175 | /*------------------------------------------------------------------------ |
| 5176 | Fill in Event data and post to the Main FSM |
| 5177 | ------------------------------------------------------------------------*/ |
| 5178 | wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5179 | wdiEventData.pEventData = pwdiUpdateProbeRspParams; |
| 5180 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams); |
| 5181 | wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5182 | wdiEventData.pUserData = pUserData; |
| 5183 | |
| 5184 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5185 | |
| 5186 | }/*WDI_UpdateProbeRspTemplateReq*/ |
| 5187 | |
| 5188 | /** |
| 5189 | @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob |
| 5190 | to the NV memory. |
| 5191 | |
| 5192 | |
| 5193 | @param wdiNvDownloadReqParams: the NV Download parameters as specified by |
| 5194 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5196 | wdiNvDownloadRspCb: callback for passing back the response of |
| 5197 | the NV Download operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5198 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5199 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5200 | callback |
| 5201 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5202 | @see WDI_PostAssocReq |
| 5203 | @return Result of the function call |
| 5204 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5205 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5206 | WDI_NvDownloadReq |
| 5207 | ( |
| 5208 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams, |
| 5209 | WDI_NvDownloadRspCb wdiNvDownloadRspCb, |
| 5210 | void* pUserData |
| 5211 | ) |
| 5212 | { |
| 5213 | WDI_EventInfoType wdiEventData; |
| 5214 | |
| 5215 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5216 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5217 | ------------------------------------------------------------------------*/ |
| 5218 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5219 | { |
| 5220 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5221 | "WDI API call before module is initialized - Fail request"); |
| 5222 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5223 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5224 | } |
| 5225 | |
| 5226 | /*------------------------------------------------------------------------ |
| 5227 | Fill in Event data and post to the Main FSM |
| 5228 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5229 | wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ; |
| 5230 | wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams; |
| 5231 | wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams); |
| 5232 | wdiEventData.pCBfnc = wdiNvDownloadRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5233 | wdiEventData.pUserData = pUserData; |
| 5234 | |
| 5235 | return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData); |
| 5236 | |
| 5237 | }/*WDI_NVDownloadReq*/ |
| 5238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5239 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5240 | @brief WDI_SetP2PGONOAReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5241 | upper MAC wants to send Notice of Absence |
| 5242 | Upon the call of this API the WLAN DAL will |
| 5243 | pack and send the probe rsp template message to the |
| 5244 | lower RIVA sub-system if DAL is in state STARTED. |
| 5245 | |
| 5246 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5247 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5248 | |
| 5249 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5250 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5251 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5252 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5253 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5254 | response of the Send Beacon Params operation received |
| 5255 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5256 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5257 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5258 | callback |
| 5259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5260 | @see WDI_AddBAReq |
| 5261 | @return Result of the function call |
| 5262 | */ |
| 5263 | WDI_Status |
| 5264 | WDI_SetP2PGONOAReq |
| 5265 | ( |
| 5266 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams, |
| 5267 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb, |
| 5268 | void* pUserData |
| 5269 | ) |
| 5270 | { |
| 5271 | WDI_EventInfoType wdiEventData; |
| 5272 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5273 | |
| 5274 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5275 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5276 | ------------------------------------------------------------------------*/ |
| 5277 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5278 | { |
| 5279 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5280 | "WDI API call before module is initialized - Fail request"); |
| 5281 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5282 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5283 | } |
| 5284 | |
| 5285 | /*------------------------------------------------------------------------ |
| 5286 | Fill in Event data and post to the Main FSM |
| 5287 | ------------------------------------------------------------------------*/ |
| 5288 | wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5289 | wdiEventData.pEventData = pwdiP2PGONOAReqParams; |
| 5290 | wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams); |
| 5291 | wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5292 | wdiEventData.pUserData = pUserData; |
| 5293 | |
| 5294 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5295 | |
| 5296 | }/*WDI_SetP2PGONOAReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5297 | |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 5298 | #ifdef FEATURE_WLAN_TDLS |
| 5299 | /** |
| 5300 | @brief WDI_SetTDLSLinkEstablishReq will be called when the |
| 5301 | upper MAC wants to send TDLS Link Establish Request Parameters |
| 5302 | Upon the call of this API the WLAN DAL will |
| 5303 | pack and send the TDLS Link Establish Request message to the |
| 5304 | lower RIVA sub-system if DAL is in state STARTED. |
| 5305 | |
| 5306 | In state BUSY this request will be queued. Request won't |
| 5307 | be allowed in any other state. |
| 5308 | |
| 5309 | |
| 5310 | @param pwdiTDLSLinkEstablishReqParams: TDLS Peer Parameters |
| 5311 | for Link Establishment (Used for PUAPSD , TDLS Off Channel ...) |
| 5312 | |
| 5313 | wdiTDLSLinkEstablishReqRspCb: callback for passing back the |
| 5314 | response of the TDLS Link Establish request received |
| 5315 | from the device |
| 5316 | |
| 5317 | pUserData: user data will be passed back with the |
| 5318 | callback |
| 5319 | |
| 5320 | @see |
| 5321 | @return Result of the function call |
| 5322 | */ |
| 5323 | WDI_Status |
| 5324 | WDI_SetTDLSLinkEstablishReq |
| 5325 | ( |
| 5326 | WDI_SetTDLSLinkEstablishReqParamsType* pwdiTDLSLinkEstablishReqParams, |
| 5327 | WDI_SetTDLSLinkEstablishReqParamsRspCb wdiTDLSLinkEstablishReqRspCb, |
| 5328 | void* pUserData |
| 5329 | ) |
| 5330 | { |
| 5331 | WDI_EventInfoType wdiEventData; |
| 5332 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5333 | |
| 5334 | /*------------------------------------------------------------------------ |
| 5335 | Sanity Check |
| 5336 | ------------------------------------------------------------------------*/ |
| 5337 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5338 | { |
| 5339 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5340 | "WDI API call before module is initialized - Fail request"); |
| 5341 | |
| 5342 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5343 | } |
| 5344 | |
| 5345 | /*------------------------------------------------------------------------ |
| 5346 | Fill in Event data and post to the Main FSM |
| 5347 | ------------------------------------------------------------------------*/ |
| 5348 | wdiEventData.wdiRequest = WDI_TDLS_LINK_ESTABLISH_REQ; |
| 5349 | wdiEventData.pEventData = pwdiTDLSLinkEstablishReqParams; |
| 5350 | wdiEventData.uEventDataSize = sizeof(*pwdiTDLSLinkEstablishReqParams); |
| 5351 | wdiEventData.pCBfnc = wdiTDLSLinkEstablishReqRspCb; |
| 5352 | wdiEventData.pUserData = pUserData; |
| 5353 | |
| 5354 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5355 | |
| 5356 | }/*WDI_SetTDLSLinkEstablishReq*/ |
| 5357 | #endif |
| 5358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5359 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5360 | @brief WDI_AddSTASelfReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5361 | UMAC wanted to add STA self while opening any new session |
| 5362 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5363 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5364 | |
| 5365 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5366 | @param pwdiAddSTASelfParams: the add sta self parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5367 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5368 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5369 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5370 | callback |
| 5371 | |
| 5372 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5373 | @return Result of the function call |
| 5374 | */ |
| 5375 | WDI_Status |
| 5376 | WDI_AddSTASelfReq |
| 5377 | ( |
| 5378 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams, |
| 5379 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb, |
| 5380 | void* pUserData |
| 5381 | ) |
| 5382 | { |
| 5383 | WDI_EventInfoType wdiEventData; |
| 5384 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5385 | |
| 5386 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5387 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5388 | ------------------------------------------------------------------------*/ |
| 5389 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5390 | { |
| 5391 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5392 | "WDI API call before module is initialized - Fail request"); |
| 5393 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5394 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5395 | } |
| 5396 | |
| 5397 | /*------------------------------------------------------------------------ |
| 5398 | Fill in Event data and post to the Main FSM |
| 5399 | ------------------------------------------------------------------------*/ |
| 5400 | wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5401 | wdiEventData.pEventData = pwdiAddSTASelfReqParams; |
| 5402 | wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams); |
| 5403 | wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5404 | wdiEventData.pUserData = pUserData; |
| 5405 | |
| 5406 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5407 | |
| 5408 | }/*WDI_AddSTASelfReq*/ |
| 5409 | |
| 5410 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5411 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5412 | /** |
| 5413 | @brief WDI_AggrAddTSReq will be called when the upper MAC to inform |
| 5414 | the device of a successful add TSpec negotiation. HW |
| 5415 | needs to receive the TSpec Info from the UMAC in order |
| 5416 | to configure properly the QoS data traffic. Upon the |
| 5417 | call of this API the WLAN DAL will pack and send a HAL |
| 5418 | Add TS request message to the lower RIVA sub-system if |
| 5419 | DAL is in state STARTED. |
| 5420 | |
| 5421 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5422 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5423 | |
| 5424 | WDI_PostAssocReq must have been called. |
| 5425 | |
| 5426 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 5427 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5429 | wdiAddTsRspCb: callback for passing back the response of |
| 5430 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5431 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5432 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5433 | callback |
| 5434 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5435 | @see WDI_PostAssocReq |
| 5436 | @return Result of the function call |
| 5437 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5438 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5439 | WDI_AggrAddTSReq |
| 5440 | ( |
| 5441 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams, |
| 5442 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb, |
| 5443 | void* pUserData |
| 5444 | ) |
| 5445 | { |
| 5446 | WDI_EventInfoType wdiEventData; |
| 5447 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5448 | |
| 5449 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5450 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5451 | ------------------------------------------------------------------------*/ |
| 5452 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5453 | { |
| 5454 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5455 | "WDI API call before module is initialized - Fail request"); |
| 5456 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5457 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5458 | } |
| 5459 | |
| 5460 | /*------------------------------------------------------------------------ |
| 5461 | Fill in Event data and post to the Main FSM |
| 5462 | ------------------------------------------------------------------------*/ |
| 5463 | wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5464 | wdiEventData.pEventData = pwdiAggrAddTsReqParams; |
| 5465 | wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams); |
| 5466 | wdiEventData.pCBfnc = wdiAggrAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5467 | wdiEventData.pUserData = pUserData; |
| 5468 | |
| 5469 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5470 | |
| 5471 | }/*WDI_AggrAddTSReq*/ |
| 5472 | |
| 5473 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 5474 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5475 | /** |
| 5476 | @brief WDI_FTMCommandReq |
| 5477 | Post FTM Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5478 | |
| 5479 | @param ftmCommandReq: FTM Command Body |
| 5480 | @param ftmCommandRspCb: FTM Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5481 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5482 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5483 | @see |
| 5484 | @return Result of the function call |
| 5485 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5486 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5487 | WDI_FTMCommandReq |
| 5488 | ( |
| 5489 | WDI_FTMCommandReqType *ftmCommandReq, |
| 5490 | WDI_FTMCommandRspCb ftmCommandRspCb, |
| 5491 | void *pUserData |
| 5492 | ) |
| 5493 | { |
| 5494 | WDI_EventInfoType wdiEventData; |
| 5495 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5496 | |
| 5497 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5498 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5499 | ------------------------------------------------------------------------*/ |
| 5500 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5501 | { |
| 5502 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5503 | "WDI API call before module is initialized - Fail request"); |
| 5504 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5505 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5506 | } |
| 5507 | |
| 5508 | /*------------------------------------------------------------------------ |
| 5509 | Fill in Event data and post to the Main FSM |
| 5510 | ------------------------------------------------------------------------*/ |
| 5511 | wdiEventData.wdiRequest = WDI_FTM_CMD_REQ; |
| 5512 | wdiEventData.pEventData = (void *)ftmCommandReq; |
| 5513 | wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32); |
| 5514 | wdiEventData.pCBfnc = ftmCommandRspCb; |
| 5515 | wdiEventData.pUserData = pUserData; |
| 5516 | |
| 5517 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5518 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5519 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5520 | @brief WDI_HostResumeReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5521 | |
| 5522 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5523 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5524 | |
| 5525 | |
| 5526 | @param pwdiResumeReqParams: as specified by |
| 5527 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5528 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5529 | wdiResumeReqRspCb: callback for passing back the response of |
| 5530 | the Resume Req received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5532 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5533 | callback |
| 5534 | |
| 5535 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5536 | @return Result of the function call |
| 5537 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5538 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5539 | WDI_HostResumeReq |
| 5540 | ( |
| 5541 | WDI_ResumeParamsType* pwdiResumeReqParams, |
| 5542 | WDI_HostResumeEventRspCb wdiResumeReqRspCb, |
| 5543 | void* pUserData |
| 5544 | ) |
| 5545 | { |
| 5546 | WDI_EventInfoType wdiEventData; |
| 5547 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5548 | |
| 5549 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5550 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5551 | ------------------------------------------------------------------------*/ |
| 5552 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5553 | { |
| 5554 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5555 | "WDI API call before module is initialized - Fail request"); |
| 5556 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5557 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5558 | } |
| 5559 | |
| 5560 | /*------------------------------------------------------------------------ |
| 5561 | Fill in Event data and post to the Main FSM |
| 5562 | ------------------------------------------------------------------------*/ |
| 5563 | wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5564 | wdiEventData.pEventData = pwdiResumeReqParams; |
| 5565 | wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams); |
| 5566 | wdiEventData.pCBfnc = wdiResumeReqRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5567 | wdiEventData.pUserData = pUserData; |
| 5568 | |
| 5569 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5570 | |
| 5571 | }/*WDI_HostResumeReq*/ |
| 5572 | |
| 5573 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5574 | @brief WDI_DelSTASelfReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5575 | |
| 5576 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5577 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5578 | |
| 5579 | |
| 5580 | @param pwdiDelStaSelfReqParams: as specified by |
| 5581 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5583 | wdiDelStaSelfRspCb: callback for passing back the response of |
| 5584 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5585 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5586 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5587 | callback |
| 5588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5589 | @see WDI_PostAssocReq |
| 5590 | @return Result of the function call |
| 5591 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5592 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5593 | WDI_DelSTASelfReq |
| 5594 | ( |
| 5595 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams, |
| 5596 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb, |
| 5597 | void* pUserData |
| 5598 | ) |
| 5599 | { |
| 5600 | WDI_EventInfoType wdiEventData; |
| 5601 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5602 | |
| 5603 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5604 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5605 | ------------------------------------------------------------------------*/ |
| 5606 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5607 | { |
| 5608 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5609 | "WDI API call before module is initialized - Fail request"); |
| 5610 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5611 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5612 | } |
| 5613 | |
| 5614 | /*------------------------------------------------------------------------ |
| 5615 | Fill in Event data and post to the Main FSM |
| 5616 | ------------------------------------------------------------------------*/ |
| 5617 | wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5618 | wdiEventData.pEventData = pwdiDelStaSelfReqParams; |
| 5619 | wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams); |
| 5620 | wdiEventData.pCBfnc = wdiDelStaSelfRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5621 | wdiEventData.pUserData = pUserData; |
| 5622 | |
| 5623 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5624 | |
| 5625 | }/*WDI_AggrAddTSReq*/ |
| 5626 | |
| 5627 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5628 | @brief WDI_SetTxPerTrackingReq will be called when the upper MAC |
| 5629 | wants to set the Tx Per Tracking configurations. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5630 | Upon the call of this API the WLAN DAL will pack |
| 5631 | and send a HAL Set Tx Per Tracking request message to the |
| 5632 | lower RIVA sub-system if DAL is in state STARTED. |
| 5633 | |
| 5634 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5635 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5637 | @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5638 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5639 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5640 | pwdiSetTxPerTrackingRspCb: callback for passing back the |
| 5641 | response of the set Tx PER Tracking configurations operation received |
| 5642 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5643 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5644 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5645 | callback |
| 5646 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5647 | @return Result of the function call |
| 5648 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5649 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5650 | WDI_SetTxPerTrackingReq |
| 5651 | ( |
| 5652 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams, |
| 5653 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb, |
| 5654 | void* pUserData |
| 5655 | ) |
| 5656 | { |
| 5657 | WDI_EventInfoType wdiEventData; |
| 5658 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5659 | |
| 5660 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5661 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5662 | ------------------------------------------------------------------------*/ |
| 5663 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5664 | { |
| 5665 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5666 | "WDI API call before module is initialized - Fail request"); |
| 5667 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5668 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5669 | } |
| 5670 | |
| 5671 | /*------------------------------------------------------------------------ |
| 5672 | Fill in Event data and post to the Main FSM |
| 5673 | ------------------------------------------------------------------------*/ |
| 5674 | wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5675 | wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5676 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5677 | wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5678 | wdiEventData.pUserData = pUserData; |
| 5679 | |
| 5680 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5681 | |
| 5682 | }/*WDI_SetTxPerTrackingReq*/ |
| 5683 | |
| 5684 | /** |
| 5685 | @brief WDI_SetTmLevelReq |
| 5686 | If HW Thermal condition changed, driver should react based on new |
| 5687 | HW thermal condition. |
| 5688 | |
| 5689 | @param pwdiSetTmLevelReq: New thermal condition information |
| 5690 | |
| 5691 | pwdiSetTmLevelRspCb: callback |
| 5692 | |
| 5693 | usrData: user data will be passed back with the |
| 5694 | callback |
| 5695 | |
| 5696 | @return Result of the function call |
| 5697 | */ |
| 5698 | WDI_Status |
| 5699 | WDI_SetTmLevelReq |
| 5700 | ( |
| 5701 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq, |
| 5702 | WDI_SetTmLevelCb pwdiSetTmLevelRspCb, |
| 5703 | void *usrData |
| 5704 | ) |
| 5705 | { |
| 5706 | WDI_EventInfoType wdiEventData; |
| 5707 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5708 | |
| 5709 | /*------------------------------------------------------------------------ |
| 5710 | Sanity Check |
| 5711 | ------------------------------------------------------------------------*/ |
| 5712 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5713 | { |
| 5714 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5715 | "WDI API call before module is initialized - Fail request"); |
| 5716 | |
| 5717 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5718 | } |
| 5719 | |
| 5720 | /*------------------------------------------------------------------------ |
| 5721 | Fill in Event data and post to the Main FSM |
| 5722 | ------------------------------------------------------------------------*/ |
| 5723 | wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ; |
| 5724 | wdiEventData.pEventData = pwdiSetTmLevelReq; |
| 5725 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq); |
| 5726 | wdiEventData.pCBfnc = pwdiSetTmLevelRspCb; |
| 5727 | wdiEventData.pUserData = usrData; |
| 5728 | |
| 5729 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5730 | } |
| 5731 | |
| 5732 | /** |
| 5733 | @brief WDI_HostSuspendInd |
| 5734 | |
| 5735 | Suspend Indication from the upper layer will be sent |
| 5736 | down to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5737 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5738 | @param WDI_SuspendResumeIndParamsType |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5739 | |
| 5740 | @see |
| 5741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5742 | @return Status of the request |
| 5743 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5744 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5745 | WDI_HostSuspendInd |
| 5746 | ( |
| 5747 | WDI_SuspendParamsType* pwdiSuspendIndParams |
| 5748 | ) |
| 5749 | { |
| 5750 | |
| 5751 | WDI_EventInfoType wdiEventData; |
| 5752 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5753 | |
| 5754 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5755 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5756 | ------------------------------------------------------------------------*/ |
| 5757 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5758 | { |
| 5759 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5760 | "WDI API call before module is initialized - Fail request"); |
| 5761 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5762 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5763 | } |
| 5764 | |
| 5765 | /*------------------------------------------------------------------------ |
| 5766 | Fill in Event data and post to the Main FSM |
| 5767 | ------------------------------------------------------------------------*/ |
| 5768 | wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5769 | wdiEventData.pEventData = pwdiSuspendIndParams; |
| 5770 | wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams); |
| 5771 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5772 | wdiEventData.pUserData = NULL; |
| 5773 | |
| 5774 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5775 | |
| 5776 | }/*WDI_HostSuspendInd*/ |
| 5777 | |
| 5778 | /** |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 5779 | @brief WDI_TrafficStatsInd |
| 5780 | Traffic Stats from the upper layer will be sent |
| 5781 | down to HAL |
| 5782 | |
| 5783 | @param WDI_TrafficStatsIndType |
| 5784 | |
| 5785 | @see |
| 5786 | |
| 5787 | @return Status of the request |
| 5788 | */ |
| 5789 | WDI_Status |
| 5790 | WDI_TrafficStatsInd |
| 5791 | ( |
| 5792 | WDI_TrafficStatsIndType *pWdiTrafficStatsIndParams |
| 5793 | ) |
| 5794 | { |
| 5795 | |
| 5796 | WDI_EventInfoType wdiEventData; |
| 5797 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5798 | |
| 5799 | /*------------------------------------------------------------------------ |
| 5800 | Sanity Check |
| 5801 | ------------------------------------------------------------------------*/ |
| 5802 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5803 | { |
| 5804 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5805 | "WDI API call before module is initialized - Fail request"); |
| 5806 | |
| 5807 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5808 | } |
| 5809 | |
| 5810 | /*------------------------------------------------------------------------ |
| 5811 | Fill in Event data and post to the Main FSM |
| 5812 | ------------------------------------------------------------------------*/ |
| 5813 | wdiEventData.wdiRequest = WDI_TRAFFIC_STATS_IND; |
| 5814 | wdiEventData.pEventData = pWdiTrafficStatsIndParams; |
| 5815 | wdiEventData.uEventDataSize = sizeof(*pWdiTrafficStatsIndParams); |
| 5816 | wdiEventData.pCBfnc = NULL; |
| 5817 | wdiEventData.pUserData = NULL; |
| 5818 | |
| 5819 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5820 | |
| 5821 | }/*WDI_TrafficStatsInd*/ |
| 5822 | |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5823 | #ifdef WLAN_FEATURE_11W |
| 5824 | /** |
| 5825 | @brief WDI_ExcludeUnencryptedInd |
| 5826 | Register with HAL to receive/drop unencrypted frames |
| 5827 | |
| 5828 | @param WDI_ExcludeUnencryptIndType |
| 5829 | |
| 5830 | @see |
| 5831 | |
| 5832 | @return Status of the request |
| 5833 | */ |
| 5834 | WDI_Status |
| 5835 | WDI_ExcludeUnencryptedInd |
| 5836 | ( |
| 5837 | WDI_ExcludeUnencryptIndType *pWdiExcUnencParams |
| 5838 | ) |
| 5839 | { |
| 5840 | |
| 5841 | WDI_EventInfoType wdiEventData; |
| 5842 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5843 | |
| 5844 | /*------------------------------------------------------------------------ |
| 5845 | Sanity Check |
| 5846 | ------------------------------------------------------------------------*/ |
| 5847 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5848 | { |
| 5849 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5850 | "WDI API call before module is initialized - Fail request"); |
| 5851 | |
| 5852 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5853 | } |
| 5854 | |
| 5855 | /*------------------------------------------------------------------------ |
| 5856 | Fill in Event data and post to the Main FSM |
| 5857 | ------------------------------------------------------------------------*/ |
| 5858 | wdiEventData.wdiRequest = WDI_EXCLUDE_UNENCRYPTED_IND; |
| 5859 | wdiEventData.pEventData = pWdiExcUnencParams; |
| 5860 | wdiEventData.uEventDataSize = sizeof(*pWdiExcUnencParams); |
| 5861 | wdiEventData.pCBfnc = NULL; |
| 5862 | wdiEventData.pUserData = NULL; |
| 5863 | |
| 5864 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5865 | |
| 5866 | }/*WDI_TrafficStatsInd*/ |
| 5867 | #endif |
| 5868 | |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 5869 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5870 | @brief WDI_HALDumpCmdReq |
| 5871 | Post HAL DUMP Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5872 | |
| 5873 | @param halDumpCmdReqParams: Hal Dump Command Body |
| 5874 | @param halDumpCmdRspCb: HAL DUMP Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5875 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5876 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5877 | @see |
| 5878 | @return Result of the function call |
| 5879 | */ |
| 5880 | WDI_Status WDI_HALDumpCmdReq |
| 5881 | ( |
| 5882 | WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams, |
| 5883 | WDI_HALDumpCmdRspCb halDumpCmdRspCb, |
| 5884 | void *pUserData |
| 5885 | ) |
| 5886 | { |
| 5887 | WDI_EventInfoType wdiEventData; |
| 5888 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5889 | |
| 5890 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5891 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5892 | ------------------------------------------------------------------------*/ |
| 5893 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5894 | { |
| 5895 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5896 | "WDI API call before module is initialized - Fail request"); |
| 5897 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5898 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5899 | } |
| 5900 | |
| 5901 | /*------------------------------------------------------------------------ |
| 5902 | Fill in Event data and post to the Main FSM |
| 5903 | ------------------------------------------------------------------------*/ |
| 5904 | wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ; |
| 5905 | wdiEventData.pEventData = (void *)halDumpCmdReqParams; |
| 5906 | wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType); |
| 5907 | wdiEventData.pCBfnc = halDumpCmdRspCb; |
| 5908 | wdiEventData.pUserData = pUserData; |
| 5909 | |
| 5910 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5911 | } |
| 5912 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5913 | /*============================================================================ |
| 5914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5915 | DAL Control Path Main FSM Function Implementation |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5917 | ============================================================================*/ |
| 5918 | |
| 5919 | /** |
| 5920 | @brief Main FSM Start function for all states except BUSY |
| 5921 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5922 | |
| 5923 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5924 | wdiEV: event posted to the main DAL FSM |
| 5925 | pEventData: pointer to the event information |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5926 | structure |
| 5927 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5928 | @see |
| 5929 | @return Result of the function call |
| 5930 | */ |
| 5931 | WDI_Status |
| 5932 | WDI_PostMainEvent |
| 5933 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5934 | WDI_ControlBlockType* pWDICtx, |
| 5935 | WDI_MainEventType wdiEV, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5936 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5937 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5938 | ) |
| 5939 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5940 | WDI_Status wdiStatus; |
| 5941 | WDI_MainFuncType pfnWDIMainEvHdlr; |
| 5942 | WDI_MainStateType wdiOldState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5943 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5944 | |
| 5945 | /*------------------------------------------------------------------------- |
| 5946 | Sanity check |
| 5947 | -------------------------------------------------------------------------*/ |
| 5948 | if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) || |
| 5949 | ( wdiEV >= WDI_MAX_EVENT )) |
| 5950 | { |
| 5951 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5952 | "Invalid state or event in Post Main Ev function ST: %d EV: %d", |
| 5953 | pWDICtx->uGlobalState, wdiEV); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5954 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5955 | } |
| 5956 | |
| 5957 | /*Access to the global state must be locked */ |
| 5958 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5959 | |
| 5960 | /*Fetch event handler for state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5961 | pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5962 | |
| 5963 | wdiOldState = pWDICtx->uGlobalState; |
| 5964 | |
| 5965 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5966 | --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a |
| 5967 | response comes from CCPU for the request sent by host: |
| 5968 | the WDI global state will be in WDI_BUSY_ST already, so do not set it to BUSY again. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5969 | This state will be set to WDI_STARTED_ST in WDI_MainRsp, if it is a expected response. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5970 | --Incase of WDI event is WDI_RESPONSE_EVENT and it is an indication from the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5971 | CCPU: |
| 5972 | don't change the state */ |
| 5973 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5974 | { |
| 5975 | /*Transition to BUSY State - the request is now being processed by the FSM, |
| 5976 | if the request fails we shall transition back to the old state, if not |
| 5977 | the request will manage its own state transition*/ |
| 5978 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
| 5979 | } |
| 5980 | /* If the state function associated with the EV is NULL it means that this |
| 5981 | event is not allowed in this state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5982 | if ( NULL != pfnWDIMainEvHdlr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5983 | { |
| 5984 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5985 | "Posting event %d in state: %d to the Main FSM", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5986 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5987 | wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5988 | } |
| 5989 | else |
| 5990 | { |
| 5991 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5992 | "Unexpected event %d in state: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5993 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5994 | wdiStatus = WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5995 | } |
| 5996 | |
| 5997 | /* If a request handles itself well it will end up in a success or in a |
| 5998 | pending |
| 5999 | Success - means that the request was processed and the proper state |
| 6000 | transition already occurred or will occur when the resp is received |
| 6001 | - NO other state transition or dequeueing is required |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6002 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6003 | Pending - means the request could not be processed at this moment in time |
| 6004 | because the FSM was already busy so no state transition or dequeueing |
| 6005 | is necessary anymore |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6006 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6007 | Success for synchronous case means that the transition may occur and |
| 6008 | processing of pending requests may continue - so it should go through |
| 6009 | and restores the state and continue processing queued requests*/ |
| 6010 | if (( WDI_STATUS_SUCCESS != wdiStatus )&& |
| 6011 | ( WDI_STATUS_PENDING != wdiStatus )) |
| 6012 | { |
| 6013 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 6014 | { |
| 6015 | /*The request has failed or could not be processed - transition back to |
| 6016 | the old state - check to see if anything was queued and try to execute |
| 6017 | The dequeue logic should post a message to a thread and return - no |
| 6018 | actual processing can occur */ |
| 6019 | WDI_STATE_TRANSITION( pWDICtx, wdiOldState); |
| 6020 | } |
| 6021 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6022 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6023 | } |
| 6024 | |
| 6025 | /* we have completed processing the event */ |
| 6026 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6027 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6028 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6029 | |
| 6030 | }/*WDI_PostMainEvent*/ |
| 6031 | |
| 6032 | |
| 6033 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6034 | INIT State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6035 | --------------------------------------------------------------------------*/ |
| 6036 | /** |
| 6037 | @brief Main FSM Start function for all states except BUSY |
| 6038 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6039 | |
| 6040 | @param pWDICtx: pointer to the WLAN DAL context |
| 6041 | pEventData: pointer to the event information structure |
| 6042 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6043 | @see |
| 6044 | @return Result of the function call |
| 6045 | */ |
| 6046 | WDI_Status |
| 6047 | WDI_MainStart |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6048 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6049 | WDI_ControlBlockType* pWDICtx, |
| 6050 | WDI_EventInfoType* pEventData |
| 6051 | ) |
| 6052 | { |
| 6053 | |
| 6054 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6055 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6056 | ----------------------------------------------------------------------*/ |
| 6057 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6058 | { |
| 6059 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6060 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6061 | pWDICtx, pEventData); |
| 6062 | return WDI_STATUS_E_FAILURE; |
| 6063 | } |
| 6064 | |
| 6065 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6066 | |
| 6067 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6068 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6069 | ----------------------------------------------------------------------*/ |
| 6070 | if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened ) |
| 6071 | { |
| 6072 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6073 | "Control Transport not yet Open - queueing the request"); |
| 6074 | |
| 6075 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6076 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6077 | |
| 6078 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6079 | return WDI_STATUS_PENDING; |
| 6080 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6081 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6082 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6083 | |
| 6084 | /*Return Success*/ |
| 6085 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6086 | |
| 6087 | }/*WDI_MainStart*/ |
| 6088 | |
| 6089 | /** |
| 6090 | @brief Main FSM Response function for state INIT |
| 6091 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6092 | |
| 6093 | @param pWDICtx: pointer to the WLAN DAL context |
| 6094 | pEventData: pointer to the event information structure |
| 6095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6096 | @see |
| 6097 | @return Result of the function call |
| 6098 | */ |
| 6099 | WDI_Status |
| 6100 | WDI_MainRspInit |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6101 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6102 | WDI_ControlBlockType* pWDICtx, |
| 6103 | WDI_EventInfoType* pEventData |
| 6104 | ) |
| 6105 | { |
| 6106 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6107 | Not expecting a response from the device before it is started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6108 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6109 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6110 | |
| 6111 | /*Return Success*/ |
| 6112 | return WDI_STATUS_E_NOT_ALLOWED; |
| 6113 | }/* WDI_MainRspInit */ |
| 6114 | |
| 6115 | /** |
| 6116 | @brief Main FSM Close function for all states except BUSY |
| 6117 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6118 | |
| 6119 | @param pWDICtx: pointer to the WLAN DAL context |
| 6120 | pEventData: pointer to the event information structure |
| 6121 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6122 | @see |
| 6123 | @return Result of the function call |
| 6124 | */ |
| 6125 | WDI_Status |
| 6126 | WDI_MainClose |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6127 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6128 | WDI_ControlBlockType* pWDICtx, |
| 6129 | WDI_EventInfoType* pEventData |
| 6130 | ) |
| 6131 | { |
| 6132 | |
| 6133 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6134 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6135 | ----------------------------------------------------------------------*/ |
| 6136 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6137 | { |
| 6138 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6139 | "Invalid parameters on Main Close %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6140 | pWDICtx, pEventData); |
| 6141 | return WDI_STATUS_E_FAILURE; |
| 6142 | } |
| 6143 | |
| 6144 | /*Return Success*/ |
| 6145 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6146 | |
| 6147 | }/*WDI_MainClose*/ |
| 6148 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6149 | STARTED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6150 | --------------------------------------------------------------------------*/ |
| 6151 | /** |
| 6152 | @brief Main FSM Start function for state STARTED |
| 6153 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6154 | |
| 6155 | @param pWDICtx: pointer to the WLAN DAL context |
| 6156 | pEventData: pointer to the event information structure |
| 6157 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6158 | @see |
| 6159 | @return Result of the function call |
| 6160 | */ |
| 6161 | WDI_Status |
| 6162 | WDI_MainStartStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6163 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6164 | WDI_ControlBlockType* pWDICtx, |
| 6165 | WDI_EventInfoType* pEventData |
| 6166 | ) |
| 6167 | { |
| 6168 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 6169 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6170 | |
| 6171 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6172 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6173 | ----------------------------------------------------------------------*/ |
| 6174 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6175 | { |
| 6176 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6177 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6178 | pWDICtx, pEventData); |
| 6179 | return WDI_STATUS_E_FAILURE; |
| 6180 | } |
| 6181 | |
| 6182 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6183 | Nothing to do transport was already started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6184 | ----------------------------------------------------------------------*/ |
| 6185 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6186 | "Received start while transport was already started - nothing to do"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6187 | |
| 6188 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6189 | |
| 6190 | /*Transition back to started because the post function transitioned us to |
| 6191 | busy*/ |
| 6192 | WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST); |
| 6193 | |
| 6194 | /*Check to see if any request is pending*/ |
| 6195 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6196 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6197 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6198 | |
| 6199 | /*Tell UMAC Success*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6200 | wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc; |
| 6201 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6202 | /*Notify UMAC*/ |
| 6203 | wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData); |
| 6204 | |
| 6205 | /*Return Success*/ |
| 6206 | return WDI_STATUS_SUCCESS; |
| 6207 | |
| 6208 | }/*WDI_MainStartStarted*/ |
| 6209 | |
| 6210 | /** |
| 6211 | @brief Main FSM Stop function for state STARTED |
| 6212 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6213 | |
| 6214 | @param pWDICtx: pointer to the WLAN DAL context |
| 6215 | pEventData: pointer to the event information structure |
| 6216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6217 | @see |
| 6218 | @return Result of the function call |
| 6219 | */ |
| 6220 | WDI_Status |
| 6221 | WDI_MainStopStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6222 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6223 | WDI_ControlBlockType* pWDICtx, |
| 6224 | WDI_EventInfoType* pEventData |
| 6225 | ) |
| 6226 | { |
| 6227 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6228 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6229 | ----------------------------------------------------------------------*/ |
| 6230 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6231 | { |
| 6232 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6233 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6234 | pWDICtx, pEventData); |
| 6235 | return WDI_STATUS_E_FAILURE; |
| 6236 | } |
| 6237 | |
| 6238 | /*State at this point is BUSY - because we enter this state before posting |
| 6239 | an event to the FSM in order to prevent potential race conditions*/ |
| 6240 | |
| 6241 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 6242 | "Processing stop request in FSM"); |
| 6243 | |
| 6244 | /*Return Success*/ |
| 6245 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6246 | |
| 6247 | }/*WDI_MainStopStarted*/ |
| 6248 | /** |
| 6249 | @brief Main FSM Request function for state started |
| 6250 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6251 | |
| 6252 | @param pWDICtx: pointer to the WLAN DAL context |
| 6253 | pEventData: pointer to the event information structure |
| 6254 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6255 | @see |
| 6256 | @return Result of the function call |
| 6257 | */ |
| 6258 | WDI_Status |
| 6259 | WDI_MainReqStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6260 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6261 | WDI_ControlBlockType* pWDICtx, |
| 6262 | WDI_EventInfoType* pEventData |
| 6263 | ) |
| 6264 | { |
| 6265 | |
| 6266 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6267 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6268 | ----------------------------------------------------------------------*/ |
| 6269 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6270 | { |
| 6271 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6272 | "Invalid parameters on Main Req Started %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6273 | pWDICtx, pEventData); |
| 6274 | return WDI_STATUS_E_FAILURE; |
| 6275 | } |
| 6276 | |
| 6277 | /*State at this point is BUSY - because we enter this state before posting |
| 6278 | an event to the FSM in order to prevent potential race conditions*/ |
| 6279 | |
| 6280 | /*Return Success*/ |
| 6281 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6282 | |
| 6283 | }/*WDI_MainReqStarted*/ |
| 6284 | |
| 6285 | /** |
| 6286 | @brief Main FSM Response function for all states except INIT |
| 6287 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6288 | |
| 6289 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6290 | pEventData: pointer to the event information structure |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6292 | @see |
| 6293 | @return Result of the function call |
| 6294 | */ |
| 6295 | WDI_Status |
| 6296 | WDI_MainRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6297 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6298 | WDI_ControlBlockType* pWDICtx, |
| 6299 | WDI_EventInfoType* pEventData |
| 6300 | ) |
| 6301 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6302 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6303 | wpt_boolean expectedResponse; |
| 6304 | |
| 6305 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6306 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6307 | ----------------------------------------------------------------------*/ |
| 6308 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6309 | { |
| 6310 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6311 | "Invalid parameters on Main Response %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6312 | pWDICtx, pEventData); |
| 6313 | return WDI_STATUS_E_FAILURE; |
| 6314 | } |
| 6315 | |
| 6316 | if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 6317 | { |
| 6318 | /* we received an expected response */ |
| 6319 | expectedResponse = eWLAN_PAL_TRUE; |
| 6320 | |
| 6321 | /*We expect that we will transition to started after this processing*/ |
| 6322 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 6323 | |
| 6324 | /* we are no longer expecting a response */ |
| 6325 | pWDICtx->wdiExpectedResponse = WDI_MAX_RESP; |
| 6326 | } |
| 6327 | else |
| 6328 | { |
| 6329 | /* we received an indication or unexpected response */ |
| 6330 | expectedResponse = eWLAN_PAL_FALSE; |
| 6331 | /* for indications no need to update state from what it is right |
| 6332 | now, unless it explicitly does it in the indication handler (say |
| 6333 | for device failure ind) */ |
| 6334 | pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState; |
| 6335 | } |
| 6336 | |
| 6337 | /*Process the response and indication */ |
| 6338 | wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData ); |
| 6339 | |
| 6340 | /*Lock the CB as we are about to do a state transition*/ |
| 6341 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6342 | |
| 6343 | /*Transition to the expected state after the response processing |
| 6344 | - this should always be started state with the following exceptions: |
| 6345 | 1. processing of a failed start response |
| 6346 | 2. device failure detected while processing response |
| 6347 | 3. stop response received*/ |
| 6348 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6349 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6350 | /*Dequeue request that may have been queued while we were waiting for the |
| 6351 | response */ |
| 6352 | if ( expectedResponse ) |
| 6353 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6354 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6355 | } |
| 6356 | |
| 6357 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6358 | |
| 6359 | /*Return Success - always */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6360 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6361 | |
| 6362 | }/*WDI_MainRsp*/ |
| 6363 | |
| 6364 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6365 | STOPPED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6366 | --------------------------------------------------------------------------*/ |
| 6367 | /** |
| 6368 | @brief Main FSM Stop function for state STOPPED |
| 6369 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6370 | |
| 6371 | @param pWDICtx: pointer to the WLAN DAL context |
| 6372 | pEventData: pointer to the event information structure |
| 6373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6374 | @see |
| 6375 | @return Result of the function call |
| 6376 | */ |
| 6377 | WDI_Status |
| 6378 | WDI_MainStopStopped |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6379 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6380 | WDI_ControlBlockType* pWDICtx, |
| 6381 | WDI_EventInfoType* pEventData |
| 6382 | ) |
| 6383 | { |
| 6384 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6385 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6386 | ----------------------------------------------------------------------*/ |
| 6387 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6388 | { |
| 6389 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6390 | "Invalid parameters on Main Stop Stopped %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6391 | pWDICtx, pEventData); |
| 6392 | return WDI_STATUS_E_FAILURE; |
| 6393 | } |
| 6394 | |
| 6395 | /*We should normally not get a STOP request if we are already stopped |
| 6396 | since we should normally be stopped by the UMAC. However in some |
| 6397 | error situations we put ourselves in the stopped state without the |
| 6398 | UMAC knowing, so when we get a STOP request in this state we still |
| 6399 | process it since we need to clean up the underlying state */ |
| 6400 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6401 | "Processing stop request while stopped in FSM"); |
| 6402 | |
| 6403 | /*Return Success*/ |
| 6404 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6405 | |
| 6406 | }/*WDI_MainStopStopped*/ |
| 6407 | |
| 6408 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6409 | BUSY State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6410 | --------------------------------------------------------------------------*/ |
| 6411 | /** |
| 6412 | @brief Main FSM Start function for state BUSY |
| 6413 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6414 | |
| 6415 | @param pWDICtx: pointer to the WLAN DAL context |
| 6416 | pEventData: pointer to the event information structure |
| 6417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6418 | @see |
| 6419 | @return Result of the function call |
| 6420 | */ |
| 6421 | WDI_Status |
| 6422 | WDI_MainStartBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6423 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6424 | WDI_ControlBlockType* pWDICtx, |
| 6425 | WDI_EventInfoType* pEventData |
| 6426 | ) |
| 6427 | { |
| 6428 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6429 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6430 | ----------------------------------------------------------------------*/ |
| 6431 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6432 | { |
| 6433 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6434 | "Invalid parameters on Main Start in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6435 | pWDICtx, pEventData); |
| 6436 | return WDI_STATUS_E_FAILURE; |
| 6437 | } |
| 6438 | |
| 6439 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6440 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6441 | ----------------------------------------------------------------------*/ |
| 6442 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6443 | "WDI Busy state - queue start request"); |
| 6444 | |
| 6445 | /*Queue the start request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6446 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6447 | |
| 6448 | /*Return Success*/ |
| 6449 | return WDI_STATUS_PENDING; |
| 6450 | }/*WDI_MainStartBusy*/ |
| 6451 | |
| 6452 | /** |
| 6453 | @brief Main FSM Stop function for state BUSY |
| 6454 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6455 | |
| 6456 | @param pWDICtx: pointer to the WLAN DAL context |
| 6457 | pEventData: pointer to the event information structure |
| 6458 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6459 | @see |
| 6460 | @return Result of the function call |
| 6461 | */ |
| 6462 | WDI_Status |
| 6463 | WDI_MainStopBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6464 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6465 | WDI_ControlBlockType* pWDICtx, |
| 6466 | WDI_EventInfoType* pEventData |
| 6467 | ) |
| 6468 | { |
| 6469 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6470 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6471 | ----------------------------------------------------------------------*/ |
| 6472 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6473 | { |
| 6474 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6475 | "Invalid parameters on Main Stop in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6476 | pWDICtx, pEventData); |
| 6477 | return WDI_STATUS_E_FAILURE; |
| 6478 | } |
| 6479 | |
| 6480 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6481 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6482 | ----------------------------------------------------------------------*/ |
| 6483 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6484 | "WDI Busy state - queue stop request"); |
| 6485 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6486 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6487 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6488 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6489 | }/*WDI_MainStopBusy*/ |
| 6490 | |
| 6491 | /** |
| 6492 | @brief Main FSM Request function for state BUSY |
| 6493 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6494 | |
| 6495 | @param pWDICtx: pointer to the WLAN DAL context |
| 6496 | pEventData: pointer to the event information structure |
| 6497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6498 | @see |
| 6499 | @return Result of the function call |
| 6500 | */ |
| 6501 | WDI_Status |
| 6502 | WDI_MainReqBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6503 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6504 | WDI_ControlBlockType* pWDICtx, |
| 6505 | WDI_EventInfoType* pEventData |
| 6506 | ) |
| 6507 | { |
| 6508 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6509 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6510 | ----------------------------------------------------------------------*/ |
| 6511 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6512 | { |
| 6513 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6514 | "Invalid parameters on Main Request in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6515 | pWDICtx, pEventData); |
| 6516 | return WDI_STATUS_E_FAILURE; |
| 6517 | } |
| 6518 | |
| 6519 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6520 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6521 | ----------------------------------------------------------------------*/ |
| 6522 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6523 | "WDI Busy state - queue request %d because waiting for response %d", |
| 6524 | pEventData->wdiRequest, pWDICtx->wdiExpectedResponse); |
| 6525 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6526 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6527 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6528 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6529 | }/*WDI_MainReqBusy*/ |
| 6530 | /** |
| 6531 | @brief Main FSM Close function for state BUSY |
| 6532 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6533 | |
| 6534 | @param pWDICtx: pointer to the WLAN DAL context |
| 6535 | pEventData: pointer to the event information structure |
| 6536 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6537 | @see |
| 6538 | @return Result of the function call |
| 6539 | */ |
| 6540 | WDI_Status |
| 6541 | WDI_MainCloseBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6542 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6543 | WDI_ControlBlockType* pWDICtx, |
| 6544 | WDI_EventInfoType* pEventData |
| 6545 | ) |
| 6546 | { |
| 6547 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6548 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6549 | ----------------------------------------------------------------------*/ |
| 6550 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6551 | { |
| 6552 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6553 | "Invalid parameters on Main Close in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6554 | pWDICtx, pEventData); |
| 6555 | return WDI_STATUS_E_FAILURE; |
| 6556 | } |
| 6557 | |
| 6558 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6559 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6560 | ----------------------------------------------------------------------*/ |
| 6561 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6562 | "WDI Busy state - queue close request"); |
| 6563 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6564 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6565 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6566 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6567 | }/*WDI_MainCloseBusy*/ |
| 6568 | |
| 6569 | /** |
| 6570 | @brief Main FSM Shutdown function for INIT & STARTED states |
| 6571 | |
| 6572 | |
| 6573 | @param pWDICtx: pointer to the WLAN DAL context |
| 6574 | pEventData: pointer to the event information structure |
| 6575 | |
| 6576 | @see |
| 6577 | @return Result of the function call |
| 6578 | */ |
| 6579 | WDI_Status |
| 6580 | WDI_MainShutdown |
| 6581 | ( |
| 6582 | WDI_ControlBlockType* pWDICtx, |
| 6583 | WDI_EventInfoType* pEventData |
| 6584 | ) |
| 6585 | { |
| 6586 | /*-------------------------------------------------------------------- |
| 6587 | Sanity Check |
| 6588 | ----------------------------------------------------------------------*/ |
| 6589 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6590 | { |
| 6591 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6592 | "Invalid parameters on Main Start %x %x", |
| 6593 | pWDICtx, pEventData); |
| 6594 | return WDI_STATUS_E_FAILURE; |
| 6595 | } |
| 6596 | |
| 6597 | /*State at this point is BUSY - because we enter this state before posting |
| 6598 | an event to the FSM in order to prevent potential race conditions*/ |
| 6599 | |
| 6600 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6601 | "Processing shutdown request in FSM"); |
| 6602 | |
| 6603 | /*Return Success*/ |
| 6604 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6605 | |
| 6606 | }/*WDI_MainShutdown*/ |
| 6607 | |
| 6608 | /** |
| 6609 | @brief Main FSM Shutdown function for BUSY state |
| 6610 | |
| 6611 | |
| 6612 | @param pWDICtx: pointer to the WLAN DAL context |
| 6613 | pEventData: pointer to the event information structure |
| 6614 | |
| 6615 | @see |
| 6616 | @return Result of the function call |
| 6617 | */ |
| 6618 | WDI_Status |
| 6619 | WDI_MainShutdownBusy |
| 6620 | ( |
| 6621 | WDI_ControlBlockType* pWDICtx, |
| 6622 | WDI_EventInfoType* pEventData |
| 6623 | ) |
| 6624 | { |
| 6625 | /*-------------------------------------------------------------------- |
| 6626 | Sanity Check |
| 6627 | ----------------------------------------------------------------------*/ |
| 6628 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6629 | { |
| 6630 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6631 | "Invalid parameters on Main Start %x %x", |
| 6632 | pWDICtx, pEventData); |
| 6633 | return WDI_STATUS_E_FAILURE; |
| 6634 | } |
| 6635 | |
| 6636 | /* If you are waiting for a HAL response at this stage, you are not |
| 6637 | * going to get it. Riva is already shutdown/crashed. |
| 6638 | */ |
| 6639 | wpalTimerStop(&gWDICb.wptResponseTimer); |
| 6640 | |
| 6641 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6642 | "Processing shutdown request in FSM: Busy state "); |
| 6643 | |
| 6644 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6645 | |
| 6646 | }/*WDI_MainShutdownBusy*/ |
| 6647 | |
| 6648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6649 | /*======================================================================= |
| 6650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6651 | WLAN DAL Control Path Main Processing Functions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6653 | *=======================================================================*/ |
| 6654 | |
| 6655 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6656 | Main DAL Control Path Request Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6657 | ========================================================================*/ |
| 6658 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6659 | @brief Process Start Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6660 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6661 | |
| 6662 | @param pWDICtx: pointer to the WLAN DAL context |
| 6663 | pEventData: pointer to the event information structure |
| 6664 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6665 | @see |
| 6666 | @return Result of the function call |
| 6667 | */ |
| 6668 | WDI_Status |
| 6669 | WDI_ProcessStartReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6670 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6671 | WDI_ControlBlockType* pWDICtx, |
| 6672 | WDI_EventInfoType* pEventData |
| 6673 | ) |
| 6674 | { |
| 6675 | WDI_StartReqParamsType* pwdiStartParams = NULL; |
| 6676 | WDI_StartRspCb wdiStartRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6677 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6678 | wpt_uint16 usDataOffset = 0; |
| 6679 | wpt_uint16 usSendSize = 0; |
| 6680 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6681 | tHalMacStartReqMsg halStartReq; |
| 6682 | wpt_uint16 usLen = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6683 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6684 | |
| 6685 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6686 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6687 | -------------------------------------------------------------------------*/ |
| 6688 | if (( NULL == pEventData ) || |
| 6689 | ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) || |
| 6690 | ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc))) |
| 6691 | { |
| 6692 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6693 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6694 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6695 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6696 | } |
| 6697 | |
| 6698 | /*----------------------------------------------------------------------- |
| 6699 | Get message buffer |
| 6700 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6701 | usLen = sizeof(halStartReq.startReqParams) + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6702 | pwdiStartParams->usConfigBufferLen; |
| 6703 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6704 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6705 | usLen, |
| 6706 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6707 | ( usSendSize < (usDataOffset + usLen ))) |
| 6708 | { |
| 6709 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6710 | "Unable to get send buffer in start req %x %x %x", |
| 6711 | pEventData, pwdiStartParams, wdiStartRspCb); |
| 6712 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6713 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6714 | } |
| 6715 | |
| 6716 | /*----------------------------------------------------------------------- |
| 6717 | Fill in the message |
| 6718 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6719 | halStartReq.startReqParams.driverType = |
| 6720 | WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6721 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6722 | halStartReq.startReqParams.uConfigBufferLen = |
| 6723 | pwdiStartParams->usConfigBufferLen; |
| 6724 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6725 | &halStartReq.startReqParams, |
| 6726 | sizeof(halStartReq.startReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6727 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6728 | usDataOffset += sizeof(halStartReq.startReqParams); |
| 6729 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6730 | pwdiStartParams->pConfigBuffer, |
| 6731 | pwdiStartParams->usConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6732 | |
| 6733 | pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6734 | pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6735 | |
| 6736 | /*Save Low Level Ind CB and associated user data - it will be used further |
| 6737 | on when an indication is coming from the lower MAC*/ |
| 6738 | pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6739 | pWDICtx->pIndUserData = pwdiStartParams->pIndUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6740 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6741 | pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6742 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6743 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6744 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6745 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6746 | wdiStartRspCb, pEventData->pUserData, WDI_START_RESP); |
| 6747 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6749 | }/*WDI_ProcessStartReq*/ |
| 6750 | |
| 6751 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6752 | @brief Process Stop Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6753 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6754 | |
| 6755 | @param pWDICtx: pointer to the WLAN DAL context |
| 6756 | pEventData: pointer to the event information structure |
| 6757 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6758 | @see |
| 6759 | @return Result of the function call |
| 6760 | */ |
| 6761 | WDI_Status |
| 6762 | WDI_ProcessStopReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6763 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6764 | WDI_ControlBlockType* pWDICtx, |
| 6765 | WDI_EventInfoType* pEventData |
| 6766 | ) |
| 6767 | { |
| 6768 | WDI_StopReqParamsType* pwdiStopParams = NULL; |
| 6769 | WDI_StopRspCb wdiStopRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6770 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6771 | wpt_uint16 usDataOffset = 0; |
| 6772 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6773 | wpt_status status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6774 | tHalMacStopReqMsg halStopReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6775 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6776 | |
| 6777 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6778 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6779 | -------------------------------------------------------------------------*/ |
| 6780 | if (( NULL == pEventData ) || |
| 6781 | ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) || |
| 6782 | ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc))) |
| 6783 | { |
| 6784 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6785 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6786 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6787 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6788 | } |
| 6789 | |
| 6790 | /*----------------------------------------------------------------------- |
| 6791 | Get message buffer |
| 6792 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6793 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6794 | sizeof(halStopReq.stopReqParams), |
| 6795 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6796 | ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) ))) |
| 6797 | { |
| 6798 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6799 | "Unable to get send buffer in stop req %x %x %x", |
| 6800 | pEventData, pwdiStopParams, wdiStopRspCb); |
| 6801 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6802 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6803 | } |
| 6804 | |
| 6805 | /*----------------------------------------------------------------------- |
| 6806 | Fill in the message |
| 6807 | -----------------------------------------------------------------------*/ |
| 6808 | halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON( |
| 6809 | pwdiStopParams->wdiStopReason); |
| 6810 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6811 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6812 | &halStopReq.stopReqParams, |
| 6813 | sizeof(halStopReq.stopReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6814 | |
| 6815 | pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6816 | pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6817 | |
| 6818 | /*! TO DO: stop the data services */ |
| 6819 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6820 | { |
| 6821 | /*Stop the STA Table !UT- check this logic again |
| 6822 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 6823 | WDI_STATableStop(pWDICtx); |
| 6824 | |
| 6825 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6826 | status = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 6827 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6828 | { |
| 6829 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6830 | "WDI Init failed to reset power state event"); |
| 6831 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6832 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6833 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6834 | } |
| 6835 | /* Stop Transport Driver, DXE */ |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 6836 | status = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb); |
| 6837 | if( eWLAN_PAL_STATUS_SUCCESS != status ) |
| 6838 | { |
| 6839 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6840 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Power Down state\n", status); |
| 6841 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6842 | goto fail; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 6843 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6844 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6845 | * Wait for the event to be set once the ACK comes back from DXE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6846 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6847 | status = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 6848 | WDI_SET_POWER_STATE_TIMEOUT); |
| 6849 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6850 | { |
| 6851 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6852 | "WDI Init failed to wait on an event"); |
| 6853 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6854 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6855 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6856 | } |
| 6857 | } |
| 6858 | |
| 6859 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6860 | Send Stop Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6861 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6862 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6863 | wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP); |
| 6864 | |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6865 | fail: |
| 6866 | // Release the message buffer so we don't leak |
| 6867 | wpalMemoryFree(pSendBuffer); |
| 6868 | |
| 6869 | failRequest: |
| 6870 | //WDA should have failure check to avoid the memory leak |
| 6871 | return WDI_STATUS_E_FAILURE; |
| 6872 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6873 | }/*WDI_ProcessStopReq*/ |
| 6874 | |
| 6875 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6876 | @brief Process Close Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6877 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6878 | |
| 6879 | @param pWDICtx: pointer to the WLAN DAL context |
| 6880 | pEventData: pointer to the event information structure |
| 6881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6882 | @see |
| 6883 | @return Result of the function call |
| 6884 | */ |
| 6885 | WDI_Status |
| 6886 | WDI_ProcessCloseReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6887 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6888 | WDI_ControlBlockType* pWDICtx, |
| 6889 | WDI_EventInfoType* pEventData |
| 6890 | ) |
| 6891 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6892 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6893 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6894 | |
| 6895 | /*Lock control block for cleanup*/ |
| 6896 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6897 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6898 | /*Clear all pending request*/ |
| 6899 | WDI_ClearPendingRequests(pWDICtx); |
| 6900 | |
| 6901 | /* Close Control transport*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6902 | WCTS_CloseTransport(pWDICtx->wctsHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6903 | |
| 6904 | /* Close Data transport*/ |
| 6905 | /* FTM mode does not open Data Path */ |
| 6906 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6907 | { |
| 6908 | WDTS_Close(pWDICtx); |
| 6909 | } |
| 6910 | |
| 6911 | /*Close the STA Table !UT- check this logic again*/ |
| 6912 | WDI_STATableClose(pWDICtx); |
| 6913 | |
| 6914 | /*close the PAL */ |
| 6915 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 6916 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 6917 | { |
| 6918 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6919 | "Failed to wpal Close %d", wptStatus); |
| 6920 | WDI_ASSERT(0); |
| 6921 | } |
| 6922 | |
| 6923 | /*Transition back to init state*/ |
| 6924 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 6925 | |
| 6926 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6927 | |
| 6928 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6929 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6930 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6931 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6932 | }/*WDI_ProcessCloseReq*/ |
| 6933 | |
| 6934 | |
| 6935 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6936 | SCANING REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6937 | ===========================================================================*/ |
| 6938 | |
| 6939 | /** |
| 6940 | @brief Process Init Scan Request function (called when Main FSM |
| 6941 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6942 | |
| 6943 | @param pWDICtx: pointer to the WLAN DAL context |
| 6944 | pEventData: pointer to the event information structure |
| 6945 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6946 | @see |
| 6947 | @return Result of the function call |
| 6948 | */ |
| 6949 | WDI_Status |
| 6950 | WDI_ProcessInitScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6951 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6952 | WDI_ControlBlockType* pWDICtx, |
| 6953 | WDI_EventInfoType* pEventData |
| 6954 | ) |
| 6955 | { |
| 6956 | WDI_InitScanReqParamsType* pwdiInitScanParams = NULL; |
| 6957 | WDI_InitScanRspCb wdiInitScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6958 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6959 | wpt_uint16 usDataOffset = 0; |
| 6960 | wpt_uint16 usSendSize = 0; |
| 6961 | wpt_uint8 i = 0; |
| 6962 | |
| 6963 | tHalInitScanReqMsg halInitScanReqMsg; |
| 6964 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6965 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6966 | * It shold be removed once host and riva changes are in sync*/ |
| 6967 | tHalInitScanConReqMsg halInitScanConReqMsg; |
| 6968 | |
| 6969 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6970 | |
| 6971 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6972 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6973 | -------------------------------------------------------------------------*/ |
| 6974 | if (( NULL == pEventData ) || |
| 6975 | ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) || |
| 6976 | ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc))) |
| 6977 | { |
| 6978 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6979 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6980 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6981 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6982 | } |
| 6983 | |
| 6984 | #if 0 |
| 6985 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6986 | /*----------------------------------------------------------------------- |
| 6987 | Check to see if SCAN is already in progress - if so reject the req |
| 6988 | We only allow one scan at a time |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6989 | ! TO DO: - revisit this constraint |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6990 | -----------------------------------------------------------------------*/ |
| 6991 | if ( pWDICtx->bScanInProgress ) |
| 6992 | { |
| 6993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6994 | "Scan is already in progress - subsequent scan is not allowed" |
| 6995 | " until the first scan completes"); |
| 6996 | |
| 6997 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6998 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6999 | } |
| 7000 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7001 | pWDICtx->bScanInProgress = eWLAN_PAL_TRUE; |
| 7002 | pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7003 | |
| 7004 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7005 | #endif |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 7006 | if ((pwdiInitScanParams->wdiReqInfo.bUseNOA) && (!WDI_getFwWlanFeatCaps(P2P_GO_NOA_DECOUPLE_INIT_SCAN))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7007 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7008 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7009 | * It shold be removed once host and riva changes are in sync*/ |
| 7010 | /*----------------------------------------------------------------------- |
| 7011 | Get message buffer |
| 7012 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7013 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7014 | sizeof(halInitScanConReqMsg.initScanParams), |
| 7015 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7016 | ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) ))) |
| 7017 | { |
| 7018 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7019 | "Unable to get send buffer in init scan req %x %x %x", |
| 7020 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 7021 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7022 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7023 | } |
| 7024 | |
| 7025 | |
| 7026 | /*----------------------------------------------------------------------- |
| 7027 | Fill in the message |
| 7028 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7029 | halInitScanConReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7030 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 7031 | |
| 7032 | wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid, |
| 7033 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7034 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7035 | halInitScanConReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7036 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7037 | halInitScanConReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7038 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7039 | halInitScanConReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7040 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 7041 | |
| 7042 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr, |
| 7043 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7044 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7045 | halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA; |
| 7046 | halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7047 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7048 | halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7049 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 7050 | |
| 7051 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7052 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7053 | halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7054 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 7055 | } |
| 7056 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7057 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7058 | &halInitScanConReqMsg.initScanParams, |
| 7059 | sizeof(halInitScanConReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7060 | } |
| 7061 | else |
| 7062 | { |
| 7063 | /*----------------------------------------------------------------------- |
| 7064 | Get message buffer |
| 7065 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7066 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7067 | sizeof(halInitScanReqMsg.initScanParams), |
| 7068 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7069 | ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) ))) |
| 7070 | { |
| 7071 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7072 | "Unable to get send buffer in init scan req %x %x %x", |
| 7073 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 7074 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7075 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7076 | } |
| 7077 | |
| 7078 | |
| 7079 | /*----------------------------------------------------------------------- |
| 7080 | Fill in the message |
| 7081 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7082 | halInitScanReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7083 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 7084 | |
| 7085 | wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid, |
| 7086 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7087 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7088 | halInitScanReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7089 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7090 | halInitScanReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7091 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7092 | halInitScanReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7093 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 7094 | |
| 7095 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr, |
| 7096 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7097 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7098 | halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7099 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 7100 | |
| 7101 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7102 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7103 | halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7104 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 7105 | } |
| 7106 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7107 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7108 | &halInitScanReqMsg.initScanParams, |
| 7109 | sizeof(halInitScanReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7110 | } |
| 7111 | |
| 7112 | pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7113 | pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7114 | |
| 7115 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7116 | Send Init Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7117 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7118 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7119 | wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP); |
| 7120 | |
| 7121 | }/*WDI_ProcessInitScanReq*/ |
| 7122 | |
| 7123 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7124 | @brief Process Start Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7125 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7126 | |
| 7127 | @param pWDICtx: pointer to the WLAN DAL context |
| 7128 | pEventData: pointer to the event information structure |
| 7129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7130 | @see |
| 7131 | @return Result of the function call |
| 7132 | */ |
| 7133 | WDI_Status |
| 7134 | WDI_ProcessStartScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7135 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7136 | WDI_ControlBlockType* pWDICtx, |
| 7137 | WDI_EventInfoType* pEventData |
| 7138 | ) |
| 7139 | { |
| 7140 | WDI_StartScanReqParamsType* pwdiStartScanParams = NULL; |
| 7141 | WDI_StartScanRspCb wdiStartScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7142 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7143 | wpt_uint16 usDataOffset = 0; |
| 7144 | wpt_uint16 usSendSize = 0; |
| 7145 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7146 | tHalStartScanReqMsg halStartScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7147 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7148 | |
| 7149 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7150 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7151 | -------------------------------------------------------------------------*/ |
| 7152 | if (( NULL == pEventData ) || |
| 7153 | ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) || |
| 7154 | ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc))) |
| 7155 | { |
| 7156 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7157 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7158 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7159 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7160 | } |
| 7161 | |
| 7162 | #if 0 |
| 7163 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7164 | /*----------------------------------------------------------------------- |
| 7165 | Check to see if SCAN is already in progress - start scan is only |
| 7166 | allowed when a scan is ongoing and the state of the scan procedure |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7167 | is either init or end |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7168 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7169 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7170 | (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) && |
| 7171 | ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState ))) |
| 7172 | { |
| 7173 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7174 | "Scan start not allowed in this state %d %d", |
| 7175 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7177 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7178 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7179 | } |
| 7180 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7181 | pWDICtx->uScanState = WDI_SCAN_STARTED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7182 | |
| 7183 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7184 | #endif |
| 7185 | |
| 7186 | /*----------------------------------------------------------------------- |
| 7187 | Get message buffer |
| 7188 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7189 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7190 | sizeof(halStartScanReqMsg.startScanParams), |
| 7191 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7192 | ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) ))) |
| 7193 | { |
| 7194 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7195 | "Unable to get send buffer in start scan req %x %x %x", |
| 7196 | pEventData, pwdiStartScanParams, wdiStartScanRspCb); |
| 7197 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7198 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7199 | } |
| 7200 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7201 | halStartScanReqMsg.startScanParams.scanChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7202 | pwdiStartScanParams->ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7203 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7204 | &halStartScanReqMsg.startScanParams, |
| 7205 | sizeof(halStartScanReqMsg.startScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7206 | |
| 7207 | pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7208 | pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7209 | |
| 7210 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7211 | Send Start Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7212 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7213 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7214 | wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP); |
| 7215 | }/*WDI_ProcessStartScanReq*/ |
| 7216 | |
| 7217 | |
| 7218 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7219 | @brief Process End Scan Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7220 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7221 | |
| 7222 | @param pWDICtx: pointer to the WLAN DAL context |
| 7223 | pEventData: pointer to the event information structure |
| 7224 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7225 | @see |
| 7226 | @return Result of the function call |
| 7227 | */ |
| 7228 | WDI_Status |
| 7229 | WDI_ProcessEndScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7230 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7231 | WDI_ControlBlockType* pWDICtx, |
| 7232 | WDI_EventInfoType* pEventData |
| 7233 | ) |
| 7234 | { |
| 7235 | WDI_EndScanReqParamsType* pwdiEndScanParams = NULL; |
| 7236 | WDI_EndScanRspCb wdiEndScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7237 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7238 | wpt_uint16 usDataOffset = 0; |
| 7239 | wpt_uint16 usSendSize = 0; |
| 7240 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7241 | tHalEndScanReqMsg halEndScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7242 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7243 | |
| 7244 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7245 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7246 | -------------------------------------------------------------------------*/ |
| 7247 | if (( NULL == pEventData ) || |
| 7248 | ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) || |
| 7249 | ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc))) |
| 7250 | { |
| 7251 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7252 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7253 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7254 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7255 | } |
| 7256 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7257 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 7258 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7259 | * forwarded to HAL and result in hang*/ |
| 7260 | #if 0 |
| 7261 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7262 | /*----------------------------------------------------------------------- |
| 7263 | Check to see if SCAN is already in progress - end scan is only |
| 7264 | allowed when a scan is ongoing and the state of the scan procedure |
| 7265 | is started |
| 7266 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7267 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7268 | ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState )) |
| 7269 | { |
| 7270 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7271 | "End start not allowed in this state %d %d", |
| 7272 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7273 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7274 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7275 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7276 | } |
| 7277 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7278 | pWDICtx->uScanState = WDI_SCAN_ENDED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7279 | |
| 7280 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7281 | #endif |
| 7282 | |
| 7283 | /*----------------------------------------------------------------------- |
| 7284 | Get message buffer |
| 7285 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7286 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7287 | sizeof(halEndScanReqMsg.endScanParams), |
| 7288 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7289 | ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) ))) |
| 7290 | { |
| 7291 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7292 | "Unable to get send buffer in start scan req %x %x %x", |
| 7293 | pEventData, pwdiEndScanParams, wdiEndScanRspCb); |
| 7294 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7295 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7296 | } |
| 7297 | |
| 7298 | halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel; |
| 7299 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7300 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7301 | &halEndScanReqMsg.endScanParams, |
| 7302 | sizeof(halEndScanReqMsg.endScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7303 | |
| 7304 | pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7305 | pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7306 | |
| 7307 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7308 | Send End Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7309 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7310 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7311 | wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP); |
| 7312 | }/*WDI_ProcessEndScanReq*/ |
| 7313 | |
| 7314 | |
| 7315 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7316 | @brief Process Finish Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7317 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7318 | |
| 7319 | @param pWDICtx: pointer to the WLAN DAL context |
| 7320 | pEventData: pointer to the event information structure |
| 7321 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7322 | @see |
| 7323 | @return Result of the function call |
| 7324 | */ |
| 7325 | WDI_Status |
| 7326 | WDI_ProcessFinishScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7327 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7328 | WDI_ControlBlockType* pWDICtx, |
| 7329 | WDI_EventInfoType* pEventData |
| 7330 | ) |
| 7331 | { |
| 7332 | WDI_FinishScanReqParamsType* pwdiFinishScanParams; |
| 7333 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7334 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7335 | wpt_uint16 usDataOffset = 0; |
| 7336 | wpt_uint16 usSendSize = 0; |
| 7337 | wpt_uint8 i = 0; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 7338 | wpt_status wptStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7339 | tHalFinishScanReqMsg halFinishScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7340 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7341 | |
| 7342 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7343 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7344 | -------------------------------------------------------------------------*/ |
| 7345 | if (( NULL == pEventData ) || |
| 7346 | ( NULL == pEventData->pEventData) || |
| 7347 | ( NULL == pEventData->pCBfnc)) |
| 7348 | { |
| 7349 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7350 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7351 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7352 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7353 | } |
| 7354 | |
| 7355 | pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData; |
| 7356 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7357 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 7358 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7359 | * forwarded to HAL and result in hang*/ |
| 7360 | #if 0 |
| 7361 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7362 | /*----------------------------------------------------------------------- |
| 7363 | Check to see if SCAN is already in progress |
| 7364 | Finish scan gets invoked any scan states. ie. abort scan |
| 7365 | It should be allowed in any states. |
| 7366 | -----------------------------------------------------------------------*/ |
| 7367 | if ( !pWDICtx->bScanInProgress ) |
| 7368 | { |
| 7369 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7370 | "Finish start not allowed in this state %d", |
| 7371 | pWDICtx->bScanInProgress ); |
| 7372 | |
| 7373 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 7374 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7375 | } |
| 7376 | |
| 7377 | /*----------------------------------------------------------------------- |
| 7378 | It is safe to reset the scan flags here because until the response comes |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7379 | back all subsequent requests will be blocked at BUSY state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7380 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7381 | pWDICtx->uScanState = WDI_SCAN_FINISHED_ST; |
| 7382 | pWDICtx->bScanInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7383 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7384 | #endif |
| 7385 | |
| 7386 | if ( pWDICtx->bInBmps ) |
| 7387 | { |
| 7388 | // notify DTS that we are entering BMPS |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 7389 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL); |
| 7390 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 7391 | { |
| 7392 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 7393 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering BMPS\n", wptStatus); |
| 7394 | WDI_ASSERT(0); |
| 7395 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7396 | } |
| 7397 | |
| 7398 | /*----------------------------------------------------------------------- |
| 7399 | Get message buffer |
| 7400 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7401 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7402 | sizeof(halFinishScanReqMsg.finishScanParams), |
| 7403 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7404 | ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) ))) |
| 7405 | { |
| 7406 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7407 | "Unable to get send buffer in start scan req %x %x %x", |
| 7408 | pEventData, pwdiFinishScanParams, wdiFinishScanRspCb); |
| 7409 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7410 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7411 | } |
| 7412 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7413 | halFinishScanReqMsg.finishScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7414 | WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode); |
| 7415 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7416 | halFinishScanReqMsg.finishScanParams.currentOperChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7417 | pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel; |
| 7418 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7419 | halFinishScanReqMsg.finishScanParams.cbState = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7420 | WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState); |
| 7421 | |
| 7422 | wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid, |
| 7423 | pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7424 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7425 | halFinishScanReqMsg.finishScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7426 | pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7427 | halFinishScanReqMsg.finishScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7428 | pwdiFinishScanParams->wdiReqInfo.ucFrameType ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7429 | halFinishScanReqMsg.finishScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7430 | pwdiFinishScanParams->wdiReqInfo.ucFrameLength ; |
| 7431 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7432 | halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7433 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ; |
| 7434 | |
| 7435 | for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7436 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7437 | halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7438 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ; |
| 7439 | } |
| 7440 | |
| 7441 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr, |
| 7442 | &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7443 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7444 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7445 | &halFinishScanReqMsg.finishScanParams, |
| 7446 | sizeof(halFinishScanReqMsg.finishScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7447 | |
| 7448 | pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7449 | pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7450 | |
| 7451 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7452 | Send Finish Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7453 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7454 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7455 | wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP); |
| 7456 | }/*WDI_ProcessFinishScanReq*/ |
| 7457 | |
| 7458 | |
| 7459 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7460 | ASSOCIATION REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7461 | ==========================================================================*/ |
| 7462 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7463 | @brief Process BSS Join for a given Session |
| 7464 | |
| 7465 | @param pWDICtx: pointer to the WLAN DAL context |
| 7466 | pEventData: pointer to the event information structure |
| 7467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7468 | @see |
| 7469 | @return Result of the function call |
| 7470 | */ |
| 7471 | WDI_Status |
| 7472 | WDI_ProcessBSSSessionJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7473 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7474 | WDI_ControlBlockType* pWDICtx, |
| 7475 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 7476 | WDI_JoinRspCb wdiJoinRspCb, |
| 7477 | void* pUserData |
| 7478 | ) |
| 7479 | { |
| 7480 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7481 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7482 | wpt_uint16 usDataOffset = 0; |
| 7483 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7484 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7485 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7486 | tHalJoinReqMsg halJoinReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7487 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7488 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7489 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7490 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7491 | /*------------------------------------------------------------------------ |
| 7492 | Check to see if we have any session with this BSSID already stored, we |
| 7493 | should not |
| 7494 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7495 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7496 | pwdiJoinParams->wdiReqInfo.macBSSID, |
| 7497 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7498 | |
| 7499 | if ( NULL != pBSSSes ) |
| 7500 | { |
| 7501 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7502 | "Association for this BSSID: " MAC_ADDRESS_STR " is already in place", |
| 7503 | MAC_ADDR_ARRAY(pwdiJoinParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7504 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7505 | /*reset the bAssociationInProgress otherwise the next |
| 7506 | *join request will be queued*/ |
| 7507 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7508 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7509 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7510 | } |
| 7511 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7512 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7513 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7514 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7515 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7516 | if ( NULL == pBSSSes ) |
| 7517 | { |
| 7518 | |
| 7519 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7520 | "DAL has no free sessions - cannot run another join"); |
| 7521 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7522 | /*reset the bAssociationInProgress otherwise the next |
| 7523 | *join request will be queued*/ |
| 7524 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7525 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7526 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7527 | } |
| 7528 | |
| 7529 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7530 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7531 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7532 | WDI_MAC_ADDR_LEN); |
| 7533 | |
| 7534 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7535 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7536 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7537 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7538 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7539 | |
| 7540 | /*----------------------------------------------------------------------- |
| 7541 | Get message buffer |
| 7542 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7543 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7544 | sizeof(halJoinReqMsg.joinReqParams), |
| 7545 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7546 | ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) ))) |
| 7547 | { |
| 7548 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7549 | "Unable to get send buffer in join req %x %x %x", |
| 7550 | pUserData, pwdiJoinParams, wdiJoinRspCb); |
| 7551 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7552 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7553 | } |
| 7554 | |
| 7555 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7556 | pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7557 | |
| 7558 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7559 | pwdiJoinParams->wdiReqInfo.macSTASelf, |
| 7560 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7561 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7562 | halJoinReqMsg.joinReqParams.ucChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7563 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel; |
| 7564 | |
| 7565 | halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState; |
| 7566 | |
Madan Mohan Koyyalamudi | 83b1282 | 2012-11-02 12:43:10 -0700 | [diff] [blame] | 7567 | #ifdef WLAN_FEATURE_VOWIFI |
| 7568 | halJoinReqMsg.joinReqParams.maxTxPower = |
| 7569 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.cMaxTxPower; |
| 7570 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7571 | halJoinReqMsg.joinReqParams.ucLocalPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7572 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint; |
| 7573 | #endif |
| 7574 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7575 | halJoinReqMsg.joinReqParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7576 | WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo. |
| 7577 | wdiSecondaryChannelOffset); |
| 7578 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7579 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7580 | &halJoinReqMsg.joinReqParams, |
| 7581 | sizeof(halJoinReqMsg.joinReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7582 | |
| 7583 | pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7584 | pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7585 | |
| 7586 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7587 | Send Join Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7588 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7589 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7590 | wdiJoinRspCb, pUserData, WDI_JOIN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7591 | |
| 7592 | }/*WDI_ProcessBSSSessionJoinReq*/ |
| 7593 | |
| 7594 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7595 | @brief Process Join Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7596 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7597 | |
| 7598 | @param pWDICtx: pointer to the WLAN DAL context |
| 7599 | pEventData: pointer to the event information structure |
| 7600 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7601 | @see |
| 7602 | @return Result of the function call |
| 7603 | */ |
| 7604 | WDI_Status |
| 7605 | WDI_ProcessJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7606 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7607 | WDI_ControlBlockType* pWDICtx, |
| 7608 | WDI_EventInfoType* pEventData |
| 7609 | ) |
| 7610 | { |
| 7611 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7612 | WDI_JoinReqParamsType* pwdiJoinParams = NULL; |
| 7613 | WDI_JoinRspCb wdiJoinRspCb = NULL; |
| 7614 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7615 | |
| 7616 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7617 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7618 | -------------------------------------------------------------------------*/ |
| 7619 | if (( NULL == pEventData ) || |
| 7620 | ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) || |
| 7621 | ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc))) |
| 7622 | { |
| 7623 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7624 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7625 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7626 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7627 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7628 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7629 | /*------------------------------------------------------------------------- |
| 7630 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7631 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7632 | -------------------------------------------------------------------------*/ |
| 7633 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7634 | |
| 7635 | if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress ) |
| 7636 | { |
| 7637 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7638 | "Association is currently in progress, queueing new join req"); |
| 7639 | |
| 7640 | /*Association is in progress - queue current one*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7641 | wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7642 | pwdiJoinParams->wdiReqInfo.macBSSID); |
| 7643 | |
| 7644 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7645 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7646 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7647 | } |
| 7648 | |
| 7649 | /*Starting a new association */ |
| 7650 | pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE; |
| 7651 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7652 | |
| 7653 | /*Process the Join Request*/ |
| 7654 | return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams, |
| 7655 | wdiJoinRspCb,pEventData->pUserData); |
| 7656 | |
| 7657 | }/*WDI_ProcessJoinReq*/ |
| 7658 | |
| 7659 | |
| 7660 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7661 | @brief Process Config BSS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7662 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7663 | |
| 7664 | @param pWDICtx: pointer to the WLAN DAL context |
| 7665 | pEventData: pointer to the event information structure |
| 7666 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7667 | @see |
| 7668 | @return Result of the function call |
| 7669 | */ |
| 7670 | WDI_Status |
| 7671 | WDI_ProcessConfigBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7672 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7673 | WDI_ControlBlockType* pWDICtx, |
| 7674 | WDI_EventInfoType* pEventData |
| 7675 | ) |
| 7676 | { |
| 7677 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams; |
| 7678 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7679 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7680 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7681 | wpt_uint16 uMsgSize = 0; |
| 7682 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7683 | wpt_uint16 usDataOffset = 0; |
| 7684 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7685 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7686 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7687 | tConfigBssReqMsg halConfigBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7688 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7689 | |
| 7690 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7691 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7692 | -------------------------------------------------------------------------*/ |
| 7693 | if (( NULL == pEventData ) || |
| 7694 | ( NULL == pEventData->pEventData ) || |
| 7695 | ( NULL == pEventData->pCBfnc )) |
| 7696 | { |
| 7697 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7698 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7699 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7700 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7701 | } |
| 7702 | |
| 7703 | pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData; |
| 7704 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc; |
| 7705 | /*------------------------------------------------------------------------- |
| 7706 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7707 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7708 | -------------------------------------------------------------------------*/ |
| 7709 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7710 | |
| 7711 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7712 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7713 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7714 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7715 | pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
| 7716 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7717 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7718 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7719 | { |
| 7720 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 7721 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7722 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7723 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7724 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7725 | if ( NULL == pBSSSes ) |
| 7726 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7727 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7728 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7729 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7730 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7731 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7732 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7733 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7734 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7735 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7736 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7737 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7738 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7739 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7740 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7741 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7742 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7743 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7744 | /* If the BSS type is IBSS create the session here as there is no Join |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7745 | * Request in case of IBSS*/ |
| 7746 | if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) || |
| 7747 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) || |
| 7748 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) || |
| 7749 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE)) |
| 7750 | { |
| 7751 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7752 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7753 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7754 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7755 | if ( NULL == pBSSSes ) |
| 7756 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7757 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7758 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7759 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7760 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7761 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7762 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7763 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7765 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7766 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7767 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7768 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7769 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7770 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7771 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7772 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7773 | } |
| 7774 | else |
| 7775 | { |
| 7776 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7777 | "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d", |
| 7778 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7779 | pwdiConfigBSSParams->wdiReqInfo.wdiBSSType); |
| 7780 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7781 | /* for IBSS testing */ |
| 7782 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7783 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7784 | } |
| 7785 | #endif |
| 7786 | } |
| 7787 | |
| 7788 | /*------------------------------------------------------------------------ |
| 7789 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7790 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7791 | ------------------------------------------------------------------------*/ |
| 7792 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7793 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7794 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7795 | "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d", |
| 7796 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7797 | ucCurrentBSSSesIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7798 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7799 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7800 | |
| 7801 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7802 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7803 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7804 | } |
| 7805 | |
| 7806 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7807 | wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq, |
| 7808 | pwdiConfigBSSParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7809 | sizeof(pWDICtx->wdiCachedConfigBssReq)); |
| 7810 | |
| 7811 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7812 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7813 | /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */ |
| 7814 | #ifdef WLAN_FEATURE_11AC |
| 7815 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7816 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7817 | else |
| 7818 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7819 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7820 | |
| 7821 | /*----------------------------------------------------------------------- |
| 7822 | Get message buffer |
| 7823 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7824 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7825 | uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7826 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7827 | { |
| 7828 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7829 | "Unable to get send buffer in config bss req %x %x %x", |
| 7830 | pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb); |
| 7831 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7832 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7833 | } |
| 7834 | |
| 7835 | /*Copy the BSS request */ |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 7836 | #ifdef WLAN_FEATURE_11AC |
| 7837 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 7838 | WDI_CopyWDIConfigBSSToHALConfigBSS( (tConfigBssParams*)&halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7839 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7840 | else |
| 7841 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7842 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7843 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7844 | |
| 7845 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 7846 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7847 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7848 | |
| 7849 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7850 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx; |
| 7851 | |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 7852 | #ifdef WLAN_FEATURE_11AC |
| 7853 | if (WDI_getFwWlanFeatCaps(DOT11AC)){ |
| 7854 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7855 | &halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7856 | uMsgSize); |
| 7857 | }else |
| 7858 | #endif |
Tushnim Bhattacharyya | 95341d3 | 2013-03-20 20:15:03 -0700 | [diff] [blame] | 7859 | { |
| 7860 | if ( uMsgSize <= sizeof(tConfigBssParams) ) |
| 7861 | { |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 7862 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Tushnim Bhattacharyya | 95341d3 | 2013-03-20 20:15:03 -0700 | [diff] [blame] | 7863 | &halConfigBssReqMsg.uBssParams.configBssParams, |
| 7864 | uMsgSize); |
| 7865 | } |
| 7866 | else |
| 7867 | { |
| 7868 | return WDI_STATUS_E_FAILURE; |
| 7869 | } |
| 7870 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7871 | |
| 7872 | pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7873 | pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7874 | |
| 7875 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7876 | Send Config BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7877 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7878 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7879 | wdiConfigBSSRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7880 | WDI_CONFIG_BSS_RESP); |
| 7881 | |
| 7882 | }/*WDI_ProcessConfigBSSReq*/ |
| 7883 | |
| 7884 | |
| 7885 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7886 | @brief Process Del BSS Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7887 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7888 | |
| 7889 | @param pWDICtx: pointer to the WLAN DAL context |
| 7890 | pEventData: pointer to the event information structure |
| 7891 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7892 | @see |
| 7893 | @return Result of the function call |
| 7894 | */ |
| 7895 | WDI_Status |
| 7896 | WDI_ProcessDelBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7897 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7898 | WDI_ControlBlockType* pWDICtx, |
| 7899 | WDI_EventInfoType* pEventData |
| 7900 | ) |
| 7901 | { |
| 7902 | WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL; |
| 7903 | WDI_DelBSSRspCb wdiDelBSSRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7904 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7905 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7906 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7907 | wpt_uint16 usDataOffset = 0; |
| 7908 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7909 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7911 | tDeleteBssReqMsg halBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7912 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7913 | |
| 7914 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7915 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7916 | -------------------------------------------------------------------------*/ |
| 7917 | if (( NULL == pEventData ) || |
| 7918 | ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) || |
| 7919 | ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc))) |
| 7920 | { |
| 7921 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7922 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7923 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7924 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7925 | } |
| 7926 | |
| 7927 | /*------------------------------------------------------------------------- |
| 7928 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7929 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7930 | -------------------------------------------------------------------------*/ |
| 7931 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7932 | |
| 7933 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7934 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7935 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7936 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 7937 | pwdiDelBSSParams->ucBssIdx, |
| 7938 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7939 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7940 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7941 | { |
| 7942 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7943 | "%s: BSS does not yet exist. ucBssIdx %d", |
| 7944 | __func__, pwdiDelBSSParams->ucBssIdx); |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7945 | |
| 7946 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7947 | |
| 7948 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7949 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7950 | |
| 7951 | /*------------------------------------------------------------------------ |
| 7952 | Check if this BSS is being currently processed or queued, |
| 7953 | if queued - queue the new request as well |
| 7954 | ------------------------------------------------------------------------*/ |
| 7955 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7956 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7957 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7958 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 7959 | __func__, pwdiDelBSSParams->ucBssIdx); |
| 7960 | |
| 7961 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 7962 | |
| 7963 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7964 | |
| 7965 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7966 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7968 | /*----------------------------------------------------------------------- |
| 7969 | If we receive a Del BSS request for an association that is already in |
| 7970 | progress, it indicates that the assoc has failed => we no longer have |
| 7971 | an association in progress => we must check for pending associations |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7972 | that were queued and start as soon as the Del BSS response is received |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7973 | -----------------------------------------------------------------------*/ |
| 7974 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
| 7975 | { |
| 7976 | /*We can switch to false here because even if a subsequent Join comes in |
| 7977 | it will only be processed when DAL transitions out of BUSY state which |
| 7978 | happens when the Del BSS request comes */ |
| 7979 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7980 | |
| 7981 | /*Former association is complete - prepare next pending assoc for |
| 7982 | processing */ |
| 7983 | WDI_DequeueAssocRequest(pWDICtx); |
| 7984 | } |
| 7985 | |
| 7986 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7987 | /*----------------------------------------------------------------------- |
| 7988 | Get message buffer |
| 7989 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7990 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7991 | sizeof(halBssReqMsg.deleteBssParams), |
| 7992 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7993 | ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) ))) |
| 7994 | { |
| 7995 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7996 | "Unable to get send buffer in start req %x %x %x", |
| 7997 | pEventData, pwdiDelBSSParams, wdiDelBSSRspCb); |
| 7998 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7999 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8000 | } |
| 8001 | |
| 8002 | /*Fill in the message request structure*/ |
| 8003 | |
| 8004 | /*BSS Index is saved on config BSS response and Post Assoc Response */ |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 8005 | halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8006 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8007 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8008 | &halBssReqMsg.deleteBssParams, |
| 8009 | sizeof(halBssReqMsg.deleteBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8010 | |
| 8011 | pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8012 | pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8013 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8014 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8015 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8016 | Send Del BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8017 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8018 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8019 | wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP); |
| 8020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8021 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8022 | }/*WDI_ProcessDelBSSReq*/ |
| 8023 | |
| 8024 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8025 | @brief Process Post Assoc Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8026 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8027 | |
| 8028 | @param pWDICtx: pointer to the WLAN DAL context |
| 8029 | pEventData: pointer to the event information structure |
| 8030 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8031 | @see |
| 8032 | @return Result of the function call |
| 8033 | */ |
| 8034 | WDI_Status |
| 8035 | WDI_ProcessPostAssocReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8036 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8037 | WDI_ControlBlockType* pWDICtx, |
| 8038 | WDI_EventInfoType* pEventData |
| 8039 | ) |
| 8040 | { |
| 8041 | WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL; |
| 8042 | WDI_PostAssocRspCb wdiPostAssocRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8043 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8044 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8045 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8046 | wpt_uint16 usDataOffset = 0; |
| 8047 | wpt_uint16 usSendSize = 0; |
| 8048 | wpt_uint16 uMsgSize = 0; |
| 8049 | wpt_uint16 uOffset = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8050 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8051 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8052 | tPostAssocReqMsg halPostAssocReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8053 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8054 | |
| 8055 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8056 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8057 | -------------------------------------------------------------------------*/ |
| 8058 | if (( NULL == pEventData ) || |
| 8059 | ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) || |
| 8060 | ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc))) |
| 8061 | { |
| 8062 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8063 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8064 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8065 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8066 | } |
| 8067 | |
| 8068 | /*------------------------------------------------------------------------- |
| 8069 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8070 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8071 | -------------------------------------------------------------------------*/ |
| 8072 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8073 | |
| 8074 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8075 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8076 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8077 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 8078 | pwdiPostAssocParams->wdiBSSParams.macBSSID, |
| 8079 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8080 | |
| 8081 | if ( NULL == pBSSSes ) |
| 8082 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8083 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8084 | "%s: Association sequence for this BSS does not yet exist - " |
| 8085 | "operation not allowed. macBSSID " MAC_ADDRESS_STR, |
| 8086 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8087 | |
| 8088 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8089 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8090 | } |
| 8091 | |
| 8092 | /*------------------------------------------------------------------------ |
| 8093 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8094 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8095 | ------------------------------------------------------------------------*/ |
| 8096 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8097 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8098 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8099 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8100 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8101 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8102 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8103 | |
| 8104 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8106 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8107 | } |
| 8108 | |
| 8109 | /*----------------------------------------------------------------------- |
| 8110 | If Post Assoc was not yet received - the current association must |
| 8111 | be in progress |
| 8112 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8113 | if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8114 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 8115 | { |
| 8116 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8117 | "Association sequence for this BSS association no longer in " |
| 8118 | "progress - not allowed"); |
| 8119 | |
| 8120 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8121 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8122 | } |
| 8123 | |
| 8124 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8125 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8126 | -----------------------------------------------------------------------*/ |
| 8127 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 8128 | { |
| 8129 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8130 | "Post Assoc not allowed before JOIN - failing request"); |
| 8131 | |
| 8132 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8133 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8134 | } |
| 8135 | |
| 8136 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8137 | |
| 8138 | uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) + |
| 8139 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ; |
| 8140 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8141 | Fill message for tx over the bus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8142 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8143 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8144 | uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8145 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 8146 | { |
| 8147 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8148 | "Unable to get send buffer in start req %x %x %x", |
| 8149 | pEventData, pwdiPostAssocParams, wdiPostAssocRspCb); |
| 8150 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8151 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8152 | } |
| 8153 | |
| 8154 | /*Copy the STA parameters */ |
| 8155 | WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 8156 | &pwdiPostAssocParams->wdiSTAParams ); |
| 8157 | |
| 8158 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8159 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8160 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 8161 | pwdiPostAssocParams->wdiSTAParams.macSTA, |
| 8162 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx )) |
| 8163 | { |
| 8164 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8165 | "This station does not exist in the WDI Station Table %d"); |
| 8166 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 8167 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8168 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8169 | } |
| 8170 | |
| 8171 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8172 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8173 | pBSSSes->ucBSSIdx; |
| 8174 | |
| 8175 | /*Copy the BSS parameters */ |
| 8176 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 8177 | &pwdiPostAssocParams->wdiBSSParams); |
| 8178 | |
| 8179 | /* Need to fill in the STA index of the peer */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8180 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8181 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 8182 | pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8183 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8184 | { |
| 8185 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8186 | "This station does not exist in the WDI Station Table %d"); |
| 8187 | wpalMutexRelease(&pWDICtx->wptMutex); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 8188 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8189 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8190 | } |
| 8191 | |
| 8192 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8193 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8194 | pBSSSes->ucBSSIdx; |
| 8195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8196 | |
| 8197 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8198 | &halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 8199 | sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8200 | |
| 8201 | uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams); |
| 8202 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8203 | wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset, |
| 8204 | &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 8205 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8206 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8207 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8208 | pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8209 | pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8210 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8211 | |
| 8212 | wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8213 | pwdiPostAssocParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8214 | sizeof(pWDICtx->wdiCachedPostAssocReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8215 | |
| 8216 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8217 | Send Post Assoc Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8218 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8219 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8220 | wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP); |
| 8221 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8222 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8223 | }/*WDI_ProcessPostAssocReq*/ |
| 8224 | |
| 8225 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8226 | @brief Process Del STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8227 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8228 | |
| 8229 | @param pWDICtx: pointer to the WLAN DAL context |
| 8230 | pEventData: pointer to the event information structure |
| 8231 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8232 | @see |
| 8233 | @return Result of the function call |
| 8234 | */ |
| 8235 | WDI_Status |
| 8236 | WDI_ProcessDelSTAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8237 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8238 | WDI_ControlBlockType* pWDICtx, |
| 8239 | WDI_EventInfoType* pEventData |
| 8240 | ) |
| 8241 | { |
| 8242 | WDI_DelSTAReqParamsType* pwdiDelSTAParams; |
| 8243 | WDI_DelSTARspCb wdiDelSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8244 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8245 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8246 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8247 | wpt_uint16 usDataOffset = 0; |
| 8248 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8249 | wpt_macAddr macBSSID; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8250 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 8251 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8252 | tDeleteStaReqMsg halDelStaReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8253 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8254 | |
| 8255 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8256 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8257 | -------------------------------------------------------------------------*/ |
| 8258 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8259 | ( NULL == pEventData->pCBfnc )) |
| 8260 | { |
| 8261 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8262 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8263 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8264 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8265 | } |
| 8266 | |
| 8267 | pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData; |
| 8268 | wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc; |
| 8269 | /*------------------------------------------------------------------------- |
| 8270 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8271 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8272 | -------------------------------------------------------------------------*/ |
| 8273 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8274 | |
| 8275 | /*------------------------------------------------------------------------ |
| 8276 | Find the BSS for which the request is made and identify WDI session |
| 8277 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8278 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8279 | pwdiDelSTAParams->ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8280 | &macBSSID)) |
| 8281 | { |
| 8282 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8283 | "This station does not exist in the WDI Station Table %d"); |
| 8284 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8285 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8286 | } |
| 8287 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8288 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8289 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8290 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8291 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8292 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8293 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8294 | |
| 8295 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8296 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8297 | } |
| 8298 | |
| 8299 | /*------------------------------------------------------------------------ |
| 8300 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8301 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8302 | ------------------------------------------------------------------------*/ |
| 8303 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8304 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8305 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8306 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8307 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8308 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8309 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8310 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8311 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8312 | } |
| 8313 | |
| 8314 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8315 | /*----------------------------------------------------------------------- |
| 8316 | Get message buffer |
| 8317 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8318 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8319 | sizeof(halDelStaReqMsg.delStaParams), |
| 8320 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8321 | ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) ))) |
| 8322 | { |
| 8323 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8324 | "Unable to get send buffer in start req %x %x %x", |
| 8325 | pEventData, pwdiDelSTAParams, wdiDelSTARspCb); |
| 8326 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8327 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8328 | } |
| 8329 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8330 | halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx; |
| 8331 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8332 | &halDelStaReqMsg.delStaParams, |
| 8333 | sizeof(halDelStaReqMsg.delStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8334 | |
| 8335 | pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8336 | pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8337 | |
| 8338 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8339 | Send Del STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8340 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8341 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8342 | wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP); |
| 8343 | |
| 8344 | }/*WDI_ProcessDelSTAReq*/ |
| 8345 | |
| 8346 | |
| 8347 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8348 | SECURITY REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8349 | ==========================================================================*/ |
| 8350 | /** |
| 8351 | @brief Process Set BSS Key Request function (called when Main FSM |
| 8352 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8353 | |
| 8354 | @param pWDICtx: pointer to the WLAN DAL context |
| 8355 | pEventData: pointer to the event information structure |
| 8356 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8357 | @see |
| 8358 | @return Result of the function call |
| 8359 | */ |
| 8360 | WDI_Status |
| 8361 | WDI_ProcessSetBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8362 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8363 | WDI_ControlBlockType* pWDICtx, |
| 8364 | WDI_EventInfoType* pEventData |
| 8365 | ) |
| 8366 | { |
| 8367 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams; |
| 8368 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8369 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8370 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8371 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8372 | wpt_uint16 usDataOffset = 0; |
| 8373 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8374 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8375 | tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}}; |
| 8376 | wpt_uint8 keyIndex = 0; |
| 8377 | |
| 8378 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8379 | |
| 8380 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8381 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8382 | -------------------------------------------------------------------------*/ |
| 8383 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8384 | ( NULL == pEventData->pCBfnc )) |
| 8385 | { |
| 8386 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8387 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8388 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8389 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8390 | } |
| 8391 | |
| 8392 | pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData; |
| 8393 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc; |
| 8394 | /*------------------------------------------------------------------------- |
| 8395 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8396 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8397 | -------------------------------------------------------------------------*/ |
| 8398 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8399 | |
| 8400 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8401 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8402 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8403 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8404 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx, |
| 8405 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8406 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8407 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8408 | { |
| 8409 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8410 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8411 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8412 | |
| 8413 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8414 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8415 | } |
| 8416 | |
| 8417 | /*------------------------------------------------------------------------ |
| 8418 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8419 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8420 | ------------------------------------------------------------------------*/ |
| 8421 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8422 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8423 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8424 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8425 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8426 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8427 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8428 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8429 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8430 | } |
| 8431 | |
| 8432 | |
| 8433 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8434 | /*----------------------------------------------------------------------- |
| 8435 | Get message buffer |
| 8436 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8437 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8438 | sizeof(halSetBssKeyReqMsg.setBssKeyParams), |
| 8439 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8440 | ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) ))) |
| 8441 | { |
| 8442 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8443 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8444 | pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb); |
| 8445 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8446 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8447 | } |
| 8448 | |
| 8449 | /*----------------------------------------------------------------------- |
| 8450 | Copy the Key parameters into the HAL message |
| 8451 | -----------------------------------------------------------------------*/ |
| 8452 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8453 | halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8454 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8455 | halSetBssKeyReqMsg.setBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8456 | WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType); |
| 8457 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8458 | halSetBssKeyReqMsg.setBssKeyParams.numKeys = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8459 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys; |
| 8460 | |
| 8461 | for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ; |
| 8462 | keyIndex++) |
| 8463 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8464 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8465 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId; |
| 8466 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast = |
| 8467 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast; |
| 8468 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection = |
| 8469 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection; |
| 8470 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8471 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8472 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8473 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8474 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8475 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8476 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength; |
| 8477 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8478 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8479 | WDI_MAX_KEY_LENGTH); |
| 8480 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8481 | |
| 8482 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8483 | &halSetBssKeyReqMsg.setBssKeyParams, |
| 8484 | sizeof(halSetBssKeyReqMsg.setBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8485 | |
| 8486 | pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8487 | pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8488 | |
| 8489 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8490 | Send Set BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8491 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8492 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8493 | wdiSetBSSKeyRspCb, pEventData->pUserData, |
| 8494 | WDI_SET_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8495 | |
| 8496 | }/*WDI_ProcessSetBssKeyReq*/ |
| 8497 | |
| 8498 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8499 | @brief Process Remove BSS Key Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8500 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8501 | |
| 8502 | @param pWDICtx: pointer to the WLAN DAL context |
| 8503 | pEventData: pointer to the event information structure |
| 8504 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8505 | @see |
| 8506 | @return Result of the function call |
| 8507 | */ |
| 8508 | WDI_Status |
| 8509 | WDI_ProcessRemoveBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8510 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8511 | WDI_ControlBlockType* pWDICtx, |
| 8512 | WDI_EventInfoType* pEventData |
| 8513 | ) |
| 8514 | { |
| 8515 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams; |
| 8516 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8517 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8518 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8519 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8520 | wpt_uint16 usDataOffset = 0; |
| 8521 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8522 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8523 | tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}}; |
| 8524 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8525 | |
| 8526 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8527 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8528 | -------------------------------------------------------------------------*/ |
| 8529 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8530 | ( NULL == pEventData->pCBfnc )) |
| 8531 | { |
| 8532 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8533 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8534 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8535 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8536 | } |
| 8537 | |
| 8538 | pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData; |
| 8539 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc; |
| 8540 | /*------------------------------------------------------------------------- |
| 8541 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8542 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8543 | -------------------------------------------------------------------------*/ |
| 8544 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8545 | |
| 8546 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8547 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8548 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8549 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8550 | pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx, |
| 8551 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8552 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8553 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8554 | { |
| 8555 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8556 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8557 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8558 | |
| 8559 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8560 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8561 | } |
| 8562 | |
| 8563 | /*------------------------------------------------------------------------ |
| 8564 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8565 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8566 | ------------------------------------------------------------------------*/ |
| 8567 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8568 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8569 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8570 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8571 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8572 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8573 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8574 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8575 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8576 | } |
| 8577 | |
| 8578 | |
| 8579 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8580 | |
| 8581 | /*----------------------------------------------------------------------- |
| 8582 | Get message buffer |
| 8583 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8584 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8585 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams), |
| 8586 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8587 | ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) ))) |
| 8588 | { |
| 8589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8590 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8591 | pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb); |
| 8592 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8593 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8594 | } |
| 8595 | /*----------------------------------------------------------------------- |
| 8596 | Copy the Key parameters into the HAL message |
| 8597 | -----------------------------------------------------------------------*/ |
| 8598 | halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
| 8599 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8600 | halRemoveBssKeyReqMsg.removeBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8601 | WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType); |
| 8602 | |
| 8603 | halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId; |
| 8604 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8605 | halRemoveBssKeyReqMsg.removeBssKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8606 | WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType); |
| 8607 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8608 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8609 | &halRemoveBssKeyReqMsg.removeBssKeyParams, |
| 8610 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8611 | |
| 8612 | pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8613 | pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8614 | |
| 8615 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8616 | Send Remove BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8617 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8618 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8619 | wdiRemoveBSSKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8620 | WDI_RMV_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8621 | }/*WDI_ProcessRemoveBssKeyReq*/ |
| 8622 | |
| 8623 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8624 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8625 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8626 | |
| 8627 | @param pWDICtx: pointer to the WLAN DAL context |
| 8628 | pEventData: pointer to the event information structure |
| 8629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8630 | @see |
| 8631 | @return Result of the function call |
| 8632 | */ |
| 8633 | WDI_Status |
| 8634 | WDI_ProcessSetStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8635 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8636 | WDI_ControlBlockType* pWDICtx, |
| 8637 | WDI_EventInfoType* pEventData |
| 8638 | ) |
| 8639 | { |
| 8640 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8641 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8642 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8643 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8644 | wpt_uint16 usDataOffset = 0; |
| 8645 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8646 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8647 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8648 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8649 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8650 | wpt_uint8 keyIndex = 0; |
| 8651 | |
| 8652 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8653 | |
| 8654 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8655 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8656 | -------------------------------------------------------------------------*/ |
| 8657 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8658 | ( NULL == pEventData->pCBfnc )) |
| 8659 | { |
| 8660 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8661 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8662 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8663 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8664 | } |
| 8665 | |
| 8666 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8667 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8668 | /*------------------------------------------------------------------------- |
| 8669 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8670 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8671 | -------------------------------------------------------------------------*/ |
| 8672 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8673 | |
| 8674 | /*------------------------------------------------------------------------ |
| 8675 | Find the BSS for which the request is made and identify WDI session |
| 8676 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8677 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8678 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8679 | &macBSSID)) |
| 8680 | { |
| 8681 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8682 | "This station does not exist in the WDI Station Table %d"); |
| 8683 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8684 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8685 | } |
| 8686 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8687 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8688 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8689 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8690 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8691 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8692 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8693 | |
| 8694 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8695 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8696 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8698 | /*------------------------------------------------------------------------ |
| 8699 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8700 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8701 | ------------------------------------------------------------------------*/ |
| 8702 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8703 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8704 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8705 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8706 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8707 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8708 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8709 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8710 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8711 | } |
| 8712 | |
| 8713 | |
| 8714 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8715 | /*----------------------------------------------------------------------- |
| 8716 | Get message buffer |
| 8717 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8718 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8719 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8720 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8721 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8722 | { |
| 8723 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8724 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8725 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8726 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8727 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8728 | } |
| 8729 | /*----------------------------------------------------------------------- |
| 8730 | Copy the STA Key parameters into the HAL message |
| 8731 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8732 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8733 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8734 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8735 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8736 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8737 | |
| 8738 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8739 | |
| 8740 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8741 | |
| 8742 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8743 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8744 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8745 | keyIndex++) |
| 8746 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8747 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8748 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8749 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8750 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8751 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8752 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8753 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8754 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8755 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8756 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8757 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8758 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8759 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8760 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8761 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8762 | WDI_MAX_KEY_LENGTH); |
| 8763 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8764 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8765 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8766 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8767 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8768 | |
| 8769 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8770 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8771 | |
| 8772 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8773 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8774 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8775 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8776 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8777 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8778 | |
| 8779 | }/*WDI_ProcessSetSTAKeyReq*/ |
| 8780 | |
| 8781 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8782 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8783 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8784 | |
| 8785 | @param pWDICtx: pointer to the WLAN DAL context |
| 8786 | pEventData: pointer to the event information structure |
| 8787 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8788 | @see |
| 8789 | @return Result of the function call |
| 8790 | */ |
| 8791 | WDI_Status |
| 8792 | WDI_ProcessRemoveStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8793 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8794 | WDI_ControlBlockType* pWDICtx, |
| 8795 | WDI_EventInfoType* pEventData |
| 8796 | ) |
| 8797 | { |
| 8798 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams; |
| 8799 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8800 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8801 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8802 | wpt_uint16 usDataOffset = 0; |
| 8803 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8804 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8805 | wpt_macAddr macBSSID; |
| 8806 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8807 | tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}}; |
| 8808 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8809 | |
| 8810 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8811 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8812 | -------------------------------------------------------------------------*/ |
| 8813 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8814 | ( NULL == pEventData->pCBfnc )) |
| 8815 | { |
| 8816 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8817 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8818 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8819 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8820 | } |
| 8821 | |
| 8822 | pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8823 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8824 | /*------------------------------------------------------------------------- |
| 8825 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8826 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8827 | -------------------------------------------------------------------------*/ |
| 8828 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8829 | |
| 8830 | /*------------------------------------------------------------------------ |
| 8831 | Find the BSS for which the request is made and identify WDI session |
| 8832 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8833 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8834 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8835 | &macBSSID)) |
| 8836 | { |
| 8837 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8838 | "This station does not exist in the WDI Station Table %d"); |
| 8839 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8840 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8841 | } |
| 8842 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8843 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8844 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8845 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8846 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8847 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8848 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8849 | |
| 8850 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8851 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8852 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8853 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8854 | /*------------------------------------------------------------------------ |
| 8855 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8856 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8857 | ------------------------------------------------------------------------*/ |
| 8858 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8859 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8860 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8861 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8862 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8864 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8865 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8866 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8867 | } |
| 8868 | |
| 8869 | |
| 8870 | |
| 8871 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8872 | /*----------------------------------------------------------------------- |
| 8873 | Get message buffer |
| 8874 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8875 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8876 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams), |
| 8877 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8878 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) ))) |
| 8879 | { |
| 8880 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8881 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8882 | pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb); |
| 8883 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8884 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8885 | } |
| 8886 | |
| 8887 | /*----------------------------------------------------------------------- |
| 8888 | Copy the Key parameters into the HAL message |
| 8889 | -----------------------------------------------------------------------*/ |
| 8890 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8891 | halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8892 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8893 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8894 | halRemoveStaKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8895 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8896 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8897 | halRemoveStaKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8898 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId; |
| 8899 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8900 | halRemoveStaKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8901 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast; |
| 8902 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8903 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8904 | &halRemoveStaKeyReqMsg.removeStaKeyParams, |
| 8905 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8906 | |
| 8907 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8908 | pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8909 | |
| 8910 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8911 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8912 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8913 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8914 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8915 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8916 | |
| 8917 | }/*WDI_ProcessRemoveSTAKeyReq*/ |
| 8918 | |
| 8919 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8920 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8921 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8922 | |
| 8923 | @param pWDICtx: pointer to the WLAN DAL context |
| 8924 | pEventData: pointer to the event information structure |
| 8925 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8926 | @see |
| 8927 | @return Result of the function call |
| 8928 | */ |
| 8929 | WDI_Status |
| 8930 | WDI_ProcessSetStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8931 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8932 | WDI_ControlBlockType* pWDICtx, |
| 8933 | WDI_EventInfoType* pEventData |
| 8934 | ) |
| 8935 | { |
| 8936 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8937 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8938 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8939 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8940 | wpt_uint16 usDataOffset = 0; |
| 8941 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8942 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8943 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8944 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8945 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8946 | wpt_uint8 keyIndex = 0; |
| 8947 | |
| 8948 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8949 | |
| 8950 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8951 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8952 | -------------------------------------------------------------------------*/ |
| 8953 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8954 | ( NULL == pEventData->pCBfnc )) |
| 8955 | { |
| 8956 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8957 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8958 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8959 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8960 | } |
| 8961 | |
| 8962 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8963 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8964 | /*------------------------------------------------------------------------- |
| 8965 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8966 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8967 | -------------------------------------------------------------------------*/ |
| 8968 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8969 | |
| 8970 | /*------------------------------------------------------------------------ |
| 8971 | Find the BSS for which the request is made and identify WDI session |
| 8972 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8973 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8974 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8975 | &macBSSID)) |
| 8976 | { |
| 8977 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8978 | "This station does not exist in the WDI Station Table %d"); |
| 8979 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8980 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8981 | } |
| 8982 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8983 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8984 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8985 | { |
| 8986 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8987 | "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8988 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8989 | |
| 8990 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8991 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8992 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8993 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8994 | /*------------------------------------------------------------------------ |
| 8995 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8996 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8997 | ------------------------------------------------------------------------*/ |
| 8998 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8999 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9000 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9001 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9002 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9003 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9004 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9005 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9006 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9007 | } |
| 9008 | |
| 9009 | |
| 9010 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9011 | /*----------------------------------------------------------------------- |
| 9012 | Get message buffer |
| 9013 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9014 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9015 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 9016 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9017 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 9018 | { |
| 9019 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9020 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9021 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 9022 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9023 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9024 | } |
| 9025 | /*----------------------------------------------------------------------- |
| 9026 | Copy the STA Key parameters into the HAL message |
| 9027 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9028 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9029 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 9030 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9031 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9032 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 9033 | |
| 9034 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 9035 | |
| 9036 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 9037 | |
| 9038 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 9039 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9040 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 9041 | keyIndex++) |
| 9042 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9043 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9044 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 9045 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 9046 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 9047 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 9048 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 9049 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9050 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9051 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9052 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9053 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9054 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9055 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 9056 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9057 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9058 | WDI_MAX_KEY_LENGTH); |
| 9059 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9060 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9061 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9062 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 9063 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9064 | |
| 9065 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9066 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9067 | |
| 9068 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9069 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9070 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9071 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9072 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 9073 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9074 | |
| 9075 | }/*WDI_ProcessSetSTABcastKeyReq*/ |
| 9076 | |
| 9077 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9078 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9079 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9080 | |
| 9081 | @param pWDICtx: pointer to the WLAN DAL context |
| 9082 | pEventData: pointer to the event information structure |
| 9083 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9084 | @see |
| 9085 | @return Result of the function call |
| 9086 | */ |
| 9087 | WDI_Status |
| 9088 | WDI_ProcessRemoveStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9089 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9090 | WDI_ControlBlockType* pWDICtx, |
| 9091 | WDI_EventInfoType* pEventData |
| 9092 | ) |
| 9093 | { |
| 9094 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams; |
| 9095 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 9096 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9097 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9098 | wpt_uint16 usDataOffset = 0; |
| 9099 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9100 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9101 | wpt_macAddr macBSSID; |
| 9102 | wpt_uint8 ucCurrentBSSSesIdx; |
| 9103 | tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}}; |
| 9104 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9105 | |
| 9106 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9107 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9108 | -------------------------------------------------------------------------*/ |
| 9109 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9110 | ( NULL == pEventData->pCBfnc )) |
| 9111 | { |
| 9112 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9113 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9114 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9115 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9116 | } |
| 9117 | |
| 9118 | pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 9119 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 9120 | /*------------------------------------------------------------------------- |
| 9121 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9122 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9123 | -------------------------------------------------------------------------*/ |
| 9124 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9125 | |
| 9126 | /*------------------------------------------------------------------------ |
| 9127 | Find the BSS for which the request is made and identify WDI session |
| 9128 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9129 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9130 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9131 | &macBSSID)) |
| 9132 | { |
| 9133 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9134 | "This station does not exist in the WDI Station Table %d"); |
| 9135 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9136 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9137 | } |
| 9138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9139 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 9140 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9141 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9142 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9143 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9144 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9145 | |
| 9146 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9147 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9148 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9149 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9150 | /*------------------------------------------------------------------------ |
| 9151 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9152 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9153 | ------------------------------------------------------------------------*/ |
| 9154 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9155 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9156 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9157 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9158 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9159 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9160 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9161 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9162 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9163 | } |
| 9164 | |
| 9165 | |
| 9166 | |
| 9167 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9168 | /*----------------------------------------------------------------------- |
| 9169 | Get message buffer |
| 9170 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9171 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_BCAST_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9172 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams), |
| 9173 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9174 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) ))) |
| 9175 | { |
| 9176 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9177 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9178 | pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb); |
| 9179 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9180 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9181 | } |
| 9182 | |
| 9183 | /*----------------------------------------------------------------------- |
| 9184 | Copy the Key parameters into the HAL message |
| 9185 | -----------------------------------------------------------------------*/ |
| 9186 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9187 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9188 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx; |
| 9189 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9190 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9191 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType); |
| 9192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9193 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9194 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId; |
| 9195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9196 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9197 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast; |
| 9198 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9199 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9200 | &halRemoveStaBcastKeyReqMsg.removeStaKeyParams, |
| 9201 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9202 | |
| 9203 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9204 | pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9205 | |
| 9206 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9207 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9208 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9209 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9210 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9211 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9212 | |
| 9213 | }/*WDI_ProcessRemoveSTABcastKeyReq*/ |
| 9214 | |
| 9215 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9216 | QOS and BA PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9217 | ==========================================================================*/ |
| 9218 | /** |
| 9219 | @brief Process Add TSpec Request function (called when Main FSM |
| 9220 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9221 | |
| 9222 | @param pWDICtx: pointer to the WLAN DAL context |
| 9223 | pEventData: pointer to the event information structure |
| 9224 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9225 | @see |
| 9226 | @return Result of the function call |
| 9227 | */ |
| 9228 | WDI_Status |
| 9229 | WDI_ProcessAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9230 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9231 | WDI_ControlBlockType* pWDICtx, |
| 9232 | WDI_EventInfoType* pEventData |
| 9233 | ) |
| 9234 | { |
| 9235 | WDI_AddTSReqParamsType* pwdiAddTSParams; |
| 9236 | WDI_AddTsRspCb wdiAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9237 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9238 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9239 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9240 | wpt_uint16 usDataOffset = 0; |
| 9241 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9242 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9243 | wpt_macAddr macBSSID; |
| 9244 | tAddTsParams halAddTsParams = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9245 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9246 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9247 | |
| 9248 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9249 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9250 | -------------------------------------------------------------------------*/ |
| 9251 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9252 | ( NULL == pEventData->pCBfnc )) |
| 9253 | { |
| 9254 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9255 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9256 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9257 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9258 | } |
| 9259 | |
| 9260 | pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData; |
| 9261 | wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc; |
| 9262 | /*------------------------------------------------------------------------- |
| 9263 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9264 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9265 | -------------------------------------------------------------------------*/ |
| 9266 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9267 | |
| 9268 | /*------------------------------------------------------------------------ |
| 9269 | Find the BSS for which the request is made and identify WDI session |
| 9270 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9271 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9272 | pwdiAddTSParams->wdiTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9273 | &macBSSID)) |
| 9274 | { |
| 9275 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9276 | "This station does not exist in the WDI Station Table %d"); |
| 9277 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9278 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9279 | } |
| 9280 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9281 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 9282 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9283 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9284 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9285 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9286 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9287 | |
| 9288 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9289 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9290 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9292 | /*------------------------------------------------------------------------ |
| 9293 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9294 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9295 | ------------------------------------------------------------------------*/ |
| 9296 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9297 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9298 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9299 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9300 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9301 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9302 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9303 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9304 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9305 | } |
| 9306 | |
| 9307 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9308 | /*----------------------------------------------------------------------- |
| 9309 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9310 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9311 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9312 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ, |
| 9313 | sizeof(halAddTsParams), |
| 9314 | &pSendBuffer, &usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9315 | &usSendSize))|| |
| 9316 | ( usSendSize < (usDataOffset + sizeof(halAddTsParams) ))) |
| 9317 | { |
| 9318 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9319 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9320 | pEventData, pwdiAddTSParams, wdiAddTSRspCb); |
| 9321 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9322 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9323 | } |
| 9324 | |
| 9325 | halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx; |
| 9326 | halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx; |
| 9327 | |
| 9328 | //TSPEC IE |
| 9329 | halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType; |
| 9330 | halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9331 | halAddTsParams.tspec.nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9332 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9333 | halAddTsParams.tspec.maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9334 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9335 | halAddTsParams.tspec.minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9336 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9337 | halAddTsParams.tspec.maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9338 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9339 | halAddTsParams.tspec.inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9340 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9341 | halAddTsParams.tspec.suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9342 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9343 | halAddTsParams.tspec.svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9344 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9345 | halAddTsParams.tspec.minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9346 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9347 | halAddTsParams.tspec.meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9348 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9349 | halAddTsParams.tspec.peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9350 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9351 | halAddTsParams.tspec.maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9352 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9353 | halAddTsParams.tspec.delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9354 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9355 | halAddTsParams.tspec.minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9356 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9357 | halAddTsParams.tspec.surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9358 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9359 | halAddTsParams.tspec.mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9360 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime; |
| 9361 | |
| 9362 | //TSPEC IE : TS INFO : TRAFFIC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9363 | halAddTsParams.tspec.tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9364 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9365 | halAddTsParams.tspec.tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9366 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9367 | halAddTsParams.tspec.tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9368 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9369 | halAddTsParams.tspec.tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9370 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9371 | halAddTsParams.tspec.tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9372 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9373 | halAddTsParams.tspec.tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9374 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9375 | halAddTsParams.tspec.tsinfo.traffic.trafficType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9376 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType; |
| 9377 | |
| 9378 | //TSPEC IE : TS INFO : SCHEDULE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9379 | halAddTsParams.tspec.tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9380 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9381 | halAddTsParams.tspec.tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9382 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule; |
| 9383 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9384 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9385 | &halAddTsParams, |
| 9386 | sizeof(halAddTsParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9387 | |
| 9388 | pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9389 | pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9390 | |
| 9391 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9392 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9393 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9394 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9395 | wdiAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9396 | WDI_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9397 | }/*WDI_ProcessAddTSpecReq*/ |
| 9398 | |
| 9399 | |
| 9400 | /** |
| 9401 | @brief Process Del TSpec Request function (called when Main FSM |
| 9402 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9403 | |
| 9404 | @param pWDICtx: pointer to the WLAN DAL context |
| 9405 | pEventData: pointer to the event information structure |
| 9406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9407 | @see |
| 9408 | @return Result of the function call |
| 9409 | */ |
| 9410 | WDI_Status |
| 9411 | WDI_ProcessDelTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9412 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9413 | WDI_ControlBlockType* pWDICtx, |
| 9414 | WDI_EventInfoType* pEventData |
| 9415 | ) |
| 9416 | { |
| 9417 | WDI_DelTSReqParamsType* pwdiDelTSParams; |
| 9418 | WDI_DelTsRspCb wdiDelTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9419 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9420 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9421 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9422 | wpt_uint16 usDataOffset = 0; |
| 9423 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9424 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9425 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9426 | |
| 9427 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9428 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9429 | -------------------------------------------------------------------------*/ |
| 9430 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9431 | ( NULL == pEventData->pCBfnc )) |
| 9432 | { |
| 9433 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9434 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9435 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9436 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9437 | } |
| 9438 | |
| 9439 | pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData; |
| 9440 | wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc; |
| 9441 | |
| 9442 | /*------------------------------------------------------------------------- |
| 9443 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9444 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9445 | -------------------------------------------------------------------------*/ |
| 9446 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9447 | |
| 9448 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9449 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9450 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9451 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 9452 | pwdiDelTSParams->wdiDelTSInfo.macBSSID, |
| 9453 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9454 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9455 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9456 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9457 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9458 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9459 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
| 9460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9461 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9462 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9463 | } |
| 9464 | |
| 9465 | /*------------------------------------------------------------------------ |
| 9466 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9467 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9468 | ------------------------------------------------------------------------*/ |
| 9469 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9470 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9471 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9472 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9473 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9474 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9475 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9476 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9477 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9478 | } |
| 9479 | |
| 9480 | |
| 9481 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9482 | /*----------------------------------------------------------------------- |
| 9483 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9484 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9485 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9486 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9487 | sizeof(pwdiDelTSParams->wdiDelTSInfo), |
| 9488 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9489 | ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) ))) |
| 9490 | { |
| 9491 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9492 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9493 | pEventData, pwdiDelTSParams, wdiDelTSRspCb); |
| 9494 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9495 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9496 | } |
| 9497 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9498 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9499 | &pwdiDelTSParams->wdiDelTSInfo, |
| 9500 | sizeof(pwdiDelTSParams->wdiDelTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9501 | |
| 9502 | pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9503 | pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9504 | |
| 9505 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9506 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9507 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9508 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9509 | wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9510 | }/*WDI_ProcessDelTSpecReq*/ |
| 9511 | |
| 9512 | /** |
| 9513 | @brief Process Update EDCA Params Request function (called when |
| 9514 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9515 | |
| 9516 | @param pWDICtx: pointer to the WLAN DAL context |
| 9517 | pEventData: pointer to the event information structure |
| 9518 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9519 | @see |
| 9520 | @return Result of the function call |
| 9521 | */ |
| 9522 | WDI_Status |
| 9523 | WDI_ProcessUpdateEDCAParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9524 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9525 | WDI_ControlBlockType* pWDICtx, |
| 9526 | WDI_EventInfoType* pEventData |
| 9527 | ) |
| 9528 | { |
| 9529 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams; |
| 9530 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9531 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9532 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9533 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9534 | wpt_uint16 usDataOffset = 0; |
| 9535 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9536 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9537 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9538 | |
| 9539 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9540 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9541 | -------------------------------------------------------------------------*/ |
| 9542 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9543 | ( NULL == pEventData->pCBfnc )) |
| 9544 | { |
| 9545 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9546 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9547 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9548 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9549 | } |
| 9550 | |
| 9551 | pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData; |
| 9552 | wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc; |
| 9553 | /*------------------------------------------------------------------------- |
| 9554 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9555 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9556 | -------------------------------------------------------------------------*/ |
| 9557 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9558 | |
| 9559 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9560 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9561 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9562 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 9563 | pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx, |
| 9564 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9565 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9566 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9567 | { |
| 9568 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9569 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 9570 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9571 | |
| 9572 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9573 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9574 | } |
| 9575 | |
| 9576 | /*------------------------------------------------------------------------ |
| 9577 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9578 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9579 | ------------------------------------------------------------------------*/ |
| 9580 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9581 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9582 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9583 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 9584 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9585 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9586 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9587 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9588 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9589 | } |
| 9590 | |
| 9591 | |
| 9592 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9593 | /*----------------------------------------------------------------------- |
| 9594 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9595 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9596 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9597 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9598 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo), |
| 9599 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9600 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) ))) |
| 9601 | { |
| 9602 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9603 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9604 | pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb); |
| 9605 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9606 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9607 | } |
| 9608 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9609 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9610 | &pwdiUpdateEDCAParams->wdiEDCAInfo, |
| 9611 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9612 | |
| 9613 | pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9614 | pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9615 | |
| 9616 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9617 | Send Update EDCA Params Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9618 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9619 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9620 | wdiUpdateEDCARspCb, pEventData->pUserData, |
| 9621 | WDI_UPD_EDCA_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9622 | }/*WDI_ProcessUpdateEDCAParamsReq*/ |
| 9623 | |
| 9624 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9625 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9626 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9627 | |
| 9628 | @param pWDICtx: pointer to the WLAN DAL context |
| 9629 | pEventData: pointer to the event information structure |
| 9630 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9631 | @see |
| 9632 | @return Result of the function call |
| 9633 | */ |
| 9634 | WDI_Status |
| 9635 | WDI_ProcessAddBASessionReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9636 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9637 | WDI_ControlBlockType* pWDICtx, |
| 9638 | WDI_EventInfoType* pEventData |
| 9639 | ) |
| 9640 | { |
| 9641 | WDI_AddBASessionReqParamsType* pwdiAddBASessionParams; |
| 9642 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9643 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9644 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9645 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9646 | wpt_uint16 usDataOffset = 0; |
| 9647 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9648 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9649 | wpt_macAddr macBSSID; |
| 9650 | |
| 9651 | tAddBASessionReqMsg halAddBASessionReq; |
| 9652 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9653 | |
| 9654 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9655 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9656 | -------------------------------------------------------------------------*/ |
| 9657 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9658 | ( NULL == pEventData->pCBfnc )) |
| 9659 | { |
| 9660 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9661 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9662 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9663 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9664 | } |
| 9665 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9666 | pwdiAddBASessionParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9667 | (WDI_AddBASessionReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9668 | wdiAddBASessionRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9669 | (WDI_AddBASessionRspCb)pEventData->pCBfnc; |
| 9670 | /*------------------------------------------------------------------------- |
| 9671 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9672 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9673 | -------------------------------------------------------------------------*/ |
| 9674 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9675 | |
| 9676 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9677 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9678 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9679 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9680 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9681 | &macBSSID)) |
| 9682 | { |
| 9683 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9684 | "This station does not exist in the WDI Station Table %d"); |
| 9685 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9686 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9687 | } |
| 9688 | |
| 9689 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9690 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9691 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9692 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9693 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9694 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9695 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9696 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 9697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9698 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9699 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9700 | } |
| 9701 | |
| 9702 | /*------------------------------------------------------------------------ |
| 9703 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9704 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9705 | ------------------------------------------------------------------------*/ |
| 9706 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9707 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9708 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9709 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9710 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9711 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9712 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9713 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9714 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9715 | } |
| 9716 | |
| 9717 | |
| 9718 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9719 | /*----------------------------------------------------------------------- |
| 9720 | Get message buffer |
| 9721 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9722 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9723 | WDI_ADD_BA_SESSION_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9724 | sizeof(halAddBASessionReq.addBASessionParams), |
| 9725 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9726 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9727 | (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) ))) |
| 9728 | { |
| 9729 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9730 | "Unable to get send buffer in Add BA session req %x %x %x", |
| 9731 | pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb); |
| 9732 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9733 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9734 | } |
| 9735 | |
| 9736 | halAddBASessionReq.addBASessionParams.staIdx = |
| 9737 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx; |
| 9738 | wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr, |
| 9739 | pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr, |
| 9740 | WDI_MAC_ADDR_LEN); |
| 9741 | halAddBASessionReq.addBASessionParams.baTID = |
| 9742 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID; |
| 9743 | halAddBASessionReq.addBASessionParams.baPolicy = |
| 9744 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy; |
| 9745 | halAddBASessionReq.addBASessionParams.baBufferSize = |
| 9746 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize; |
| 9747 | halAddBASessionReq.addBASessionParams.baTimeout = |
| 9748 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout; |
| 9749 | halAddBASessionReq.addBASessionParams.baSSN = |
| 9750 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN; |
| 9751 | halAddBASessionReq.addBASessionParams.baDirection = |
| 9752 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection; |
| 9753 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9754 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9755 | &halAddBASessionReq.addBASessionParams, |
| 9756 | sizeof(halAddBASessionReq.addBASessionParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9757 | |
| 9758 | pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9759 | pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9760 | |
| 9761 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9762 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9763 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9764 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9765 | wdiAddBASessionRspCb, pEventData->pUserData, |
| 9766 | WDI_ADD_BA_SESSION_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9767 | }/*WDI_ProcessAddBASessionReq*/ |
| 9768 | |
| 9769 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9770 | @brief Process Del BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9771 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9772 | |
| 9773 | @param pWDICtx: pointer to the WLAN DAL context |
| 9774 | pEventData: pointer to the event information structure |
| 9775 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9776 | @see |
| 9777 | @return Result of the function call |
| 9778 | */ |
| 9779 | WDI_Status |
| 9780 | WDI_ProcessDelBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9781 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9782 | WDI_ControlBlockType* pWDICtx, |
| 9783 | WDI_EventInfoType* pEventData |
| 9784 | ) |
| 9785 | { |
| 9786 | WDI_DelBAReqParamsType* pwdiDelBAParams; |
| 9787 | WDI_DelBARspCb wdiDelBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9788 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9789 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9790 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9791 | wpt_uint16 usDataOffset = 0; |
| 9792 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9793 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9794 | wpt_macAddr macBSSID; |
| 9795 | tDelBAParams halDelBAparam; |
| 9796 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9797 | |
| 9798 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9799 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9800 | -------------------------------------------------------------------------*/ |
| 9801 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9802 | ( NULL == pEventData->pCBfnc )) |
| 9803 | { |
| 9804 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9805 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9806 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9807 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9808 | } |
| 9809 | |
| 9810 | pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData; |
| 9811 | wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc; |
| 9812 | /*------------------------------------------------------------------------- |
| 9813 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9814 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9815 | -------------------------------------------------------------------------*/ |
| 9816 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9817 | |
| 9818 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9819 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9820 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9821 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9822 | pwdiDelBAParams->wdiBAInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9823 | &macBSSID)) |
| 9824 | { |
| 9825 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9826 | "This station does not exist in the WDI Station Table %d"); |
| 9827 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9828 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9829 | } |
| 9830 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9831 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9832 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9833 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9834 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9835 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9836 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9837 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9838 | |
| 9839 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9840 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9841 | } |
| 9842 | |
| 9843 | /*------------------------------------------------------------------------ |
| 9844 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9845 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9846 | ------------------------------------------------------------------------*/ |
| 9847 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9848 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9849 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9850 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9851 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9852 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9853 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9854 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9855 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9856 | } |
| 9857 | |
| 9858 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9859 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9860 | sizeof(halDelBAparam), |
| 9861 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9862 | ( usSendSize < (usDataOffset + sizeof(halDelBAparam) ))) |
| 9863 | { |
| 9864 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9865 | "Unable to get send buffer for DEL BA req %x %x %x", |
| 9866 | pEventData, pwdiDelBAParams, wdiDelBARspCb); |
| 9867 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9868 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9869 | } |
| 9870 | |
| 9871 | halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx; |
| 9872 | halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID; |
| 9873 | halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection; |
| 9874 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9875 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9876 | &halDelBAparam, |
| 9877 | sizeof(halDelBAparam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9878 | |
| 9879 | pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9880 | pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9881 | |
| 9882 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9883 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9884 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9885 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9886 | wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9887 | }/*WDI_ProcessDelBAReq*/ |
| 9888 | |
| 9889 | #ifdef FEATURE_WLAN_CCX |
| 9890 | |
| 9891 | WDI_Status |
| 9892 | WDI_ProcessTSMStatsReq |
| 9893 | ( |
| 9894 | WDI_ControlBlockType* pWDICtx, |
| 9895 | WDI_EventInfoType* pEventData |
| 9896 | ) |
| 9897 | { |
| 9898 | WDI_TSMStatsReqParamsType* pwdiTSMParams; |
| 9899 | WDI_TsmRspCb wdiTSMRspCb; |
| 9900 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 9901 | WDI_BSSSessionType* pBSSSes = NULL; |
| 9902 | wpt_uint8* pSendBuffer = NULL; |
| 9903 | wpt_uint16 usDataOffset = 0; |
| 9904 | wpt_uint16 usSendSize = 0; |
| 9905 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 9906 | tTsmStatsParams halTsmStatsReqParams = {0}; |
| 9907 | |
| 9908 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9909 | |
| 9910 | /*------------------------------------------------------------------------- |
| 9911 | Sanity check |
| 9912 | -------------------------------------------------------------------------*/ |
| 9913 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9914 | ( NULL == pEventData->pCBfnc )) |
| 9915 | { |
| 9916 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9917 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9918 | WDI_ASSERT(0); |
| 9919 | return WDI_STATUS_E_FAILURE; |
| 9920 | } |
| 9921 | |
| 9922 | pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData; |
| 9923 | wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc; |
| 9924 | /*------------------------------------------------------------------------- |
| 9925 | Check to see if we are in the middle of an association, if so queue, if |
| 9926 | not it means it is free to process request |
| 9927 | -------------------------------------------------------------------------*/ |
| 9928 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9929 | |
| 9930 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes); |
| 9931 | if ( NULL == pBSSSes ) |
| 9932 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9933 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9934 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9935 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9936 | |
| 9937 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9938 | return WDI_STATUS_E_NOT_ALLOWED; |
| 9939 | } |
| 9940 | |
| 9941 | /*------------------------------------------------------------------------ |
| 9942 | Check if this BSS is being currently processed or queued, |
| 9943 | if queued - queue the new request as well |
| 9944 | ------------------------------------------------------------------------*/ |
| 9945 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9946 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9947 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9948 | "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9949 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9950 | |
| 9951 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 9952 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9953 | return wdiStatus; |
| 9954 | } |
| 9955 | |
| 9956 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9957 | /*----------------------------------------------------------------------- |
| 9958 | Get message buffer |
| 9959 | ! TO DO : proper conversion into the HAL Message Request Format |
| 9960 | -----------------------------------------------------------------------*/ |
| 9961 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ, |
| 9962 | sizeof(halTsmStatsReqParams), |
| 9963 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9964 | ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) ))) |
| 9965 | { |
| 9966 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9967 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9968 | pEventData, pwdiTSMParams, wdiTSMRspCb); |
| 9969 | WDI_ASSERT(0); |
| 9970 | return WDI_STATUS_E_FAILURE; |
| 9971 | } |
| 9972 | |
| 9973 | halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid; |
| 9974 | wpalMemoryCopy(halTsmStatsReqParams.bssId, |
| 9975 | pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, |
| 9976 | WDI_MAC_ADDR_LEN); |
| 9977 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9978 | &halTsmStatsReqParams, |
| 9979 | sizeof(halTsmStatsReqParams)); |
| 9980 | |
| 9981 | pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB; |
| 9982 | pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData; |
| 9983 | |
| 9984 | /*------------------------------------------------------------------------- |
| 9985 | Send TSM Stats Request to HAL |
| 9986 | -------------------------------------------------------------------------*/ |
| 9987 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9988 | wdiTSMRspCb, pEventData->pUserData, |
| 9989 | WDI_TSM_STATS_RESP); |
| 9990 | }/*WDI_ProcessTSMStatsReq*/ |
| 9991 | |
| 9992 | #endif |
| 9993 | |
| 9994 | |
| 9995 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9996 | @brief Process Flush AC Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9997 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9998 | |
| 9999 | @param pWDICtx: pointer to the WLAN DAL context |
| 10000 | pEventData: pointer to the event information structure |
| 10001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10002 | @see |
| 10003 | @return Result of the function call |
| 10004 | */ |
| 10005 | WDI_Status |
| 10006 | WDI_ProcessFlushAcReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10007 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10008 | WDI_ControlBlockType* pWDICtx, |
| 10009 | WDI_EventInfoType* pEventData |
| 10010 | ) |
| 10011 | { |
| 10012 | WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL; |
| 10013 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10014 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10015 | wpt_uint16 usDataOffset = 0; |
| 10016 | wpt_uint16 usSendSize = 0; |
| 10017 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10018 | |
| 10019 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10020 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10021 | -------------------------------------------------------------------------*/ |
| 10022 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10023 | ( NULL == pEventData->pCBfnc )) |
| 10024 | { |
| 10025 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10026 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10027 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10028 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10029 | } |
| 10030 | |
| 10031 | pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData; |
| 10032 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc; |
| 10033 | /*----------------------------------------------------------------------- |
| 10034 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10035 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10036 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10037 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10038 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo), |
| 10039 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10040 | ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) ))) |
| 10041 | { |
| 10042 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10043 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10044 | pEventData, pwdiFlushAcParams, wdiFlushAcRspCb); |
| 10045 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10046 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10047 | } |
| 10048 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10049 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10050 | &pwdiFlushAcParams->wdiFlushAcInfo, |
| 10051 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10052 | |
| 10053 | pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10054 | pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10055 | |
| 10056 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10057 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10058 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10059 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10060 | wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10061 | }/*WDI_ProcessFlushAcReq*/ |
| 10062 | |
| 10063 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10064 | @brief Process BT AMP event Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10065 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10066 | |
| 10067 | @param pWDICtx: pointer to the WLAN DAL context |
| 10068 | pEventData: pointer to the event information structure |
| 10069 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10070 | @see |
| 10071 | @return Result of the function call |
| 10072 | */ |
| 10073 | WDI_Status |
| 10074 | WDI_ProcessBtAmpEventReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10075 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10076 | WDI_ControlBlockType* pWDICtx, |
| 10077 | WDI_EventInfoType* pEventData |
| 10078 | ) |
| 10079 | { |
| 10080 | WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL; |
| 10081 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10082 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10083 | wpt_uint16 usDataOffset = 0; |
| 10084 | wpt_uint16 usSendSize = 0; |
| 10085 | |
| 10086 | tBtAmpEventMsg haltBtAmpEventMsg; |
| 10087 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10088 | |
| 10089 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10090 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10091 | -------------------------------------------------------------------------*/ |
| 10092 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10093 | ( NULL == pEventData->pCBfnc )) |
| 10094 | { |
| 10095 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10096 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10097 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10098 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10099 | } |
| 10100 | |
| 10101 | pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData; |
| 10102 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc; |
| 10103 | /*----------------------------------------------------------------------- |
| 10104 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10105 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10106 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10107 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10108 | sizeof(haltBtAmpEventMsg.btAmpEventParams), |
| 10109 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10110 | ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) ))) |
| 10111 | { |
| 10112 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10113 | "Unable to get send buffer in BT AMP event req %x %x %x", |
| 10114 | pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb); |
| 10115 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10116 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10117 | } |
| 10118 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10119 | haltBtAmpEventMsg.btAmpEventParams.btAmpEventType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10120 | pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10121 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10122 | &haltBtAmpEventMsg.btAmpEventParams, |
| 10123 | sizeof(haltBtAmpEventMsg.btAmpEventParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10124 | |
| 10125 | pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10126 | pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10127 | |
| 10128 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10129 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10130 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10131 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10132 | wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10133 | }/*WDI_ProcessBtAmpEventReq*/ |
| 10134 | |
| 10135 | /** |
| 10136 | @brief Process Add STA self Request function (called when Main FSM |
| 10137 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10138 | |
| 10139 | @param pWDICtx: pointer to the WLAN DAL context |
| 10140 | pEventData: pointer to the event information structure |
| 10141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10142 | @see |
| 10143 | @return Result of the function call |
| 10144 | */ |
| 10145 | WDI_Status |
| 10146 | WDI_ProcessAddSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10147 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10148 | WDI_ControlBlockType* pWDICtx, |
| 10149 | WDI_EventInfoType* pEventData |
| 10150 | ) |
| 10151 | { |
| 10152 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams; |
| 10153 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10154 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10155 | wpt_uint16 usDataOffset = 0; |
| 10156 | wpt_uint16 usSendSize = 0; |
Kiran Kumar Lokere | 9d96829 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10157 | tAddStaSelfParams_V1 halAddSTASelfParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10158 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10159 | |
| 10160 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10161 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10162 | -------------------------------------------------------------------------*/ |
| 10163 | if (( NULL == pEventData ) || |
| 10164 | ( NULL == pEventData->pEventData) || |
| 10165 | ( NULL == pEventData->pCBfnc)) |
| 10166 | { |
| 10167 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10168 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10169 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10170 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10171 | } |
| 10172 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10173 | pwdiAddSTASelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10174 | (WDI_AddSTASelfReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10175 | wdiAddSTASelfReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10176 | (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc; |
| 10177 | /*----------------------------------------------------------------------- |
| 10178 | Get message buffer |
| 10179 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10180 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10181 | WDI_ADD_STA_SELF_REQ, |
Kiran Kumar Lokere | 9d96829 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10182 | sizeof(tAddStaSelfParams_V1), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10183 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Kiran Kumar Lokere | 9d96829 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10184 | ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams_V1) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10185 | { |
| 10186 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10187 | "Unable to get send buffer in ADD STA SELF REQ %x %x %x", |
| 10188 | pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb); |
| 10189 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10190 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10191 | } |
| 10192 | |
| 10193 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10194 | wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10195 | sizeof(pWDICtx->wdiCacheAddSTASelfReq)); |
| 10196 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10197 | wpalMemoryCopy(halAddSTASelfParams.selfMacAddr, |
Kiran Kumar Lokere | 9d96829 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10198 | pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6); |
| 10199 | halAddSTASelfParams.iface_persona = HAL_IFACE_UNKNOWN; |
| 10200 | if (pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.currDeviceMode == VOS_STA_MODE) |
| 10201 | { |
| 10202 | halAddSTASelfParams.iface_persona = HAL_IFACE_STA_MODE; |
| 10203 | } |
| 10204 | else if ((pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.currDeviceMode == |
| 10205 | VOS_P2P_CLIENT_MODE) || |
| 10206 | (pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.currDeviceMode == |
| 10207 | VOS_P2P_DEVICE)) |
| 10208 | { |
| 10209 | halAddSTASelfParams.iface_persona = HAL_IFACE_P2P_MODE; |
| 10210 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10211 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams, |
Kiran Kumar Lokere | 9d96829 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10212 | sizeof(tAddStaSelfParams_V1)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10213 | |
| 10214 | pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10215 | pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10216 | |
| 10217 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10218 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10219 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10220 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10221 | wdiAddSTASelfReqRspCb, pEventData->pUserData, |
| 10222 | WDI_ADD_STA_SELF_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10223 | }/*WDI_ProcessAddSTASelfReq*/ |
| 10224 | |
| 10225 | |
| 10226 | |
| 10227 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10228 | @brief Process Del Sta Self Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10229 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10230 | |
| 10231 | @param pWDICtx: pointer to the WLAN DAL context |
| 10232 | pEventData: pointer to the event information structure |
| 10233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10234 | @see |
| 10235 | @return Result of the function call |
| 10236 | */ |
| 10237 | WDI_Status |
| 10238 | WDI_ProcessDelSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10239 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10240 | WDI_ControlBlockType* pWDICtx, |
| 10241 | WDI_EventInfoType* pEventData |
| 10242 | ) |
| 10243 | { |
| 10244 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams; |
| 10245 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10246 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10247 | wpt_uint16 usDataOffset = 0; |
| 10248 | wpt_uint16 usSendSize = 0; |
| 10249 | tDelStaSelfParams halSetDelSelfSTAParams; |
| 10250 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10251 | |
| 10252 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10253 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10254 | -------------------------------------------------------------------------*/ |
| 10255 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10256 | ( NULL == pEventData->pCBfnc )) |
| 10257 | { |
| 10258 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10259 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10260 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10261 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10262 | } |
| 10263 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10264 | pwdiDelStaSelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10265 | (WDI_DelSTASelfReqParamsType*)pEventData->pEventData; |
| 10266 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc; |
| 10267 | |
| 10268 | /*----------------------------------------------------------------------- |
| 10269 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10270 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10271 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10272 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10273 | sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo), |
| 10274 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10275 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10276 | (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) ))) |
| 10277 | { |
| 10278 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10279 | "Unable to get send buffer in Del Sta Self req %x %x %x", |
| 10280 | pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb); |
| 10281 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10282 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10283 | } |
| 10284 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10285 | wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10286 | pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ; |
| 10287 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10288 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams, |
| 10289 | sizeof(tDelStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10290 | |
| 10291 | pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10292 | pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10293 | |
| 10294 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10295 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10296 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10297 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10298 | wdiDelStaSelfRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10299 | WDI_DEL_STA_SELF_RESP); |
| 10300 | |
| 10301 | } |
| 10302 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10303 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 10304 | /** |
| 10305 | @brief Process Start Oem Data Request function (called when Main |
| 10306 | FSM allows it) |
| 10307 | |
| 10308 | @param pWDICtx: pointer to the WLAN DAL context |
| 10309 | pEventData: pointer to the event information structure |
| 10310 | |
| 10311 | @see |
| 10312 | @return Result of the function call |
| 10313 | */ |
| 10314 | WDI_Status |
| 10315 | WDI_ProcessStartOemDataReq |
| 10316 | ( |
| 10317 | WDI_ControlBlockType* pWDICtx, |
| 10318 | WDI_EventInfoType* pEventData |
| 10319 | ) |
| 10320 | { |
| 10321 | WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL; |
| 10322 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 10323 | wpt_uint8* pSendBuffer = NULL; |
| 10324 | wpt_uint16 usDataOffset = 0; |
| 10325 | wpt_uint16 usSendSize = 0; |
| 10326 | wpt_uint16 reqLen; |
| 10327 | tStartOemDataReqParams* halStartOemDataReqParams; |
| 10328 | |
| 10329 | /*------------------------------------------------------------------------- |
| 10330 | Sanity check |
| 10331 | -------------------------------------------------------------------------*/ |
| 10332 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10333 | ( NULL == pEventData->pCBfnc )) |
| 10334 | { |
| 10335 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10336 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10337 | WDI_ASSERT(0); |
| 10338 | return WDI_STATUS_E_FAILURE; |
| 10339 | } |
| 10340 | |
| 10341 | pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData; |
| 10342 | wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc; |
| 10343 | |
| 10344 | /*----------------------------------------------------------------------- |
| 10345 | Get message buffer |
| 10346 | -----------------------------------------------------------------------*/ |
| 10347 | |
| 10348 | reqLen = sizeof(tStartOemDataReqParams); |
| 10349 | |
| 10350 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10351 | WDI_START_OEM_DATA_REQ, reqLen, |
| 10352 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10353 | (usSendSize < (usDataOffset + reqLen))) |
| 10354 | { |
| 10355 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10356 | "Unable to get send buffer in Start Oem Data req %x %x %x", |
| 10357 | pEventData, pwdiOemDataReqParams, wdiOemDataRspCb); |
| 10358 | WDI_ASSERT(0); |
| 10359 | return WDI_STATUS_E_FAILURE; |
| 10360 | } |
| 10361 | |
| 10362 | //copying WDI OEM DATA REQ PARAMS to shared memory |
| 10363 | halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset ); |
| 10364 | |
| 10365 | wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr)); |
| 10366 | wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE); |
| 10367 | |
| 10368 | pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB; |
| 10369 | pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData; |
| 10370 | |
| 10371 | /*------------------------------------------------------------------------- |
| 10372 | Send Start Request to HAL |
| 10373 | -------------------------------------------------------------------------*/ |
| 10374 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10375 | wdiOemDataRspCb, pEventData->pUserData, |
| 10376 | WDI_START_OEM_DATA_RESP); |
| 10377 | }/*WDI_ProcessStartOemDataReq*/ |
| 10378 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10379 | |
| 10380 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10381 | @brief Process Host Resume Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10382 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10383 | |
| 10384 | @param pWDICtx: pointer to the WLAN DAL context |
| 10385 | pEventData: pointer to the event information structure |
| 10386 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10387 | @see |
| 10388 | @return Result of the function call |
| 10389 | */ |
| 10390 | WDI_Status |
| 10391 | WDI_ProcessHostResumeReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10392 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10393 | WDI_ControlBlockType* pWDICtx, |
| 10394 | WDI_EventInfoType* pEventData |
| 10395 | ) |
| 10396 | { |
| 10397 | WDI_ResumeParamsType* pwdiHostResumeParams = NULL; |
| 10398 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10399 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10400 | wpt_uint16 usDataOffset = 0; |
| 10401 | wpt_uint16 usSendSize = 0; |
| 10402 | tHalWlanHostResumeReqParam halResumeReqParams; |
| 10403 | |
| 10404 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10405 | |
| 10406 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10407 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10408 | -------------------------------------------------------------------------*/ |
| 10409 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10410 | ( NULL == pEventData->pCBfnc )) |
| 10411 | { |
| 10412 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10413 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10414 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10415 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10416 | } |
| 10417 | |
| 10418 | pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData; |
| 10419 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc; |
| 10420 | |
| 10421 | /*----------------------------------------------------------------------- |
| 10422 | Get message buffer |
| 10423 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10424 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10425 | WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams), |
| 10426 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10427 | (usSendSize < (usDataOffset + sizeof(halResumeReqParams)))) |
| 10428 | { |
| 10429 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10430 | "Unable to get send buffer in Start Oem Data req %x %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10431 | pEventData, pwdiHostResumeParams, wdiHostResumeRspCb); |
| 10432 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10433 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10434 | } |
| 10435 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10436 | halResumeReqParams.configuredMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10437 | pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10438 | |
| 10439 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10440 | &halResumeReqParams, |
| 10441 | sizeof(halResumeReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10442 | |
| 10443 | pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10444 | pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10445 | |
| 10446 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10447 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10448 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10449 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10450 | wdiHostResumeRspCb, pEventData->pUserData, |
| 10451 | WDI_HOST_RESUME_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10452 | }/*WDI_ProcessHostResumeReq*/ |
| 10453 | |
| 10454 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10455 | @brief Process set Tx Per Tracking Parameters Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10456 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10457 | |
| 10458 | @param pWDICtx: pointer to the WLAN DAL context |
| 10459 | pEventData: pointer to the event information structure |
| 10460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10461 | @see |
| 10462 | @return Result of the function call |
| 10463 | */ |
| 10464 | WDI_Status |
| 10465 | WDI_ProcessSetTxPerTrackingReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10466 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10467 | WDI_ControlBlockType* pWDICtx, |
| 10468 | WDI_EventInfoType* pEventData |
| 10469 | ) |
| 10470 | { |
| 10471 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL; |
| 10472 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10473 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10474 | wpt_uint16 usDataOffset = 0; |
| 10475 | wpt_uint16 usSendSize = 0; |
| 10476 | tHalTxPerTrackingReqParam halTxPerTrackingReqParam; |
| 10477 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10478 | |
| 10479 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10480 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10481 | -------------------------------------------------------------------------*/ |
| 10482 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10483 | ( NULL == pEventData->pCBfnc )) |
| 10484 | { |
| 10485 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10486 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10487 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10488 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10489 | } |
| 10490 | |
| 10491 | pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData; |
| 10492 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10493 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10494 | /*----------------------------------------------------------------------- |
| 10495 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10496 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10497 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10498 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_PER_TRACKING_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10499 | sizeof(halTxPerTrackingReqParam), |
| 10500 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10501 | ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) ))) |
| 10502 | { |
| 10503 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10504 | "Unable to get send buffer in set tx per tracking req %x %x %x", |
| 10505 | pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb); |
| 10506 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10507 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10508 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10509 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10510 | halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable; |
| 10511 | halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod; |
| 10512 | halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio; |
| 10513 | halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10514 | |
| 10515 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10516 | &halTxPerTrackingReqParam, |
| 10517 | sizeof(halTxPerTrackingReqParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10518 | |
| 10519 | pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10520 | pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10521 | |
| 10522 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10523 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10524 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10525 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10526 | pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10527 | }/*WDI_ProcessSetTxPerTrackingReq*/ |
| 10528 | |
| 10529 | /*========================================================================= |
| 10530 | Indications |
| 10531 | =========================================================================*/ |
| 10532 | |
| 10533 | /** |
| 10534 | @brief Process Suspend Indications function (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10535 | |
| 10536 | @param pWDICtx: pointer to the WLAN DAL context |
| 10537 | pEventData: pointer to the event information structure |
| 10538 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10539 | @see |
| 10540 | @return Result of the function call |
| 10541 | */ |
| 10542 | WDI_Status |
| 10543 | WDI_ProcessHostSuspendInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10544 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10545 | WDI_ControlBlockType* pWDICtx, |
| 10546 | WDI_EventInfoType* pEventData |
| 10547 | ) |
| 10548 | { |
| 10549 | WDI_SuspendParamsType *pSuspendIndParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10550 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10551 | wpt_uint16 usDataOffset = 0; |
| 10552 | wpt_uint16 usSendSize = 0; |
| 10553 | WDI_Status wdiStatus; |
| 10554 | tHalWlanHostSuspendIndParam halWlanSuspendIndparams; |
| 10555 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10556 | |
| 10557 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10558 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10559 | -------------------------------------------------------------------------*/ |
| 10560 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10561 | { |
| 10562 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10563 | "%s: Invalid parameters in Suspend ind",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10564 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10565 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10566 | } |
| 10567 | |
| 10568 | pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData; |
| 10569 | |
| 10570 | /*----------------------------------------------------------------------- |
| 10571 | Get message buffer |
| 10572 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10573 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10574 | WDI_HOST_SUSPEND_IND, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10575 | sizeof(halWlanSuspendIndparams), |
| 10576 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10577 | (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams)))) |
| 10578 | { |
| 10579 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10580 | "Unable to get send buffer in Suspend Ind "); |
| 10581 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10582 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10583 | } |
| 10584 | |
| 10585 | halWlanSuspendIndparams.configuredMcstBcstFilterSetting = |
| 10586 | pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting; |
| 10587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10588 | halWlanSuspendIndparams.activeSessionCount = |
Hoonki Lee | 2659997 | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 10589 | WDI_GetActiveSessionsCount(pWDICtx, NULL, eWLAN_PAL_TRUE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10590 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10591 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams, |
| 10592 | sizeof(tHalWlanHostSuspendIndParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10593 | |
| 10594 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10595 | Send Suspend Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10596 | -------------------------------------------------------------------------*/ |
| 10597 | pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10598 | pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10599 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10600 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10601 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10602 | }/*WDI_ProcessHostSuspendInd*/ |
| 10603 | |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 10604 | |
| 10605 | |
| 10606 | /** |
| 10607 | @brief Process Traffic Stats Indications function (called when Main FSM allows it) |
| 10608 | |
| 10609 | @param pWDICtx: pointer to the WLAN DAL context |
| 10610 | pEventData: pointer to the event information structure |
| 10611 | |
| 10612 | @see |
| 10613 | @return Result of the function call |
| 10614 | */ |
| 10615 | WDI_Status |
| 10616 | WDI_ProcessTrafficStatsInd |
| 10617 | ( |
| 10618 | WDI_ControlBlockType* pWDICtx, |
| 10619 | WDI_EventInfoType* pEventData |
| 10620 | ) |
| 10621 | { |
| 10622 | WDI_TrafficStatsIndType* pTrafficStatsIndParams; |
| 10623 | wpt_uint8* pSendBuffer = NULL; |
| 10624 | wpt_uint16 usDataOffset = 0; |
| 10625 | wpt_uint16 usSendSize = 0; |
| 10626 | WDI_Status wdiStatus; |
| 10627 | tStatsClassBIndParams* pStatsClassBIndParams; |
| 10628 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10629 | |
| 10630 | /*------------------------------------------------------------------------- |
| 10631 | Sanity check |
| 10632 | -------------------------------------------------------------------------*/ |
| 10633 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10634 | { |
| 10635 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10636 | "%s: Invalid parameters in Traffic Stats ind",__func__); |
| 10637 | WDI_ASSERT(0); |
| 10638 | return WDI_STATUS_E_FAILURE; |
| 10639 | } |
| 10640 | |
| 10641 | pTrafficStatsIndParams = (WDI_TrafficStatsIndType *)pEventData->pEventData; |
| 10642 | |
| 10643 | if(pTrafficStatsIndParams->length != sizeof(tStaStatsClassB)*(HAL_NUM_STA)) |
| 10644 | { |
| 10645 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10646 | "%s: Invalid parameters in Traffic Stats ind",__func__); |
| 10647 | WDI_ASSERT(0); |
| 10648 | return WDI_STATUS_E_FAILURE; |
| 10649 | } |
| 10650 | |
| 10651 | /*----------------------------------------------------------------------- |
| 10652 | Get message buffer |
| 10653 | -----------------------------------------------------------------------*/ |
| 10654 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10655 | WDI_TRAFFIC_STATS_IND, |
| 10656 | sizeof(tStatsClassBIndParams), |
| 10657 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10658 | (usSendSize < (usDataOffset + sizeof(tStatsClassBIndParams)))) |
| 10659 | { |
| 10660 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 10661 | "Unable to get send buffer in Traffic Stats Ind "); |
| 10662 | WDI_ASSERT(0); |
| 10663 | return WDI_STATUS_E_FAILURE; |
| 10664 | } |
| 10665 | |
| 10666 | pStatsClassBIndParams = (tStatsClassBIndParams*)(pSendBuffer+usDataOffset); |
| 10667 | |
| 10668 | pStatsClassBIndParams->duration = pTrafficStatsIndParams->duration; |
| 10669 | |
| 10670 | wpalMemoryCopy(pStatsClassBIndParams->staStatsClassB, |
| 10671 | pTrafficStatsIndParams->pTrafficStats, |
| 10672 | pTrafficStatsIndParams->length); |
| 10673 | |
| 10674 | /*------------------------------------------------------------------------- |
| 10675 | Send Suspend Request to HAL |
| 10676 | -------------------------------------------------------------------------*/ |
| 10677 | pWDICtx->wdiReqStatusCB = pTrafficStatsIndParams->wdiReqStatusCB; |
| 10678 | pWDICtx->pReqStatusUserData = pTrafficStatsIndParams->pUserData; |
| 10679 | |
| 10680 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
| 10681 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10682 | }/*WDI_ProcessTrafficStatsInd*/ |
| 10683 | |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 10684 | #ifdef WLAN_FEATURE_11W |
| 10685 | /** |
| 10686 | @brief Process Exclude Unencrypted Indications function (called |
| 10687 | when Main FSM allows it) |
| 10688 | |
| 10689 | @param pWDICtx: pointer to the WLAN DAL context |
| 10690 | pEventData: pointer to the event information structure |
| 10691 | |
| 10692 | @see |
| 10693 | @return Result of the function call |
| 10694 | */ |
| 10695 | WDI_Status |
| 10696 | WDI_ProcessExcludeUnencryptInd |
| 10697 | ( |
| 10698 | WDI_ControlBlockType* pWDICtx, |
| 10699 | WDI_EventInfoType* pEventData |
| 10700 | ) |
| 10701 | { |
| 10702 | WDI_ExcludeUnencryptIndType* pWDIExcUnencIndParams; |
| 10703 | wpt_uint8* pSendBuffer = NULL; |
| 10704 | wpt_uint16 usDataOffset = 0; |
| 10705 | wpt_uint16 usSendSize = 0; |
| 10706 | WDI_Status wdiStatus; |
| 10707 | tHalWlanExcludeUnEncryptedIndParam* pHalExcUnencIndParams; |
| 10708 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10709 | |
| 10710 | /*------------------------------------------------------------------------- |
| 10711 | Sanity check |
| 10712 | -------------------------------------------------------------------------*/ |
| 10713 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10714 | { |
| 10715 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10716 | "%s: Invalid parameters in Exclude Unencrypted ind",__func__); |
| 10717 | WDI_ASSERT(0); |
| 10718 | return WDI_STATUS_E_FAILURE; |
| 10719 | } |
| 10720 | |
| 10721 | pWDIExcUnencIndParams = (WDI_ExcludeUnencryptIndType *)pEventData->pEventData; |
| 10722 | |
| 10723 | /*----------------------------------------------------------------------- |
| 10724 | Get message buffer |
| 10725 | -----------------------------------------------------------------------*/ |
| 10726 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10727 | WDI_EXCLUDE_UNENCRYPTED_IND, |
| 10728 | sizeof(tHalWlanExcludeUnEncryptedIndParam), |
| 10729 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10730 | (usSendSize < (usDataOffset + sizeof(tHalWlanExcludeUnEncryptedIndParam)))) |
| 10731 | { |
| 10732 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 10733 | "Unable to get send buffer in Exclude Unencrypted Ind "); |
| 10734 | WDI_ASSERT(0); |
| 10735 | return WDI_STATUS_E_FAILURE; |
| 10736 | } |
| 10737 | |
| 10738 | pHalExcUnencIndParams = (tHalWlanExcludeUnEncryptedIndParam*)(pSendBuffer+usDataOffset); |
| 10739 | |
| 10740 | pHalExcUnencIndParams->bDot11ExcludeUnencrypted = pWDIExcUnencIndParams->bExcludeUnencrypt; |
| 10741 | |
| 10742 | wpalMemoryCopy(pHalExcUnencIndParams->bssId, |
| 10743 | pWDIExcUnencIndParams->bssid, WDI_MAC_ADDR_LEN); |
| 10744 | |
| 10745 | /*------------------------------------------------------------------------- |
| 10746 | Send Suspend Request to HAL |
| 10747 | -------------------------------------------------------------------------*/ |
| 10748 | pWDICtx->wdiReqStatusCB = pWDIExcUnencIndParams->wdiReqStatusCB; |
| 10749 | pWDICtx->pReqStatusUserData = pWDIExcUnencIndParams->pUserData; |
| 10750 | |
| 10751 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
| 10752 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10753 | }/*WDI_ProcessExcludeUnencryptInd*/ |
| 10754 | #endif |
| 10755 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10756 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10757 | MISC CONTROL PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10758 | ==========================================================================*/ |
| 10759 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10760 | @brief Process Channel Switch Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10761 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10762 | |
| 10763 | @param pWDICtx: pointer to the WLAN DAL context |
| 10764 | pEventData: pointer to the event information structure |
| 10765 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10766 | @see |
| 10767 | @return Result of the function call |
| 10768 | */ |
| 10769 | WDI_Status |
| 10770 | WDI_ProcessChannelSwitchReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10771 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10772 | WDI_ControlBlockType* pWDICtx, |
| 10773 | WDI_EventInfoType* pEventData |
| 10774 | ) |
| 10775 | { |
| 10776 | WDI_SwitchChReqParamsType* pwdiSwitchChParams; |
| 10777 | WDI_SwitchChRspCb wdiSwitchChRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10778 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10779 | wpt_uint16 usDataOffset = 0; |
| 10780 | wpt_uint16 usSendSize = 0; |
| 10781 | tSwitchChannelReqMsg halSwitchChannelReq = {{0}}; |
| 10782 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10783 | |
| 10784 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10785 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10786 | -------------------------------------------------------------------------*/ |
| 10787 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10788 | ( NULL == pEventData->pCBfnc )) |
| 10789 | { |
| 10790 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10791 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10792 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10793 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10794 | } |
| 10795 | |
| 10796 | pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData; |
| 10797 | wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc; |
| 10798 | /*----------------------------------------------------------------------- |
| 10799 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10800 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10801 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10802 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10803 | sizeof(halSwitchChannelReq.switchChannelParams), |
| 10804 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10805 | ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) ))) |
| 10806 | { |
| 10807 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10808 | "Unable to get send buffer in channel switch req %x %x %x", |
| 10809 | pEventData, pwdiSwitchChParams, wdiSwitchChRspCb); |
| 10810 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10811 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10812 | } |
| 10813 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10814 | halSwitchChannelReq.switchChannelParams.channelNumber = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10815 | pwdiSwitchChParams->wdiChInfo.ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10816 | #ifndef WLAN_FEATURE_VOWIFI |
| 10817 | halSwitchChannelReq.switchChannelParams.localPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10818 | pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint; |
| 10819 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10820 | halSwitchChannelReq.switchChannelParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10821 | pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset; |
| 10822 | |
| 10823 | #ifdef WLAN_FEATURE_VOWIFI |
| 10824 | halSwitchChannelReq.switchChannelParams.maxTxPower |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10825 | = pwdiSwitchChParams->wdiChInfo.cMaxTxPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10826 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr, |
| 10827 | pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr, |
| 10828 | WDI_MAC_ADDR_LEN); |
| 10829 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId, |
| 10830 | pwdiSwitchChParams->wdiChInfo.macBSSId, |
| 10831 | WDI_MAC_ADDR_LEN); |
| 10832 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10833 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10834 | &halSwitchChannelReq.switchChannelParams, |
| 10835 | sizeof(halSwitchChannelReq.switchChannelParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10836 | |
| 10837 | pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10838 | pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10839 | |
| 10840 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10841 | Send Switch Channel Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10842 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10843 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10844 | wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10845 | }/*WDI_ProcessChannelSwitchReq*/ |
| 10846 | |
| 10847 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10848 | @brief Process Config STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10849 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10850 | |
| 10851 | @param pWDICtx: pointer to the WLAN DAL context |
| 10852 | pEventData: pointer to the event information structure |
| 10853 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10854 | @see |
| 10855 | @return Result of the function call |
| 10856 | */ |
| 10857 | WDI_Status |
| 10858 | WDI_ProcessConfigStaReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10859 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10860 | WDI_ControlBlockType* pWDICtx, |
| 10861 | WDI_EventInfoType* pEventData |
| 10862 | ) |
| 10863 | { |
| 10864 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams; |
| 10865 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10866 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10867 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10868 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10869 | wpt_uint16 usDataOffset = 0; |
| 10870 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10871 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10872 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10873 | tConfigStaReqMsg halConfigStaReqMsg; |
| 10874 | wpt_uint16 uMsgSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10875 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10876 | |
| 10877 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10878 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10879 | -------------------------------------------------------------------------*/ |
| 10880 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10881 | ( NULL == pEventData->pCBfnc )) |
| 10882 | { |
| 10883 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10884 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10885 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10886 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10887 | } |
| 10888 | |
| 10889 | pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData; |
| 10890 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc; |
| 10891 | /*------------------------------------------------------------------------- |
| 10892 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10893 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10894 | -------------------------------------------------------------------------*/ |
| 10895 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10896 | |
| 10897 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10898 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10899 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10900 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10901 | pwdiConfigSTAParams->wdiReqInfo.macBSSID, |
| 10902 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10903 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10904 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10905 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10906 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10907 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10908 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10909 | |
| 10910 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10911 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10912 | } |
| 10913 | |
| 10914 | /*------------------------------------------------------------------------ |
| 10915 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10916 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10917 | ------------------------------------------------------------------------*/ |
| 10918 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10919 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10921 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10922 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10923 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10924 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10925 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10926 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10927 | } |
| 10928 | |
| 10929 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10930 | |
| 10931 | /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */ |
| 10932 | #ifdef WLAN_FEATURE_11AC |
| 10933 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10934 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10935 | else |
| 10936 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10937 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10938 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10939 | /*----------------------------------------------------------------------- |
| 10940 | Get message buffer |
| 10941 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10942 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ, |
| 10943 | uMsgSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10944 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10945 | ( usSendSize < (usDataOffset + uMsgSize ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10946 | { |
| 10947 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10948 | "Unable to get send buffer in config sta req %x %x %x", |
| 10949 | pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb); |
| 10950 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10951 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10952 | } |
| 10953 | |
| 10954 | /*Copy the station context*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10955 | WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10956 | &pwdiConfigSTAParams->wdiReqInfo); |
| 10957 | |
| 10958 | if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF) |
| 10959 | { |
| 10960 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10961 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10962 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 10963 | pwdiConfigSTAParams->wdiReqInfo.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10964 | (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10965 | { |
| 10966 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10967 | "This station does not exist in the WDI Station Table %d"); |
| 10968 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 10969 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10970 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10971 | } |
| 10972 | } |
| 10973 | else |
| 10974 | { |
| 10975 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 10976 | yet received it from HAL */ |
Gopichand Nakkala | 79aacf0 | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 10977 | halConfigStaReqMsg.uStaParams.configStaParams.staIdx = pwdiConfigSTAParams->wdiReqInfo.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10978 | } |
| 10979 | |
| 10980 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10981 | halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx; |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10982 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10983 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10984 | &halConfigStaReqMsg.uStaParams, |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10985 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10986 | |
| 10987 | pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10988 | pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10989 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10990 | wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq, |
| 10991 | pwdiConfigSTAParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10992 | sizeof(pWDICtx->wdiCachedConfigStaReq)); |
| 10993 | |
| 10994 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10995 | Send Config STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10996 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10997 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10998 | wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10999 | }/*WDI_ProcessConfigStaReq*/ |
| 11000 | |
| 11001 | |
| 11002 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11003 | @brief Process Set Link State Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11004 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11005 | |
| 11006 | @param pWDICtx: pointer to the WLAN DAL context |
| 11007 | pEventData: pointer to the event information structure |
| 11008 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11009 | @see |
| 11010 | @return Result of the function call |
| 11011 | */ |
| 11012 | WDI_Status |
| 11013 | WDI_ProcessSetLinkStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11014 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11015 | WDI_ControlBlockType* pWDICtx, |
| 11016 | WDI_EventInfoType* pEventData |
| 11017 | ) |
| 11018 | { |
| 11019 | WDI_SetLinkReqParamsType* pwdiSetLinkParams; |
| 11020 | WDI_SetLinkStateRspCb wdiSetLinkRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11021 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11022 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11023 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11024 | wpt_uint16 usDataOffset = 0; |
| 11025 | wpt_uint16 usSendSize = 0; |
| 11026 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11027 | tLinkStateParams halLinkStateReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11028 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11029 | |
| 11030 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11031 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11032 | -------------------------------------------------------------------------*/ |
| 11033 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 11034 | ( NULL == pEventData->pCBfnc )) |
| 11035 | { |
| 11036 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11037 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11038 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11039 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11040 | } |
| 11041 | |
| 11042 | pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData; |
| 11043 | wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc; |
| 11044 | /*------------------------------------------------------------------------- |
| 11045 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11046 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11047 | -------------------------------------------------------------------------*/ |
| 11048 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11049 | |
| 11050 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11051 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11052 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11053 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 11054 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, |
| 11055 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11056 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11057 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11058 | { |
Madan Mohan Koyyalamudi | 891e949 | 2012-10-21 12:19:31 -0700 | [diff] [blame] | 11059 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11060 | "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR, |
| 11061 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11062 | } |
| 11063 | else |
| 11064 | { |
| 11065 | /*------------------------------------------------------------------------ |
| 11066 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11067 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11068 | ------------------------------------------------------------------------*/ |
| 11069 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11070 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11071 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11072 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11073 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
| 11074 | |
| 11075 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11076 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11077 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11078 | } |
| 11079 | } |
| 11080 | /* If the link is set to enter IDLE - the Session allocated for this BSS |
| 11081 | will be deleted on the Set Link State response coming from HAL |
| 11082 | - cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11083 | wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11084 | sizeof(pWDICtx->wdiCacheSetLinkStReq)); |
| 11085 | |
| 11086 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11087 | /*----------------------------------------------------------------------- |
| 11088 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11089 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11090 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11091 | |
| 11092 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11093 | sizeof(halLinkStateReqMsg), |
| 11094 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11095 | ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) ))) |
| 11096 | { |
| 11097 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11098 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11099 | pEventData, pwdiSetLinkParams, wdiSetLinkRspCb); |
| 11100 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11101 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11102 | } |
| 11103 | |
| 11104 | wpalMemoryCopy(halLinkStateReqMsg.bssid, |
| 11105 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 11106 | |
| 11107 | wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr, |
| 11108 | pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN); |
| 11109 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11110 | halLinkStateReqMsg.state = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11111 | WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState); |
| 11112 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11113 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11114 | &halLinkStateReqMsg, |
| 11115 | sizeof(halLinkStateReqMsg)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11116 | |
| 11117 | pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11118 | pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11119 | |
| 11120 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11121 | Send Set Link State Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11122 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11123 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11124 | wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11125 | }/*WDI_ProcessSetLinkStateReq*/ |
| 11126 | |
| 11127 | |
| 11128 | /** |
| 11129 | @brief Process Get Stats Request function (called when Main FSM |
| 11130 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11131 | |
| 11132 | @param pWDICtx: pointer to the WLAN DAL context |
| 11133 | pEventData: pointer to the event information structure |
| 11134 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11135 | @see |
| 11136 | @return Result of the function call |
| 11137 | */ |
| 11138 | WDI_Status |
| 11139 | WDI_ProcessGetStatsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11140 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11141 | WDI_ControlBlockType* pWDICtx, |
| 11142 | WDI_EventInfoType* pEventData |
| 11143 | ) |
| 11144 | { |
| 11145 | WDI_GetStatsReqParamsType* pwdiGetStatsParams; |
| 11146 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11147 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11148 | wpt_uint16 usDataOffset = 0; |
| 11149 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11150 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11151 | WDI_BSSSessionType* pBSSSes = NULL; |
| 11152 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11153 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11154 | tHalStatsReqMsg halStatsReqMsg; |
| 11155 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11156 | |
| 11157 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11158 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11159 | -------------------------------------------------------------------------*/ |
| 11160 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 11161 | ( NULL == pEventData->pCBfnc ) ) |
| 11162 | { |
| 11163 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11164 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11165 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11166 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11167 | } |
| 11168 | |
| 11169 | pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData; |
| 11170 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 11171 | |
| 11172 | /*------------------------------------------------------------------------- |
| 11173 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11174 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11175 | -------------------------------------------------------------------------*/ |
| 11176 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11177 | |
| 11178 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11179 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11180 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11181 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11182 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11183 | &macBSSID)) |
| 11184 | { |
| 11185 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11186 | "This station does not exist in the WDI Station Table %d"); |
| 11187 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11188 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11189 | } |
| 11190 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11191 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11192 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11193 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11194 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11195 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11196 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11197 | |
| 11198 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11199 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11200 | } |
| 11201 | |
| 11202 | /*------------------------------------------------------------------------ |
| 11203 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11204 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11205 | ------------------------------------------------------------------------*/ |
| 11206 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11207 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11208 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11209 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11210 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11211 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11212 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11213 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11214 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11215 | } |
| 11216 | |
| 11217 | |
| 11218 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11219 | |
| 11220 | /*----------------------------------------------------------------------- |
| 11221 | Get message buffer |
| 11222 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11223 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11224 | sizeof(halStatsReqMsg.statsReqParams), |
| 11225 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11226 | ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) ))) |
| 11227 | { |
| 11228 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11229 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11230 | pEventData, pwdiGetStatsParams, wdiGetStatsRspCb); |
| 11231 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11232 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11233 | } |
| 11234 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11235 | halStatsReqMsg.statsReqParams.staId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11236 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11237 | halStatsReqMsg.statsReqParams.statsMask = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11238 | pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11239 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11240 | &halStatsReqMsg.statsReqParams, |
| 11241 | sizeof(halStatsReqMsg.statsReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11242 | |
| 11243 | pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11244 | pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11245 | |
| 11246 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11247 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11248 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11249 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11250 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11251 | }/*WDI_ProcessGetStatsReq*/ |
| 11252 | |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 11253 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 11254 | /** |
| 11255 | @brief Process Get Roam Rssi Request function (called when Main FSM |
| 11256 | allows it) |
| 11257 | |
| 11258 | @param pWDICtx: pointer to the WLAN DAL context |
| 11259 | pEventData: pointer to the event information structure |
| 11260 | |
| 11261 | @see |
| 11262 | @return Result of the function call |
| 11263 | */ |
| 11264 | WDI_Status |
| 11265 | WDI_ProcessGetRoamRssiReq |
| 11266 | ( |
| 11267 | WDI_ControlBlockType* pWDICtx, |
| 11268 | WDI_EventInfoType* pEventData |
| 11269 | ) |
| 11270 | { |
| 11271 | WDI_GetRoamRssiReqParamsType* pwdiGetRoamRssiParams; |
| 11272 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 11273 | wpt_uint8* pSendBuffer = NULL; |
| 11274 | wpt_uint16 usDataOffset = 0; |
| 11275 | wpt_uint16 usSendSize = 0; |
| 11276 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 11277 | WDI_BSSSessionType* pBSSSes = NULL; |
| 11278 | wpt_macAddr macBSSID; |
| 11279 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 11280 | tHalGetRoamRssiReqMsg halRssiRoamReqMsg; |
| 11281 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11282 | /*------------------------------------------------------------------------- |
| 11283 | Sanity check |
| 11284 | -------------------------------------------------------------------------*/ |
| 11285 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 11286 | ( NULL == pEventData->pCBfnc ) ) |
| 11287 | { |
| 11288 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11289 | "%s: Invalid parameters", __func__); |
| 11290 | WDI_ASSERT(0); |
| 11291 | return WDI_STATUS_E_FAILURE; |
| 11292 | } |
| 11293 | |
| 11294 | pwdiGetRoamRssiParams = (WDI_GetRoamRssiReqParamsType*)pEventData->pEventData; |
| 11295 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 11296 | |
| 11297 | /*------------------------------------------------------------------------- |
| 11298 | Check to see if we are in the middle of an association, if so queue, if |
| 11299 | not it means it is free to process request |
| 11300 | -------------------------------------------------------------------------*/ |
| 11301 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11302 | |
| 11303 | /*------------------------------------------------------------------------ |
| 11304 | Find the BSS for which the request is made |
| 11305 | ------------------------------------------------------------------------*/ |
| 11306 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11307 | pwdiGetRoamRssiParams->wdiGetRoamRssiParamsInfo.ucSTAIdx, |
| 11308 | &macBSSID)) |
| 11309 | { |
| 11310 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11311 | "This station does not exist in the WDI Station Table %d"); |
| 11312 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11313 | return WDI_STATUS_E_FAILURE; |
| 11314 | } |
| 11315 | |
| 11316 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11317 | if ( NULL == pBSSSes ) |
| 11318 | { |
| 11319 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11320 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11321 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 11322 | |
| 11323 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11324 | return WDI_STATUS_E_NOT_ALLOWED; |
| 11325 | } |
| 11326 | |
| 11327 | /*------------------------------------------------------------------------ |
| 11328 | Check if this BSS is being currently processed or queued, |
| 11329 | if queued - queue the new request as well |
| 11330 | ------------------------------------------------------------------------*/ |
| 11331 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11332 | { |
| 11333 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11334 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11335 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 11336 | |
| 11337 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 11338 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11339 | return wdiStatus; |
| 11340 | } |
| 11341 | |
| 11342 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11343 | |
| 11344 | /*----------------------------------------------------------------------- |
| 11345 | Get message buffer |
| 11346 | -----------------------------------------------------------------------*/ |
| 11347 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_ROAM_RSSI_REQ, |
| 11348 | sizeof(halRssiRoamReqMsg.roamRssiReqParams), |
| 11349 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11350 | ( usSendSize < (usDataOffset + sizeof(halRssiRoamReqMsg.roamRssiReqParams) ))) |
| 11351 | { |
| 11352 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11353 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11354 | pEventData, pwdiGetRoamRssiParams, wdiGetStatsRspCb); |
| 11355 | WDI_ASSERT(0); |
| 11356 | return WDI_STATUS_E_FAILURE; |
| 11357 | } |
| 11358 | |
| 11359 | halRssiRoamReqMsg.roamRssiReqParams.staId = |
| 11360 | pwdiGetRoamRssiParams->wdiGetRoamRssiParamsInfo.ucSTAIdx; |
| 11361 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11362 | &halRssiRoamReqMsg.roamRssiReqParams, |
| 11363 | sizeof(halRssiRoamReqMsg.roamRssiReqParams)); |
| 11364 | |
| 11365 | pWDICtx->wdiReqStatusCB = pwdiGetRoamRssiParams->wdiReqStatusCB; |
| 11366 | pWDICtx->pReqStatusUserData = pwdiGetRoamRssiParams->pUserData; |
| 11367 | |
| 11368 | /*------------------------------------------------------------------------- |
| 11369 | Send Get STA Request to HAL |
| 11370 | -------------------------------------------------------------------------*/ |
| 11371 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11372 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_ROAM_RSSI_RESP); |
| 11373 | }/*WDI_ProcessGetRoamRssiReq*/ |
| 11374 | #endif |
| 11375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11376 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11377 | @brief Process Update Cfg Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11378 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11379 | |
| 11380 | @param pWDICtx: pointer to the WLAN DAL context |
| 11381 | pEventData: pointer to the event information structure |
| 11382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11383 | @see |
| 11384 | @return Result of the function call |
| 11385 | */ |
| 11386 | WDI_Status |
| 11387 | WDI_ProcessUpdateCfgReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11388 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11389 | WDI_ControlBlockType* pWDICtx, |
| 11390 | WDI_EventInfoType* pEventData |
| 11391 | ) |
| 11392 | { |
| 11393 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL; |
| 11394 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL; |
| 11395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11396 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11397 | wpt_uint16 usDataOffset = 0; |
| 11398 | wpt_uint16 usSendSize = 0; |
| 11399 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11400 | |
| 11401 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11402 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11403 | -------------------------------------------------------------------------*/ |
| 11404 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 11405 | ( NULL == pEventData->pCBfnc)) |
| 11406 | { |
| 11407 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11408 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11409 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11410 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11411 | } |
| 11412 | |
| 11413 | pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData; |
| 11414 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc; |
| 11415 | |
| 11416 | /*----------------------------------------------------------------------- |
| 11417 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11418 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11419 | -----------------------------------------------------------------------*/ |
| 11420 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11421 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11422 | pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32), |
| 11423 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11424 | ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen))) |
| 11425 | { |
| 11426 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11427 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11428 | pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb); |
| 11429 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11430 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11431 | } |
| 11432 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11433 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11434 | &pwdiUpdateCfgParams->uConfigBufferLen, |
| 11435 | sizeof(wpt_uint32)); |
| 11436 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32), |
| 11437 | pwdiUpdateCfgParams->pConfigBuffer, |
| 11438 | pwdiUpdateCfgParams->uConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11439 | |
| 11440 | pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11441 | pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11442 | |
| 11443 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11444 | Send Update Cfg Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11445 | -------------------------------------------------------------------------*/ |
| 11446 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11447 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11448 | wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11449 | |
| 11450 | }/*WDI_ProcessUpdateCfgReq*/ |
| 11451 | |
| 11452 | |
| 11453 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11454 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11455 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11456 | |
| 11457 | @param pWDICtx: pointer to the WLAN DAL context |
| 11458 | pEventData: pointer to the event information structure |
| 11459 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11460 | @see |
| 11461 | @return Result of the function call |
| 11462 | */ |
| 11463 | WDI_Status |
| 11464 | WDI_ProcessAddBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11465 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11466 | WDI_ControlBlockType* pWDICtx, |
| 11467 | WDI_EventInfoType* pEventData |
| 11468 | ) |
| 11469 | { |
| 11470 | WDI_AddBAReqParamsType* pwdiAddBAParams; |
| 11471 | WDI_AddBARspCb wdiAddBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11472 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11473 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11474 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11475 | wpt_uint16 usDataOffset = 0; |
| 11476 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11477 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11478 | wpt_macAddr macBSSID; |
| 11479 | |
| 11480 | tAddBAReqMsg halAddBAReq; |
| 11481 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11482 | |
| 11483 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11484 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11485 | -------------------------------------------------------------------------*/ |
| 11486 | if (( NULL == pEventData ) || |
| 11487 | ( NULL == pEventData->pEventData) || |
| 11488 | ( NULL == pEventData->pCBfnc )) |
| 11489 | { |
| 11490 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11491 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11492 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11493 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11494 | } |
| 11495 | |
| 11496 | pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData; |
| 11497 | wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc; |
| 11498 | |
| 11499 | /*------------------------------------------------------------------------- |
| 11500 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11501 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11502 | -------------------------------------------------------------------------*/ |
| 11503 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11504 | |
| 11505 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11506 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11507 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11508 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11509 | pwdiAddBAParams->wdiBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11510 | &macBSSID)) |
| 11511 | { |
| 11512 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11513 | "This station does not exist in the WDI Station Table %d"); |
| 11514 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11515 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11516 | } |
| 11517 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11518 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11519 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11520 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11521 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11522 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11523 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11524 | |
| 11525 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11526 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11527 | } |
| 11528 | |
| 11529 | /*------------------------------------------------------------------------ |
| 11530 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11531 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11532 | ------------------------------------------------------------------------*/ |
| 11533 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11534 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11535 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11536 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11537 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11538 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11539 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11540 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11541 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11542 | } |
| 11543 | |
| 11544 | |
| 11545 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11546 | /*----------------------------------------------------------------------- |
| 11547 | Get message buffer |
| 11548 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11549 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11550 | sizeof(halAddBAReq.addBAParams), |
| 11551 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11552 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11553 | (usDataOffset + sizeof(halAddBAReq.addBAParams) ))) |
| 11554 | { |
| 11555 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11556 | "Unable to get send buffer in Add BA req %x %x %x", |
| 11557 | pEventData, pwdiAddBAParams, wdiAddBARspCb); |
| 11558 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11559 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11560 | } |
| 11561 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11562 | halAddBAReq.addBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11563 | pwdiAddBAParams->wdiBAInfoType.ucBaSessionID; |
| 11564 | halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize; |
| 11565 | #ifdef FEATURE_ON_CHIP_REORDERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11566 | halAddBAReq.addBAParams.isReorderingDoneOnChip = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11567 | pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip; |
| 11568 | #endif |
| 11569 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11570 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11571 | &halAddBAReq.addBAParams, |
| 11572 | sizeof(halAddBAReq.addBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11573 | |
| 11574 | pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11575 | pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11576 | |
| 11577 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11578 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11579 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11580 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11581 | wdiAddBARspCb, pEventData->pUserData, |
| 11582 | WDI_ADD_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11583 | }/*WDI_ProcessAddBAReq*/ |
| 11584 | |
| 11585 | |
| 11586 | |
| 11587 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11588 | @brief Process Trigger BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11589 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11590 | |
| 11591 | @param pWDICtx: pointer to the WLAN DAL context |
| 11592 | pEventData: pointer to the event information structure |
| 11593 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11594 | @see |
| 11595 | @return Result of the function call |
| 11596 | */ |
| 11597 | WDI_Status |
| 11598 | WDI_ProcessTriggerBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11599 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11600 | WDI_ControlBlockType* pWDICtx, |
| 11601 | WDI_EventInfoType* pEventData |
| 11602 | ) |
| 11603 | { |
| 11604 | WDI_TriggerBAReqParamsType* pwdiTriggerBAParams; |
| 11605 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11606 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11607 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11608 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11609 | wpt_uint16 usDataOffset = 0; |
| 11610 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11611 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11612 | wpt_uint16 index; |
| 11613 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11614 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11615 | tTriggerBAReqMsg halTriggerBAReq; |
| 11616 | tTriggerBaReqCandidate* halTriggerBACandidate; |
| 11617 | WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate; |
| 11618 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11619 | |
| 11620 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11621 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11622 | -------------------------------------------------------------------------*/ |
| 11623 | if (( NULL == pEventData ) || |
| 11624 | ( NULL == pEventData->pEventData ) || |
| 11625 | ( NULL == pEventData->pCBfnc )) |
| 11626 | { |
| 11627 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11628 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11629 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11630 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11631 | } |
| 11632 | |
| 11633 | pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData; |
| 11634 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc; |
| 11635 | /*------------------------------------------------------------------------- |
| 11636 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11637 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11638 | -------------------------------------------------------------------------*/ |
| 11639 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11640 | |
| 11641 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11642 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11643 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11644 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11645 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11646 | &macBSSID)) |
| 11647 | { |
| 11648 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11649 | "This station does not exist in the WDI Station Table %d"); |
| 11650 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11651 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11652 | } |
| 11653 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11654 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11655 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11656 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11657 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11658 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11659 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11660 | |
| 11661 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11662 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11663 | } |
| 11664 | |
| 11665 | /*------------------------------------------------------------------------ |
| 11666 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11667 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11668 | ------------------------------------------------------------------------*/ |
| 11669 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11670 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11671 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11672 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11673 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11674 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11675 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11676 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11677 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11678 | } |
| 11679 | |
| 11680 | |
| 11681 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11682 | /*----------------------------------------------------------------------- |
| 11683 | Get message buffer |
| 11684 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11685 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11686 | WDI_TRIGGER_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11687 | sizeof(halTriggerBAReq.triggerBAParams) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11688 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11689 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt), |
| 11690 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11691 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11692 | (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11693 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11694 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) ))) |
| 11695 | { |
| 11696 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11697 | "Unable to get send buffer in Trigger BA req %x %x %x", |
| 11698 | pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb); |
| 11699 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11700 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11701 | } |
| 11702 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11703 | halTriggerBAReq.triggerBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11704 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11705 | halTriggerBAReq.triggerBAParams.baCandidateCnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11706 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt; |
| 11707 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11708 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11709 | &halTriggerBAReq.triggerBAParams, |
| 11710 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11711 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11712 | wdiTriggerBACandidate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11713 | (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1); |
| 11714 | halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+ |
| 11715 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11716 | |
| 11717 | for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11718 | index++) |
| 11719 | { |
| 11720 | halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx; |
| 11721 | halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap; |
| 11722 | halTriggerBACandidate++; |
| 11723 | wdiTriggerBACandidate++; |
| 11724 | } |
| 11725 | |
| 11726 | pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11727 | pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11728 | |
| 11729 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11730 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11731 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11732 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11733 | wdiTriggerBARspCb, pEventData->pUserData, |
| 11734 | WDI_TRIGGER_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11735 | }/*WDI_ProcessTriggerBAReq*/ |
| 11736 | |
| 11737 | |
| 11738 | |
| 11739 | /** |
| 11740 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11741 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11742 | |
| 11743 | @param pWDICtx: pointer to the WLAN DAL context |
| 11744 | pEventData: pointer to the event information structure |
| 11745 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11746 | @see |
| 11747 | @return Result of the function call |
| 11748 | */ |
| 11749 | WDI_Status |
| 11750 | WDI_ProcessUpdateBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11751 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11752 | WDI_ControlBlockType* pWDICtx, |
| 11753 | WDI_EventInfoType* pEventData |
| 11754 | ) |
| 11755 | { |
| 11756 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams; |
| 11757 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11758 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11759 | wpt_uint16 usDataOffset = 0; |
| 11760 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11761 | tUpdateBeaconParams halUpdateBeaconParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11762 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11763 | |
| 11764 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11765 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11766 | -------------------------------------------------------------------------*/ |
| 11767 | if (( NULL == pEventData ) || |
| 11768 | ( NULL == pEventData->pEventData) || |
| 11769 | ( NULL == pEventData->pCBfnc)) |
| 11770 | { |
| 11771 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11772 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11773 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11774 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11775 | } |
| 11776 | |
| 11777 | pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData; |
| 11778 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc; |
| 11779 | /*----------------------------------------------------------------------- |
| 11780 | Get message buffer |
| 11781 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11782 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11783 | sizeof(halUpdateBeaconParams), |
| 11784 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11785 | ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) ))) |
| 11786 | { |
| 11787 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11788 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11789 | pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb); |
| 11790 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11791 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11792 | } |
| 11793 | |
| 11794 | /*BSS Index of the BSS*/ |
| 11795 | halUpdateBeaconParams.bssIdx = |
| 11796 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx; |
| 11797 | /*shortPreamble mode. HAL should update all the STA rates when it |
| 11798 | receives this message*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11799 | halUpdateBeaconParams.fShortPreamble = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11800 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble; |
| 11801 | /* short Slot time.*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11802 | halUpdateBeaconParams.fShortSlotTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11803 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime; |
| 11804 | /* Beacon Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11805 | halUpdateBeaconParams.beaconInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11806 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval; |
| 11807 | |
| 11808 | /*Protection related */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11809 | halUpdateBeaconParams.llaCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11810 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11811 | halUpdateBeaconParams.llbCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11812 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11813 | halUpdateBeaconParams.llgCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11814 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11815 | halUpdateBeaconParams.ht20MhzCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11816 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11817 | halUpdateBeaconParams.llnNonGFCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11818 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11819 | halUpdateBeaconParams.fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11820 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport; |
| 11821 | halUpdateBeaconParams.fRIFSMode = |
| 11822 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11823 | halUpdateBeaconParams.paramChangeBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11824 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap; |
| 11825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11826 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams, |
| 11827 | sizeof(halUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11828 | |
| 11829 | pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11830 | pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11831 | |
| 11832 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11833 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11834 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11835 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11836 | wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11837 | }/*WDI_ProcessUpdateBeaconParamsReq*/ |
| 11838 | |
| 11839 | |
| 11840 | |
| 11841 | /** |
| 11842 | @brief Process Send Beacon template Request function (called when Main FSM |
| 11843 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11844 | |
| 11845 | @param pWDICtx: pointer to the WLAN DAL context |
| 11846 | pEventData: pointer to the event information structure |
| 11847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11848 | @see |
| 11849 | @return Result of the function call |
| 11850 | */ |
| 11851 | WDI_Status |
| 11852 | WDI_ProcessSendBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11853 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11854 | WDI_ControlBlockType* pWDICtx, |
| 11855 | WDI_EventInfoType* pEventData |
| 11856 | ) |
| 11857 | { |
| 11858 | WDI_SendBeaconParamsType* pwdiSendBeaconParams; |
| 11859 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11860 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11861 | wpt_uint16 usDataOffset = 0; |
| 11862 | wpt_uint16 usSendSize = 0; |
| 11863 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11864 | |
| 11865 | tSendBeaconReqMsg halSendBeaconReq; |
| 11866 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11867 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11868 | -------------------------------------------------------------------------*/ |
| 11869 | if (( NULL == pEventData ) || |
| 11870 | ( NULL == pEventData->pEventData ) || |
| 11871 | ( NULL == pEventData->pCBfnc )) |
| 11872 | { |
| 11873 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11874 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11875 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11876 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11877 | } |
| 11878 | |
| 11879 | pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData; |
| 11880 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc; |
| 11881 | /*----------------------------------------------------------------------- |
| 11882 | Get message buffer |
| 11883 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11884 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11885 | sizeof(halSendBeaconReq.sendBeaconParam), |
| 11886 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11887 | ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) ))) |
| 11888 | { |
| 11889 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11890 | "Unable to get send buffer in send beacon req %x %x %x", |
| 11891 | pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb); |
| 11892 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11893 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11894 | } |
| 11895 | |
| 11896 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId, |
| 11897 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID, |
| 11898 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11899 | halSendBeaconReq.sendBeaconParam.beaconLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11900 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength; |
| 11901 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon, |
| 11902 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon, |
| 11903 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11904 | halSendBeaconReq.sendBeaconParam.timIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11905 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset; |
Gopichand Nakkala | 1ec80b6 | 2013-03-22 11:15:19 +0530 | [diff] [blame] | 11906 | /* usP2PIeOffset should be atleast greater than timIeOffset */ |
| 11907 | if ((pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset != 0 ) && |
| 11908 | (pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset < |
| 11909 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset)) |
| 11910 | { |
| 11911 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11912 | "Invalid usP2PIeOffset %hu", |
| 11913 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset); |
| 11914 | WDI_ASSERT(0); |
| 11915 | return WDI_STATUS_E_FAILURE; |
| 11916 | } |
| 11917 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11918 | halSendBeaconReq.sendBeaconParam.p2pIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11919 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11920 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11921 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11922 | &halSendBeaconReq.sendBeaconParam, |
| 11923 | sizeof(halSendBeaconReq.sendBeaconParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11924 | |
| 11925 | pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11926 | pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11927 | |
| 11928 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11929 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11930 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11931 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11932 | wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11933 | }/*WDI_ProcessSendBeaconParamsReq*/ |
| 11934 | |
| 11935 | /** |
| 11936 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11937 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11938 | |
| 11939 | @param pWDICtx: pointer to the WLAN DAL context |
| 11940 | pEventData: pointer to the event information structure |
| 11941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11942 | @see |
| 11943 | @return Result of the function call |
| 11944 | */ |
| 11945 | WDI_Status |
| 11946 | WDI_ProcessUpdateProbeRspTemplateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11947 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11948 | WDI_ControlBlockType* pWDICtx, |
| 11949 | WDI_EventInfoType* pEventData |
| 11950 | ) |
| 11951 | { |
| 11952 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams; |
| 11953 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11954 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11955 | wpt_uint16 usDataOffset = 0; |
| 11956 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11957 | tSendProbeRespReqParams halUpdateProbeRspTmplParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11958 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11959 | |
| 11960 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11961 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11962 | -------------------------------------------------------------------------*/ |
| 11963 | if (( NULL == pEventData ) || |
| 11964 | ( NULL == pEventData->pEventData) || |
| 11965 | ( NULL == pEventData->pCBfnc)) |
| 11966 | { |
| 11967 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11968 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11969 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11970 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11971 | } |
| 11972 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11973 | pwdiUpdateProbeRespTmplParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11974 | (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11975 | wdiUpdateProbeRespTmplRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11976 | (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc; |
| 11977 | /*----------------------------------------------------------------------- |
| 11978 | Get message buffer |
| 11979 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11980 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_PROBE_RSP_TEMPLATE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11981 | sizeof(halUpdateProbeRspTmplParams), |
| 11982 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11983 | ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) ))) |
| 11984 | { |
| 11985 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11986 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11987 | pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb); |
| 11988 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11989 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11990 | } |
| 11991 | |
| 11992 | wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11993 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11994 | WDI_MAC_ADDR_LEN); |
| 11995 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11996 | halUpdateProbeRspTmplParams.probeRespTemplateLen = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11997 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen; |
| 11998 | |
| 11999 | wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate, |
| 12000 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12001 | BEACON_TEMPLATE_SIZE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12002 | |
| 12003 | |
| 12004 | wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap, |
| 12005 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap, |
| 12006 | WDI_PROBE_REQ_BITMAP_IE_LEN); |
| 12007 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12008 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12009 | &halUpdateProbeRspTmplParams, |
| 12010 | sizeof(halUpdateProbeRspTmplParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12011 | |
| 12012 | pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12013 | pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12014 | |
| 12015 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12016 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12017 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12018 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12019 | wdiUpdateProbeRespTmplRspCb, pEventData->pUserData, |
| 12020 | WDI_UPD_PROBE_RSP_TEMPLATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12021 | }/*WDI_ProcessUpdateProbeRspTemplateReq*/ |
| 12022 | |
| 12023 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12024 | @brief Process NV blob download function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12025 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12026 | |
| 12027 | @param pWDICtx: pointer to the WLAN DAL context |
| 12028 | pEventData: pointer to the event information structure |
| 12029 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12030 | @see |
| 12031 | @return Result of the function call |
| 12032 | */ |
| 12033 | WDI_Status |
| 12034 | WDI_ProcessNvDownloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12035 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12036 | WDI_ControlBlockType* pWDICtx, |
| 12037 | WDI_EventInfoType* pEventData |
| 12038 | ) |
| 12039 | { |
| 12040 | |
| 12041 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL; |
| 12042 | WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL; |
| 12043 | |
| 12044 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12045 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12046 | -------------------------------------------------------------------------*/ |
| 12047 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12048 | ( NULL == (pwdiNvDownloadReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12049 | (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12050 | ( NULL == (wdiNvDownloadRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12051 | (WDI_NvDownloadRspCb)pEventData->pCBfnc))) |
| 12052 | { |
| 12053 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12054 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12055 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12056 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12057 | } |
| 12058 | |
| 12059 | /*Intialize the Nv Blob Info */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12060 | pWDICtx->wdiNvBlobInfo.usTotalFragment = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12061 | TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize); |
| 12062 | |
| 12063 | /*cache the wdi nv request message here if the the first fragment |
| 12064 | * To issue the request to HAL for the next fragment */ |
| 12065 | if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
| 12066 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12067 | wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq, |
| 12068 | pwdiNvDownloadReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12069 | sizeof(pWDICtx->wdiCachedNvDownloadReq)); |
| 12070 | |
| 12071 | pWDICtx->pfncRspCB = pEventData->pCBfnc; |
| 12072 | pWDICtx->pRspCBUserData = pEventData->pUserData; |
| 12073 | } |
| 12074 | |
| 12075 | return WDI_SendNvBlobReq(pWDICtx,pEventData); |
| 12076 | } |
| 12077 | |
| 12078 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12079 | @brief Process Set Max Tx Power Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12080 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12081 | |
| 12082 | @param pWDICtx: pointer to the WLAN DAL context |
| 12083 | pEventData: pointer to the event information structure |
| 12084 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12085 | @see |
| 12086 | @return Result of the function call |
| 12087 | */ |
| 12088 | WDI_Status WDI_ProcessSetMaxTxPowerReq |
| 12089 | ( |
| 12090 | WDI_ControlBlockType* pWDICtx, |
| 12091 | WDI_EventInfoType* pEventData |
| 12092 | ) |
| 12093 | { |
| 12094 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL; |
| 12095 | WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12096 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12097 | wpt_uint16 usDataOffset = 0; |
| 12098 | wpt_uint16 usSendSize = 0; |
| 12099 | tSetMaxTxPwrReq halSetMaxTxPower; |
| 12100 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12101 | |
| 12102 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12103 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12104 | -------------------------------------------------------------------------*/ |
| 12105 | if (( NULL == pEventData ) || |
| 12106 | ( NULL == pEventData->pEventData ) || |
| 12107 | ( NULL == pEventData->pCBfnc )) |
| 12108 | { |
| 12109 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12110 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12111 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12112 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12113 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12114 | pwdiSetMaxTxPowerParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12115 | (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12116 | wdiSetMaxTxPowerRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12117 | (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc; |
| 12118 | |
| 12119 | /*----------------------------------------------------------------------- |
| 12120 | Get message buffer |
| 12121 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12122 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_MAX_TX_POWER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12123 | sizeof(halSetMaxTxPower.setMaxTxPwrParams), |
| 12124 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12125 | ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12126 | ))) |
| 12127 | { |
| 12128 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12129 | "Unable to get Set Max Tx Power req %x %x %x", |
| 12130 | pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb); |
| 12131 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12132 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12133 | } |
| 12134 | |
| 12135 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId, |
| 12136 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId, |
| 12137 | WDI_MAC_ADDR_LEN); |
| 12138 | |
| 12139 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr, |
| 12140 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr, |
| 12141 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12142 | halSetMaxTxPower.setMaxTxPwrParams.power = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12143 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12144 | |
| 12145 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12146 | &halSetMaxTxPower.setMaxTxPwrParams, |
| 12147 | sizeof(halSetMaxTxPower.setMaxTxPwrParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12148 | |
| 12149 | pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12150 | pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12151 | |
| 12152 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12153 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12154 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12155 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12156 | wdiSetMaxTxPowerRspCb, pEventData->pUserData, |
| 12157 | WDI_SET_MAX_TX_POWER_RESP); |
| 12158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12159 | } |
| 12160 | |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 12161 | /** |
| 12162 | @brief Process Set Tx Power Request function (called when Main |
| 12163 | FSM allows it) |
| 12164 | |
| 12165 | @param pWDICtx: pointer to the WLAN DAL context |
| 12166 | pEventData: pointer to the event information structure |
| 12167 | |
| 12168 | @see |
| 12169 | @return Result of the function call |
| 12170 | */ |
| 12171 | WDI_Status WDI_ProcessSetTxPowerReq |
| 12172 | ( |
| 12173 | WDI_ControlBlockType* pWDICtx, |
| 12174 | WDI_EventInfoType* pEventData |
| 12175 | ) |
| 12176 | { |
| 12177 | WDI_SetTxPowerParamsType* pwdiSetTxPowerParams = NULL; |
| 12178 | WDA_SetTxPowerRspCb wdiSetTxPowerRspCb; |
| 12179 | wpt_uint8* pSendBuffer = NULL; |
| 12180 | wpt_uint16 usDataOffset = 0; |
| 12181 | wpt_uint16 usSendSize = 0; |
Leo Chang | a37e2a9 | 2013-03-25 17:39:58 -0700 | [diff] [blame] | 12182 | tSetTxPwrReqParams *halSetTxPower = NULL; |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 12183 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12184 | |
| 12185 | /*------------------------------------------------------------------------- |
| 12186 | Sanity check |
| 12187 | -------------------------------------------------------------------------*/ |
| 12188 | if (( NULL == pEventData ) || |
| 12189 | ( NULL == pEventData->pEventData ) || |
| 12190 | ( NULL == pEventData->pCBfnc )) |
| 12191 | { |
| 12192 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12193 | "%s: Invalid parameters", __func__); |
| 12194 | WDI_ASSERT(0); |
| 12195 | return WDI_STATUS_E_FAILURE; |
| 12196 | } |
| 12197 | |
| 12198 | pwdiSetTxPowerParams = |
| 12199 | (WDI_SetTxPowerParamsType*)pEventData->pEventData; |
| 12200 | wdiSetTxPowerRspCb = |
| 12201 | (WDA_SetTxPowerRspCb)pEventData->pCBfnc; |
| 12202 | |
| 12203 | /*----------------------------------------------------------------------- |
| 12204 | Get message buffer |
| 12205 | -----------------------------------------------------------------------*/ |
| 12206 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_POWER_REQ, |
| 12207 | sizeof(tSetTxPwrReqParams), |
| 12208 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12209 | ( usSendSize < (usDataOffset + sizeof(tSetTxPwrReqParams) |
| 12210 | ))) |
| 12211 | { |
| 12212 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12213 | "Unable to get Set Max Tx Power req %x %x %x", |
| 12214 | pEventData, pwdiSetTxPowerParams, wdiSetTxPowerRspCb); |
| 12215 | WDI_ASSERT(0); |
| 12216 | return WDI_STATUS_E_FAILURE; |
| 12217 | } |
| 12218 | |
Leo Chang | a37e2a9 | 2013-03-25 17:39:58 -0700 | [diff] [blame] | 12219 | halSetTxPower = (tSetTxPwrReqParams *)(pSendBuffer + usDataOffset); |
| 12220 | halSetTxPower->txPower = pwdiSetTxPowerParams->wdiTxPowerInfo.ucPower; |
| 12221 | halSetTxPower->bssIdx = pwdiSetTxPowerParams->wdiTxPowerInfo.bssIdx; |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 12222 | |
| 12223 | pWDICtx->wdiReqStatusCB = pwdiSetTxPowerParams->wdiReqStatusCB; |
| 12224 | pWDICtx->pReqStatusUserData = pwdiSetTxPowerParams->pUserData; |
| 12225 | |
| 12226 | /*------------------------------------------------------------------------- |
| 12227 | Send Set Tx Power Request to HAL |
| 12228 | -------------------------------------------------------------------------*/ |
| 12229 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12230 | wdiSetTxPowerRspCb, pEventData->pUserData, |
| 12231 | WDI_SET_TX_POWER_RESP); |
| 12232 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12233 | |
| 12234 | /** |
| 12235 | @brief Process P2P Notice Of Absence Request function (called when Main FSM |
| 12236 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12237 | |
| 12238 | @param pWDICtx: pointer to the WLAN DAL context |
| 12239 | pEventData: pointer to the event information structure |
| 12240 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12241 | @see |
| 12242 | @return Result of the function call |
| 12243 | */ |
| 12244 | WDI_Status |
| 12245 | WDI_ProcessP2PGONOAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12246 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12247 | WDI_ControlBlockType* pWDICtx, |
| 12248 | WDI_EventInfoType* pEventData |
| 12249 | ) |
| 12250 | { |
| 12251 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams; |
| 12252 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12253 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12254 | wpt_uint16 usDataOffset = 0; |
| 12255 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12256 | tSetP2PGONOAParams halSetP2PGONOAParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12257 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12258 | |
| 12259 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12260 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12261 | -------------------------------------------------------------------------*/ |
| 12262 | if (( NULL == pEventData ) || |
| 12263 | ( NULL == pEventData->pEventData) || |
| 12264 | ( NULL == pEventData->pCBfnc)) |
| 12265 | { |
| 12266 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12267 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12268 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12269 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12270 | } |
| 12271 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12272 | pwdiP2PGONOAReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12273 | (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12274 | wdiP2PGONOAReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12275 | (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc; |
| 12276 | /*----------------------------------------------------------------------- |
| 12277 | Get message buffer |
| 12278 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12279 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 12280 | WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12281 | sizeof(halSetP2PGONOAParams), |
| 12282 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12283 | ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) ))) |
| 12284 | { |
| 12285 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12286 | "Unable to get send buffer in set P2P GO NOA REQ %x %x %x", |
| 12287 | pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb); |
| 12288 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12289 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12290 | } |
| 12291 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12292 | halSetP2PGONOAParams.opp_ps = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12293 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12294 | halSetP2PGONOAParams.ctWindow = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12295 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow; |
| 12296 | halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12297 | halSetP2PGONOAParams.duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12298 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12299 | halSetP2PGONOAParams.interval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12300 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12301 | halSetP2PGONOAParams.single_noa_duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12302 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12303 | halSetP2PGONOAParams.psSelection = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12304 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection; |
| 12305 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12306 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12307 | &halSetP2PGONOAParams, |
| 12308 | sizeof(halSetP2PGONOAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12309 | |
| 12310 | pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12311 | pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12312 | |
| 12313 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12314 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12315 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12316 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12317 | wdiP2PGONOAReqRspCb, pEventData->pUserData, |
| 12318 | WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12319 | }/*WDI_ProcessP2PGONOAReq*/ |
| 12320 | |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 12321 | #ifdef FEATURE_WLAN_TDLS |
| 12322 | |
| 12323 | /** |
| 12324 | @brief Process P2P Notice Of Absence Request function (called when Main FSM |
| 12325 | allows it) |
| 12326 | |
| 12327 | @param pWDICtx: pointer to the WLAN DAL context |
| 12328 | pEventData: pointer to the event information structure |
| 12329 | |
| 12330 | @see |
| 12331 | @return Result of the function call |
| 12332 | */ |
| 12333 | WDI_Status |
| 12334 | WDI_ProcessTdlsLinkEstablishReq |
| 12335 | ( |
| 12336 | WDI_ControlBlockType* pWDICtx, |
| 12337 | WDI_EventInfoType* pEventData |
| 12338 | ) |
| 12339 | { |
| 12340 | WDI_SetTDLSLinkEstablishReqParamsType* pwdiTDLSLinkEstablishReqParams; |
| 12341 | WDI_SetTDLSLinkEstablishReqParamsRspCb wdiTDLSLinkEstablishReqRspCb; |
| 12342 | wpt_uint8* pSendBuffer = NULL; |
| 12343 | wpt_uint16 usDataOffset = 0; |
| 12344 | wpt_uint16 usSendSize = 0; |
| 12345 | |
| 12346 | tTDLSLinkEstablishedType halSetTDLSLinkEstablishParams; |
| 12347 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12348 | |
| 12349 | /*------------------------------------------------------------------------- |
| 12350 | Sanity check |
| 12351 | -------------------------------------------------------------------------*/ |
| 12352 | if (( NULL == pEventData ) || |
| 12353 | ( NULL == pEventData->pEventData) || |
| 12354 | ( NULL == pEventData->pCBfnc)) |
| 12355 | { |
| 12356 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12357 | "%s: Invalid parameters", __func__); |
| 12358 | WDI_ASSERT(0); |
| 12359 | return WDI_STATUS_E_FAILURE; |
| 12360 | } |
| 12361 | pwdiTDLSLinkEstablishReqParams = |
| 12362 | (WDI_SetTDLSLinkEstablishReqParamsType*)pEventData->pEventData; |
| 12363 | wdiTDLSLinkEstablishReqRspCb = |
| 12364 | (WDI_SetTDLSLinkEstablishReqParamsRspCb)pEventData->pCBfnc; |
| 12365 | |
| 12366 | |
| 12367 | /*----------------------------------------------------------------------- |
| 12368 | Get message buffer |
| 12369 | -----------------------------------------------------------------------*/ |
| 12370 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 12371 | WDI_TDLS_LINK_ESTABLISH_REQ, |
| 12372 | sizeof(halSetTDLSLinkEstablishParams), |
| 12373 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12374 | ( usSendSize < (usDataOffset + sizeof(halSetTDLSLinkEstablishParams) ))) |
| 12375 | { |
| 12376 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12377 | "Unable to get send buffer in set P2P GO NOA REQ %x %x %x", |
| 12378 | pEventData, pwdiTDLSLinkEstablishReqParams, wdiTDLSLinkEstablishReqRspCb); |
| 12379 | WDI_ASSERT(0); |
| 12380 | return WDI_STATUS_E_FAILURE; |
| 12381 | } |
| 12382 | |
| 12383 | halSetTDLSLinkEstablishParams.staIdx = |
| 12384 | pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uStaIdx; |
| 12385 | halSetTDLSLinkEstablishParams.bIsResponder = |
| 12386 | pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uIsResponder; |
| 12387 | halSetTDLSLinkEstablishParams.acVOUAPSDFlag = |
| 12388 | (pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uUapsdQueues & 0x08) >> 3; |
| 12389 | halSetTDLSLinkEstablishParams.acVIUAPSDFlag = |
| 12390 | (pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uUapsdQueues & 0x04) >> 2; |
| 12391 | halSetTDLSLinkEstablishParams.acBKUAPSDFlag = |
| 12392 | (pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uUapsdQueues & 0x02) >> 1; |
| 12393 | halSetTDLSLinkEstablishParams.acBEUAPSDFlag = |
| 12394 | pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uUapsdQueues & 0x01; |
| 12395 | halSetTDLSLinkEstablishParams.aAck = 0; |
| 12396 | halSetTDLSLinkEstablishParams.maxServicePeriodLength = (pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uMaxSp & 0x03); |
| 12397 | halSetTDLSLinkEstablishParams.moreDataAck = 0; |
| 12398 | halSetTDLSLinkEstablishParams.TPUBufferStaSupport = pwdiTDLSLinkEstablishReqParams->wdiTDLSLinkEstablishInfo.uIsBufSta; |
| 12399 | |
| 12400 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12401 | &halSetTDLSLinkEstablishParams, |
| 12402 | sizeof(halSetTDLSLinkEstablishParams)); |
| 12403 | |
| 12404 | pWDICtx->wdiReqStatusCB = pwdiTDLSLinkEstablishReqParams->wdiReqStatusCB; |
| 12405 | pWDICtx->pReqStatusUserData = pwdiTDLSLinkEstablishReqParams->pUserData; |
| 12406 | |
| 12407 | /*------------------------------------------------------------------------- |
| 12408 | Send Update Probe Resp Template Request to HAL |
| 12409 | -------------------------------------------------------------------------*/ |
| 12410 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12411 | wdiTDLSLinkEstablishReqRspCb, pEventData->pUserData, |
| 12412 | WDI_TDLS_LINK_ESTABLISH_REQ_RESP); |
| 12413 | return 0; |
| 12414 | }/*WDI_ProcessTdlsLinkEstablishReq*/ |
| 12415 | |
| 12416 | |
| 12417 | #endif |
| 12418 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12419 | |
| 12420 | |
| 12421 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12422 | @brief Function to handle the ack from DXE once the power |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12423 | state is set. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12424 | @param None |
| 12425 | |
| 12426 | @see |
| 12427 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12428 | */ |
| 12429 | void |
| 12430 | WDI_SetPowerStateCb |
| 12431 | ( |
| 12432 | wpt_status status, |
| 12433 | unsigned int dxePhyAddr, |
| 12434 | void *pContext |
| 12435 | ) |
| 12436 | { |
| 12437 | wpt_status wptStatus; |
| 12438 | WDI_ControlBlockType *pCB = NULL; |
| 12439 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 12440 | if(eWLAN_PAL_STATUS_E_FAILURE == status ) |
| 12441 | { |
| 12442 | //it shouldn't happen, put an error msg |
| 12443 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12444 | /* |
| 12445 | * Trigger the event to bring the Enter BMPS req function to come |
| 12446 | * out of wait |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12447 | */ |
| 12448 | if( NULL != pContext ) |
| 12449 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12450 | pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12451 | } |
| 12452 | else |
| 12453 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12454 | //put an error msg |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12455 | pCB = &gWDICb; |
| 12456 | } |
| 12457 | pCB->dxePhyAddr = dxePhyAddr; |
| 12458 | wptStatus = wpalEventSet(&pCB->setPowerStateEvent); |
| 12459 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 12460 | { |
| 12461 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12462 | "Failed to set an event"); |
| 12463 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12464 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12465 | } |
| 12466 | return; |
| 12467 | } |
| 12468 | |
| 12469 | |
| 12470 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12471 | @brief Process Enter IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12472 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12473 | |
| 12474 | @param pWDICtx: pointer to the WLAN DAL context |
| 12475 | pEventData: pointer to the event information structure |
| 12476 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12477 | @see |
| 12478 | @return Result of the function call |
| 12479 | */ |
| 12480 | WDI_Status |
| 12481 | WDI_ProcessEnterImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12482 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12483 | WDI_ControlBlockType* pWDICtx, |
| 12484 | WDI_EventInfoType* pEventData |
| 12485 | ) |
| 12486 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12487 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12488 | WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12489 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12490 | wpt_uint16 usDataOffset = 0; |
| 12491 | wpt_uint16 usSendSize = 0; |
| 12492 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12493 | |
| 12494 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12495 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12496 | -------------------------------------------------------------------------*/ |
| 12497 | if (( NULL == pEventData ) || |
| 12498 | ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc))) |
| 12499 | { |
| 12500 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12501 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12502 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12503 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12504 | } |
| 12505 | |
| 12506 | /*----------------------------------------------------------------------- |
| 12507 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12508 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12509 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12510 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12511 | 0, |
| 12512 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12513 | ( usSendSize < (usDataOffset ))) |
| 12514 | { |
| 12515 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12516 | "Unable to get send buffer in Enter IMPS req %x %x", |
| 12517 | pEventData, wdiEnterImpsRspCb); |
| 12518 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12519 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12520 | } |
| 12521 | |
| 12522 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12523 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 12524 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12525 | { |
| 12526 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12527 | "WDI Init failed to reset an event"); |
| 12528 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12529 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12530 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12531 | } |
| 12532 | |
| 12533 | // notify DTS that we are entering IMPS |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12534 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb); |
| 12535 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) { |
| 12536 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 12537 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering IMPS\n", wptStatus); |
| 12538 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12539 | goto fail; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12540 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12541 | |
| 12542 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12543 | * Wait for the event to be set once the ACK comes back from DXE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12544 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12545 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 12546 | WDI_SET_POWER_STATE_TIMEOUT); |
| 12547 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12548 | { |
| 12549 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12550 | "WDI Init failed to wait on an event"); |
| 12551 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12552 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12553 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12554 | } |
| 12555 | |
| 12556 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12557 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12558 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12559 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12560 | wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12561 | |
| 12562 | fail: |
| 12563 | // Release the message buffer so we don't leak |
| 12564 | wpalMemoryFree(pSendBuffer); |
| 12565 | |
| 12566 | failRequest: |
| 12567 | //WDA should have failure check to avoid the memory leak |
| 12568 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12569 | }/*WDI_ProcessEnterImpsReq*/ |
| 12570 | |
| 12571 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12572 | @brief Process Exit IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12573 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12574 | |
| 12575 | @param pWDICtx: pointer to the WLAN DAL context |
| 12576 | pEventData: pointer to the event information structure |
| 12577 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12578 | @see |
| 12579 | @return Result of the function call |
| 12580 | */ |
| 12581 | WDI_Status |
| 12582 | WDI_ProcessExitImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12583 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12584 | WDI_ControlBlockType* pWDICtx, |
| 12585 | WDI_EventInfoType* pEventData |
| 12586 | ) |
| 12587 | { |
| 12588 | WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12589 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12590 | wpt_uint16 usDataOffset = 0; |
| 12591 | wpt_uint16 usSendSize = 0; |
| 12592 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12593 | |
| 12594 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12595 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12596 | -------------------------------------------------------------------------*/ |
| 12597 | if (( NULL == pEventData ) || |
| 12598 | ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc))) |
| 12599 | { |
| 12600 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12601 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12602 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12603 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12604 | } |
| 12605 | |
| 12606 | /*----------------------------------------------------------------------- |
| 12607 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12608 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12609 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12610 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12611 | 0, |
| 12612 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12613 | ( usSendSize < (usDataOffset ))) |
| 12614 | { |
| 12615 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12616 | "Unable to get send buffer in Exit IMPS req %x %x", |
| 12617 | pEventData, wdiExitImpsRspCb); |
| 12618 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12619 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12620 | } |
| 12621 | |
| 12622 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12623 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12624 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12625 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12626 | wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12627 | }/*WDI_ProcessExitImpsReq*/ |
| 12628 | |
| 12629 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12630 | @brief Process Enter BMPS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12631 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12632 | |
| 12633 | @param pWDICtx: pointer to the WLAN DAL context |
| 12634 | pEventData: pointer to the event information structure |
| 12635 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12636 | @see |
| 12637 | @return Result of the function call |
| 12638 | */ |
| 12639 | WDI_Status |
| 12640 | WDI_ProcessEnterBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12641 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12642 | WDI_ControlBlockType* pWDICtx, |
| 12643 | WDI_EventInfoType* pEventData |
| 12644 | ) |
| 12645 | { |
| 12646 | WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL; |
| 12647 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12648 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12649 | wpt_uint16 usDataOffset = 0; |
| 12650 | wpt_uint16 usSendSize = 0; |
| 12651 | tHalEnterBmpsReqParams enterBmpsReq; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12652 | wpt_status wptStatus; |
| 12653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12654 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12655 | |
| 12656 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12657 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12658 | -------------------------------------------------------------------------*/ |
| 12659 | if (( NULL == pEventData ) || |
| 12660 | ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) || |
| 12661 | ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc))) |
| 12662 | { |
| 12663 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12664 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12665 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12666 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12667 | } |
| 12668 | |
| 12669 | /*----------------------------------------------------------------------- |
| 12670 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12671 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12672 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12673 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12674 | sizeof(enterBmpsReq), |
| 12675 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12676 | ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) ))) |
| 12677 | { |
| 12678 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12679 | "Unable to get send buffer in Enter BMPS req %x %x %x", |
| 12680 | pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb); |
| 12681 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12682 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12683 | } |
| 12684 | |
| 12685 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12686 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 12687 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12688 | { |
| 12689 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12690 | "WDI Init failed to reset an event"); |
| 12691 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12692 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12693 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12694 | } |
| 12695 | |
| 12696 | // notify DTS that we are entering BMPS |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12697 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb); |
| 12698 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 12699 | { |
| 12700 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 12701 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that we are entering BMPS\n", wptStatus); |
| 12702 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12703 | goto fail; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12704 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12705 | |
| 12706 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12707 | * Wait for the event to be set once the ACK comes back from DXE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12708 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12709 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 12710 | WDI_SET_POWER_STATE_TIMEOUT); |
| 12711 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12712 | { |
| 12713 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12714 | "WDI Init failed to wait on an event"); |
| 12715 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12716 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12717 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12718 | } |
| 12719 | |
| 12720 | pWDICtx->bInBmps = eWLAN_PAL_TRUE; |
| 12721 | |
| 12722 | enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx; |
| 12723 | enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt; |
| 12724 | enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount; |
| 12725 | enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod; |
| 12726 | |
| 12727 | // For CCX and 11R Roaming |
| 12728 | enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod; |
| 12729 | enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage; |
| 12730 | enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable; |
| 12731 | |
| 12732 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12733 | &enterBmpsReq, |
| 12734 | sizeof(enterBmpsReq)); |
| 12735 | |
| 12736 | pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12737 | pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12738 | |
| 12739 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12740 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12741 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12742 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12743 | wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12744 | |
| 12745 | fail: |
| 12746 | // Release the message buffer so we don't leak |
| 12747 | wpalMemoryFree(pSendBuffer); |
| 12748 | |
| 12749 | failRequest: |
| 12750 | //WDA should have failure check to avoid the memory leak |
| 12751 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12752 | }/*WDI_ProcessEnterBmpsReq*/ |
| 12753 | |
| 12754 | /** |
| 12755 | @brief Process Exit BMPS Request function (called when Main FSM |
| 12756 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12757 | |
| 12758 | @param pWDICtx: pointer to the WLAN DAL context |
| 12759 | pEventData: pointer to the event information structure |
| 12760 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12761 | @see |
| 12762 | @return Result of the function call |
| 12763 | */ |
| 12764 | WDI_Status |
| 12765 | WDI_ProcessExitBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12766 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12767 | WDI_ControlBlockType* pWDICtx, |
| 12768 | WDI_EventInfoType* pEventData |
| 12769 | ) |
| 12770 | { |
| 12771 | WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL; |
| 12772 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12773 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12774 | wpt_uint16 usDataOffset = 0; |
| 12775 | wpt_uint16 usSendSize = 0; |
| 12776 | tHalExitBmpsReqParams exitBmpsReq; |
| 12777 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12778 | |
| 12779 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12780 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12781 | -------------------------------------------------------------------------*/ |
| 12782 | if (( NULL == pEventData ) || |
| 12783 | ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) || |
| 12784 | ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc))) |
| 12785 | { |
| 12786 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12787 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12788 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12789 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12790 | } |
| 12791 | |
| 12792 | /*----------------------------------------------------------------------- |
| 12793 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12794 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12795 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12796 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12797 | sizeof(exitBmpsReq), |
| 12798 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12799 | ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) ))) |
| 12800 | { |
| 12801 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12802 | "Unable to get send buffer in Exit BMPS req %x %x %x", |
| 12803 | pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb); |
| 12804 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12805 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12806 | } |
| 12807 | exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull; |
| 12808 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12809 | exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx; |
| 12810 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12811 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12812 | &exitBmpsReq, |
| 12813 | sizeof(exitBmpsReq)); |
| 12814 | |
| 12815 | pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12816 | pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12817 | |
| 12818 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12819 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12820 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12821 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12822 | wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12823 | }/*WDI_ProcessExitBmpsReq*/ |
| 12824 | |
| 12825 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12826 | @brief Process Enter UAPSD Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12827 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12828 | |
| 12829 | @param pWDICtx: pointer to the WLAN DAL context |
| 12830 | pEventData: pointer to the event information structure |
| 12831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12832 | @see |
| 12833 | @return Result of the function call |
| 12834 | */ |
| 12835 | WDI_Status |
| 12836 | WDI_ProcessEnterUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12837 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12838 | WDI_ControlBlockType* pWDICtx, |
| 12839 | WDI_EventInfoType* pEventData |
| 12840 | ) |
| 12841 | { |
| 12842 | WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL; |
| 12843 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12844 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12845 | wpt_uint16 usDataOffset = 0; |
| 12846 | wpt_uint16 usSendSize = 0; |
| 12847 | tUapsdReqParams enterUapsdReq; |
| 12848 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12849 | |
| 12850 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12851 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12852 | -------------------------------------------------------------------------*/ |
| 12853 | if (( NULL == pEventData ) || |
| 12854 | ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) || |
| 12855 | ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc))) |
| 12856 | { |
| 12857 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12858 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12859 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12860 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12861 | } |
| 12862 | |
| 12863 | /*----------------------------------------------------------------------- |
| 12864 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12865 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12866 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12867 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12868 | sizeof(enterUapsdReq), |
| 12869 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12870 | ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) ))) |
| 12871 | { |
| 12872 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12873 | "Unable to get send buffer in Enter UAPSD req %x %x %x", |
| 12874 | pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb); |
| 12875 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12876 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12877 | } |
| 12878 | |
| 12879 | enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled; |
| 12880 | enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled; |
| 12881 | enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled; |
| 12882 | enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled; |
| 12883 | enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled; |
| 12884 | enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled; |
| 12885 | enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled; |
| 12886 | enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12887 | enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12888 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12889 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12890 | &enterUapsdReq, |
| 12891 | sizeof(enterUapsdReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12892 | |
| 12893 | pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12894 | pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12895 | |
| 12896 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12897 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12898 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12899 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12900 | wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12901 | }/*WDI_ProcessEnterUapsdReq*/ |
| 12902 | |
| 12903 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12904 | @brief Process Exit UAPSD Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12905 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12906 | |
| 12907 | @param pWDICtx: pointer to the WLAN DAL context |
| 12908 | pEventData: pointer to the event information structure |
| 12909 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12910 | @see |
| 12911 | @return Result of the function call |
| 12912 | */ |
| 12913 | WDI_Status |
| 12914 | WDI_ProcessExitUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12915 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12916 | WDI_ControlBlockType* pWDICtx, |
| 12917 | WDI_EventInfoType* pEventData |
| 12918 | ) |
| 12919 | { |
| 12920 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12921 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12922 | wpt_uint16 usDataOffset = 0; |
| 12923 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12924 | WDI_ExitUapsdReqParamsType *pExitUapsdparams; |
| 12925 | wpt_uint8 bssIdx = 0; |
| 12926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12927 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12928 | |
| 12929 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12930 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12931 | -------------------------------------------------------------------------*/ |
| 12932 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12933 | ( NULL == (pExitUapsdparams = (WDI_ExitUapsdReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12934 | ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc))) |
| 12935 | { |
| 12936 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12937 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12938 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12939 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12940 | } |
| 12941 | |
| 12942 | /*----------------------------------------------------------------------- |
| 12943 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12944 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12945 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12946 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12947 | sizeof(wpt_uint8), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12948 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12949 | ( usSendSize < (usDataOffset + sizeof(wpt_uint8)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12950 | { |
| 12951 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12952 | "Unable to get send buffer in Exit UAPSD req %x %x", |
| 12953 | pEventData, wdiExitUapsdRspCb); |
| 12954 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12955 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12956 | } |
| 12957 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12958 | bssIdx = pExitUapsdparams->wdiExitUapsdInfo.bssIdx; |
| 12959 | |
| 12960 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12961 | &bssIdx, |
| 12962 | sizeof(wpt_uint8)); |
| 12963 | |
| 12964 | pWDICtx->wdiReqStatusCB = pExitUapsdparams->wdiReqStatusCB; |
| 12965 | pWDICtx->pReqStatusUserData = pExitUapsdparams->pUserData; |
| 12966 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12967 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12968 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12969 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12970 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12971 | wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12972 | }/*WDI_ProcessExitUapsdReq*/ |
| 12973 | |
| 12974 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12975 | @brief Process Set UAPSD params Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12976 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12977 | |
| 12978 | @param pWDICtx: pointer to the WLAN DAL context |
| 12979 | pEventData: pointer to the event information structure |
| 12980 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12981 | @see |
| 12982 | @return Result of the function call |
| 12983 | */ |
| 12984 | WDI_Status |
| 12985 | WDI_ProcessSetUapsdAcParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12986 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12987 | WDI_ControlBlockType* pWDICtx, |
| 12988 | WDI_EventInfoType* pEventData |
| 12989 | ) |
| 12990 | { |
| 12991 | WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL; |
| 12992 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12993 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12994 | wpt_uint16 usDataOffset = 0; |
| 12995 | wpt_uint16 usSendSize = 0; |
| 12996 | tUapsdInfo uapsdAcParamsReq; |
| 12997 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12998 | |
| 12999 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13000 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13001 | -------------------------------------------------------------------------*/ |
| 13002 | if (( NULL == pEventData ) || |
| 13003 | ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) || |
| 13004 | ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc))) |
| 13005 | { |
| 13006 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13007 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13008 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13009 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13010 | } |
| 13011 | |
| 13012 | /*----------------------------------------------------------------------- |
| 13013 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13014 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13015 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13016 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13017 | sizeof(uapsdAcParamsReq), |
| 13018 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13019 | ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) ))) |
| 13020 | { |
| 13021 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13022 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 13023 | pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb); |
| 13024 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13025 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13026 | } |
| 13027 | |
| 13028 | uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc; |
| 13029 | uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx; |
| 13030 | uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp; |
| 13031 | uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval; |
| 13032 | uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval; |
| 13033 | uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval; |
| 13034 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13035 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13036 | &uapsdAcParamsReq, |
| 13037 | sizeof(uapsdAcParamsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13038 | |
| 13039 | pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13040 | pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13041 | |
| 13042 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13043 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13044 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13045 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13046 | wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13047 | }/*WDI_ProcessSetUapsdAcParamsReq*/ |
| 13048 | |
| 13049 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13050 | @brief Process update UAPSD params Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13051 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13052 | |
| 13053 | @param pWDICtx: pointer to the WLAN DAL context |
| 13054 | pEventData: pointer to the event information structure |
| 13055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13056 | @see |
| 13057 | @return Result of the function call |
| 13058 | */ |
| 13059 | WDI_Status |
| 13060 | WDI_ProcessUpdateUapsdParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13061 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13062 | WDI_ControlBlockType* pWDICtx, |
| 13063 | WDI_EventInfoType* pEventData |
| 13064 | ) |
| 13065 | { |
| 13066 | WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL; |
| 13067 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13068 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13069 | wpt_uint16 usDataOffset = 0; |
| 13070 | wpt_uint16 usSendSize = 0; |
| 13071 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13072 | |
| 13073 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13074 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13075 | -------------------------------------------------------------------------*/ |
| 13076 | if (( NULL == pEventData ) || |
| 13077 | ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) || |
| 13078 | ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc))) |
| 13079 | { |
| 13080 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13081 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13082 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13083 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13084 | } |
| 13085 | |
| 13086 | /*----------------------------------------------------------------------- |
| 13087 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13088 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13089 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13090 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13091 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo), |
| 13092 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13093 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) ))) |
| 13094 | { |
| 13095 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13096 | "Unable to get send buffer in Update UAPSD params req %x %x %x", |
| 13097 | pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb); |
| 13098 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13099 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13100 | } |
| 13101 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13102 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13103 | &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo, |
| 13104 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13105 | |
| 13106 | pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13107 | pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13108 | |
| 13109 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13110 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13111 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13112 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13113 | wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13114 | }/*WDI_ProcessUpdateUapsdParamsReq*/ |
| 13115 | |
| 13116 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13117 | @brief Process Configure RXP filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13118 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13119 | |
| 13120 | @param pWDICtx: pointer to the WLAN DAL context |
| 13121 | pEventData: pointer to the event information structure |
| 13122 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13123 | @see |
| 13124 | @return Result of the function call |
| 13125 | */ |
| 13126 | WDI_Status |
| 13127 | WDI_ProcessConfigureRxpFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13128 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13129 | WDI_ControlBlockType* pWDICtx, |
| 13130 | WDI_EventInfoType* pEventData |
| 13131 | ) |
| 13132 | { |
| 13133 | WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL; |
| 13134 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13135 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13136 | wpt_uint16 usDataOffset = 0; |
| 13137 | wpt_uint16 usSendSize = 0; |
| 13138 | tHalConfigureRxpFilterReqParams halRxpFilterParams; |
| 13139 | |
| 13140 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13141 | |
| 13142 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13143 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13144 | -------------------------------------------------------------------------*/ |
| 13145 | if (( NULL == pEventData ) || |
| 13146 | ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) || |
| 13147 | ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc))) |
| 13148 | { |
| 13149 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13150 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13151 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13152 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13153 | } |
| 13154 | |
| 13155 | /*----------------------------------------------------------------------- |
| 13156 | Get message buffer |
| 13157 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13158 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13159 | sizeof(halRxpFilterParams), |
| 13160 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13161 | ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) ))) |
| 13162 | { |
| 13163 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13164 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 13165 | pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb); |
| 13166 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13167 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13168 | } |
| 13169 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13170 | halRxpFilterParams.setMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13171 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13172 | halRxpFilterParams.setMcstBcstFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13173 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter; |
| 13174 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13175 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13176 | &halRxpFilterParams, |
| 13177 | sizeof(halRxpFilterParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13178 | |
| 13179 | pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13180 | pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13181 | |
| 13182 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13183 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13184 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13185 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13186 | wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13187 | }/*WDI_ProcessConfigureRxpFilterReq*/ |
| 13188 | |
| 13189 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13190 | @brief Process set beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13191 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13192 | |
| 13193 | @param pWDICtx: pointer to the WLAN DAL context |
| 13194 | pEventData: pointer to the event information structure |
| 13195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13196 | @see |
| 13197 | @return Result of the function call |
| 13198 | */ |
| 13199 | WDI_Status |
| 13200 | WDI_ProcessSetBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13201 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13202 | WDI_ControlBlockType* pWDICtx, |
| 13203 | WDI_EventInfoType* pEventData |
| 13204 | ) |
| 13205 | { |
| 13206 | WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 13207 | WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13208 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13209 | wpt_uint16 usDataOffset = 0; |
| 13210 | wpt_uint16 usSendSize = 0; |
| 13211 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13212 | |
| 13213 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13214 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13215 | -------------------------------------------------------------------------*/ |
| 13216 | if (( NULL == pEventData ) || |
| 13217 | ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 13218 | ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc))) |
| 13219 | { |
| 13220 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13221 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13222 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13223 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13224 | } |
| 13225 | |
| 13226 | /*----------------------------------------------------------------------- |
| 13227 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13228 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13229 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13230 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13231 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe), |
| 13232 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13233 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 13234 | { |
| 13235 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13236 | "Unable to get send buffer in Set beacon filter req %x %x %x", |
| 13237 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 13238 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13239 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13240 | } |
| 13241 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13242 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13243 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 13244 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
| 13245 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 13246 | &pwdiBeaconFilterParams->aFilters[0], |
| 13247 | pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13248 | |
| 13249 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13250 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13251 | |
| 13252 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13253 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13254 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13255 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13256 | wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13257 | }/*WDI_ProcessSetBeaconFilterReq*/ |
| 13258 | |
| 13259 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13260 | @brief Process remove beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13261 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13262 | |
| 13263 | @param pWDICtx: pointer to the WLAN DAL context |
| 13264 | pEventData: pointer to the event information structure |
| 13265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13266 | @see |
| 13267 | @return Result of the function call |
| 13268 | */ |
| 13269 | WDI_Status |
| 13270 | WDI_ProcessRemBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13271 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13272 | WDI_ControlBlockType* pWDICtx, |
| 13273 | WDI_EventInfoType* pEventData |
| 13274 | ) |
| 13275 | { |
| 13276 | WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 13277 | WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13278 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13279 | wpt_uint16 usDataOffset = 0; |
| 13280 | wpt_uint16 usSendSize = 0; |
| 13281 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13282 | |
| 13283 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13284 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13285 | -------------------------------------------------------------------------*/ |
| 13286 | if (( NULL == pEventData ) || |
| 13287 | ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 13288 | ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc))) |
| 13289 | { |
| 13290 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13291 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13292 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13293 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13294 | } |
| 13295 | |
| 13296 | /*----------------------------------------------------------------------- |
| 13297 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13298 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13299 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13300 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13301 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 13302 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13303 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 13304 | { |
| 13305 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13306 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 13307 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 13308 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13309 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13310 | } |
| 13311 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13312 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13313 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 13314 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13315 | |
| 13316 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13317 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13318 | |
| 13319 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13320 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13321 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13322 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13323 | wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13324 | } |
| 13325 | |
| 13326 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13327 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13328 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13329 | |
| 13330 | @param pWDICtx: pointer to the WLAN DAL context |
| 13331 | pEventData: pointer to the event information structure |
| 13332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13333 | @see |
| 13334 | @return Result of the function call |
| 13335 | */ |
| 13336 | WDI_Status |
| 13337 | WDI_ProcessSetRSSIThresholdsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13338 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13339 | WDI_ControlBlockType* pWDICtx, |
| 13340 | WDI_EventInfoType* pEventData |
| 13341 | ) |
| 13342 | { |
| 13343 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL; |
| 13344 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13345 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13346 | wpt_uint16 usDataOffset = 0; |
| 13347 | wpt_uint16 usSendSize = 0; |
| 13348 | tHalRSSIThresholds rssiThresholdsReq; |
| 13349 | WDI_Status ret_status = 0; |
| 13350 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13351 | |
| 13352 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13353 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13354 | -------------------------------------------------------------------------*/ |
| 13355 | if (( NULL == pEventData ) || |
| 13356 | ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) || |
| 13357 | ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc))) |
| 13358 | { |
| 13359 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13360 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13361 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13362 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13363 | } |
| 13364 | |
| 13365 | /*----------------------------------------------------------------------- |
| 13366 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13367 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13368 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13369 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13370 | sizeof(rssiThresholdsReq), |
| 13371 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13372 | ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) ))) |
| 13373 | { |
| 13374 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13375 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 13376 | pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb); |
| 13377 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13378 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13379 | } |
| 13380 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13381 | rssiThresholdsReq.bReserved10 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13382 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13383 | rssiThresholdsReq.bRssiThres1NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13384 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13385 | rssiThresholdsReq.bRssiThres1PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13386 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13387 | rssiThresholdsReq.bRssiThres2NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13388 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13389 | rssiThresholdsReq.bRssiThres2PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13390 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13391 | rssiThresholdsReq.bRssiThres3NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13392 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13393 | rssiThresholdsReq.bRssiThres3PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13394 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13395 | rssiThresholdsReq.ucRssiThreshold1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13396 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13397 | rssiThresholdsReq.ucRssiThreshold2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13398 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13399 | rssiThresholdsReq.ucRssiThreshold3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13400 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3; |
| 13401 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13402 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13403 | &rssiThresholdsReq, |
| 13404 | sizeof(rssiThresholdsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13405 | |
| 13406 | pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13407 | pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13408 | |
| 13409 | /*------------------------------------------------------------------------- |
| 13410 | Send Set threshold req to HAL |
| 13411 | -------------------------------------------------------------------------*/ |
| 13412 | if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13413 | wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS) |
| 13414 | { |
| 13415 | // When we are in idle state WDI_STARTED_ST and we receive indication for threshold |
| 13416 | // req. Then as a result of processing the threshold cross ind, we trigger |
| 13417 | // a Set threshold req, then we need to indicate to WDI that it needs to |
| 13418 | // go to busy state as a result of the indication as we sent a req in the |
| 13419 | // same WDI context. |
| 13420 | // Hence expected state transition is to busy. |
| 13421 | pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST; |
| 13422 | } |
| 13423 | |
| 13424 | return ret_status; |
| 13425 | } |
| 13426 | |
| 13427 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13428 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13429 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13430 | |
| 13431 | @param pWDICtx: pointer to the WLAN DAL context |
| 13432 | pEventData: pointer to the event information structure |
| 13433 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13434 | @see |
| 13435 | @return Result of the function call |
| 13436 | */ |
| 13437 | WDI_Status |
| 13438 | WDI_ProcessHostOffloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13439 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13440 | WDI_ControlBlockType* pWDICtx, |
| 13441 | WDI_EventInfoType* pEventData |
| 13442 | ) |
| 13443 | { |
| 13444 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL; |
| 13445 | WDI_HostOffloadCb wdiHostOffloadCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13446 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13447 | wpt_uint16 usDataOffset = 0; |
| 13448 | wpt_uint16 usSendSize = 0; |
| 13449 | tHalHostOffloadReq hostOffloadParams; |
| 13450 | tHalNSOffloadParams nsOffloadParams; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13451 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13452 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13453 | |
| 13454 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13455 | |
| 13456 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13457 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13458 | -------------------------------------------------------------------------*/ |
| 13459 | if (( NULL == pEventData ) || |
| 13460 | ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) || |
| 13461 | ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc))) |
| 13462 | { |
| 13463 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13464 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13465 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13466 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13467 | } |
| 13468 | |
| 13469 | /*----------------------------------------------------------------------- |
| 13470 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13471 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13472 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13473 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13474 | sizeof(hostOffloadParams)+sizeof(nsOffloadParams), |
| 13475 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13476 | ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) ))) |
| 13477 | { |
| 13478 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13479 | "Unable to get send buffer in host offload req %x %x %x", |
| 13480 | pEventData, pwdiHostOffloadParams, wdiHostOffloadCb); |
| 13481 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13482 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13483 | } |
| 13484 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13485 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13486 | pwdiHostOffloadParams->wdiHostOffloadInfo.bssId, |
| 13487 | &pBSSSes); |
| 13488 | if ( NULL == pBSSSes ) |
| 13489 | { |
| 13490 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Gopichand Nakkala | c8c7121 | 2013-05-29 18:53:35 +0530 | [diff] [blame] | 13491 | " %s : Association for this BSSID does not exist " MAC_ADDRESS_STR, |
| 13492 | __func__, MAC_ADDR_ARRAY(pwdiHostOffloadParams->wdiHostOffloadInfo.bssId)); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13493 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13494 | } |
| 13495 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13496 | hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType; |
| 13497 | hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13498 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13499 | if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType ) |
| 13500 | { |
| 13501 | // ARP Offload |
| 13502 | wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr, |
| 13503 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr, |
| 13504 | 4); |
| 13505 | } |
| 13506 | else |
| 13507 | { |
| 13508 | // NS Offload |
| 13509 | wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr, |
| 13510 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 13511 | 16); |
| 13512 | |
| 13513 | #ifdef WLAN_NS_OFFLOAD |
| 13514 | // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams |
| 13515 | wpalMemoryCopy(nsOffloadParams.srcIPv6Addr, |
| 13516 | pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr, |
| 13517 | 16); |
| 13518 | wpalMemoryCopy(nsOffloadParams.selfIPv6Addr, |
| 13519 | pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr, |
| 13520 | 16); |
| 13521 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1, |
| 13522 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1, |
| 13523 | 16); |
| 13524 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2, |
| 13525 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2, |
| 13526 | 16); |
| 13527 | wpalMemoryCopy(nsOffloadParams.selfMacAddr, |
| 13528 | pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr, |
| 13529 | 6); |
Gopichand Nakkala | 0616f59 | 2013-06-11 12:45:54 +0530 | [diff] [blame] | 13530 | nsOffloadParams.srcIPv6AddrValid = |
| 13531 | pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid; |
| 13532 | |
| 13533 | nsOffloadParams.targetIPv6Addr1Valid = |
| 13534 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid; |
| 13535 | |
| 13536 | nsOffloadParams.targetIPv6Addr2Valid = |
| 13537 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid; |
| 13538 | |
| 13539 | nsOffloadParams.slotIndex = |
| 13540 | pwdiHostOffloadParams->wdiNsOffloadParams.slotIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13542 | #endif // WLAN_NS_OFFLOAD |
| 13543 | } |
| 13544 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13545 | nsOffloadParams.bssIdx = pBSSSes->ucBSSIdx; |
| 13546 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13547 | // copy hostOffloadParams into pSendBuffer |
| 13548 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13549 | &hostOffloadParams, |
| 13550 | sizeof(hostOffloadParams)); |
| 13551 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13552 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13553 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13554 | // copy nsOffloadParams into pSendBuffer |
| 13555 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13556 | &nsOffloadParams, |
| 13557 | sizeof(nsOffloadParams)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13558 | } |
| 13559 | else |
| 13560 | { |
| 13561 | #ifdef WLAN_NS_OFFLOAD |
| 13562 | if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType ) |
| 13563 | { |
| 13564 | // copy nsOffloadParams into pSendBuffer |
| 13565 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
| 13566 | &nsOffloadParams, |
| 13567 | sizeof(nsOffloadParams)); |
| 13568 | } |
| 13569 | #endif |
| 13570 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13571 | |
| 13572 | pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13573 | pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13574 | |
| 13575 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13576 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13577 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13578 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13579 | wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13580 | |
| 13581 | fail: |
| 13582 | // Release the message buffer so we don't leak |
| 13583 | wpalMemoryFree(pSendBuffer); |
| 13584 | |
| 13585 | failRequest: |
| 13586 | //WDA should have failure check to avoid the memory leak |
| 13587 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13588 | }/*WDI_ProcessHostOffloadReq*/ |
| 13589 | |
| 13590 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13591 | @brief Process Keep Alive Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13592 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13593 | |
| 13594 | @param pWDICtx: pointer to the WLAN DAL context |
| 13595 | pEventData: pointer to the event information structure |
| 13596 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13597 | @see |
| 13598 | @return Result of the function call |
| 13599 | */ |
| 13600 | WDI_Status |
| 13601 | WDI_ProcessKeepAliveReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13602 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13603 | WDI_ControlBlockType* pWDICtx, |
| 13604 | WDI_EventInfoType* pEventData |
| 13605 | ) |
| 13606 | { |
| 13607 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL; |
| 13608 | WDI_KeepAliveCb wdiKeepAliveCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13609 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13610 | wpt_uint16 usDataOffset = 0; |
| 13611 | wpt_uint16 usSendSize = 0; |
| 13612 | tHalKeepAliveReq keepAliveReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13613 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13614 | WDI_BSSSessionType* pBSSSes = NULL; |
| 13615 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13616 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13617 | |
| 13618 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13619 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13620 | -------------------------------------------------------------------------*/ |
| 13621 | if (( NULL == pEventData ) || |
| 13622 | ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) || |
| 13623 | ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc))) |
| 13624 | { |
| 13625 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13626 | "Invalid parameters in Keep Alive req"); |
| 13627 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13628 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13629 | } |
| 13630 | |
| 13631 | /*----------------------------------------------------------------------- |
| 13632 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13633 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13634 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13635 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13636 | sizeof(keepAliveReq), |
| 13637 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13638 | ( usSendSize < (usDataOffset + sizeof(keepAliveReq) ))) |
| 13639 | { |
| 13640 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13641 | "Unable to get send buffer in keep alive req %x %x %x", |
| 13642 | pEventData, pwdiKeepAliveParams, wdiKeepAliveCb); |
| 13643 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13644 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13645 | } |
| 13646 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13647 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13648 | pwdiKeepAliveParams->wdiKeepAliveInfo.bssId, |
| 13649 | &pBSSSes); |
| 13650 | if ( NULL == pBSSSes ) |
| 13651 | { |
| 13652 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13653 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13654 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13655 | } |
| 13656 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13657 | keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType; |
| 13658 | keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod; |
| 13659 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13660 | keepAliveReq.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13661 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13662 | if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2) |
| 13663 | { |
| 13664 | wpalMemoryCopy(keepAliveReq.hostIpv4Addr, |
| 13665 | pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr, |
| 13666 | HAL_IPV4_ADDR_LEN); |
| 13667 | wpalMemoryCopy(keepAliveReq.destIpv4Addr, |
| 13668 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13669 | HAL_IPV4_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13670 | wpalMemoryCopy(keepAliveReq.destMacAddr, |
| 13671 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr, |
| 13672 | HAL_MAC_ADDR_LEN); |
| 13673 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13674 | |
| 13675 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13676 | &keepAliveReq, |
| 13677 | sizeof(keepAliveReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13678 | |
| 13679 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 13680 | "Process keep alive req %d",sizeof(keepAliveReq)); |
| 13681 | |
| 13682 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 13683 | "Process keep alive req time period %d",keepAliveReq.timePeriod); |
| 13684 | |
| 13685 | pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13686 | pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13687 | |
| 13688 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 13689 | "Sending keep alive req to HAL"); |
| 13690 | |
| 13691 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13692 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13693 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13694 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13695 | wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13696 | |
| 13697 | fail: |
| 13698 | // Release the message buffer so we don't leak |
| 13699 | wpalMemoryFree(pSendBuffer); |
| 13700 | |
| 13701 | failRequest: |
| 13702 | //WDA should have failure check to avoid the memory leak |
| 13703 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13704 | }/*WDI_ProcessKeepAliveReq*/ |
| 13705 | |
| 13706 | |
| 13707 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13708 | @brief Process Wowl add bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13709 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13710 | |
| 13711 | @param pWDICtx: pointer to the WLAN DAL context |
| 13712 | pEventData: pointer to the event information structure |
| 13713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13714 | @see |
| 13715 | @return Result of the function call |
| 13716 | */ |
| 13717 | WDI_Status |
| 13718 | WDI_ProcessWowlAddBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13719 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13720 | WDI_ControlBlockType* pWDICtx, |
| 13721 | WDI_EventInfoType* pEventData |
| 13722 | ) |
| 13723 | { |
| 13724 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL; |
| 13725 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13726 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13727 | wpt_uint16 usDataOffset = 0; |
| 13728 | wpt_uint16 usSendSize = 0; |
| 13729 | tHalWowlAddBcastPtrn wowlAddBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13730 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13731 | WDI_BSSSessionType* pBSSSes = NULL; |
| 13732 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13733 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13734 | |
| 13735 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13736 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13737 | -------------------------------------------------------------------------*/ |
| 13738 | if (( NULL == pEventData ) || |
| 13739 | ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 13740 | ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc))) |
| 13741 | { |
| 13742 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13743 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13744 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13745 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13746 | } |
| 13747 | |
| 13748 | /*----------------------------------------------------------------------- |
| 13749 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13750 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13751 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13752 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ADD_BC_PTRN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13753 | sizeof(wowlAddBcPtrnReq), |
| 13754 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13755 | ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) ))) |
| 13756 | { |
| 13757 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13758 | "Unable to get send buffer in Wowl add bc ptrn req %x %x %x", |
| 13759 | pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb); |
| 13760 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13761 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13762 | } |
| 13763 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13764 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13765 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.bssId, |
| 13766 | &pBSSSes); |
| 13767 | if ( NULL == pBSSSes ) |
| 13768 | { |
| 13769 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13770 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13771 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13772 | } |
| 13773 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13774 | wowlAddBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13775 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13776 | wowlAddBcPtrnReq.ucPatternByteOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13777 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13778 | wowlAddBcPtrnReq.ucPatternMaskSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13779 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13780 | wowlAddBcPtrnReq.ucPatternSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13781 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize; |
| 13782 | |
| 13783 | if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE) |
| 13784 | { |
| 13785 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 13786 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 13787 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize); |
| 13788 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 13789 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 13790 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize); |
| 13791 | } |
| 13792 | else |
| 13793 | { |
| 13794 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 13795 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 13796 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13797 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 13798 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 13799 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13800 | |
| 13801 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 13802 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 13803 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13804 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 13805 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 13806 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13807 | } |
| 13808 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13809 | wowlAddBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 13810 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13811 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13812 | &wowlAddBcPtrnReq, |
| 13813 | sizeof(wowlAddBcPtrnReq)); |
| 13814 | |
| 13815 | pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13816 | pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13817 | |
| 13818 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13819 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13820 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13821 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13822 | wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13823 | fail: |
| 13824 | // Release the message buffer so we don't leak |
| 13825 | wpalMemoryFree(pSendBuffer); |
| 13826 | |
| 13827 | failRequest: |
| 13828 | //WDA should have failure check to avoid the memory leak |
| 13829 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13830 | }/*WDI_ProcessWowlAddBcPtrnReq*/ |
| 13831 | |
| 13832 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13833 | @brief Process Wowl delete bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13834 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13835 | |
| 13836 | @param pWDICtx: pointer to the WLAN DAL context |
| 13837 | pEventData: pointer to the event information structure |
| 13838 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13839 | @see |
| 13840 | @return Result of the function call |
| 13841 | */ |
| 13842 | WDI_Status |
| 13843 | WDI_ProcessWowlDelBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13844 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13845 | WDI_ControlBlockType* pWDICtx, |
| 13846 | WDI_EventInfoType* pEventData |
| 13847 | ) |
| 13848 | { |
| 13849 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL; |
| 13850 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13851 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13852 | wpt_uint16 usDataOffset = 0; |
| 13853 | wpt_uint16 usSendSize = 0; |
| 13854 | tHalWowlDelBcastPtrn wowlDelBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13855 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13856 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13857 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13858 | |
| 13859 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13860 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13861 | -------------------------------------------------------------------------*/ |
| 13862 | if (( NULL == pEventData ) || |
| 13863 | ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 13864 | ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc))) |
| 13865 | { |
| 13866 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13867 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13868 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13869 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13870 | } |
| 13871 | |
| 13872 | /*----------------------------------------------------------------------- |
| 13873 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13874 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13875 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13876 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_DEL_BC_PTRN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13877 | sizeof(wowlDelBcPtrnReq), |
| 13878 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13879 | ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) ))) |
| 13880 | { |
| 13881 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13882 | "Unable to get send buffer in Wowl del bc ptrn req %x %x %x", |
| 13883 | pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb); |
| 13884 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13885 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13886 | } |
| 13887 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13888 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13889 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.bssId, |
| 13890 | &pBSSSes); |
| 13891 | if ( NULL == pBSSSes ) |
| 13892 | { |
| 13893 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13894 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13895 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13896 | } |
| 13897 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13898 | wowlDelBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13899 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13900 | |
| 13901 | wowlDelBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 13902 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13903 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13904 | &wowlDelBcPtrnReq, |
| 13905 | sizeof(wowlDelBcPtrnReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13906 | |
| 13907 | pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13908 | pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13909 | |
| 13910 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13911 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13912 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13913 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13914 | wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13915 | |
| 13916 | fail: |
| 13917 | // Release the message buffer so we don't leak |
| 13918 | wpalMemoryFree(pSendBuffer); |
| 13919 | |
| 13920 | failRequest: |
| 13921 | //WDA should have failure check to avoid the memory leak |
| 13922 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13923 | }/*WDI_ProcessWowlDelBcPtrnReq*/ |
| 13924 | |
| 13925 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13926 | @brief Process Wowl enter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13927 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13928 | |
| 13929 | @param pWDICtx: pointer to the WLAN DAL context |
| 13930 | pEventData: pointer to the event information structure |
| 13931 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13932 | @see |
| 13933 | @return Result of the function call |
| 13934 | */ |
| 13935 | WDI_Status |
| 13936 | WDI_ProcessWowlEnterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13937 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13938 | WDI_ControlBlockType* pWDICtx, |
| 13939 | WDI_EventInfoType* pEventData |
| 13940 | ) |
| 13941 | { |
| 13942 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL; |
| 13943 | WDI_WowlEnterReqCb wdiWowlEnterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13944 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13945 | wpt_uint16 usDataOffset = 0; |
| 13946 | wpt_uint16 usSendSize = 0; |
| 13947 | tHalWowlEnterParams wowlEnterReq; |
| 13948 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13949 | |
| 13950 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13951 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13952 | -------------------------------------------------------------------------*/ |
| 13953 | if (( NULL == pEventData ) || |
| 13954 | ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) || |
| 13955 | ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc))) |
| 13956 | { |
| 13957 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13958 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13959 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13960 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13961 | } |
| 13962 | |
| 13963 | /*----------------------------------------------------------------------- |
| 13964 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13965 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13966 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13967 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13968 | sizeof(wowlEnterReq), |
| 13969 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13970 | ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) ))) |
| 13971 | { |
| 13972 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13973 | "Unable to get send buffer in Wowl enter req %x %x %x", |
| 13974 | pEventData, pwdiWowlEnterParams, wdiWowlEnterCb); |
| 13975 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13976 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13977 | } |
| 13978 | |
Kumar Anand | 21a2602 | 2013-07-22 14:35:34 -0700 | [diff] [blame^] | 13979 | wpalMemoryZero(&wowlEnterReq, sizeof(tHalWowlEnterParams)); |
| 13980 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13981 | wowlEnterReq.ucMagicPktEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13982 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13983 | wowlEnterReq.ucPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13984 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13985 | wowlEnterReq.ucUcastPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13986 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13987 | wowlEnterReq.ucWowChnlSwitchRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13988 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13989 | wowlEnterReq.ucWowDeauthRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13990 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13991 | wowlEnterReq.ucWowDisassocRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13992 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13993 | wowlEnterReq.ucWowMaxMissedBeacons = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13994 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13995 | wowlEnterReq.ucWowMaxSleepUsec = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13996 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec; |
| 13997 | |
| 13998 | #ifdef WLAN_WAKEUP_EVENTS |
| 13999 | wowlEnterReq.ucWoWEAPIDRequestEnable = |
| 14000 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable; |
| 14001 | |
| 14002 | wowlEnterReq.ucWoWEAPOL4WayEnable = |
| 14003 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable; |
| 14004 | |
| 14005 | wowlEnterReq.ucWowNetScanOffloadMatch = |
| 14006 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch; |
| 14007 | |
| 14008 | wowlEnterReq.ucWowGTKRekeyError = |
| 14009 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError; |
| 14010 | |
| 14011 | wowlEnterReq.ucWoWBSSConnLoss = |
| 14012 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss; |
| 14013 | #endif // WLAN_WAKEUP_EVENTS |
| 14014 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14015 | wowlEnterReq.bssIdx = pwdiWowlEnterParams->wdiWowlEnterInfo.bssIdx; |
| 14016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14017 | wpalMemoryCopy(wowlEnterReq.magicPtrn, |
| 14018 | pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn, |
| 14019 | sizeof(tSirMacAddr)); |
| 14020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14021 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 14022 | &wowlEnterReq, |
| 14023 | sizeof(wowlEnterReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14024 | |
| 14025 | pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14026 | pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14027 | |
| 14028 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14029 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14030 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14031 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 14032 | wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14033 | }/*WDI_ProcessWowlEnterReq*/ |
| 14034 | |
| 14035 | /** |
| 14036 | @brief Process Wowl exit Request function (called when Main FSM |
| 14037 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14038 | |
| 14039 | @param pWDICtx: pointer to the WLAN DAL context |
| 14040 | pEventData: pointer to the event information structure |
| 14041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14042 | @see |
| 14043 | @return Result of the function call |
| 14044 | */ |
| 14045 | WDI_Status |
| 14046 | WDI_ProcessWowlExitReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14047 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14048 | WDI_ControlBlockType* pWDICtx, |
| 14049 | WDI_EventInfoType* pEventData |
| 14050 | ) |
| 14051 | { |
| 14052 | WDI_WowlExitReqCb wdiWowlExitCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14053 | WDI_WowlExitReqParamsType* pwdiWowlExitParams = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14054 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14055 | wpt_uint16 usDataOffset = 0; |
| 14056 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14057 | tHalWowlExitParams wowlExitparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14058 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14059 | |
| 14060 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14061 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14062 | -------------------------------------------------------------------------*/ |
| 14063 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14064 | ( NULL == (pwdiWowlExitParams = (WDI_WowlExitReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14065 | ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc))) |
| 14066 | { |
| 14067 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14068 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14069 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14070 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14071 | } |
| 14072 | |
| 14073 | /*----------------------------------------------------------------------- |
| 14074 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14075 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14076 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14077 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14078 | sizeof(wowlExitparams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14079 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14080 | ( usSendSize < (usDataOffset + sizeof(wowlExitparams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14081 | { |
| 14082 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14083 | "Unable to get send buffer in Wowl Exit req %x %x", |
| 14084 | pEventData, wdiWowlExitCb); |
| 14085 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14086 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14087 | } |
| 14088 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 14089 | wowlExitparams.bssIdx = pwdiWowlExitParams->wdiWowlExitInfo.bssIdx; |
| 14090 | |
| 14091 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 14092 | &wowlExitparams, |
| 14093 | sizeof(wowlExitparams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14094 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14095 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14096 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14097 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 14098 | wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14099 | }/*WDI_ProcessWowlExitReq*/ |
| 14100 | |
| 14101 | /** |
| 14102 | @brief Process Configure Apps Cpu Wakeup State Request function |
| 14103 | (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14104 | |
| 14105 | @param pWDICtx: pointer to the WLAN DAL context |
| 14106 | pEventData: pointer to the event information structure |
| 14107 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14108 | @see |
| 14109 | @return Result of the function call |
| 14110 | */ |
| 14111 | WDI_Status |
| 14112 | WDI_ProcessConfigureAppsCpuWakeupStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14113 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14114 | WDI_ControlBlockType* pWDICtx, |
| 14115 | WDI_EventInfoType* pEventData |
| 14116 | ) |
| 14117 | { |
| 14118 | WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL; |
| 14119 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14120 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14121 | wpt_uint16 usDataOffset = 0; |
| 14122 | wpt_uint16 usSendSize = 0; |
| 14123 | tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams; |
| 14124 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14125 | |
| 14126 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14127 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14128 | -------------------------------------------------------------------------*/ |
| 14129 | if (( NULL == pEventData ) || |
| 14130 | ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) || |
| 14131 | ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc))) |
| 14132 | { |
| 14133 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14134 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14135 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14136 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14137 | } |
| 14138 | |
| 14139 | /*----------------------------------------------------------------------- |
| 14140 | Get message buffer |
| 14141 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14142 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14143 | sizeof(halCfgAppsCpuWakeupStateReqParams), |
| 14144 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 14145 | ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) ))) |
| 14146 | { |
| 14147 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14148 | "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x", |
| 14149 | pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb); |
| 14150 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14151 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14152 | } |
| 14153 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14154 | halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14155 | pwdiAppsCpuWakeupStateParams->bIsAppsAwake; |
| 14156 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14157 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 14158 | &halCfgAppsCpuWakeupStateReqParams, |
| 14159 | sizeof(halCfgAppsCpuWakeupStateReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14160 | |
| 14161 | pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14162 | pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14163 | |
| 14164 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14165 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14166 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14167 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 14168 | wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData, |
| 14169 | WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14170 | }/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/ |
| 14171 | |
| 14172 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 14173 | /** |
| 14174 | @brief Process Aggregated Add TSpec Request function (called when Main FSM |
| 14175 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14176 | |
| 14177 | @param pWDICtx: pointer to the WLAN DAL context |
| 14178 | pEventData: pointer to the event information structure |
| 14179 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14180 | @see |
| 14181 | @return Result of the function call |
| 14182 | */ |
| 14183 | WDI_Status |
| 14184 | WDI_ProcessAggrAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14185 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14186 | WDI_ControlBlockType* pWDICtx, |
| 14187 | WDI_EventInfoType* pEventData |
| 14188 | ) |
| 14189 | { |
| 14190 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams; |
| 14191 | WDI_AggrAddTsRspCb wdiAggrAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14192 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14193 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14194 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14195 | wpt_uint16 usDataOffset = 0; |
| 14196 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14197 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14198 | wpt_macAddr macBSSID; |
| 14199 | tAggrAddTsReq halAggrAddTsReq; |
| 14200 | int i; |
| 14201 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14202 | |
| 14203 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14204 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14205 | -------------------------------------------------------------------------*/ |
| 14206 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 14207 | ( NULL == pEventData->pCBfnc )) |
| 14208 | { |
| 14209 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14210 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14211 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14212 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14213 | } |
| 14214 | wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 ); |
| 14215 | pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData; |
| 14216 | wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc; |
| 14217 | /*------------------------------------------------------------------------- |
| 14218 | Check to see if we are in the middle of an association, if so queue, if |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14219 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14220 | -------------------------------------------------------------------------*/ |
| 14221 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14222 | |
| 14223 | /*------------------------------------------------------------------------ |
| 14224 | Find the BSS for which the request is made and identify WDI session |
| 14225 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14226 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 14227 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14228 | &macBSSID)) |
| 14229 | { |
| 14230 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14231 | "This station does not exist in the WDI Station Table %d"); |
| 14232 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14233 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14234 | } |
| 14235 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14236 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 14237 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14238 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14239 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14240 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 14241 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14242 | |
| 14243 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14244 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14245 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14246 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14247 | /*------------------------------------------------------------------------ |
| 14248 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14249 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14250 | ------------------------------------------------------------------------*/ |
| 14251 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 14252 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14253 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14254 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 14255 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14256 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14257 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14258 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14259 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14260 | } |
| 14261 | |
| 14262 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14263 | /*----------------------------------------------------------------------- |
| 14264 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14265 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14266 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14267 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14268 | sizeof(tAggrAddTsParams), |
| 14269 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 14270 | ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) ))) |
| 14271 | { |
| 14272 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14273 | "Unable to get send buffer in set bss key req %x %x %x", |
| 14274 | pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb); |
| 14275 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14276 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14277 | } |
| 14278 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14279 | halAggrAddTsReq.aggrAddTsParam.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14280 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14281 | halAggrAddTsReq.aggrAddTsParam.tspecIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14282 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx; |
| 14283 | |
| 14284 | for( i = 0; i < WLAN_HAL_MAX_AC; i++ ) |
| 14285 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14286 | halAggrAddTsReq.aggrAddTsParam.tspec[i].type = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14287 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14288 | halAggrAddTsReq.aggrAddTsParam.tspec[i].length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14289 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14290 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14291 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14292 | ackPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14293 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14294 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14295 | accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14296 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14297 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14298 | userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14299 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14300 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14301 | psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14302 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14303 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14304 | aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14305 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14306 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14307 | direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14308 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14309 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14310 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14311 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14312 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14313 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14314 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14315 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14316 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14317 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14318 | |
| 14319 | |
| 14320 | halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14321 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14322 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14323 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14324 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14325 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14326 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14327 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14328 | halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14329 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14330 | halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14331 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14332 | halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14333 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14334 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14335 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14336 | halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14337 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14338 | halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14339 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14340 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14341 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14342 | halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14343 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14344 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14345 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14346 | halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14347 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14348 | halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14349 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime; |
| 14350 | } |
| 14351 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14352 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 14353 | &halAggrAddTsReq, |
| 14354 | sizeof(halAggrAddTsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14355 | |
| 14356 | pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14357 | pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14358 | |
| 14359 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14360 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14361 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14362 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14363 | wdiAggrAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14364 | WDI_AGGR_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14365 | }/*WDI_ProcessAggrAddTSpecReq*/ |
| 14366 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 14367 | |
| 14368 | /** |
| 14369 | @brief Process Shutdown Request function (called when Main FSM |
| 14370 | allows it) |
| 14371 | |
| 14372 | @param pWDICtx: pointer to the WLAN DAL context |
| 14373 | pEventData: pointer to the event information structure |
| 14374 | |
| 14375 | @see |
| 14376 | @return Result of the function call |
| 14377 | */ |
| 14378 | WDI_Status |
| 14379 | WDI_ProcessShutdownReq |
| 14380 | ( |
| 14381 | WDI_ControlBlockType* pWDICtx, |
| 14382 | WDI_EventInfoType* pEventData |
| 14383 | ) |
| 14384 | { |
| 14385 | wpt_status wptStatus; |
| 14386 | |
| 14387 | |
| 14388 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14389 | |
| 14390 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14391 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14392 | -------------------------------------------------------------------------*/ |
| 14393 | if ( NULL == pEventData ) |
| 14394 | { |
| 14395 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14396 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14397 | WDI_ASSERT(0); |
| 14398 | return WDI_STATUS_E_FAILURE; |
| 14399 | } |
| 14400 | |
| 14401 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14402 | |
| 14403 | |
| 14404 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 14405 | /*! TO DO: stop the data services */ |
| 14406 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 14407 | { |
| 14408 | /*Stop the STA Table !UT- check this logic again |
| 14409 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 14410 | WDI_STATableStop(pWDICtx); |
| 14411 | |
| 14412 | /* Stop Transport Driver, DXE */ |
| 14413 | WDTS_Stop(pWDICtx); |
| 14414 | } |
| 14415 | |
| 14416 | /*Clear all pending request*/ |
| 14417 | WDI_ClearPendingRequests(pWDICtx); |
| 14418 | /* Close Data transport*/ |
| 14419 | /* FTM mode does not open Data Path */ |
| 14420 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 14421 | { |
| 14422 | WDTS_Close(pWDICtx); |
| 14423 | } |
| 14424 | /*Close the STA Table !UT- check this logic again*/ |
| 14425 | WDI_STATableClose(pWDICtx); |
| 14426 | /*close the PAL */ |
| 14427 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 14428 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 14429 | { |
| 14430 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14431 | "Failed to wpal Close %d", wptStatus); |
| 14432 | WDI_ASSERT(0); |
| 14433 | } |
| 14434 | |
| 14435 | /*Transition back to init state*/ |
| 14436 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 14437 | |
| 14438 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14439 | |
| 14440 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14441 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14442 | |
| 14443 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14444 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14445 | }/*WDI_ProcessShutdownReq*/ |
| 14446 | |
| 14447 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14448 | Main DAL Control Path Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14449 | ========================================================================*/ |
| 14450 | |
| 14451 | /** |
| 14452 | @brief Process Start Response function (called when a response |
| 14453 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14454 | |
| 14455 | @param pWDICtx: pointer to the WLAN DAL context |
| 14456 | pEventData: pointer to the event information structure |
| 14457 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14458 | @see |
| 14459 | @return Result of the function call |
| 14460 | */ |
| 14461 | WDI_Status |
| 14462 | WDI_ProcessStartRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14463 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14464 | WDI_ControlBlockType* pWDICtx, |
| 14465 | WDI_EventInfoType* pEventData |
| 14466 | ) |
| 14467 | { |
| 14468 | WDI_StartRspParamsType wdiRspParams; |
| 14469 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 14470 | |
| 14471 | tHalMacStartRspParams* startRspParams; |
| 14472 | |
| 14473 | #ifndef HAL_SELF_STA_PER_BSS |
| 14474 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 14475 | #endif |
| 14476 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14477 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14478 | wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14479 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14480 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14481 | -------------------------------------------------------------------------*/ |
| 14482 | if (( NULL == pEventData ) || |
| 14483 | ( NULL == pEventData->pEventData) || |
| 14484 | ( NULL == wdiStartRspCb )) |
| 14485 | { |
| 14486 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14487 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14488 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14489 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14490 | } |
| 14491 | |
| 14492 | /*------------------------------------------------------------------------- |
| 14493 | Extract response and send it to UMAC |
| 14494 | -------------------------------------------------------------------------*/ |
| 14495 | if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize ) |
| 14496 | { |
| 14497 | // not enough data was received |
| 14498 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 14499 | "Invalid response length in Start Resp Expect %x Rcvd %x", |
| 14500 | sizeof(tHalMacStartRspParams), pEventData->uEventDataSize); |
| 14501 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14502 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14503 | } |
| 14504 | |
| 14505 | /*------------------------------------------------------------------------- |
| 14506 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14507 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14508 | -------------------------------------------------------------------------*/ |
| 14509 | startRspParams = (tHalMacStartRspParams *) pEventData->pEventData; |
| 14510 | |
| 14511 | wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids; |
| 14512 | wdiRspParams.ucMaxStations = startRspParams->ucMaxStations; |
| 14513 | wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR; |
| 14514 | wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR; |
| 14515 | wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION; |
| 14516 | wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION; |
| 14517 | wdiRspParams.wlanReportedVersion.major = |
| 14518 | startRspParams->wcnssWlanVersion.major; |
| 14519 | wdiRspParams.wlanReportedVersion.minor = |
| 14520 | startRspParams->wcnssWlanVersion.minor; |
| 14521 | wdiRspParams.wlanReportedVersion.version = |
| 14522 | startRspParams->wcnssWlanVersion.version; |
| 14523 | wdiRspParams.wlanReportedVersion.revision = |
| 14524 | startRspParams->wcnssWlanVersion.revision; |
| 14525 | wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion, |
| 14526 | startRspParams->wcnssCrmVersionString, |
| 14527 | sizeof(wdiRspParams.wcnssSoftwareVersion)); |
| 14528 | wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion, |
| 14529 | startRspParams->wcnssWlanVersionString, |
| 14530 | sizeof(wdiRspParams.wcnssHardwareVersion)); |
| 14531 | wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status); |
| 14532 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 14533 | /*Save the HAL Version*/ |
| 14534 | pWDICtx->wlanVersion = wdiRspParams.wlanReportedVersion; |
| 14535 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14536 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14537 | if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus ) |
| 14538 | { |
| 14539 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 14540 | |
| 14541 | /*Cache the start response for further use*/ |
| 14542 | wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14543 | &wdiRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14544 | sizeof(pWDICtx->wdiCachedStartRspParams)); |
| 14545 | |
| 14546 | } |
| 14547 | else |
| 14548 | { |
| 14549 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14550 | "Failed to start device with status %s(%d)", |
| 14551 | WDI_getHALStatusMsgString(startRspParams->status), |
| 14552 | startRspParams->status); |
| 14553 | |
| 14554 | /*Set the expected state transition to stopped - because the start has |
| 14555 | failed*/ |
| 14556 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 14557 | |
| 14558 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14559 | |
| 14560 | /*Notify UMAC*/ |
| 14561 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14562 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14563 | WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus); |
| 14564 | |
| 14565 | /*Although the response is an error - it was processed by our function |
| 14566 | so as far as the caller is concerned this is a succesful reponse processing*/ |
| 14567 | return WDI_STATUS_SUCCESS; |
| 14568 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14569 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14570 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14571 | |
| 14572 | if(eDRIVER_TYPE_MFG == pWDICtx->driverMode) |
| 14573 | { |
| 14574 | /* FTM mode does not need to execute below */ |
| 14575 | /* Notify UMAC */ |
| 14576 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 14577 | return WDI_STATUS_SUCCESS; |
| 14578 | } |
| 14579 | |
| 14580 | /* START the Data transport */ |
| 14581 | WDTS_startTransport(pWDICtx); |
| 14582 | |
| 14583 | /*Start the STA Table !- check this logic again*/ |
| 14584 | WDI_STATableStart(pWDICtx); |
| 14585 | |
| 14586 | #ifndef HAL_SELF_STA_PER_BSS |
| 14587 | /* Store the Self STA Index */ |
| 14588 | pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx; |
| 14589 | |
| 14590 | pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId; |
| 14591 | wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta, |
| 14592 | WDI_MAC_ADDR_LEN); |
| 14593 | |
| 14594 | /* At this point add the self-STA */ |
| 14595 | |
| 14596 | /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */ |
| 14597 | /* !TO DO: wdiAddSTAParam.bcastDpuSignature */ |
| 14598 | /*! TO DO: wdiAddSTAParam.dpuSig */ |
| 14599 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 14600 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 14601 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 14602 | |
| 14603 | //all DPU indices are the same for self STA |
| 14604 | wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId; |
| 14605 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 14606 | wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14607 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta, |
| 14608 | WDI_MAC_ADDR_LEN); |
| 14609 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 14610 | wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx; |
| 14611 | |
| 14612 | /* Note: Since we don't get an explicit config STA request for self STA, we |
| 14613 | add the self STA upon receiving the Start response message. But the |
| 14614 | self STA entry in the table is deleted when WDI gets an explicit delete STA |
| 14615 | request */ |
| 14616 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 14617 | #endif |
| 14618 | |
| 14619 | /*Notify UMAC*/ |
| 14620 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 14621 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14622 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14623 | }/*WDI_ProcessStartRsp*/ |
| 14624 | |
| 14625 | |
| 14626 | /** |
| 14627 | @brief Process Stop Response function (called when a response |
| 14628 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14629 | |
| 14630 | @param pWDICtx: pointer to the WLAN DAL context |
| 14631 | pEventData: pointer to the event information structure |
| 14632 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14633 | @see |
| 14634 | @return Result of the function call |
| 14635 | */ |
| 14636 | WDI_Status |
| 14637 | WDI_ProcessStopRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14638 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14639 | WDI_ControlBlockType* pWDICtx, |
| 14640 | WDI_EventInfoType* pEventData |
| 14641 | ) |
| 14642 | { |
| 14643 | WDI_Status wdiStatus; |
| 14644 | WDI_StopRspCb wdiStopRspCb = NULL; |
| 14645 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14646 | tHalMacStopRspMsg halMacStopRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14647 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14649 | wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14650 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14651 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14652 | -------------------------------------------------------------------------*/ |
| 14653 | if (( NULL == pEventData ) || |
| 14654 | ( NULL == pEventData->pEventData) || |
| 14655 | ( NULL == wdiStopRspCb )) |
| 14656 | { |
| 14657 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14658 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14659 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14660 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14661 | } |
| 14662 | |
| 14663 | /*------------------------------------------------------------------------- |
| 14664 | Extract response and send it to UMAC |
| 14665 | -------------------------------------------------------------------------*/ |
| 14666 | if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize ) |
| 14667 | { |
| 14668 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14669 | "Invalid response length in Stop Resp %x %x", |
| 14670 | pEventData->uEventDataSize); |
| 14671 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14672 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14673 | } |
| 14674 | |
| 14675 | /*------------------------------------------------------------------------- |
| 14676 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14677 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14678 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14679 | wpalMemoryCopy( &halMacStopRspMsg.stopRspParams, |
| 14680 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14681 | sizeof(halMacStopRspMsg.stopRspParams)); |
| 14682 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14683 | wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14684 | |
| 14685 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14686 | |
| 14687 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14688 | Check to see if the stop went OK |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14689 | --------------------------------------------------------------------------*/ |
| 14690 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 14691 | { |
| 14692 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14693 | "Failed to stop the device with status %s (%d)", |
| 14694 | WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status), |
| 14695 | halMacStopRspMsg.stopRspParams.status); |
| 14696 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14697 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14698 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14699 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14700 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14701 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14703 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 14704 | |
| 14705 | /*Transition now as WDI may get preempted imediately after it sends |
| 14706 | up the Stop Response and it will not get to process the state transition |
| 14707 | from Main Rsp function*/ |
| 14708 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
| 14709 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14710 | |
| 14711 | /*! TO DO: - STOP the Data transport */ |
| 14712 | |
| 14713 | /*Notify UMAC*/ |
| 14714 | wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14715 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14716 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14717 | }/*WDI_ProcessStopRsp*/ |
| 14718 | |
| 14719 | /** |
| 14720 | @brief Process Close Rsp function (called when a response |
| 14721 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14722 | |
| 14723 | @param pWDICtx: pointer to the WLAN DAL context |
| 14724 | pEventData: pointer to the event information structure |
| 14725 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14726 | @see |
| 14727 | @return Result of the function call |
| 14728 | */ |
| 14729 | WDI_Status |
| 14730 | WDI_ProcessCloseRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14731 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14732 | WDI_ControlBlockType* pWDICtx, |
| 14733 | WDI_EventInfoType* pEventData |
| 14734 | ) |
| 14735 | { |
| 14736 | /*There is no close response comming from HAL - function just kept for |
| 14737 | simmetry */ |
| 14738 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14739 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14740 | }/*WDI_ProcessCloseRsp*/ |
| 14741 | |
| 14742 | |
| 14743 | /*============================================================================ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14744 | SCAN RESPONSE PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14745 | ============================================================================*/ |
| 14746 | |
| 14747 | /** |
| 14748 | @brief Process Init Scan Rsp function (called when a response |
| 14749 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14750 | |
| 14751 | @param pWDICtx: pointer to the WLAN DAL context |
| 14752 | pEventData: pointer to the event information structure |
| 14753 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14754 | @see |
| 14755 | @return Result of the function call |
| 14756 | */ |
| 14757 | WDI_Status |
| 14758 | WDI_ProcessInitScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14759 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14760 | WDI_ControlBlockType* pWDICtx, |
| 14761 | WDI_EventInfoType* pEventData |
| 14762 | ) |
| 14763 | { |
| 14764 | WDI_Status wdiStatus; |
| 14765 | WDI_InitScanRspCb wdiInitScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14766 | tHalInitScanRspMsg halInitScanRspMsg; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 14767 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14768 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14769 | |
| 14770 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14771 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14772 | -------------------------------------------------------------------------*/ |
| 14773 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14774 | ( NULL == pEventData->pEventData)) |
| 14775 | { |
| 14776 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14777 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14778 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14779 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14780 | } |
| 14781 | |
| 14782 | wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB; |
| 14783 | if( NULL == wdiInitScanRspCb) |
| 14784 | { |
| 14785 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14786 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14787 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14788 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14789 | } |
| 14790 | |
| 14791 | /*------------------------------------------------------------------------- |
| 14792 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14793 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14794 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14795 | wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams, |
| 14796 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14797 | sizeof(halInitScanRspMsg.initScanRspParams)); |
| 14798 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14799 | wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14800 | |
| 14801 | if ( pWDICtx->bInBmps ) |
| 14802 | { |
| 14803 | // notify DTS that we are entering Full power |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 14804 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 14805 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) { |
| 14806 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 14807 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 14808 | WDI_ASSERT(0); |
| 14809 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14810 | } |
| 14811 | |
| 14812 | /*Notify UMAC*/ |
| 14813 | wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14814 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14815 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14816 | }/*WDI_ProcessInitScanRsp*/ |
| 14817 | |
| 14818 | |
| 14819 | /** |
| 14820 | @brief Process Start Scan Rsp function (called when a response |
| 14821 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14822 | |
| 14823 | @param pWDICtx: pointer to the WLAN DAL context |
| 14824 | pEventData: pointer to the event information structure |
| 14825 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14826 | @see |
| 14827 | @return Result of the function call |
| 14828 | */ |
| 14829 | WDI_Status |
| 14830 | WDI_ProcessStartScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14831 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14832 | WDI_ControlBlockType* pWDICtx, |
| 14833 | WDI_EventInfoType* pEventData |
| 14834 | ) |
| 14835 | { |
| 14836 | WDI_StartScanRspParamsType wdiStartScanParams; |
| 14837 | WDI_StartScanRspCb wdiStartScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14838 | |
| 14839 | tHalStartScanRspMsg halStartScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14840 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14841 | |
| 14842 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14843 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14844 | -------------------------------------------------------------------------*/ |
| 14845 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14846 | ( NULL == pEventData->pEventData)) |
| 14847 | { |
| 14848 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14849 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14850 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14851 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14852 | } |
| 14853 | |
| 14854 | wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB; |
| 14855 | if( NULL == wdiStartScanRspCb) |
| 14856 | { |
| 14857 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14858 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14859 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14860 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14861 | } |
| 14862 | |
| 14863 | /*------------------------------------------------------------------------- |
| 14864 | Extract response and send it to UMAC |
| 14865 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14866 | wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams, |
| 14867 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14868 | sizeof(halStartScanRspMsg.startScanRspParams)); |
| 14869 | |
| 14870 | wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14871 | halStartScanRspMsg.startScanRspParams.status); |
| 14872 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14873 | wdiStartScanParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14874 | halStartScanRspMsg.startScanRspParams.txMgmtPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14875 | wpalMemoryCopy( wdiStartScanParams.aStartTSF, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14876 | halStartScanRspMsg.startScanRspParams.startTSF, |
| 14877 | 2); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14878 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14879 | |
| 14880 | if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status ) |
| 14881 | { |
| 14882 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14883 | "Start scan failed with status %s (%d)", |
| 14884 | WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status), |
| 14885 | halStartScanRspMsg.startScanRspParams.status); |
| 14886 | /* send the status to UMAC, don't return from here*/ |
| 14887 | } |
| 14888 | |
| 14889 | /*Notify UMAC*/ |
| 14890 | wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData); |
| 14891 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14892 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14893 | |
| 14894 | }/*WDI_ProcessStartScanRsp*/ |
| 14895 | |
| 14896 | |
| 14897 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14898 | @brief Process End Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14899 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14900 | |
| 14901 | @param pWDICtx: pointer to the WLAN DAL context |
| 14902 | pEventData: pointer to the event information structure |
| 14903 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14904 | @see |
| 14905 | @return Result of the function call |
| 14906 | */ |
| 14907 | WDI_Status |
| 14908 | WDI_ProcessEndScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14909 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14910 | WDI_ControlBlockType* pWDICtx, |
| 14911 | WDI_EventInfoType* pEventData |
| 14912 | ) |
| 14913 | { |
| 14914 | WDI_Status wdiStatus; |
| 14915 | tHalEndScanRspMsg halEndScanRspMsg; |
| 14916 | WDI_EndScanRspCb wdiEndScanRspCb; |
| 14917 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14918 | |
| 14919 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14920 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14921 | -------------------------------------------------------------------------*/ |
| 14922 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14923 | ( NULL == pEventData->pEventData)) |
| 14924 | { |
| 14925 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14926 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14927 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14928 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14929 | } |
| 14930 | |
| 14931 | wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB; |
| 14932 | |
| 14933 | /*------------------------------------------------------------------------- |
| 14934 | Extract response and send it to UMAC |
| 14935 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14936 | wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams, |
| 14937 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14938 | sizeof(halEndScanRspMsg.endScanRspParams)); |
| 14939 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14940 | wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14941 | |
| 14942 | if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status ) |
| 14943 | { |
| 14944 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14945 | "End Scan failed with status %s (%d )", |
| 14946 | WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status), |
| 14947 | halEndScanRspMsg.endScanRspParams.status); |
| 14948 | /* send the status to UMAC, don't return from here*/ |
| 14949 | } |
| 14950 | |
| 14951 | /*Notify UMAC*/ |
| 14952 | wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14953 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14954 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14955 | }/*WDI_ProcessEndScanRsp*/ |
| 14956 | |
| 14957 | |
| 14958 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14959 | @brief Process Finish Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14960 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14961 | |
| 14962 | @param pWDICtx: pointer to the WLAN DAL context |
| 14963 | pEventData: pointer to the event information structure |
| 14964 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14965 | @see |
| 14966 | @return Result of the function call |
| 14967 | */ |
| 14968 | WDI_Status |
| 14969 | WDI_ProcessFinishScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14970 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14971 | WDI_ControlBlockType* pWDICtx, |
| 14972 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14973 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14974 | { |
| 14975 | WDI_Status wdiStatus; |
| 14976 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14977 | |
| 14978 | tHalFinishScanRspMsg halFinishScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14979 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14980 | |
| 14981 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14982 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14983 | -------------------------------------------------------------------------*/ |
| 14984 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14985 | ( NULL == pEventData->pEventData)) |
| 14986 | { |
| 14987 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14988 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14989 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14990 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14991 | } |
| 14992 | |
| 14993 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB; |
| 14994 | |
| 14995 | /*------------------------------------------------------------------------- |
| 14996 | Extract response and send it to UMAC |
| 14997 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14998 | wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status, |
| 14999 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15000 | sizeof(halFinishScanRspMsg.finishScanRspParams.status)); |
| 15001 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15002 | wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15003 | |
| 15004 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15005 | "Finish scan response reported status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15006 | halFinishScanRspMsg.finishScanRspParams.status); |
| 15007 | |
| 15008 | if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&& |
| 15009 | ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status )) |
| 15010 | { |
| 15011 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15012 | "Finish Scan failed with status %s (%d)", |
| 15013 | WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status), |
| 15014 | halFinishScanRspMsg.finishScanRspParams.status); |
| 15015 | /* send the status to UMAC, don't return from here*/ |
| 15016 | } |
| 15017 | |
| 15018 | /*Notify UMAC*/ |
| 15019 | wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15021 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15022 | }/*WDI_ProcessFinishScanRsp*/ |
| 15023 | |
| 15024 | /** |
| 15025 | @brief Process Join Response function (called when a response |
| 15026 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15027 | |
| 15028 | @param pWDICtx: pointer to the WLAN DAL context |
| 15029 | pEventData: pointer to the event information structure |
| 15030 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15031 | @see |
| 15032 | @return Result of the function call |
| 15033 | */ |
| 15034 | WDI_Status |
| 15035 | WDI_ProcessJoinRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15036 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15037 | WDI_ControlBlockType* pWDICtx, |
| 15038 | WDI_EventInfoType* pEventData |
| 15039 | ) |
| 15040 | { |
| 15041 | WDI_Status wdiStatus; |
| 15042 | WDI_JoinRspCb wdiJoinRspCb; |
| 15043 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15044 | |
| 15045 | tHalJoinRspMsg halJoinRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15046 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15047 | |
| 15048 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15049 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15050 | -------------------------------------------------------------------------*/ |
| 15051 | if (( NULL == pWDICtx ) || |
| 15052 | ( NULL == pWDICtx->pfncRspCB ) || |
| 15053 | ( NULL == pEventData ) || |
| 15054 | ( NULL == pEventData->pEventData)) |
| 15055 | { |
| 15056 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15057 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15058 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15059 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15060 | } |
| 15061 | |
| 15062 | wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB; |
| 15063 | |
| 15064 | /*------------------------------------------------------------------------- |
| 15065 | Extract response and send it to UMAC |
| 15066 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15067 | wpalMemoryCopy( &halJoinRspMsg.joinRspParams, |
| 15068 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15069 | sizeof(halJoinRspMsg.joinRspParams)); |
| 15070 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15071 | wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15072 | |
| 15073 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15074 | |
| 15075 | /*----------------------------------------------------------------------- |
| 15076 | Join response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15077 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15078 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15079 | if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15080 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 15081 | { |
| 15082 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15083 | "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or " |
| 15084 | "association no longer in progress %d - mysterious HAL response", |
| 15085 | __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15086 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15087 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15088 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15089 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15090 | } |
| 15091 | |
| 15092 | pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx]; |
| 15093 | |
| 15094 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15095 | Join Response is only allowed in init state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15096 | -----------------------------------------------------------------------*/ |
| 15097 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 15098 | { |
| 15099 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15100 | "Join only allowed in Joining state - failure state is %d " |
| 15101 | "strange HAL response", pBSSSes->wdiAssocState); |
| 15102 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15103 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15104 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15105 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15106 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15107 | } |
| 15108 | |
| 15109 | |
| 15110 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15111 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15112 | -----------------------------------------------------------------------*/ |
| 15113 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 15114 | { |
| 15115 | /*Association was failed by HAL - remove session*/ |
| 15116 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15117 | |
| 15118 | /*Association no longer in progress */ |
| 15119 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 15120 | |
| 15121 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 15122 | WDI_DequeueAssocRequest(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15124 | } |
| 15125 | else |
| 15126 | { |
| 15127 | /*Transition to state Joining - this may be redundant as we are supposed |
| 15128 | to be in this state already - but just to be safe*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15129 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15130 | } |
| 15131 | |
| 15132 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15133 | |
| 15134 | /*Notify UMAC*/ |
| 15135 | wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15137 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15138 | }/*WDI_ProcessJoinRsp*/ |
| 15139 | |
| 15140 | |
| 15141 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15142 | @brief Process Config BSS Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15143 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15144 | |
| 15145 | @param pWDICtx: pointer to the WLAN DAL context |
| 15146 | pEventData: pointer to the event information structure |
| 15147 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15148 | @see |
| 15149 | @return Result of the function call |
| 15150 | */ |
| 15151 | WDI_Status |
| 15152 | WDI_ProcessConfigBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15153 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15154 | WDI_ControlBlockType* pWDICtx, |
| 15155 | WDI_EventInfoType* pEventData |
| 15156 | ) |
| 15157 | { |
| 15158 | WDI_ConfigBSSRspParamsType wdiConfigBSSParams; |
| 15159 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15160 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15161 | WDI_BSSSessionType* pBSSSes = NULL; |
| 15162 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15163 | tConfigBssRspMsg halConfigBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15164 | WDI_AddStaParams wdiBcastAddSTAParam = {0}; |
| 15165 | WDI_AddStaParams wdiAddSTAParam = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15166 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15167 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15168 | |
| 15169 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15170 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15171 | -------------------------------------------------------------------------*/ |
| 15172 | if (( NULL == pEventData ) || |
| 15173 | ( NULL == pEventData->pEventData)) |
| 15174 | { |
| 15175 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15176 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15177 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15178 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15179 | } |
| 15180 | |
| 15181 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB; |
| 15182 | |
| 15183 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15184 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15185 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15186 | wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams, |
| 15187 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15188 | sizeof(halConfigBssRspMsg.configBssRspParams)); |
| 15189 | |
| 15190 | wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 15191 | halConfigBssRspMsg.configBssRspParams.status); |
| 15192 | if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus) |
| 15193 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15194 | wpalMemoryCopy( wdiConfigBSSParams.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15195 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID, |
| 15196 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15197 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15198 | wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15199 | |
| 15200 | wdiConfigBSSParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15201 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15202 | |
| 15203 | wdiConfigBSSParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15204 | halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15205 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15206 | wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15207 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15208 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15209 | wdiConfigBSSParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15210 | halConfigBssRspMsg.configBssRspParams.txMgmtPower; |
| 15211 | #endif |
| 15212 | wpalMemoryCopy( wdiConfigBSSParams.macSTA, |
| 15213 | halConfigBssRspMsg.configBssRspParams.staMac, |
| 15214 | WDI_MAC_ADDR_LEN ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15216 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15217 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15218 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15219 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15220 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 15221 | wdiConfigBSSParams.macBSSID, |
| 15222 | &pBSSSes); |
| 15223 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15224 | /*----------------------------------------------------------------------- |
| 15225 | Config BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15226 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15227 | -----------------------------------------------------------------------*/ |
| 15228 | if ( NULL == pBSSSes ) |
| 15229 | { |
| 15230 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15231 | "Association sequence for this BSS does not yet exist " |
| 15232 | "- mysterious HAL response"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15233 | |
| 15234 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15235 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15236 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15237 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15238 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15240 | /*Save data for this BSS*/ |
| 15241 | pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType; |
| 15242 | pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15243 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15244 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15245 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15246 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15247 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15248 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15249 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15250 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15251 | pBSSSes->ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15252 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
| 15253 | pBSSSes->bcastStaIdx = |
| 15254 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15256 | /* !TO DO: Shuould we be updating the RMF Capability of self STA here? */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15257 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15258 | /*------------------------------------------------------------------------- |
| 15259 | Add Peer STA |
| 15260 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15261 | wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15262 | wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx; |
| 15263 | wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15264 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15265 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15266 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15267 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15268 | wdiAddSTAParam.ucHTCapable = |
| 15269 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable; |
| 15270 | wdiAddSTAParam.ucStaType = |
| 15271 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType; |
| 15272 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15273 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15274 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 15275 | halConfigBssRspMsg.configBssRspParams.staMac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15276 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15277 | |
| 15278 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 15279 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID , |
| 15280 | WDI_MAC_ADDR_LEN); |
| 15281 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15282 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15283 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15284 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15285 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15286 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15287 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15288 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15289 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15290 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15291 | wdiAddSTAParam.ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15292 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15293 | wdiAddSTAParam.ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15294 | halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15296 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 15297 | "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15298 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15299 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 15300 | /*------------------------------------------------------------------------- |
| 15301 | Add Broadcast STA only in AP mode |
| 15302 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15303 | if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode == |
Ravi Joshi | a97bf5b | 2013-07-08 15:48:47 -0700 | [diff] [blame] | 15304 | WDI_BSS_OPERATIONAL_MODE_AP || pBSSSes->wdiBssType == WDI_IBSS_MODE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15305 | { |
| 15306 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 15307 | "Add BCAST STA to table for index: %d", |
| 15308 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15309 | |
| 15310 | wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15311 | sizeof(WDI_AddStaParams) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15312 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15313 | WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam, |
| 15314 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
| 15315 | } |
| 15316 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15317 | } |
| 15318 | else |
| 15319 | { |
| 15320 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15321 | "Config BSS RSP failed with status : %s(%d)", |
| 15322 | WDI_getHALStatusMsgString( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15323 | halConfigBssRspMsg.configBssRspParams.status), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15324 | halConfigBssRspMsg.configBssRspParams.status); |
| 15325 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15327 | /*Association was failed by HAL - remove session*/ |
| 15328 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15329 | |
| 15330 | /*Association no longer in progress */ |
| 15331 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 15332 | |
| 15333 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 15334 | WDI_DequeueAssocRequest(pWDICtx); |
| 15335 | |
| 15336 | } |
| 15337 | |
| 15338 | /*Notify UMAC*/ |
| 15339 | wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData); |
| 15340 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15341 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15342 | }/*WDI_ProcessConfigBSSRsp*/ |
| 15343 | |
| 15344 | |
| 15345 | /** |
| 15346 | @brief Process Del BSS Response function (called when a response |
| 15347 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15348 | |
| 15349 | @param pWDICtx: pointer to the WLAN DAL context |
| 15350 | pEventData: pointer to the event information structure |
| 15351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15352 | @see |
| 15353 | @return Result of the function call |
| 15354 | */ |
| 15355 | WDI_Status |
| 15356 | WDI_ProcessDelBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15357 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15358 | WDI_ControlBlockType* pWDICtx, |
| 15359 | WDI_EventInfoType* pEventData |
| 15360 | ) |
| 15361 | { |
| 15362 | WDI_DelBSSRspParamsType wdiDelBSSParams; |
| 15363 | WDI_DelBSSRspCb wdiDelBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15364 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15365 | WDI_BSSSessionType* pBSSSes = NULL; |
| 15366 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15367 | tDeleteBssRspMsg halDelBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15368 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15369 | |
| 15370 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15371 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15372 | -------------------------------------------------------------------------*/ |
| 15373 | if (( NULL == pEventData ) || |
| 15374 | ( NULL == pEventData->pEventData)) |
| 15375 | { |
| 15376 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15377 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15378 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15379 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15380 | } |
| 15381 | |
| 15382 | wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB; |
| 15383 | |
| 15384 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15385 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15386 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15387 | wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams, |
| 15388 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15389 | sizeof(halDelBssRspMsg.deleteBssRspParams)); |
| 15390 | |
| 15391 | |
| 15392 | wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15393 | halDelBssRspMsg.deleteBssRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15394 | |
| 15395 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15396 | |
| 15397 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15398 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15399 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15400 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 15401 | halDelBssRspMsg.deleteBssRspParams.bssIdx, |
| 15402 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15403 | |
| 15404 | /*----------------------------------------------------------------------- |
| 15405 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15406 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15407 | -----------------------------------------------------------------------*/ |
| 15408 | if ( NULL == pBSSSes ) |
| 15409 | { |
| 15410 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15411 | "Association sequence for this BSS does not yet exist or " |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15412 | "association no longer in progress - mysterious HAL response"); |
| 15413 | |
| 15414 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15415 | |
| 15416 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15417 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15418 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15419 | |
| 15420 | /*Extract BSSID for the response to UMAC*/ |
| 15421 | wpalMemoryCopy(wdiDelBSSParams.macBSSID, |
| 15422 | pBSSSes->macBSSID, WDI_MAC_ADDR_LEN); |
| 15423 | |
| 15424 | wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx; |
| 15425 | |
| 15426 | /*----------------------------------------------------------------------- |
| 15427 | The current session will be deleted |
| 15428 | -----------------------------------------------------------------------*/ |
| 15429 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15430 | |
| 15431 | |
| 15432 | /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */ |
| 15433 | if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15434 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15435 | (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx ); |
Madan Mohan Koyyalamudi | f371f17 | 2012-10-31 16:35:43 -0700 | [diff] [blame] | 15436 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15437 | |
| 15438 | /* Delete the STA's in this BSS */ |
| 15439 | WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx); |
| 15440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15441 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15442 | |
| 15443 | /*Notify UMAC*/ |
| 15444 | wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData); |
| 15445 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15446 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15447 | }/*WDI_ProcessDelBSSRsp*/ |
| 15448 | |
| 15449 | /** |
| 15450 | @brief Process Post Assoc Rsp function (called when a response |
| 15451 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15452 | |
| 15453 | @param pWDICtx: pointer to the WLAN DAL context |
| 15454 | pEventData: pointer to the event information structure |
| 15455 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15456 | @see |
| 15457 | @return Result of the function call |
| 15458 | */ |
| 15459 | WDI_Status |
| 15460 | WDI_ProcessPostAssocRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15461 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15462 | WDI_ControlBlockType* pWDICtx, |
| 15463 | WDI_EventInfoType* pEventData |
| 15464 | ) |
| 15465 | { |
| 15466 | WDI_PostAssocRspParamsType wdiPostAssocParams; |
| 15467 | WDI_PostAssocRspCb wdiPostAssocRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15468 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15469 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15470 | tPostAssocRspMsg halPostAssocRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15471 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15472 | |
| 15473 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15474 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15475 | -------------------------------------------------------------------------*/ |
| 15476 | if (( NULL == pEventData ) || |
| 15477 | ( NULL == pEventData->pEventData)) |
| 15478 | { |
| 15479 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15480 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15481 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15482 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15483 | } |
| 15484 | |
| 15485 | wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB; |
| 15486 | |
| 15487 | /*------------------------------------------------------------------------- |
| 15488 | Extract response and send it to UMAC |
| 15489 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15490 | wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams, |
| 15491 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15492 | sizeof(halPostAssocRspMsg.postAssocRspParams)); |
| 15493 | |
| 15494 | /*Extract the Post Assoc STA Params */ |
| 15495 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15496 | wdiPostAssocParams.staParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15497 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15498 | wdiPostAssocParams.staParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15499 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15500 | wdiPostAssocParams.staParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15501 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 15502 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15503 | wdiPostAssocParams.wdiStatus = |
| 15504 | WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15505 | |
| 15506 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 15507 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15508 | wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA, |
| 15509 | pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15510 | WDI_MAC_ADDR_LEN); |
| 15511 | |
| 15512 | /* Extract Post Assoc BSS Params */ |
| 15513 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15514 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID, |
| 15515 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID, |
| 15516 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15517 | |
| 15518 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 15519 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15520 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15521 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext |
| 15522 | .macSTA, WDI_MAC_ADDR_LEN); |
| 15523 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15524 | wdiPostAssocParams.bssParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15525 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 15526 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15527 | wdiPostAssocParams.bssParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15528 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
| 15529 | |
| 15530 | wdiPostAssocParams.bssParams.ucBSSIdx = |
| 15531 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 15532 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15533 | wdiPostAssocParams.bssParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15534 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx; |
| 15535 | |
| 15536 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15537 | |
| 15538 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15539 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15540 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15541 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15542 | wdiPostAssocParams.bssParams. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15543 | macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15544 | |
| 15545 | /*----------------------------------------------------------------------- |
| 15546 | Post assoc response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15547 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15548 | -----------------------------------------------------------------------*/ |
| 15549 | if (( NULL == pBSSSes ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15550 | ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15551 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 15552 | { |
| 15553 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15554 | "Association sequence for this BSS does not yet exist or " |
| 15555 | "association no longer in progress - mysterious HAL response"); |
| 15556 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15557 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15558 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15559 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15560 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15561 | } |
| 15562 | |
| 15563 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15564 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15565 | -----------------------------------------------------------------------*/ |
| 15566 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 15567 | { |
| 15568 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15569 | "Post Assoc not allowed before JOIN - failing request " |
| 15570 | "strange HAL response"); |
| 15571 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15572 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15573 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15574 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15575 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15576 | } |
| 15577 | |
| 15578 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15579 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15580 | -----------------------------------------------------------------------*/ |
| 15581 | if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus ) |
| 15582 | { |
| 15583 | /*Association was failed by HAL - remove session*/ |
| 15584 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15585 | } |
| 15586 | else |
| 15587 | { |
| 15588 | /*Transition to state POST Assoc*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15589 | pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15590 | |
| 15591 | /*Save DPU Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15592 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15593 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15594 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15595 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15596 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15597 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15598 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15599 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature; |
| 15600 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15601 | pBSSSes->ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15602 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 15603 | } |
| 15604 | |
| 15605 | /*Association no longer in progress */ |
| 15606 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 15607 | |
| 15608 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 15609 | WDI_DequeueAssocRequest(pWDICtx); |
| 15610 | |
| 15611 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15612 | |
| 15613 | /*Notify UMAC*/ |
| 15614 | wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData); |
| 15615 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15616 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15617 | }/*WDI_ProcessPostAssocRsp*/ |
| 15618 | |
| 15619 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15620 | @brief Process Del STA Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15621 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15622 | |
| 15623 | @param pWDICtx: pointer to the WLAN DAL context |
| 15624 | pEventData: pointer to the event information structure |
| 15625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15626 | @see |
| 15627 | @return Result of the function call |
| 15628 | */ |
| 15629 | WDI_Status |
| 15630 | WDI_ProcessDelSTARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15631 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15632 | WDI_ControlBlockType* pWDICtx, |
| 15633 | WDI_EventInfoType* pEventData |
| 15634 | ) |
| 15635 | { |
| 15636 | WDI_DelSTARspParamsType wdiDelSTARsp; |
| 15637 | WDI_DelSTARspCb wdiDelSTARspCb; |
| 15638 | wpt_uint8 staType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15639 | tDeleteStaRspMsg halDelStaRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15640 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15641 | |
| 15642 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15643 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15644 | -------------------------------------------------------------------------*/ |
| 15645 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15646 | ( NULL == pEventData->pEventData)) |
| 15647 | { |
| 15648 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15649 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15650 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15651 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15652 | } |
| 15653 | |
| 15654 | wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB; |
| 15655 | |
| 15656 | /*------------------------------------------------------------------------- |
| 15657 | Extract response and send it to UMAC |
| 15658 | -------------------------------------------------------------------------*/ |
| 15659 | wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15660 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15661 | sizeof(halDelStaRspMsg.delStaRspParams)); |
| 15662 | |
| 15663 | wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15664 | wdiDelSTARsp.wdiStatus = |
| 15665 | WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15666 | |
| 15667 | WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType); |
| 15668 | |
| 15669 | /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */ |
| 15670 | if(staType == WDI_STA_ENTRY_SELF) |
| 15671 | { |
| 15672 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 15673 | |
| 15674 | /* At this point add the self-STA */ |
| 15675 | |
| 15676 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 15677 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 15678 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 15679 | |
| 15680 | #define WDI_DPU_SELF_STA_DEFAULT_IDX 0 |
| 15681 | #define WDI_DPU_SELF_STA_DEFAULT_SIG 0 |
| 15682 | |
| 15683 | //all DPU indices are the same for self STA |
| 15684 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 15685 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 15686 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 15687 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 15688 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 15689 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG; |
Madan Mohan Koyyalamudi | 15a48f0 | 2012-10-05 17:13:53 -0700 | [diff] [blame] | 15690 | |
| 15691 | pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15692 | } |
| 15693 | else |
| 15694 | { |
| 15695 | //Delete the station in the table |
| 15696 | WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx); |
| 15697 | } |
| 15698 | |
| 15699 | /*Notify UMAC*/ |
| 15700 | wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData); |
| 15701 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15702 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15703 | }/*WDI_ProcessDelSTARsp*/ |
| 15704 | |
| 15705 | |
| 15706 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15707 | Security Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15708 | ==========================================================================*/ |
| 15709 | |
| 15710 | /** |
| 15711 | @brief Process Set BSS Key Rsp function (called when a response |
| 15712 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15713 | |
| 15714 | @param pWDICtx: pointer to the WLAN DAL context |
| 15715 | pEventData: pointer to the event information structure |
| 15716 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15717 | @see |
| 15718 | @return Result of the function call |
| 15719 | */ |
| 15720 | WDI_Status |
| 15721 | WDI_ProcessSetBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15722 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15723 | WDI_ControlBlockType* pWDICtx, |
| 15724 | WDI_EventInfoType* pEventData |
| 15725 | ) |
| 15726 | { |
| 15727 | WDI_Status wdiStatus; |
| 15728 | eHalStatus halStatus; |
| 15729 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
| 15730 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15731 | |
| 15732 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15733 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15734 | -------------------------------------------------------------------------*/ |
| 15735 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15736 | ( NULL == pEventData->pEventData)) |
| 15737 | { |
| 15738 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15739 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15740 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15741 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15742 | } |
| 15743 | |
| 15744 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 15745 | |
| 15746 | /*------------------------------------------------------------------------- |
| 15747 | Extract response and send it to UMAC |
| 15748 | -------------------------------------------------------------------------*/ |
| 15749 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15750 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15751 | |
| 15752 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15753 | { |
| 15754 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15755 | "Set BSS Key failed with status %s (%d)", |
| 15756 | WDI_getHALStatusMsgString(halStatus), |
| 15757 | halStatus); |
| 15758 | /* send the status to UMAC, don't return from here*/ |
| 15759 | } |
| 15760 | |
| 15761 | /*Notify UMAC*/ |
| 15762 | wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15763 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15764 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15765 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 15766 | |
| 15767 | /** |
| 15768 | @brief Process Remove BSS Key Rsp function (called when a response |
| 15769 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15770 | |
| 15771 | @param pWDICtx: pointer to the WLAN DAL context |
| 15772 | pEventData: pointer to the event information structure |
| 15773 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15774 | @see |
| 15775 | @return Result of the function call |
| 15776 | */ |
| 15777 | WDI_Status |
| 15778 | WDI_ProcessRemoveBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15779 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15780 | WDI_ControlBlockType* pWDICtx, |
| 15781 | WDI_EventInfoType* pEventData |
| 15782 | ) |
| 15783 | { |
| 15784 | WDI_Status wdiStatus; |
| 15785 | eHalStatus halStatus; |
| 15786 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
| 15787 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15788 | |
| 15789 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15790 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15791 | -------------------------------------------------------------------------*/ |
| 15792 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15793 | ( NULL == pEventData->pEventData)) |
| 15794 | { |
| 15795 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15796 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15797 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15798 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15799 | } |
| 15800 | |
| 15801 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 15802 | |
| 15803 | /*------------------------------------------------------------------------- |
| 15804 | Extract response and send it to UMAC |
| 15805 | -------------------------------------------------------------------------*/ |
| 15806 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15807 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15808 | |
| 15809 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15810 | { |
| 15811 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15812 | "Remove BSS Key failed with status %s (%d )", |
| 15813 | WDI_getHALStatusMsgString(halStatus), |
| 15814 | halStatus); |
| 15815 | /* send the status to UMAC, don't return from here*/ |
| 15816 | } |
| 15817 | |
| 15818 | /*Notify UMAC*/ |
| 15819 | wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15820 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15821 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15822 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 15823 | |
| 15824 | |
| 15825 | /** |
| 15826 | @brief Process Set STA Key Rsp function (called when a response |
| 15827 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15828 | |
| 15829 | @param pWDICtx: pointer to the WLAN DAL context |
| 15830 | pEventData: pointer to the event information structure |
| 15831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15832 | @see |
| 15833 | @return Result of the function call |
| 15834 | */ |
| 15835 | WDI_Status |
| 15836 | WDI_ProcessSetStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15837 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15838 | WDI_ControlBlockType* pWDICtx, |
| 15839 | WDI_EventInfoType* pEventData |
| 15840 | ) |
| 15841 | { |
| 15842 | WDI_Status wdiStatus; |
| 15843 | eHalStatus halStatus; |
| 15844 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 15845 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15846 | |
| 15847 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15848 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15849 | -------------------------------------------------------------------------*/ |
| 15850 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15851 | ( NULL == pEventData->pEventData)) |
| 15852 | { |
| 15853 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15854 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15855 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15856 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15857 | } |
| 15858 | |
| 15859 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15860 | |
| 15861 | /*------------------------------------------------------------------------- |
| 15862 | Extract response and send it to UMAC |
| 15863 | -------------------------------------------------------------------------*/ |
| 15864 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15865 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15866 | |
| 15867 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15868 | { |
| 15869 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15870 | "Set STA Key failed with status %s (%d)", |
| 15871 | WDI_getHALStatusMsgString(halStatus), |
| 15872 | halStatus); |
| 15873 | /* send the status to UMAC, don't return from here*/ |
| 15874 | } |
| 15875 | |
| 15876 | /*Notify UMAC*/ |
| 15877 | wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15878 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15879 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15880 | }/*WDI_ProcessSetSTAKeyRsp*/ |
| 15881 | |
| 15882 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15883 | @brief Process Remove STA Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15884 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15885 | |
| 15886 | @param pWDICtx: pointer to the WLAN DAL context |
| 15887 | pEventData: pointer to the event information structure |
| 15888 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15889 | @see |
| 15890 | @return Result of the function call |
| 15891 | */ |
| 15892 | WDI_Status |
| 15893 | WDI_ProcessRemoveStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15894 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15895 | WDI_ControlBlockType* pWDICtx, |
| 15896 | WDI_EventInfoType* pEventData |
| 15897 | ) |
| 15898 | { |
| 15899 | WDI_Status wdiStatus; |
| 15900 | eHalStatus halStatus; |
| 15901 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 15902 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15903 | |
| 15904 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15905 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15906 | -------------------------------------------------------------------------*/ |
| 15907 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15908 | ( NULL == pEventData->pEventData)) |
| 15909 | { |
| 15910 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15911 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15912 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15913 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15914 | } |
| 15915 | |
| 15916 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15917 | |
| 15918 | /*------------------------------------------------------------------------- |
| 15919 | Extract response and send it to UMAC |
| 15920 | -------------------------------------------------------------------------*/ |
| 15921 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15922 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15923 | |
| 15924 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15925 | { |
| 15926 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15927 | "Remove STA Key failed with status %s (%d)", |
| 15928 | WDI_getHALStatusMsgString(halStatus), |
| 15929 | halStatus); |
| 15930 | /* send the status to UMAC, don't return from here*/ |
| 15931 | } |
| 15932 | |
| 15933 | /*Notify UMAC*/ |
| 15934 | wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15935 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15936 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15937 | }/*WDI_ProcessRemoveStaKeyRsp*/ |
| 15938 | |
| 15939 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15940 | @brief Process Set STA Bcast Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15941 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15942 | |
| 15943 | @param pWDICtx: pointer to the WLAN DAL context |
| 15944 | pEventData: pointer to the event information structure |
| 15945 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15946 | @see |
| 15947 | @return Result of the function call |
| 15948 | */ |
| 15949 | WDI_Status |
| 15950 | WDI_ProcessSetStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15951 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15952 | WDI_ControlBlockType* pWDICtx, |
| 15953 | WDI_EventInfoType* pEventData |
| 15954 | ) |
| 15955 | { |
| 15956 | WDI_Status wdiStatus; |
| 15957 | eHalStatus halStatus; |
| 15958 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb; |
| 15959 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15960 | |
| 15961 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15962 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15963 | -------------------------------------------------------------------------*/ |
| 15964 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15965 | ( NULL == pEventData->pEventData)) |
| 15966 | { |
| 15967 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15968 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15969 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15970 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15971 | } |
| 15972 | |
| 15973 | wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15974 | |
| 15975 | /*------------------------------------------------------------------------- |
| 15976 | Extract response and send it to UMAC |
| 15977 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15978 | wpalMemoryCopy( &halStatus, |
| 15979 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15980 | sizeof(halStatus)); |
| 15981 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15982 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15983 | |
| 15984 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15985 | { |
| 15986 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15987 | "Set STA Key failed with status %s (%d)", |
| 15988 | WDI_getHALStatusMsgString(halStatus), |
| 15989 | halStatus); |
| 15990 | /* send the status to UMAC, don't return from here*/ |
| 15991 | } |
| 15992 | |
| 15993 | /*Notify UMAC*/ |
| 15994 | wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15995 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15996 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15997 | }/*WDI_ProcessSetSTABcastKeyRsp*/ |
| 15998 | |
| 15999 | /** |
| 16000 | @brief Process Remove STA Bcast Key Rsp function (called when a |
| 16001 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16002 | |
| 16003 | @param pWDICtx: pointer to the WLAN DAL context |
| 16004 | pEventData: pointer to the event information structure |
| 16005 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16006 | @see |
| 16007 | @return Result of the function call |
| 16008 | */ |
| 16009 | WDI_Status |
| 16010 | WDI_ProcessRemoveStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16011 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16012 | WDI_ControlBlockType* pWDICtx, |
| 16013 | WDI_EventInfoType* pEventData |
| 16014 | ) |
| 16015 | { |
| 16016 | WDI_Status wdiStatus; |
| 16017 | eHalStatus halStatus; |
| 16018 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb; |
| 16019 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16020 | |
| 16021 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16022 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16023 | -------------------------------------------------------------------------*/ |
| 16024 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16025 | ( NULL == pEventData->pEventData)) |
| 16026 | { |
| 16027 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16028 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16029 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16030 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16031 | } |
| 16032 | |
| 16033 | wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 16034 | |
| 16035 | /*------------------------------------------------------------------------- |
| 16036 | Extract response and send it to UMAC |
| 16037 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16038 | wpalMemoryCopy( &halStatus, |
| 16039 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16040 | sizeof(halStatus)); |
| 16041 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16042 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16043 | |
| 16044 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 16045 | { |
| 16046 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16047 | "Remove STA Key failed with status %s (%d)", |
| 16048 | WDI_getHALStatusMsgString(halStatus), |
| 16049 | halStatus); |
| 16050 | /* send the status to UMAC, don't return from here*/ |
| 16051 | } |
| 16052 | |
| 16053 | /*Notify UMAC*/ |
| 16054 | wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16055 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16056 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16057 | }/*WDI_ProcessRemoveStaBcastKeyRsp*/ |
| 16058 | |
| 16059 | |
| 16060 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16061 | QoS and BA Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16062 | ==========================================================================*/ |
| 16063 | |
| 16064 | /** |
| 16065 | @brief Process Add TSpec Rsp function (called when a response |
| 16066 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16067 | |
| 16068 | @param pWDICtx: pointer to the WLAN DAL context |
| 16069 | pEventData: pointer to the event information structure |
| 16070 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16071 | @see |
| 16072 | @return Result of the function call |
| 16073 | */ |
| 16074 | WDI_Status |
| 16075 | WDI_ProcessAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16076 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16077 | WDI_ControlBlockType* pWDICtx, |
| 16078 | WDI_EventInfoType* pEventData |
| 16079 | ) |
| 16080 | { |
| 16081 | WDI_Status wdiStatus; |
| 16082 | eHalStatus halStatus; |
| 16083 | WDI_AddTsRspCb wdiAddTsRspCb; |
| 16084 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16085 | |
| 16086 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16087 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16088 | -------------------------------------------------------------------------*/ |
| 16089 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16090 | ( NULL == pEventData->pEventData)) |
| 16091 | { |
| 16092 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16093 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16094 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16095 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16096 | } |
| 16097 | |
| 16098 | wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 16099 | |
| 16100 | /*------------------------------------------------------------------------- |
| 16101 | Extract response and send it to UMAC |
| 16102 | -------------------------------------------------------------------------*/ |
| 16103 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16104 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16105 | |
| 16106 | /*Notify UMAC*/ |
| 16107 | wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16108 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16109 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16110 | }/*WDI_ProcessAddTSpecRsp*/ |
| 16111 | |
| 16112 | |
| 16113 | /** |
| 16114 | @brief Process Del TSpec Rsp function (called when a response |
| 16115 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16116 | |
| 16117 | @param pWDICtx: pointer to the WLAN DAL context |
| 16118 | pEventData: pointer to the event information structure |
| 16119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16120 | @see |
| 16121 | @return Result of the function call |
| 16122 | */ |
| 16123 | WDI_Status |
| 16124 | WDI_ProcessDelTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16125 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16126 | WDI_ControlBlockType* pWDICtx, |
| 16127 | WDI_EventInfoType* pEventData |
| 16128 | ) |
| 16129 | { |
| 16130 | WDI_Status wdiStatus; |
| 16131 | eHalStatus halStatus; |
| 16132 | WDI_DelTsRspCb wdiDelTsRspCb; |
| 16133 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16134 | |
| 16135 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16136 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16137 | -------------------------------------------------------------------------*/ |
| 16138 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16139 | ( NULL == pEventData->pEventData)) |
| 16140 | { |
| 16141 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16142 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16143 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16144 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16145 | } |
| 16146 | |
| 16147 | wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB; |
| 16148 | |
| 16149 | /*------------------------------------------------------------------------- |
| 16150 | Extract response and send it to UMAC |
| 16151 | -------------------------------------------------------------------------*/ |
| 16152 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16153 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16154 | |
| 16155 | /*Notify UMAC*/ |
| 16156 | wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16158 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16159 | }/*WDI_ProcessDelTSpecRsp*/ |
| 16160 | |
| 16161 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16162 | @brief Process Update EDCA Parameters Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16163 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16164 | |
| 16165 | @param pWDICtx: pointer to the WLAN DAL context |
| 16166 | pEventData: pointer to the event information structure |
| 16167 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16168 | @see |
| 16169 | @return Result of the function call |
| 16170 | */ |
| 16171 | WDI_Status |
| 16172 | WDI_ProcessUpdateEDCAParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16173 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16174 | WDI_ControlBlockType* pWDICtx, |
| 16175 | WDI_EventInfoType* pEventData |
| 16176 | ) |
| 16177 | { |
| 16178 | WDI_Status wdiStatus; |
| 16179 | eHalStatus halStatus; |
| 16180 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb; |
| 16181 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16182 | |
| 16183 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16184 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16185 | -------------------------------------------------------------------------*/ |
| 16186 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16187 | ( NULL == pEventData->pEventData)) |
| 16188 | { |
| 16189 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16190 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16191 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16192 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16193 | } |
| 16194 | |
| 16195 | wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB; |
| 16196 | |
| 16197 | /*------------------------------------------------------------------------- |
| 16198 | Extract response and send it to UMAC |
| 16199 | -------------------------------------------------------------------------*/ |
| 16200 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16201 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16202 | |
| 16203 | /*Notify UMAC*/ |
| 16204 | wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16205 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16206 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16207 | }/*WDI_ProcessUpdateEDCAParamsRsp*/ |
| 16208 | |
| 16209 | |
| 16210 | /** |
| 16211 | @brief Process Add BA Rsp function (called when a response |
| 16212 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16213 | |
| 16214 | @param pWDICtx: pointer to the WLAN DAL context |
| 16215 | pEventData: pointer to the event information structure |
| 16216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16217 | @see |
| 16218 | @return Result of the function call |
| 16219 | */ |
| 16220 | WDI_Status |
| 16221 | WDI_ProcessAddBASessionRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16222 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16223 | WDI_ControlBlockType* pWDICtx, |
| 16224 | WDI_EventInfoType* pEventData |
| 16225 | ) |
| 16226 | { |
| 16227 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
| 16228 | |
| 16229 | tAddBASessionRspParams halBASessionRsp; |
| 16230 | WDI_AddBASessionRspParamsType wdiBASessionRsp; |
| 16231 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16232 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16233 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16234 | |
| 16235 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16236 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16237 | -------------------------------------------------------------------------*/ |
| 16238 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16239 | ( NULL == pEventData->pEventData)) |
| 16240 | { |
| 16241 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16242 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16243 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16244 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16245 | } |
| 16246 | |
| 16247 | wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB; |
| 16248 | |
| 16249 | /*------------------------------------------------------------------------- |
| 16250 | Extract response and send it to UMAC |
| 16251 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16252 | wpalMemoryCopy( &halBASessionRsp, |
| 16253 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16254 | sizeof(halBASessionRsp)); |
| 16255 | |
| 16256 | wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status); |
| 16257 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 16258 | if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16259 | { |
| 16260 | wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken; |
| 16261 | wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID; |
| 16262 | wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize; |
| 16263 | wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID; |
| 16264 | wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize; |
| 16265 | wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID; |
| 16266 | wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN; |
| 16267 | } |
| 16268 | |
| 16269 | /*Notify UMAC*/ |
| 16270 | wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData); |
| 16271 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16272 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16273 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16274 | |
| 16275 | |
| 16276 | /** |
| 16277 | @brief Process Del BA Rsp function (called when a response |
| 16278 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16279 | |
| 16280 | @param pWDICtx: pointer to the WLAN DAL context |
| 16281 | pEventData: pointer to the event information structure |
| 16282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16283 | @see |
| 16284 | @return Result of the function call |
| 16285 | */ |
| 16286 | WDI_Status |
| 16287 | WDI_ProcessDelBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16288 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16289 | WDI_ControlBlockType* pWDICtx, |
| 16290 | WDI_EventInfoType* pEventData |
| 16291 | ) |
| 16292 | { |
| 16293 | WDI_Status wdiStatus; |
| 16294 | eHalStatus halStatus; |
| 16295 | WDI_DelBARspCb wdiDelBARspCb; |
| 16296 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16297 | |
| 16298 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16299 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16300 | -------------------------------------------------------------------------*/ |
| 16301 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16302 | ( NULL == pEventData->pEventData)) |
| 16303 | { |
| 16304 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16305 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16306 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16307 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16308 | } |
| 16309 | |
| 16310 | wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB; |
| 16311 | |
| 16312 | /*------------------------------------------------------------------------- |
| 16313 | Extract response and send it to UMAC |
| 16314 | -------------------------------------------------------------------------*/ |
| 16315 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16316 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16317 | |
| 16318 | if ( eHAL_STATUS_SUCCESS == halStatus ) |
| 16319 | { |
| 16320 | /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/ |
| 16321 | } |
| 16322 | |
| 16323 | /*Notify UMAC*/ |
| 16324 | wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16325 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16326 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16327 | }/*WDI_ProcessDelBARsp*/ |
| 16328 | |
| 16329 | #ifdef FEATURE_WLAN_CCX |
| 16330 | /** |
| 16331 | @brief Process TSM Stats Rsp function (called when a response |
| 16332 | is being received over the bus from HAL) |
| 16333 | |
| 16334 | @param pWDICtx: pointer to the WLAN DAL context |
| 16335 | pEventData: pointer to the event information structure |
| 16336 | |
| 16337 | @see |
| 16338 | @return Result of the function call |
| 16339 | */ |
| 16340 | WDI_Status |
| 16341 | WDI_ProcessTsmStatsRsp |
| 16342 | ( |
| 16343 | WDI_ControlBlockType* pWDICtx, |
| 16344 | WDI_EventInfoType* pEventData |
| 16345 | ) |
| 16346 | { |
| 16347 | WDI_TsmRspCb wdiTsmStatsRspCb; |
| 16348 | tTsmStatsRspMsg halTsmStatsRspMsg; |
| 16349 | WDI_TSMStatsRspParamsType wdiTsmStatsRspParams; |
| 16350 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16351 | |
| 16352 | /*------------------------------------------------------------------------- |
| 16353 | Sanity check |
| 16354 | -------------------------------------------------------------------------*/ |
| 16355 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16356 | ( NULL == pEventData->pEventData)) |
| 16357 | { |
| 16358 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16359 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16360 | WDI_ASSERT(0); |
| 16361 | return WDI_STATUS_E_FAILURE; |
| 16362 | } |
| 16363 | |
| 16364 | wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB; |
| 16365 | |
| 16366 | /*------------------------------------------------------------------------- |
| 16367 | Unpack HAL Response Message - the header was already extracted by the |
| 16368 | main Response Handling procedure |
| 16369 | -------------------------------------------------------------------------*/ |
| 16370 | wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams, |
| 16371 | pEventData->pEventData, |
| 16372 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams)); |
| 16373 | |
| 16374 | wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly; |
| 16375 | wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist, |
| 16376 | halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist, |
| 16377 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/ |
| 16378 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0])); |
| 16379 | wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly; |
| 16380 | wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss; |
| 16381 | wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount; |
| 16382 | wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount; |
| 16383 | wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly; |
| 16384 | wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 16385 | halTsmStatsRspMsg.tsmStatsRspParams.status); |
| 16386 | |
| 16387 | /*Notify UMAC*/ |
| 16388 | wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData); |
| 16389 | |
| 16390 | return WDI_STATUS_SUCCESS; |
| 16391 | }/*WDI_ProcessTsmStatsRsp*/ |
| 16392 | |
| 16393 | #endif |
| 16394 | |
| 16395 | |
| 16396 | |
| 16397 | /** |
| 16398 | @brief Process Flush AC Rsp function (called when a response |
| 16399 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16400 | |
| 16401 | @param pWDICtx: pointer to the WLAN DAL context |
| 16402 | pEventData: pointer to the event information structure |
| 16403 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16404 | @see |
| 16405 | @return Result of the function call |
| 16406 | */ |
| 16407 | WDI_Status |
| 16408 | WDI_ProcessFlushAcRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16409 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16410 | WDI_ControlBlockType* pWDICtx, |
| 16411 | WDI_EventInfoType* pEventData |
| 16412 | ) |
| 16413 | { |
| 16414 | WDI_Status wdiStatus; |
| 16415 | eHalStatus halStatus; |
| 16416 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
| 16417 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16418 | |
| 16419 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16420 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16421 | -------------------------------------------------------------------------*/ |
| 16422 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16423 | ( NULL == pEventData->pEventData)) |
| 16424 | { |
| 16425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16426 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16427 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16428 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16429 | } |
| 16430 | |
| 16431 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB; |
| 16432 | |
| 16433 | /*------------------------------------------------------------------------- |
| 16434 | Extract response and send it to UMAC |
| 16435 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16436 | wpalMemoryCopy( &halStatus, |
| 16437 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16438 | sizeof(halStatus)); |
| 16439 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16440 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16441 | |
| 16442 | /*Notify UMAC*/ |
| 16443 | wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16444 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16445 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16446 | }/*WDI_ProcessFlushAcRsp*/ |
| 16447 | |
| 16448 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16449 | @brief Process BT AMP event Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16450 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16451 | |
| 16452 | @param pWDICtx: pointer to the WLAN DAL context |
| 16453 | pEventData: pointer to the event information structure |
| 16454 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16455 | @see |
| 16456 | @return Result of the function call |
| 16457 | */ |
| 16458 | WDI_Status |
| 16459 | WDI_ProcessBtAmpEventRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16460 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16461 | WDI_ControlBlockType* pWDICtx, |
| 16462 | WDI_EventInfoType* pEventData |
| 16463 | ) |
| 16464 | { |
| 16465 | WDI_Status wdiStatus; |
| 16466 | eHalStatus halStatus; |
| 16467 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
| 16468 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16469 | |
| 16470 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16471 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16472 | -------------------------------------------------------------------------*/ |
| 16473 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16474 | ( NULL == pEventData->pEventData)) |
| 16475 | { |
| 16476 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16477 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16478 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16479 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16480 | } |
| 16481 | |
| 16482 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB; |
| 16483 | |
| 16484 | /*------------------------------------------------------------------------- |
| 16485 | Extract response and send it to UMAC |
| 16486 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16487 | wpalMemoryCopy( &halStatus, |
| 16488 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16489 | sizeof(halStatus)); |
| 16490 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16491 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16492 | |
| 16493 | /*Notify UMAC*/ |
| 16494 | wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16495 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16496 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16497 | }/*WDI_ProcessBtAmpEventRsp*/ |
| 16498 | |
| 16499 | |
| 16500 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16501 | @brief Process ADD STA SELF Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16502 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16503 | |
| 16504 | @param pWDICtx: pointer to the WLAN DAL context |
| 16505 | pEventData: pointer to the event information structure |
| 16506 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16507 | @see |
| 16508 | @return Result of the function call |
| 16509 | */ |
| 16510 | WDI_Status |
| 16511 | WDI_ProcessAddSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16512 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16513 | WDI_ControlBlockType* pWDICtx, |
| 16514 | WDI_EventInfoType* pEventData |
| 16515 | ) |
| 16516 | { |
| 16517 | WDI_AddSTASelfRspParamsType wdiAddSTASelfParams; |
| 16518 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb; |
| 16519 | tAddStaSelfRspMsg halAddStaSelfRsp; |
| 16520 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 16521 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16522 | |
| 16523 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16524 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16525 | -------------------------------------------------------------------------*/ |
| 16526 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16527 | ( NULL == pEventData->pEventData)) |
| 16528 | { |
| 16529 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16530 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16531 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16532 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16533 | } |
| 16534 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16535 | wdiAddSTASelfReqParamsRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16536 | (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB; |
| 16537 | |
| 16538 | /*------------------------------------------------------------------------- |
| 16539 | Extract response and send it to UMAC |
| 16540 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16541 | wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams, |
| 16542 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16543 | sizeof(halAddStaSelfRsp.addStaSelfRspParams)); |
| 16544 | |
| 16545 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16546 | wdiAddSTASelfParams.wdiStatus = |
| 16547 | WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16548 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16549 | wdiAddSTASelfParams.ucSTASelfIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16550 | halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16551 | wdiAddSTASelfParams.dpuIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16552 | halAddStaSelfRsp.addStaSelfRspParams.dpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16553 | wdiAddSTASelfParams.dpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16554 | halAddStaSelfRsp.addStaSelfRspParams.dpuSignature; |
| 16555 | |
| 16556 | wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta, |
| 16557 | pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr, |
| 16558 | WDI_MAC_ADDR_LEN); |
| 16559 | |
| 16560 | |
| 16561 | #ifdef HAL_SELF_STA_PER_BSS |
| 16562 | |
| 16563 | /* At this point add the self-STA */ |
| 16564 | |
| 16565 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 16566 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 16567 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 16568 | |
| 16569 | //all DPU indices are the same for self STA |
| 16570 | |
| 16571 | /*DPU Information*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16572 | wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16573 | wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature; |
| 16574 | wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 16575 | wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 16576 | wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 16577 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 16578 | |
| 16579 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta, |
| 16580 | WDI_MAC_ADDR_LEN); |
| 16581 | |
| 16582 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 16583 | wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx; |
| 16584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16585 | if(halAddStaSelfRsp.addStaSelfRspParams.status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16586 | != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO) |
| 16587 | { |
| 16588 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 16589 | } |
| 16590 | #endif |
| 16591 | |
| 16592 | /*Notify UMAC*/ |
| 16593 | wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData); |
| 16594 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16595 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16596 | }/*WDI_ProcessAddSTASelfRsp*/ |
| 16597 | |
| 16598 | |
| 16599 | |
| 16600 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16601 | @brief WDI_ProcessDelSTASelfRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16602 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16603 | |
| 16604 | @param pWDICtx: pointer to the WLAN DAL context |
| 16605 | pEventData: pointer to the event information structure |
| 16606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16607 | @see |
| 16608 | @return Result of the function call |
| 16609 | */ |
| 16610 | WDI_Status |
| 16611 | WDI_ProcessDelSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16612 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16613 | WDI_ControlBlockType* pWDICtx, |
| 16614 | WDI_EventInfoType* pEventData |
| 16615 | ) |
| 16616 | { |
| 16617 | WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams; |
| 16618 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
| 16619 | tDelStaSelfRspParams delStaSelfRspParams; |
| 16620 | wpt_uint8 ucStaIdx; |
| 16621 | |
| 16622 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16623 | |
| 16624 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16625 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16626 | -------------------------------------------------------------------------*/ |
| 16627 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16628 | ( NULL == pEventData->pEventData)) |
| 16629 | { |
| 16630 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16631 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16632 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16633 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16634 | } |
| 16635 | |
| 16636 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB; |
| 16637 | |
| 16638 | /*------------------------------------------------------------------------- |
| 16639 | Extract response and send it to UMAC |
| 16640 | -------------------------------------------------------------------------*/ |
| 16641 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16642 | wpalMemoryCopy( &delStaSelfRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16643 | (wpt_uint8*)pEventData->pEventData, |
| 16644 | sizeof(tDelStaSelfRspParams)); |
| 16645 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16646 | wdiDelStaSelfRspParams.wdiStatus = |
| 16647 | WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16649 | /* delStaSelfRspParams.status is not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16650 | eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/ |
| 16651 | if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status ) |
| 16652 | { |
| 16653 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16654 | wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16655 | delStaSelfRspParams.selfMacAddr, |
| 16656 | &ucStaIdx); |
| 16657 | if(WDI_STATUS_E_FAILURE == wdiStatus) |
| 16658 | { |
| 16659 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16660 | "%s: Unable to extract the STA Idx ", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16661 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16662 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16663 | } |
| 16664 | WDI_STATableDelSta(pWDICtx, ucStaIdx); |
| 16665 | } |
| 16666 | |
| 16667 | /*Notify UMAC*/ |
| 16668 | wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData); |
| 16669 | |
| 16670 | return WDI_STATUS_SUCCESS; |
| 16671 | } |
| 16672 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16673 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 16674 | /** |
| 16675 | @brief Start Oem Data Rsp function (called when a |
| 16676 | response is being received over the bus from HAL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16677 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16678 | @param pWDICtx: pointer to the WLAN DAL context |
| 16679 | pEventData: pointer to the event information structure |
| 16680 | |
| 16681 | @see |
| 16682 | @return Result of the function call |
| 16683 | */ |
| 16684 | #define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName) |
| 16685 | |
| 16686 | WDI_Status |
| 16687 | WDI_ProcessStartOemDataRsp |
| 16688 | ( |
| 16689 | WDI_ControlBlockType* pWDICtx, |
| 16690 | WDI_EventInfoType* pEventData |
| 16691 | ) |
| 16692 | { |
| 16693 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 16694 | WDI_oemDataRspParamsType* wdiOemDataRspParams; |
| 16695 | tStartOemDataRspParams* halStartOemDataRspParams; |
| 16696 | |
| 16697 | /*------------------------------------------------------------------------- |
| 16698 | Sanity check |
| 16699 | -------------------------------------------------------------------------*/ |
| 16700 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16701 | ( NULL == pEventData->pEventData)) |
| 16702 | { |
| 16703 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16704 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16705 | WDI_ASSERT(0); |
| 16706 | return WDI_STATUS_E_FAILURE; |
| 16707 | } |
| 16708 | |
| 16709 | wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB; |
| 16710 | |
| 16711 | /*------------------------------------------------------------------------- |
| 16712 | Extract response and send it to UMAC |
| 16713 | -------------------------------------------------------------------------*/ |
| 16714 | halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData; |
| 16715 | |
| 16716 | |
| 16717 | //It is the responsibility of the application code to check for failure |
| 16718 | //conditions! |
| 16719 | |
| 16720 | //Allocate memory for WDI OEM DATA RSP structure |
| 16721 | wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ; |
| 16722 | |
| 16723 | if(NULL == wdiOemDataRspParams) |
| 16724 | { |
| 16725 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16726 | "Failed to allocate memory in OEM DATA Response %x %x %x ", |
| 16727 | pWDICtx, pEventData, pEventData->pEventData); |
| 16728 | WDI_ASSERT(0); |
| 16729 | return WDI_STATUS_E_FAILURE; |
| 16730 | } |
| 16731 | |
| 16732 | /* Populate WDI structure members */ |
| 16733 | wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); |
| 16734 | |
| 16735 | /*Notify UMAC*/ |
| 16736 | wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData); |
| 16737 | |
| 16738 | //Free memory allocated for WDI OEM_DATA MEAS RSP structure |
| 16739 | wpalMemoryFree(wdiOemDataRspParams); |
| 16740 | |
| 16741 | return WDI_STATUS_SUCCESS; |
| 16742 | }/*WDI_PrcoessStartOemDataRsp*/ |
| 16743 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16744 | |
| 16745 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16746 | Miscellaneous Control Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16747 | ===========================================================================*/ |
| 16748 | |
| 16749 | /** |
| 16750 | @brief Process Channel Switch Rsp function (called when a response |
| 16751 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16752 | |
| 16753 | @param pWDICtx: pointer to the WLAN DAL context |
| 16754 | pEventData: pointer to the event information structure |
| 16755 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16756 | @see |
| 16757 | @return Result of the function call |
| 16758 | */ |
| 16759 | WDI_Status |
| 16760 | WDI_ProcessChannelSwitchRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16761 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16762 | WDI_ControlBlockType* pWDICtx, |
| 16763 | WDI_EventInfoType* pEventData |
| 16764 | ) |
| 16765 | { |
| 16766 | WDI_SwitchCHRspParamsType wdiSwitchChRsp; |
| 16767 | WDI_SwitchChRspCb wdiChSwitchRspCb; |
| 16768 | tSwitchChannelRspParams halSwitchChannelRsp; |
| 16769 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16770 | |
| 16771 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16772 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16773 | -------------------------------------------------------------------------*/ |
| 16774 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16775 | ( NULL == pEventData->pEventData)) |
| 16776 | { |
| 16777 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16778 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16779 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16780 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16781 | } |
| 16782 | |
| 16783 | wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB; |
| 16784 | |
| 16785 | /*------------------------------------------------------------------------- |
| 16786 | Extract response and send it to UMAC |
| 16787 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16788 | wpalMemoryCopy( &halSwitchChannelRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16789 | (wpt_uint8*)pEventData->pEventData, |
| 16790 | sizeof(halSwitchChannelRsp)); |
| 16791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16792 | wdiSwitchChRsp.wdiStatus = |
| 16793 | WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16794 | wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber; |
| 16795 | |
| 16796 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16797 | wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16798 | #endif |
| 16799 | |
| 16800 | /*Notify UMAC*/ |
| 16801 | wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData); |
| 16802 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16803 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16804 | }/*WDI_ProcessChannelSwitchRsp*/ |
| 16805 | |
| 16806 | |
| 16807 | /** |
| 16808 | @brief Process Config STA Rsp function (called when a response |
| 16809 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16810 | |
| 16811 | @param pWDICtx: pointer to the WLAN DAL context |
| 16812 | pEventData: pointer to the event information structure |
| 16813 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16814 | @see |
| 16815 | @return Result of the function call |
| 16816 | */ |
| 16817 | WDI_Status |
| 16818 | WDI_ProcessConfigStaRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16819 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16820 | WDI_ControlBlockType* pWDICtx, |
| 16821 | WDI_EventInfoType* pEventData |
| 16822 | ) |
| 16823 | { |
| 16824 | WDI_ConfigSTARspParamsType wdiCfgSTAParams; |
| 16825 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
| 16826 | WDI_AddStaParams wdiAddSTAParam; |
| 16827 | |
| 16828 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16829 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16830 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16831 | tConfigStaRspMsg halConfigStaRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16832 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16833 | |
| 16834 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16835 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16836 | -------------------------------------------------------------------------*/ |
| 16837 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16838 | ( NULL == pEventData->pEventData)) |
| 16839 | { |
| 16840 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16841 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16842 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16843 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16844 | } |
| 16845 | |
| 16846 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB; |
| 16847 | |
| 16848 | /*------------------------------------------------------------------------- |
| 16849 | Extract response and send it to UMAC |
| 16850 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16851 | wpalMemoryCopy( &halConfigStaRsp.configStaRspParams, |
| 16852 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16853 | sizeof(halConfigStaRsp.configStaRspParams)); |
| 16854 | |
| 16855 | |
| 16856 | wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
| 16857 | wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx; |
| 16858 | wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16859 | wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 16860 | wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig; |
| 16861 | |
| 16862 | /* MAC Address of STA - take from cache as it does not come back in the |
| 16863 | response*/ |
| 16864 | wpalMemoryCopy( wdiCfgSTAParams.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16865 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16866 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16867 | |
| 16868 | wdiCfgSTAParams.wdiStatus = |
| 16869 | WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16870 | |
| 16871 | wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
| 16872 | wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
| 16873 | wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
| 16874 | |
| 16875 | if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus ) |
| 16876 | { |
| 16877 | if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16878 | { |
| 16879 | /* ADD STA to table */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16880 | wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16881 | wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16882 | wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16883 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16884 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16885 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16886 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16887 | wdiAddSTAParam.ucHTCapable = |
| 16888 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable; |
| 16889 | wdiAddSTAParam.ucStaType = |
| 16890 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType; |
Chet Lanctot | 23e79ed | 2013-06-27 11:14:56 -0700 | [diff] [blame] | 16891 | wdiAddSTAParam.ucRmfEnabled = |
| 16892 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucRMFEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16893 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16894 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16895 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 16896 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16897 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16898 | |
| 16899 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 16900 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID , |
| 16901 | WDI_MAC_ADDR_LEN); |
| 16902 | |
| 16903 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16904 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID, |
| 16905 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16906 | |
| 16907 | if ( NULL == pBSSSes ) |
| 16908 | { |
| 16909 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16910 | "Association for this BSSID is not in place"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16912 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16913 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16914 | } |
| 16915 | |
| 16916 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16917 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16918 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16919 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16920 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16921 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16922 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16923 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16924 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16925 | wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16927 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 16928 | } |
| 16929 | if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16930 | { |
| 16931 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 16932 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16933 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16934 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16935 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16936 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16937 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16938 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16939 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16940 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16941 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16942 | halConfigStaRsp.configStaRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16943 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16944 | halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16945 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16946 | halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16947 | } |
| 16948 | } |
| 16949 | |
| 16950 | /*Notify UMAC*/ |
| 16951 | wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData); |
| 16952 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16953 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16954 | }/*WDI_ProcessConfigStaRsp*/ |
| 16955 | |
| 16956 | |
| 16957 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16958 | @brief Process Set Link State Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16959 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16960 | |
| 16961 | @param pWDICtx: pointer to the WLAN DAL context |
| 16962 | pEventData: pointer to the event information structure |
| 16963 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16964 | @see |
| 16965 | @return Result of the function call |
| 16966 | */ |
| 16967 | WDI_Status |
| 16968 | WDI_ProcessSetLinkStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16969 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16970 | WDI_ControlBlockType* pWDICtx, |
| 16971 | WDI_EventInfoType* pEventData |
| 16972 | ) |
| 16973 | { |
| 16974 | WDI_Status wdiStatus; |
| 16975 | eHalStatus halStatus; |
| 16976 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb; |
| 16977 | |
| 16978 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16979 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16980 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16981 | |
| 16982 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16983 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16984 | -------------------------------------------------------------------------*/ |
| 16985 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16986 | ( NULL == pEventData->pEventData)) |
| 16987 | { |
| 16988 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16989 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16990 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16991 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16992 | } |
| 16993 | |
| 16994 | wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB; |
| 16995 | |
| 16996 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 16997 | |
| 16998 | /*If the link is being transitioned to idle - the BSS is to be deleted |
| 16999 | - this type of ending a session is possible when UMAC has failed an |
| 17000 | - association session during Join*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17001 | if ( WDI_LINK_IDLE_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17002 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 17003 | { |
| 17004 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17005 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17006 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17007 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 17008 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID, |
| 17009 | &pBSSSes); |
| 17010 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17011 | /*----------------------------------------------------------------------- |
| 17012 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17013 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17014 | -----------------------------------------------------------------------*/ |
| 17015 | if ( NULL == pBSSSes ) |
| 17016 | { |
| 17017 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 17018 | "Set link response received outside association session"); |
| 17019 | } |
| 17020 | else |
| 17021 | { |
| 17022 | /* For BT AMP roles no need to delete the sessions if assoc fails. There |
| 17023 | will be del BSS coming after this to stop the beaconing & cleaning up the |
| 17024 | sessions*/ |
| 17025 | if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&& |
| 17026 | ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType )) |
| 17027 | { |
| 17028 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17029 | The current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17030 | -----------------------------------------------------------------------*/ |
| 17031 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 17032 | |
| 17033 | /*----------------------------------------------------------------------- |
| 17034 | Check to see if this association is in progress - if so disable the |
| 17035 | flag as this has ended |
| 17036 | -----------------------------------------------------------------------*/ |
| 17037 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17038 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17039 | /*Association no longer in progress */ |
| 17040 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 17041 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 17042 | WDI_DequeueAssocRequest(pWDICtx); |
| 17043 | } |
| 17044 | } |
| 17045 | } |
| 17046 | } |
| 17047 | /* If the link state has been set to POST ASSOC, reset the "association in |
| 17048 | progress" flag */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17049 | if ( WDI_LINK_POSTASSOC_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17050 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 17051 | { |
| 17052 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 17053 | WDI_DequeueAssocRequest(pWDICtx); |
| 17054 | } |
| 17055 | |
| 17056 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 17057 | |
| 17058 | /*------------------------------------------------------------------------- |
| 17059 | Extract response and send it to UMAC |
| 17060 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17061 | wpalMemoryCopy( &halStatus, |
| 17062 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17063 | sizeof(halStatus)); |
| 17064 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17065 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17066 | |
| 17067 | /*Notify UMAC*/ |
| 17068 | wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17069 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17070 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17071 | }/*WDI_ProcessSetLinkStateRsp*/ |
| 17072 | |
| 17073 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17074 | @brief Process Get Stats Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17075 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17076 | |
| 17077 | @param pWDICtx: pointer to the WLAN DAL context |
| 17078 | pEventData: pointer to the event information structure |
| 17079 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17080 | @see |
| 17081 | @return Result of the function call |
| 17082 | */ |
| 17083 | WDI_Status |
| 17084 | WDI_ProcessGetStatsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17085 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17086 | WDI_ControlBlockType* pWDICtx, |
| 17087 | WDI_EventInfoType* pEventData |
| 17088 | ) |
| 17089 | { |
| 17090 | WDI_GetStatsRspParamsType *wdiGetStatsRsp; |
| 17091 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 17092 | tHalStatsRspParams* pHalStatsRspParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17094 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17095 | |
| 17096 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17097 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17098 | -------------------------------------------------------------------------*/ |
| 17099 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17100 | ( NULL == pEventData->pEventData)) |
| 17101 | { |
| 17102 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17103 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17104 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17105 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17106 | } |
| 17107 | |
| 17108 | /*------------------------------------------------------------------------- |
| 17109 | Extract response and send it to UMAC |
| 17110 | -------------------------------------------------------------------------*/ |
| 17111 | pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData; |
| 17112 | |
| 17113 | /*allocate the stats response buffer */ |
| 17114 | wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate( |
| 17115 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams) |
| 17116 | + sizeof(WDI_GetStatsRspParamsType)); |
| 17117 | |
| 17118 | if(NULL == wdiGetStatsRsp) |
| 17119 | { |
| 17120 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17121 | "Failed to allocate memory in Get Stats Response %x %x %x ", |
| 17122 | pWDICtx, pEventData, pEventData->pEventData); |
| 17123 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17124 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17125 | } |
| 17126 | |
| 17127 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB; |
| 17128 | |
| 17129 | wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen); |
| 17130 | wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType; |
| 17131 | wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen; |
| 17132 | wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status); |
| 17133 | wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId; |
| 17134 | wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask; |
| 17135 | |
| 17136 | /* copy the stats from buffer at the end of the tHalStatsRspParams message */ |
| 17137 | wpalMemoryCopy(wdiGetStatsRsp + 1, |
| 17138 | (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams), |
| 17139 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)); |
| 17140 | |
| 17141 | /*Notify UMAC*/ |
| 17142 | wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData); |
| 17143 | |
| 17144 | wpalMemoryFree(wdiGetStatsRsp); |
| 17145 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17146 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17147 | }/*WDI_ProcessGetStatsRsp*/ |
| 17148 | |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 17149 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 17150 | /** |
| 17151 | @brief Process Get Roam Rssi Rsp function (called when a response is |
| 17152 | being received over the bus from HAL) |
| 17153 | |
| 17154 | @param pWDICtx: pointer to the WLAN DAL context |
| 17155 | pEventData: pointer to the event information structure |
| 17156 | |
| 17157 | @see |
| 17158 | @return Result of the function call |
| 17159 | */ |
| 17160 | WDI_Status |
| 17161 | WDI_ProcessGetRoamRssiRsp |
| 17162 | ( |
| 17163 | WDI_ControlBlockType* pWDICtx, |
| 17164 | WDI_EventInfoType* pEventData |
| 17165 | ) |
| 17166 | { |
| 17167 | WDI_GetRoamRssiRspParamsType wdiGetRoamRssiRsp; |
| 17168 | WDI_GetRoamRssiRspCb wdiGetRoamRssiRspCb; |
| 17169 | tHalGetRoamRssiRspMsg halRoamRssiRspParams; |
| 17170 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17171 | |
| 17172 | /*------------------------------------------------------------------------- |
| 17173 | Sanity check |
| 17174 | -------------------------------------------------------------------------*/ |
| 17175 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17176 | ( NULL == pEventData->pEventData)) |
| 17177 | { |
| 17178 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17179 | "%s: Invalid parameters", __func__); |
| 17180 | WDI_ASSERT(0); |
| 17181 | return WDI_STATUS_E_FAILURE; |
| 17182 | } |
| 17183 | |
| 17184 | wdiGetRoamRssiRspCb = (WDI_GetRoamRssiRspCb)pWDICtx->pfncRspCB; |
| 17185 | if(NULL == wdiGetRoamRssiRspCb) |
| 17186 | { |
| 17187 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17188 | "%s: call back function is NULL", __func__); |
| 17189 | WDI_ASSERT(0); |
| 17190 | return WDI_STATUS_E_FAILURE; |
| 17191 | } |
| 17192 | |
| 17193 | /*------------------------------------------------------------------------- |
| 17194 | Extract response and send it to UMAC |
| 17195 | -------------------------------------------------------------------------*/ |
| 17196 | wpalMemoryCopy( &halRoamRssiRspParams.roamRssiRspParams, |
| 17197 | pEventData->pEventData, |
| 17198 | sizeof(halRoamRssiRspParams.roamRssiRspParams)); |
| 17199 | |
| 17200 | wdiGetRoamRssiRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halRoamRssiRspParams.roamRssiRspParams.status); |
| 17201 | wdiGetRoamRssiRsp.ucSTAIdx = halRoamRssiRspParams.roamRssiRspParams.staId; |
| 17202 | wdiGetRoamRssiRsp.rssi = halRoamRssiRspParams.roamRssiRspParams.rssi; |
| 17203 | |
| 17204 | /*Notify UMAC*/ |
| 17205 | wdiGetRoamRssiRspCb( &wdiGetRoamRssiRsp, pWDICtx->pRspCBUserData); |
| 17206 | |
| 17207 | return WDI_STATUS_SUCCESS; |
| 17208 | }/*WDI_ProcessGetRoamRssiRsp*/ |
| 17209 | #endif |
| 17210 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17211 | |
| 17212 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17213 | @brief Process Update Cfg Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17214 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17215 | |
| 17216 | @param pWDICtx: pointer to the WLAN DAL context |
| 17217 | pEventData: pointer to the event information structure |
| 17218 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17219 | @see |
| 17220 | @return Result of the function call |
| 17221 | */ |
| 17222 | WDI_Status |
| 17223 | WDI_ProcessUpdateCfgRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17224 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17225 | WDI_ControlBlockType* pWDICtx, |
| 17226 | WDI_EventInfoType* pEventData |
| 17227 | ) |
| 17228 | { |
| 17229 | WDI_Status wdiStatus; |
| 17230 | eHalStatus halStatus; |
| 17231 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb; |
| 17232 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17233 | |
| 17234 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17235 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17236 | -------------------------------------------------------------------------*/ |
| 17237 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17238 | ( NULL == pEventData->pEventData)) |
| 17239 | { |
| 17240 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17241 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17242 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17243 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17244 | } |
| 17245 | |
| 17246 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB; |
| 17247 | |
| 17248 | /*------------------------------------------------------------------------- |
| 17249 | Extract response and send it to UMAC |
| 17250 | -------------------------------------------------------------------------*/ |
| 17251 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17252 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17253 | |
| 17254 | /*Notify UMAC*/ |
| 17255 | wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17256 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17257 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17258 | }/*WDI_ProcessUpdateCfgRsp*/ |
| 17259 | |
| 17260 | |
| 17261 | |
| 17262 | /** |
| 17263 | @brief Process Add BA Rsp function (called when a response |
| 17264 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17265 | |
| 17266 | @param pWDICtx: pointer to the WLAN DAL context |
| 17267 | pEventData: pointer to the event information structure |
| 17268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17269 | @see |
| 17270 | @return Result of the function call |
| 17271 | */ |
| 17272 | WDI_Status |
| 17273 | WDI_ProcessAddBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17274 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17275 | WDI_ControlBlockType* pWDICtx, |
| 17276 | WDI_EventInfoType* pEventData |
| 17277 | ) |
| 17278 | { |
| 17279 | WDI_AddBARspCb wdiAddBARspCb; |
| 17280 | |
| 17281 | tAddBARspParams halAddBARsp; |
| 17282 | WDI_AddBARspinfoType wdiAddBARsp; |
| 17283 | |
| 17284 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17285 | |
| 17286 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17287 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17288 | -------------------------------------------------------------------------*/ |
| 17289 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17290 | ( NULL == pEventData->pEventData)) |
| 17291 | { |
| 17292 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17293 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17294 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17295 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17296 | } |
| 17297 | |
| 17298 | wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB; |
| 17299 | |
| 17300 | /*------------------------------------------------------------------------- |
| 17301 | Extract response and send it to UMAC |
| 17302 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17303 | wpalMemoryCopy( &halAddBARsp, |
| 17304 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17305 | sizeof(halAddBARsp)); |
| 17306 | |
| 17307 | wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status); |
| 17308 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 17309 | if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17310 | { |
| 17311 | wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken; |
| 17312 | } |
| 17313 | |
| 17314 | /*Notify UMAC*/ |
| 17315 | wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData); |
| 17316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17317 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17318 | }/*WDI_ProcessAddSessionBARsp*/ |
| 17319 | |
| 17320 | /** |
| 17321 | @brief Process Add BA Rsp function (called when a response |
| 17322 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17323 | |
| 17324 | @param pWDICtx: pointer to the WLAN DAL context |
| 17325 | pEventData: pointer to the event information structure |
| 17326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17327 | @see |
| 17328 | @return Result of the function call |
| 17329 | */ |
| 17330 | WDI_Status |
| 17331 | WDI_ProcessTriggerBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17332 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17333 | WDI_ControlBlockType* pWDICtx, |
| 17334 | WDI_EventInfoType* pEventData |
| 17335 | ) |
| 17336 | { |
| 17337 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
| 17338 | |
| 17339 | tTriggerBARspParams* halTriggerBARsp; |
| 17340 | tTriggerBaRspCandidate* halBaCandidate; |
| 17341 | WDI_TriggerBARspParamsType* wdiTriggerBARsp; |
| 17342 | WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate; |
| 17343 | wpt_uint16 index; |
| 17344 | wpt_uint16 TidIndex; |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17345 | WDI_Status halTriggerBARspStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17346 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17347 | |
| 17348 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17349 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17350 | -------------------------------------------------------------------------*/ |
| 17351 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17352 | ( NULL == pEventData->pEventData)) |
| 17353 | { |
| 17354 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17355 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17356 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17357 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17358 | } |
| 17359 | |
| 17360 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB; |
| 17361 | |
| 17362 | /*------------------------------------------------------------------------- |
| 17363 | Extract response and send it to UMAC |
| 17364 | -------------------------------------------------------------------------*/ |
| 17365 | halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData; |
| 17366 | |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17367 | halTriggerBARspStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status); |
| 17368 | |
| 17369 | if ( WDI_STATUS_SUCCESS == halTriggerBARspStatus) |
| 17370 | { |
| 17371 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17372 | halTriggerBARsp->baCandidateCnt * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17373 | sizeof(WDI_TriggerBARspCandidateType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17374 | |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17375 | if(NULL == wdiTriggerBARsp) |
| 17376 | { |
| 17377 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17378 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 17379 | pWDICtx, pEventData, pEventData->pEventData); |
| 17380 | WDI_ASSERT(0); |
| 17381 | return WDI_STATUS_E_FAILURE; |
| 17382 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17383 | |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17384 | wdiTriggerBARsp->wdiStatus = halTriggerBARspStatus; |
| 17385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17386 | wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17387 | wpalMemoryCopy(wdiTriggerBARsp->macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17388 | halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN); |
| 17389 | |
| 17390 | wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1); |
| 17391 | halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1); |
| 17392 | |
| 17393 | for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++) |
| 17394 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17395 | wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17396 | halBaCandidate->staAddr, WDI_MAC_ADDR_LEN); |
| 17397 | for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++) |
| 17398 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17399 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17400 | halBaCandidate->baInfo[TidIndex].fBaEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17401 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17402 | halBaCandidate->baInfo[TidIndex].startingSeqNum; |
| 17403 | } |
| 17404 | wdiTriggerBARspCandidate++; |
| 17405 | halBaCandidate++; |
| 17406 | } |
| 17407 | } |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17408 | else |
| 17409 | { |
| 17410 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType)); |
| 17411 | |
| 17412 | if(NULL == wdiTriggerBARsp) |
| 17413 | { |
| 17414 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17415 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 17416 | pWDICtx, pEventData, pEventData->pEventData); |
| 17417 | WDI_ASSERT(0); |
| 17418 | return WDI_STATUS_E_FAILURE; |
| 17419 | } |
| 17420 | |
| 17421 | wdiTriggerBARsp->wdiStatus = halTriggerBARspStatus; |
| 17422 | |
| 17423 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17424 | |
| 17425 | /*Notify UMAC*/ |
| 17426 | wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData); |
| 17427 | |
| 17428 | wpalMemoryFree(wdiTriggerBARsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17429 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17430 | }/*WDI_ProcessAddSessionBARsp*/ |
| 17431 | |
| 17432 | /** |
| 17433 | @brief Process Update Beacon Params Rsp function (called when a response |
| 17434 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17435 | |
| 17436 | @param pWDICtx: pointer to the WLAN DAL context |
| 17437 | pEventData: pointer to the event information structure |
| 17438 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17439 | @see |
| 17440 | @return Result of the function call |
| 17441 | */ |
| 17442 | WDI_Status |
| 17443 | WDI_ProcessUpdateBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17444 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17445 | WDI_ControlBlockType* pWDICtx, |
| 17446 | WDI_EventInfoType* pEventData |
| 17447 | ) |
| 17448 | { |
| 17449 | WDI_Status wdiStatus; |
| 17450 | eHalStatus halStatus; |
| 17451 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
| 17452 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17453 | |
| 17454 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17455 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17456 | -------------------------------------------------------------------------*/ |
| 17457 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17458 | ( NULL == pEventData->pEventData)) |
| 17459 | { |
| 17460 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17461 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17462 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17463 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17464 | } |
| 17465 | |
| 17466 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 17467 | |
| 17468 | /*------------------------------------------------------------------------- |
| 17469 | Extract response and send it to UMAC |
| 17470 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17471 | wpalMemoryCopy( &halStatus, |
| 17472 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17473 | sizeof(halStatus)); |
| 17474 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17475 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17476 | |
| 17477 | /*Notify UMAC*/ |
| 17478 | wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17480 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17481 | }/*WDI_ProcessUpdateBeaconParamsRsp*/ |
| 17482 | |
| 17483 | /** |
| 17484 | @brief Process Send Beacon template Rsp function (called when a response |
| 17485 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17486 | |
| 17487 | @param pWDICtx: pointer to the WLAN DAL context |
| 17488 | pEventData: pointer to the event information structure |
| 17489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17490 | @see |
| 17491 | @return Result of the function call |
| 17492 | */ |
| 17493 | WDI_Status |
| 17494 | WDI_ProcessSendBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17495 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17496 | WDI_ControlBlockType* pWDICtx, |
| 17497 | WDI_EventInfoType* pEventData |
| 17498 | ) |
| 17499 | { |
| 17500 | WDI_Status wdiStatus; |
| 17501 | eHalStatus halStatus; |
| 17502 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
| 17503 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17504 | |
| 17505 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17506 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17507 | -------------------------------------------------------------------------*/ |
| 17508 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17509 | ( NULL == pEventData->pEventData)) |
| 17510 | { |
| 17511 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17512 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17513 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17514 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17515 | } |
| 17516 | |
| 17517 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 17518 | |
| 17519 | /*------------------------------------------------------------------------- |
| 17520 | Extract response and send it to UMAC |
| 17521 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17522 | wpalMemoryCopy( &halStatus, |
| 17523 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17524 | sizeof(halStatus)); |
| 17525 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17526 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17527 | |
| 17528 | /*Notify UMAC*/ |
| 17529 | wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17530 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17531 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17532 | }/*WDI_ProcessSendBeaconParamsRsp*/ |
| 17533 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17535 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17536 | @brief Process Update Probe Resp Template Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17537 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17538 | |
| 17539 | @param pWDICtx: pointer to the WLAN DAL context |
| 17540 | pEventData: pointer to the event information structure |
| 17541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17542 | @see |
| 17543 | @return Result of the function call |
| 17544 | */ |
| 17545 | WDI_Status |
| 17546 | WDI_ProcessUpdateProbeRspTemplateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17547 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17548 | WDI_ControlBlockType* pWDICtx, |
| 17549 | WDI_EventInfoType* pEventData |
| 17550 | ) |
| 17551 | { |
| 17552 | WDI_Status wdiStatus; |
| 17553 | eHalStatus halStatus; |
| 17554 | WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb; |
| 17555 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17556 | |
| 17557 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17558 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17559 | -------------------------------------------------------------------------*/ |
| 17560 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17561 | ( NULL == pEventData->pEventData)) |
| 17562 | { |
| 17563 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17564 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17565 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17566 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17567 | } |
| 17568 | |
| 17569 | wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB; |
| 17570 | |
| 17571 | /*------------------------------------------------------------------------- |
| 17572 | Extract response and send it to UMAC |
| 17573 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17574 | wpalMemoryCopy( &halStatus, |
| 17575 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17576 | sizeof(halStatus)); |
| 17577 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17578 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17579 | |
| 17580 | /*Notify UMAC*/ |
| 17581 | wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17582 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17583 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17584 | }/*WDI_ProcessUpdateProbeRspTemplateRsp*/ |
| 17585 | |
| 17586 | /** |
| 17587 | @brief Process Set Max Tx Power Rsp function (called when a response |
| 17588 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17589 | |
| 17590 | @param pWDICtx: pointer to the WLAN DAL context |
| 17591 | pEventData: pointer to the event information structure |
| 17592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17593 | @see |
| 17594 | @return Result of the function call |
| 17595 | */ |
| 17596 | WDI_Status |
| 17597 | WDI_ProcessSetMaxTxPowerRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17598 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17599 | WDI_ControlBlockType* pWDICtx, |
| 17600 | WDI_EventInfoType* pEventData |
| 17601 | ) |
| 17602 | { |
| 17603 | tSetMaxTxPwrRspMsg halTxpowerrsp; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17604 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17605 | WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17607 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb; |
| 17608 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17609 | |
| 17610 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17611 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17612 | -------------------------------------------------------------------------*/ |
| 17613 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17614 | ( NULL == pEventData->pEventData)) |
| 17615 | { |
| 17616 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17617 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17618 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17619 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17620 | } |
| 17621 | |
| 17622 | wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB; |
| 17623 | |
| 17624 | /*------------------------------------------------------------------------- |
| 17625 | Extract response and send it to UMAC |
| 17626 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17627 | wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams, |
| 17628 | pEventData->pEventData, |
| 17629 | sizeof(halTxpowerrsp.setMaxTxPwrRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17630 | |
| 17631 | if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status ) |
| 17632 | { |
| 17633 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17634 | "Error status returned in Set Max Tx Power Response "); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17635 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 17636 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17637 | } |
| 17638 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17639 | wdiSetMaxTxPowerRspMsg.wdiStatus = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17640 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17641 | wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17642 | |
| 17643 | /*Notify UMAC*/ |
| 17644 | wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 17645 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17646 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17647 | } |
| 17648 | |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 17649 | /** |
| 17650 | @brief Process Set Tx Power Rsp function (called when a response |
| 17651 | is being received over the bus from HAL) |
| 17652 | |
| 17653 | @param pWDICtx: pointer to the WLAN DAL context |
| 17654 | pEventData: pointer to the event information structure |
| 17655 | |
| 17656 | @see |
| 17657 | @return Result of the function call |
| 17658 | */ |
| 17659 | WDI_Status |
| 17660 | WDI_ProcessSetTxPowerRsp |
| 17661 | ( |
| 17662 | WDI_ControlBlockType* pWDICtx, |
| 17663 | WDI_EventInfoType* pEventData |
| 17664 | ) |
| 17665 | { |
| 17666 | tSetTxPwrRspMsg halTxpowerrsp; |
| 17667 | WDI_SetTxPowerRspMsg wdiSetTxPowerRspMsg; |
| 17668 | WDA_SetTxPowerRspCb wdiReqStatusCb; |
| 17669 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17670 | |
| 17671 | /*------------------------------------------------------------------------- |
| 17672 | Sanity check |
| 17673 | -------------------------------------------------------------------------*/ |
| 17674 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17675 | ( NULL == pEventData->pEventData)) |
| 17676 | { |
| 17677 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17678 | "%s: Invalid parameters", __func__); |
| 17679 | WDI_ASSERT(0); |
| 17680 | return WDI_STATUS_E_FAILURE; |
| 17681 | } |
| 17682 | |
| 17683 | wdiReqStatusCb = (WDA_SetTxPowerRspCb)pWDICtx->pfncRspCB; |
| 17684 | |
| 17685 | /*------------------------------------------------------------------------- |
| 17686 | Extract response and send it to UMAC |
| 17687 | -------------------------------------------------------------------------*/ |
| 17688 | wpalMemoryCopy(&halTxpowerrsp.setTxPwrRspParams, |
| 17689 | pEventData->pEventData, |
| 17690 | sizeof(halTxpowerrsp.setTxPwrRspParams)); |
| 17691 | |
| 17692 | if (eHAL_STATUS_SUCCESS != halTxpowerrsp.setTxPwrRspParams.status) |
| 17693 | { |
| 17694 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17695 | "Error status returned in Set Tx Power Response "); |
| 17696 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 17697 | return WDI_STATUS_E_FAILURE; |
| 17698 | } |
| 17699 | |
| 17700 | wdiSetTxPowerRspMsg.wdiStatus = |
| 17701 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setTxPwrRspParams.status); |
| 17702 | |
| 17703 | /*Notify UMAC*/ |
| 17704 | wdiReqStatusCb(&wdiSetTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 17705 | |
| 17706 | return WDI_STATUS_SUCCESS; |
| 17707 | } |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 17708 | #ifdef FEATURE_WLAN_TDLS |
| 17709 | /** |
| 17710 | @brief Process TDLS Link Establish Rsp function (called |
| 17711 | when a response is being received over the bus from HAL) |
| 17712 | |
| 17713 | @param pWDICtx: pointer to the WLAN DAL context |
| 17714 | pEventData: pointer to the event information structure |
| 17715 | |
| 17716 | @see |
| 17717 | @return Result of the function call |
| 17718 | */ |
| 17719 | WDI_Status |
| 17720 | WDI_ProcessLinkEstablishReqRsp |
| 17721 | ( |
| 17722 | WDI_ControlBlockType* pWDICtx, |
| 17723 | WDI_EventInfoType* pEventData |
| 17724 | ) |
| 17725 | { |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 17726 | eHalStatus halStatus; |
| 17727 | WDI_SetTDLSLinkEstablishReqParamsRspCb wdiTDLSLinkEstablishReqParamsRspCb; |
Gopichand Nakkala | 68d0c88 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 17728 | tTDLSLinkEstablishedRespMsg halTdlsLinkEstablishedRespMsg; |
| 17729 | WDI_SetTdlsLinkEstablishReqResp wdiSetTdlsLinkEstablishReqResp; |
| 17730 | |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 17731 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17732 | |
| 17733 | /*------------------------------------------------------------------------- |
| 17734 | Sanity check |
| 17735 | -------------------------------------------------------------------------*/ |
| 17736 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17737 | ( NULL == pEventData->pEventData)) |
| 17738 | { |
| 17739 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17740 | "%s: Invalid parameters", __func__); |
| 17741 | WDI_ASSERT(0); |
| 17742 | return WDI_STATUS_E_FAILURE; |
| 17743 | } |
| 17744 | |
Gopichand Nakkala | 68d0c88 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 17745 | /*------------------------------------------------------------------------- |
| 17746 | Extract indication and send it to UMAC |
| 17747 | -------------------------------------------------------------------------*/ |
| 17748 | wpalMemoryCopy( &halTdlsLinkEstablishedRespMsg.TDLSLinkEstablishedRespParams, |
| 17749 | pEventData->pEventData, |
| 17750 | sizeof(halTdlsLinkEstablishedRespMsg.TDLSLinkEstablishedRespParams) ); |
| 17751 | |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 17752 | wdiTDLSLinkEstablishReqParamsRspCb = (WDI_SetTDLSLinkEstablishReqParamsRspCb)pWDICtx->pfncRspCB; |
| 17753 | |
| 17754 | /*------------------------------------------------------------------------- |
| 17755 | Extract response and send it to UMAC |
| 17756 | -------------------------------------------------------------------------*/ |
| 17757 | wpalMemoryCopy( &halStatus, |
| 17758 | pEventData->pEventData, |
| 17759 | sizeof(halStatus)); |
| 17760 | |
Gopichand Nakkala | 68d0c88 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 17761 | wdiSetTdlsLinkEstablishReqResp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17762 | wdiSetTdlsLinkEstablishReqResp.uStaIdx = halTdlsLinkEstablishedRespMsg.TDLSLinkEstablishedRespParams.staIdx; |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 17763 | |
| 17764 | /*Notify UMAC*/ |
Gopichand Nakkala | 68d0c88 | 2013-06-27 19:38:43 +0530 | [diff] [blame] | 17765 | wdiTDLSLinkEstablishReqParamsRspCb( &wdiSetTdlsLinkEstablishReqResp, pWDICtx->pRspCBUserData); |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 17766 | |
| 17767 | return WDI_STATUS_SUCCESS; |
| 17768 | }/*WDI_ProcessLinkEstablishReqRsp*/ |
| 17769 | #endif |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 17770 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17771 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17772 | @brief Process P2P Group Owner Notice Of Absense Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17773 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17774 | |
| 17775 | @param pWDICtx: pointer to the WLAN DAL context |
| 17776 | pEventData: pointer to the event information structure |
| 17777 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17778 | @see |
| 17779 | @return Result of the function call |
| 17780 | */ |
| 17781 | WDI_Status |
| 17782 | WDI_ProcessP2PGONOARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17783 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17784 | WDI_ControlBlockType* pWDICtx, |
| 17785 | WDI_EventInfoType* pEventData |
| 17786 | ) |
| 17787 | { |
| 17788 | WDI_Status wdiStatus; |
| 17789 | eHalStatus halStatus; |
| 17790 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb; |
| 17791 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17792 | |
| 17793 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17794 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17795 | -------------------------------------------------------------------------*/ |
| 17796 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17797 | ( NULL == pEventData->pEventData)) |
| 17798 | { |
| 17799 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17800 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17801 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17802 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17803 | } |
| 17804 | |
| 17805 | wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB; |
| 17806 | |
| 17807 | /*------------------------------------------------------------------------- |
| 17808 | Extract response and send it to UMAC |
| 17809 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17810 | wpalMemoryCopy( &halStatus, |
| 17811 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17812 | sizeof(halStatus)); |
| 17813 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17814 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17815 | |
| 17816 | /*Notify UMAC*/ |
| 17817 | wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17818 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17819 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17820 | }/*WDI_ProcessP2PGONOARsp*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17821 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17822 | @brief Process Enter IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17823 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17824 | |
| 17825 | @param pWDICtx: pointer to the WLAN DAL context |
| 17826 | pEventData: pointer to the event information structure |
| 17827 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17828 | @see |
| 17829 | @return Result of the function call |
| 17830 | */ |
| 17831 | WDI_Status |
| 17832 | WDI_ProcessEnterImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17833 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17834 | WDI_ControlBlockType* pWDICtx, |
| 17835 | WDI_EventInfoType* pEventData |
| 17836 | ) |
| 17837 | { |
| 17838 | WDI_Status wdiStatus; |
| 17839 | eHalStatus halStatus; |
| 17840 | WDI_EnterImpsRspCb wdiEnterImpsRspCb; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17841 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17842 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17843 | |
| 17844 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17845 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17846 | -------------------------------------------------------------------------*/ |
| 17847 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17848 | ( NULL == pEventData->pEventData)) |
| 17849 | { |
| 17850 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17851 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17852 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17853 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17854 | } |
| 17855 | |
| 17856 | wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB; |
| 17857 | |
| 17858 | /*------------------------------------------------------------------------- |
| 17859 | Extract response and send it to UMAC |
| 17860 | -------------------------------------------------------------------------*/ |
| 17861 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17862 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17863 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17864 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17865 | /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state. |
| 17866 | * Other module states are taken care by PMC. |
| 17867 | * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails?? |
| 17868 | */ |
| 17869 | if (wdiStatus != WDI_STATUS_SUCCESS) { |
| 17870 | |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 17871 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17872 | "WDI Process Enter IMPS RSP failed With HAL Status Code: %d", |
| 17873 | halStatus); |
| 17874 | /* Call Back is not required as we are putting the DXE in FULL |
| 17875 | * and riva is already in full (IMPS RSP Failed)*/ |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17876 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17877 | |
| 17878 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) { |
| 17879 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17880 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 17881 | WDI_ASSERT(0); |
| 17882 | } |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17883 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17884 | /*Notify UMAC*/ |
| 17885 | wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17886 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17887 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17888 | }/*WDI_ProcessEnterImpsRsp*/ |
| 17889 | |
| 17890 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17891 | @brief Process Exit IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17892 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17893 | |
| 17894 | @param pWDICtx: pointer to the WLAN DAL context |
| 17895 | pEventData: pointer to the event information structure |
| 17896 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17897 | @see |
| 17898 | @return Result of the function call |
| 17899 | */ |
| 17900 | WDI_Status |
| 17901 | WDI_ProcessExitImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17902 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17903 | WDI_ControlBlockType* pWDICtx, |
| 17904 | WDI_EventInfoType* pEventData |
| 17905 | ) |
| 17906 | { |
| 17907 | WDI_Status wdiStatus; |
| 17908 | eHalStatus halStatus; |
| 17909 | WDI_ExitImpsRspCb wdiExitImpsRspCb; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17910 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17911 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17912 | |
| 17913 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17914 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17915 | -------------------------------------------------------------------------*/ |
| 17916 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17917 | ( NULL == pEventData->pEventData)) |
| 17918 | { |
| 17919 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17920 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17921 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17922 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17923 | } |
| 17924 | |
| 17925 | wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB; |
| 17926 | |
| 17927 | /*------------------------------------------------------------------------- |
| 17928 | Extract response and send it to UMAC |
| 17929 | -------------------------------------------------------------------------*/ |
| 17930 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17931 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17932 | |
Gopichand Nakkala | c8c7121 | 2013-05-29 18:53:35 +0530 | [diff] [blame] | 17933 | if (halStatus != eHAL_STATUS_SUCCESS) |
| 17934 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17935 | "%s: Exit IMPS response is a failure with halStatus %d", __func__, halStatus); |
| 17936 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17937 | // notify DTS that we are entering Full power |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17938 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17939 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 17940 | { |
| 17941 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17942 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 17943 | WDI_ASSERT(0); |
| 17944 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17945 | /*Notify UMAC*/ |
| 17946 | wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17947 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17948 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17949 | }/*WDI_ProcessExitImpsRsp*/ |
| 17950 | |
| 17951 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17952 | @brief Process Enter BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17953 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17954 | |
| 17955 | @param pWDICtx: pointer to the WLAN DAL context |
| 17956 | pEventData: pointer to the event information structure |
| 17957 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17958 | @see |
| 17959 | @return Result of the function call |
| 17960 | */ |
| 17961 | WDI_Status |
| 17962 | WDI_ProcessEnterBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17963 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17964 | WDI_ControlBlockType* pWDICtx, |
| 17965 | WDI_EventInfoType* pEventData |
| 17966 | ) |
| 17967 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17968 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 17969 | tHalEnterBmpsRspParams halEnterBmpsRsp; |
| 17970 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb; |
| 17971 | WDI_EnterBmpsRspParamsType wdiEnterBmpsRspparams; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17972 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17973 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17974 | |
| 17975 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17976 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17977 | -------------------------------------------------------------------------*/ |
| 17978 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17979 | ( NULL == pEventData->pEventData)) |
| 17980 | { |
| 17981 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17982 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17983 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17984 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17985 | } |
| 17986 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17987 | /*------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17988 | Extract response and send it to UMAC |
| 17989 | -------------------------------------------------------------------------*/ |
| 17990 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17991 | { |
| 17992 | wpalMemoryCopy( &halEnterBmpsRsp, |
| 17993 | pEventData->pEventData, |
| 17994 | sizeof(halEnterBmpsRsp)); |
| 17995 | |
| 17996 | //Used to print debug message |
| 17997 | halStatus = halEnterBmpsRsp.status; |
| 17998 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterBmpsRsp.status); |
| 17999 | wdiEnterBmpsRspparams.bssIdx = halEnterBmpsRsp.bssIdx; |
| 18000 | } |
| 18001 | else |
| 18002 | { |
| 18003 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18004 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18005 | } |
| 18006 | |
| 18007 | wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18008 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 18009 | /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state. |
| 18010 | * Other module states are taken care by PMC. |
| 18011 | * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails?? |
| 18012 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18013 | if (wdiEnterBmpsRspparams.wdiStatus != WDI_STATUS_SUCCESS) |
| 18014 | { |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 18015 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18016 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 18017 | "WDI Process Enter BMPS RSP failed With HAL Status Code: %d", |
| 18018 | halStatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18019 | /* Call Back is not required as we are putting the DXE in FULL |
| 18020 | * and riva is already in FULL (BMPS RSP Failed)*/ |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 18021 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 18022 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 18023 | { |
| 18024 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 18025 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 18026 | WDI_ASSERT(0); |
| 18027 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18028 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 18029 | } |
| 18030 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18031 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18032 | wdiEnterBmpsRspCb( &wdiEnterBmpsRspparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18033 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18034 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18035 | }/*WDI_ProcessEnterBmpsRsp*/ |
| 18036 | |
| 18037 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18038 | @brief Process Exit BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18039 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18040 | |
| 18041 | @param pWDICtx: pointer to the WLAN DAL context |
| 18042 | pEventData: pointer to the event information structure |
| 18043 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18044 | @see |
| 18045 | @return Result of the function call |
| 18046 | */ |
| 18047 | WDI_Status |
| 18048 | WDI_ProcessExitBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18049 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18050 | WDI_ControlBlockType* pWDICtx, |
| 18051 | WDI_EventInfoType* pEventData |
| 18052 | ) |
| 18053 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18054 | eHalStatus halStatus; |
| 18055 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18056 | tHalExitBmpsRspParams halExitBmpsRsp; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 18057 | WDI_ExitBmpsRspParamsType wdiExitBmpsRspParams; |
| 18058 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18059 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18060 | |
| 18061 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18062 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18063 | -------------------------------------------------------------------------*/ |
| 18064 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18065 | ( NULL == pEventData->pEventData)) |
| 18066 | { |
| 18067 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18068 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18069 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18070 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18071 | } |
| 18072 | |
| 18073 | wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB; |
| 18074 | |
| 18075 | /*------------------------------------------------------------------------- |
| 18076 | Extract response and send it to UMAC |
| 18077 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18078 | |
| 18079 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18080 | { |
| 18081 | wpalMemoryCopy( &halExitBmpsRsp, |
| 18082 | pEventData->pEventData, |
| 18083 | sizeof(halExitBmpsRsp)); |
| 18084 | |
| 18085 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitBmpsRsp.status); |
| 18086 | wdiExitBmpsRspParams.bssIdx = halExitBmpsRsp.bssIdx; |
| 18087 | } |
| 18088 | else |
| 18089 | { |
| 18090 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18091 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18092 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18093 | |
| 18094 | // notify DTS that we are entering Full power |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 18095 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 18096 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 18097 | { |
| 18098 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 18099 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 18100 | WDI_ASSERT(0); |
| 18101 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18102 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
| 18103 | |
| 18104 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18105 | wdiExitBmpsRspCb( &wdiExitBmpsRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18106 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18107 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18108 | }/*WDI_ProcessExitBmpsRsp*/ |
| 18109 | |
| 18110 | /** |
| 18111 | @brief Process Enter UAPSD Rsp function (called when a response |
| 18112 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18113 | |
| 18114 | @param pWDICtx: pointer to the WLAN DAL context |
| 18115 | pEventData: pointer to the event information structure |
| 18116 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18117 | @see |
| 18118 | @return Result of the function call |
| 18119 | */ |
| 18120 | WDI_Status |
| 18121 | WDI_ProcessEnterUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18122 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18123 | WDI_ControlBlockType* pWDICtx, |
| 18124 | WDI_EventInfoType* pEventData |
| 18125 | ) |
| 18126 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18127 | eHalStatus halStatus; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18128 | tUapsdRspParams halEnterUapsdRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18129 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18130 | WDI_EnterUapsdRspParamsType wdiEnterUapsdRspParams; |
| 18131 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18132 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18133 | |
| 18134 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18135 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18136 | -------------------------------------------------------------------------*/ |
| 18137 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18138 | ( NULL == pEventData->pEventData)) |
| 18139 | { |
| 18140 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18141 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18142 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18143 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18144 | } |
| 18145 | |
| 18146 | wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB; |
| 18147 | |
| 18148 | /*------------------------------------------------------------------------- |
| 18149 | Extract response and send it to UMAC |
| 18150 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18151 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18152 | { |
| 18153 | wpalMemoryCopy( &halEnterUapsdRsp, |
| 18154 | pEventData->pEventData, |
| 18155 | sizeof(halEnterUapsdRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18156 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18157 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterUapsdRsp.status); |
| 18158 | wdiEnterUapsdRspParams.bssIdx = halEnterUapsdRsp.bssIdx; |
| 18159 | } |
| 18160 | else |
| 18161 | { |
| 18162 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18163 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18164 | } |
| 18165 | |
| 18166 | if(WDI_STATUS_SUCCESS == wdiEnterUapsdRspParams.wdiStatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18167 | { |
| 18168 | // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed |
| 18169 | // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring |
| 18170 | // the traffic to decide when to suspend the trigger frames when there is no traffic |
| 18171 | // activity on the trigger enabled ACs |
| 18172 | pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX; |
| 18173 | |
| 18174 | #ifdef WLAN_PERF |
| 18175 | // Increment the BD signature to refresh the fast path BD utilization |
| 18176 | pWDICtx->uBdSigSerialNum++; |
| 18177 | #endif |
| 18178 | } |
| 18179 | |
| 18180 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18181 | wdiEnterUapsdRspCb( &wdiEnterUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18183 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18184 | }/*WDI_ProcessEnterUapsdRsp*/ |
| 18185 | |
| 18186 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18187 | @brief Process Exit UAPSD Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18188 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18189 | |
| 18190 | @param pWDICtx: pointer to the WLAN DAL context |
| 18191 | pEventData: pointer to the event information structure |
| 18192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18193 | @see |
| 18194 | @return Result of the function call |
| 18195 | */ |
| 18196 | WDI_Status |
| 18197 | WDI_ProcessExitUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18198 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18199 | WDI_ControlBlockType* pWDICtx, |
| 18200 | WDI_EventInfoType* pEventData |
| 18201 | ) |
| 18202 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18203 | eHalStatus halStatus; |
| 18204 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18205 | tHalExitUapsdRspParams halExitUapsdRsp; |
| 18206 | WDI_ExitUapsdRspParamsType wdiExitUapsdRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18207 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18208 | |
| 18209 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18210 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18211 | -------------------------------------------------------------------------*/ |
| 18212 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18213 | ( NULL == pEventData->pEventData)) |
| 18214 | { |
| 18215 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18216 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18217 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18218 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18219 | } |
| 18220 | |
| 18221 | wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB; |
| 18222 | |
| 18223 | /*------------------------------------------------------------------------- |
| 18224 | Extract response and send it to UMAC |
| 18225 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18226 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18227 | { |
| 18228 | wpalMemoryCopy( &halExitUapsdRsp, |
| 18229 | pEventData->pEventData, |
| 18230 | sizeof(halExitUapsdRsp)); |
| 18231 | |
| 18232 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitUapsdRsp.status); |
| 18233 | wdiExitUapsdRspParams.bssIdx = halExitUapsdRsp.bssIdx; |
| 18234 | } |
| 18235 | else |
| 18236 | { |
| 18237 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18238 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18239 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18240 | // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM |
| 18241 | // directly instead of the FW WQ. |
| 18242 | pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT; |
| 18243 | |
| 18244 | #ifdef WLAN_PERF |
| 18245 | // Increment the BD signature to refresh the fast path BD utilization |
| 18246 | pWDICtx->uBdSigSerialNum++; |
| 18247 | #endif |
| 18248 | |
| 18249 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18250 | wdiExitUapsdRspCb( &wdiExitUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18251 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18252 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18253 | }/*WDI_ProcessExitUapsdRsp*/ |
| 18254 | |
| 18255 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18256 | @brief Process set UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18257 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18258 | |
| 18259 | @param pWDICtx: pointer to the WLAN DAL context |
| 18260 | pEventData: pointer to the event information structure |
| 18261 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18262 | @see |
| 18263 | @return Result of the function call |
| 18264 | */ |
| 18265 | WDI_Status |
| 18266 | WDI_ProcessSetUapsdAcParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18267 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18268 | WDI_ControlBlockType* pWDICtx, |
| 18269 | WDI_EventInfoType* pEventData |
| 18270 | ) |
| 18271 | { |
| 18272 | WDI_Status wdiStatus; |
| 18273 | eHalStatus halStatus; |
| 18274 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb; |
| 18275 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18276 | |
| 18277 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18278 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18279 | -------------------------------------------------------------------------*/ |
| 18280 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18281 | ( NULL == pEventData->pEventData)) |
| 18282 | { |
| 18283 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18284 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18285 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18286 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18287 | } |
| 18288 | |
| 18289 | wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB; |
| 18290 | |
| 18291 | /*------------------------------------------------------------------------- |
| 18292 | Extract response and send it to UMAC |
| 18293 | -------------------------------------------------------------------------*/ |
| 18294 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18295 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18296 | |
| 18297 | /*Notify UMAC*/ |
| 18298 | wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18299 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18300 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18301 | }/*WDI_ProcessSetUapsdAcParamsRsp*/ |
| 18302 | |
| 18303 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18304 | @brief Process update UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18305 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18306 | |
| 18307 | @param pWDICtx: pointer to the WLAN DAL context |
| 18308 | pEventData: pointer to the event information structure |
| 18309 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18310 | @see |
| 18311 | @return Result of the function call |
| 18312 | */ |
| 18313 | WDI_Status |
| 18314 | WDI_ProcessUpdateUapsdParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18315 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18316 | WDI_ControlBlockType* pWDICtx, |
| 18317 | WDI_EventInfoType* pEventData |
| 18318 | ) |
| 18319 | { |
| 18320 | WDI_Status wdiStatus; |
| 18321 | eHalStatus halStatus; |
| 18322 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb; |
| 18323 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18324 | |
| 18325 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18326 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18327 | -------------------------------------------------------------------------*/ |
| 18328 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18329 | ( NULL == pEventData->pEventData)) |
| 18330 | { |
| 18331 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18332 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18333 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18334 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18335 | } |
| 18336 | |
| 18337 | wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB; |
| 18338 | |
| 18339 | /*------------------------------------------------------------------------- |
| 18340 | Extract response and send it to UMAC |
| 18341 | -------------------------------------------------------------------------*/ |
| 18342 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18343 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18344 | |
| 18345 | /*Notify UMAC*/ |
| 18346 | wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18347 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18348 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18349 | }/*WDI_ProcessUpdateUapsdParamsRsp*/ |
| 18350 | |
| 18351 | /** |
| 18352 | @brief Process Configure RXP filter Rsp function (called when a |
| 18353 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18354 | |
| 18355 | @param pWDICtx: pointer to the WLAN DAL context |
| 18356 | pEventData: pointer to the event information structure |
| 18357 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18358 | @see |
| 18359 | @return Result of the function call |
| 18360 | */ |
| 18361 | WDI_Status |
| 18362 | WDI_ProcessConfigureRxpFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18363 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18364 | WDI_ControlBlockType* pWDICtx, |
| 18365 | WDI_EventInfoType* pEventData |
| 18366 | ) |
| 18367 | { |
| 18368 | WDI_Status wdiStatus; |
| 18369 | eHalStatus halStatus; |
| 18370 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb; |
| 18371 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18372 | |
| 18373 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18374 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18375 | -------------------------------------------------------------------------*/ |
| 18376 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18377 | ( NULL == pEventData->pEventData)) |
| 18378 | { |
| 18379 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18380 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18381 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18382 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18383 | } |
| 18384 | |
| 18385 | wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB; |
| 18386 | |
| 18387 | /*------------------------------------------------------------------------- |
| 18388 | Extract response and send it to UMAC |
| 18389 | -------------------------------------------------------------------------*/ |
| 18390 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18391 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18392 | |
| 18393 | /*Notify UMAC*/ |
| 18394 | wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18396 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18397 | }/*WDI_ProcessConfigureRxpFilterRsp*/ |
| 18398 | |
| 18399 | /** |
| 18400 | @brief Process Set beacon filter Rsp function (called when a |
| 18401 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18402 | |
| 18403 | @param pWDICtx: pointer to the WLAN DAL context |
| 18404 | pEventData: pointer to the event information structure |
| 18405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18406 | @see |
| 18407 | @return Result of the function call |
| 18408 | */ |
| 18409 | WDI_Status |
| 18410 | WDI_ProcessSetBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18411 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18412 | WDI_ControlBlockType* pWDICtx, |
| 18413 | WDI_EventInfoType* pEventData |
| 18414 | ) |
| 18415 | { |
| 18416 | WDI_Status wdiStatus; |
| 18417 | eHalStatus halStatus; |
| 18418 | WDI_SetBeaconFilterCb wdiBeaconFilterCb; |
| 18419 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18420 | |
| 18421 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18422 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18423 | -------------------------------------------------------------------------*/ |
| 18424 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18425 | ( NULL == pEventData->pEventData)) |
| 18426 | { |
| 18427 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18428 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18429 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18430 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18431 | } |
| 18432 | |
| 18433 | wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB; |
| 18434 | |
| 18435 | /*------------------------------------------------------------------------- |
| 18436 | Extract response and send it to UMAC |
| 18437 | -------------------------------------------------------------------------*/ |
| 18438 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18439 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18440 | |
| 18441 | /*Notify UMAC*/ |
| 18442 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18443 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18444 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18445 | }/*WDI_ProcessSetBeaconFilterRsp*/ |
| 18446 | |
| 18447 | /** |
| 18448 | @brief Process remove beacon filter Rsp function (called when a |
| 18449 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18450 | |
| 18451 | @param pWDICtx: pointer to the WLAN DAL context |
| 18452 | pEventData: pointer to the event information structure |
| 18453 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18454 | @see |
| 18455 | @return Result of the function call |
| 18456 | */ |
| 18457 | WDI_Status |
| 18458 | WDI_ProcessRemBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18459 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18460 | WDI_ControlBlockType* pWDICtx, |
| 18461 | WDI_EventInfoType* pEventData |
| 18462 | ) |
| 18463 | { |
| 18464 | WDI_Status wdiStatus; |
| 18465 | eHalStatus halStatus; |
| 18466 | WDI_RemBeaconFilterCb wdiBeaconFilterCb; |
| 18467 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18468 | |
| 18469 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18470 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18471 | -------------------------------------------------------------------------*/ |
| 18472 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18473 | ( NULL == pEventData->pEventData)) |
| 18474 | { |
| 18475 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18476 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18477 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18478 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18479 | } |
| 18480 | |
| 18481 | wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB; |
| 18482 | |
| 18483 | /*------------------------------------------------------------------------- |
| 18484 | Extract response and send it to UMAC |
| 18485 | -------------------------------------------------------------------------*/ |
| 18486 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18487 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18488 | |
| 18489 | /*Notify UMAC*/ |
| 18490 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18491 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18492 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18493 | }/*WDI_ProcessRemBeaconFilterRsp*/ |
| 18494 | |
| 18495 | /** |
| 18496 | @brief Process set RSSI thresholds Rsp function (called when a |
| 18497 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18498 | |
| 18499 | @param pWDICtx: pointer to the WLAN DAL context |
| 18500 | pEventData: pointer to the event information structure |
| 18501 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18502 | @see |
| 18503 | @return Result of the function call |
| 18504 | */ |
| 18505 | WDI_Status |
| 18506 | WDI_ProcessSetRSSIThresoldsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18507 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18508 | WDI_ControlBlockType* pWDICtx, |
| 18509 | WDI_EventInfoType* pEventData |
| 18510 | ) |
| 18511 | { |
| 18512 | WDI_Status wdiStatus; |
| 18513 | eHalStatus halStatus; |
| 18514 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb; |
| 18515 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18516 | |
| 18517 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18518 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18519 | -------------------------------------------------------------------------*/ |
| 18520 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18521 | ( NULL == pEventData->pEventData)) |
| 18522 | { |
| 18523 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18524 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18525 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18526 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18527 | } |
| 18528 | |
| 18529 | wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB; |
| 18530 | |
| 18531 | /*------------------------------------------------------------------------- |
| 18532 | Extract response and send it to UMAC |
| 18533 | -------------------------------------------------------------------------*/ |
| 18534 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18535 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18536 | |
| 18537 | /*Notify UMAC*/ |
| 18538 | wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18539 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18540 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18541 | }/*WDI_ProcessSetRSSIThresoldsRsp*/ |
| 18542 | |
| 18543 | /** |
| 18544 | @brief Process host offload Rsp function (called when a |
| 18545 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18546 | |
| 18547 | @param pWDICtx: pointer to the WLAN DAL context |
| 18548 | pEventData: pointer to the event information structure |
| 18549 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18550 | @see |
| 18551 | @return Result of the function call |
| 18552 | */ |
| 18553 | WDI_Status |
| 18554 | WDI_ProcessHostOffloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18555 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18556 | WDI_ControlBlockType* pWDICtx, |
| 18557 | WDI_EventInfoType* pEventData |
| 18558 | ) |
| 18559 | { |
| 18560 | WDI_Status wdiStatus; |
| 18561 | eHalStatus halStatus; |
| 18562 | WDI_HostOffloadCb wdiHostOffloadCb; |
| 18563 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18564 | |
| 18565 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18566 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18567 | -------------------------------------------------------------------------*/ |
| 18568 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18569 | ( NULL == pEventData->pEventData)) |
| 18570 | { |
| 18571 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18572 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18573 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18574 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18575 | } |
| 18576 | |
| 18577 | wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB; |
| 18578 | |
| 18579 | /*------------------------------------------------------------------------- |
| 18580 | Extract response and send it to UMAC |
| 18581 | -------------------------------------------------------------------------*/ |
| 18582 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18583 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18584 | |
| 18585 | /*Notify UMAC*/ |
| 18586 | wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18588 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18589 | }/*WDI_ProcessHostOffloadRsp*/ |
| 18590 | |
| 18591 | /** |
| 18592 | @brief Process keep alive Rsp function (called when a |
| 18593 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18594 | |
| 18595 | @param pWDICtx: pointer to the WLAN DAL context |
| 18596 | pEventData: pointer to the event information structure |
| 18597 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18598 | @see |
| 18599 | @return Result of the function call |
| 18600 | */ |
| 18601 | WDI_Status |
| 18602 | WDI_ProcessKeepAliveRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18603 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18604 | WDI_ControlBlockType* pWDICtx, |
| 18605 | WDI_EventInfoType* pEventData |
| 18606 | ) |
| 18607 | { |
| 18608 | WDI_Status wdiStatus; |
| 18609 | eHalStatus halStatus; |
| 18610 | WDI_KeepAliveCb wdiKeepAliveCb; |
| 18611 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18612 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18613 | "Received WDI_ProcessKeepAliveRsp Callback from HAL"); |
| 18614 | |
| 18615 | |
| 18616 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18617 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18618 | -------------------------------------------------------------------------*/ |
| 18619 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18620 | ( NULL == pEventData->pEventData)) |
| 18621 | { |
| 18622 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18623 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18624 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18625 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18626 | } |
| 18627 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18628 | wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB; |
| 18629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18630 | /*------------------------------------------------------------------------- |
| 18631 | Extract response and send it to UMAC |
| 18632 | -------------------------------------------------------------------------*/ |
| 18633 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18634 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18635 | |
| 18636 | /*Notify UMAC*/ |
| 18637 | wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18638 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18639 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18640 | }/*WDI_ProcessKeepAliveRsp*/ |
| 18641 | |
| 18642 | /** |
| 18643 | @brief Process wowl add ptrn Rsp function (called when a |
| 18644 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18645 | |
| 18646 | @param pWDICtx: pointer to the WLAN DAL context |
| 18647 | pEventData: pointer to the event information structure |
| 18648 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18649 | @see |
| 18650 | @return Result of the function call |
| 18651 | */ |
| 18652 | WDI_Status |
| 18653 | WDI_ProcessWowlAddBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18654 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18655 | WDI_ControlBlockType* pWDICtx, |
| 18656 | WDI_EventInfoType* pEventData |
| 18657 | ) |
| 18658 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18659 | eHalStatus halStatus; |
| 18660 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18661 | tHalAddWowlBcastPtrnRspParams halAddWowlBcastPtrRsp; |
| 18662 | WDI_WowlAddBcPtrnRspParamsType wdiWowlAddBcPtrRsp; |
| 18663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18664 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18665 | |
| 18666 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18667 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18668 | -------------------------------------------------------------------------*/ |
| 18669 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18670 | ( NULL == pEventData->pEventData)) |
| 18671 | { |
| 18672 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18673 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18674 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18675 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18676 | } |
| 18677 | |
| 18678 | wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB; |
| 18679 | |
| 18680 | /*------------------------------------------------------------------------- |
| 18681 | Extract response and send it to UMAC |
| 18682 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18683 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18684 | { |
| 18685 | wpalMemoryCopy( &halAddWowlBcastPtrRsp, |
| 18686 | pEventData->pEventData, |
| 18687 | sizeof(halAddWowlBcastPtrRsp)); |
| 18688 | |
| 18689 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 18690 | WDI_HAL_2_WDI_STATUS(halAddWowlBcastPtrRsp.status); |
| 18691 | } |
| 18692 | else |
| 18693 | { |
| 18694 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18695 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 18696 | WDI_HAL_2_WDI_STATUS(halStatus); |
| 18697 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18698 | |
| 18699 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18700 | wdiWowlAddBcPtrnCb( &wdiWowlAddBcPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18701 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18702 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18703 | }/*WDI_ProcessWowlAddBcPtrnRsp*/ |
| 18704 | |
| 18705 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18706 | @brief Process wowl delete ptrn Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18707 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18708 | |
| 18709 | @param pWDICtx: pointer to the WLAN DAL context |
| 18710 | pEventData: pointer to the event information structure |
| 18711 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18712 | @see |
| 18713 | @return Result of the function call |
| 18714 | */ |
| 18715 | WDI_Status |
| 18716 | WDI_ProcessWowlDelBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18717 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18718 | WDI_ControlBlockType* pWDICtx, |
| 18719 | WDI_EventInfoType* pEventData |
| 18720 | ) |
| 18721 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18722 | eHalStatus halStatus; |
| 18723 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18724 | tHalDelWowlBcastPtrnRspParams halDelWowlBcastPtrRsp; |
| 18725 | WDI_WowlDelBcPtrnRspParamsType wdiWowlDelBcstPtrRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18726 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18727 | |
| 18728 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18729 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18730 | -------------------------------------------------------------------------*/ |
| 18731 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18732 | ( NULL == pEventData->pEventData)) |
| 18733 | { |
| 18734 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18735 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18736 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18737 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18738 | } |
| 18739 | |
| 18740 | wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB; |
| 18741 | |
| 18742 | /*------------------------------------------------------------------------- |
| 18743 | Extract response and send it to UMAC |
| 18744 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18745 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18746 | { |
| 18747 | wpalMemoryCopy( &halDelWowlBcastPtrRsp, |
| 18748 | pEventData->pEventData, |
| 18749 | sizeof(halDelWowlBcastPtrRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18750 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18751 | wdiWowlDelBcstPtrRsp.wdiStatus = |
| 18752 | WDI_HAL_2_WDI_STATUS(halDelWowlBcastPtrRsp.status); |
| 18753 | } |
| 18754 | else |
| 18755 | { |
| 18756 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18757 | wdiWowlDelBcstPtrRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18758 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18759 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18760 | wdiWowlDelBcPtrnCb( &wdiWowlDelBcstPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18761 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18762 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18763 | }/*WDI_ProcessWowlDelBcPtrnRsp*/ |
| 18764 | |
| 18765 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18766 | @brief Process wowl enter Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18767 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18768 | |
| 18769 | @param pWDICtx: pointer to the WLAN DAL context |
| 18770 | pEventData: pointer to the event information structure |
| 18771 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18772 | @see |
| 18773 | @return Result of the function call |
| 18774 | */ |
| 18775 | WDI_Status |
| 18776 | WDI_ProcessWowlEnterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18777 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18778 | WDI_ControlBlockType* pWDICtx, |
| 18779 | WDI_EventInfoType* pEventData |
| 18780 | ) |
| 18781 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18782 | eHalStatus halStatus; |
| 18783 | WDI_WowlEnterReqCb wdiWowlEnterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18784 | WDI_WowlEnterRspParamsType wdiwowlEnterRsp; |
| 18785 | tHalEnterWowlRspParams halEnterWowlRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18786 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18787 | |
| 18788 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18789 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18790 | -------------------------------------------------------------------------*/ |
| 18791 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18792 | ( NULL == pEventData->pEventData)) |
| 18793 | { |
| 18794 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18795 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18796 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18797 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18798 | } |
| 18799 | |
| 18800 | wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB; |
| 18801 | |
| 18802 | /*------------------------------------------------------------------------- |
| 18803 | Extract response and send it to UMAC |
| 18804 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18805 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18806 | { |
| 18807 | wpalMemoryCopy( &halEnterWowlRspParams, |
| 18808 | (wpt_uint8*)pEventData->pEventData, |
| 18809 | sizeof(halEnterWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18810 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18811 | wdiwowlEnterRsp.bssIdx = halEnterWowlRspParams.bssIdx; |
| 18812 | wdiwowlEnterRsp.status = |
| 18813 | WDI_HAL_2_WDI_STATUS(halEnterWowlRspParams.status); |
| 18814 | } |
| 18815 | else |
| 18816 | { |
| 18817 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18818 | wdiwowlEnterRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18819 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18820 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18821 | wdiWowlEnterCb( &wdiwowlEnterRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18822 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18823 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18824 | }/*WDI_ProcessWowlEnterRsp*/ |
| 18825 | |
| 18826 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18827 | @brief Process wowl exit Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18828 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18829 | |
| 18830 | @param pWDICtx: pointer to the WLAN DAL context |
| 18831 | pEventData: pointer to the event information structure |
| 18832 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18833 | @see |
| 18834 | @return Result of the function call |
| 18835 | */ |
| 18836 | WDI_Status |
| 18837 | WDI_ProcessWowlExitRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18838 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18839 | WDI_ControlBlockType* pWDICtx, |
| 18840 | WDI_EventInfoType* pEventData |
| 18841 | ) |
| 18842 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18843 | eHalStatus halStatus; |
| 18844 | WDI_WowlExitReqCb wdiWowlExitCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18845 | tHalExitWowlRspParams halExitWowlRspParams; |
| 18846 | WDI_WowlExitRspParamsType wdiWowlExitRsp; |
| 18847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18848 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18849 | |
| 18850 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18851 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18852 | -------------------------------------------------------------------------*/ |
| 18853 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18854 | ( NULL == pEventData->pEventData)) |
| 18855 | { |
| 18856 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18857 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18858 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18859 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18860 | } |
| 18861 | |
| 18862 | wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB; |
| 18863 | |
| 18864 | /*------------------------------------------------------------------------- |
| 18865 | Extract response and send it to UMAC |
| 18866 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18867 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18868 | { |
| 18869 | wpalMemoryCopy( &halExitWowlRspParams, |
| 18870 | pEventData->pEventData, |
| 18871 | sizeof(halExitWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18872 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18873 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halExitWowlRspParams.status); |
| 18874 | wdiWowlExitRsp.bssIdx = halExitWowlRspParams.bssIdx; |
| 18875 | |
| 18876 | } |
| 18877 | else |
| 18878 | { |
| 18879 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18880 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18881 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18882 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18883 | wdiWowlExitCb( &wdiWowlExitRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18884 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18885 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18886 | }/*WDI_ProcessWowlExitRsp*/ |
| 18887 | |
| 18888 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18889 | @brief Process Configure Apps CPU wakeup State Rsp function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18890 | (called when a response is being received over the bus |
| 18891 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18892 | |
| 18893 | @param pWDICtx: pointer to the WLAN DAL context |
| 18894 | pEventData: pointer to the event information structure |
| 18895 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18896 | @see |
| 18897 | @return Result of the function call |
| 18898 | */ |
| 18899 | WDI_Status |
| 18900 | WDI_ProcessConfigureAppsCpuWakeupStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18901 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18902 | WDI_ControlBlockType* pWDICtx, |
| 18903 | WDI_EventInfoType* pEventData |
| 18904 | ) |
| 18905 | { |
| 18906 | WDI_Status wdiStatus; |
| 18907 | eHalStatus halStatus; |
| 18908 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb; |
| 18909 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18910 | |
| 18911 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18912 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18913 | -------------------------------------------------------------------------*/ |
| 18914 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18915 | ( NULL == pEventData->pEventData)) |
| 18916 | { |
| 18917 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18918 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18919 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18920 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18921 | } |
| 18922 | |
| 18923 | wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB; |
| 18924 | |
| 18925 | /*------------------------------------------------------------------------- |
| 18926 | Extract response and send it to UMAC |
| 18927 | -------------------------------------------------------------------------*/ |
| 18928 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18929 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18930 | |
| 18931 | /*Notify UMAC*/ |
| 18932 | wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18933 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18934 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18935 | }/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/ |
| 18936 | |
| 18937 | |
| 18938 | /** |
| 18939 | @brief Process Nv download(called when a response |
| 18940 | is being received over the bus from HAL,will check if the responce is ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18941 | |
| 18942 | @param pWDICtx: pointer to the WLAN DAL context |
| 18943 | pEventData: pointer to the event information structure |
| 18944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18945 | @see |
| 18946 | @return Result of the function call |
| 18947 | */ |
| 18948 | WDI_Status |
| 18949 | WDI_ProcessNvDownloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18950 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18951 | WDI_ControlBlockType* pWDICtx, |
| 18952 | WDI_EventInfoType* pEventData |
| 18953 | ) |
| 18954 | { |
| 18955 | |
| 18956 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 18957 | tHalNvImgDownloadRspParams halNvDownloadRsp; |
| 18958 | WDI_NvDownloadRspInfoType wdiNvDownloadRsp; |
| 18959 | |
| 18960 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18961 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18962 | -------------------------------------------------------------------------*/ |
| 18963 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18964 | ( NULL == pEventData->pEventData)) |
| 18965 | { |
| 18966 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18967 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18968 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18969 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18970 | } |
| 18971 | |
| 18972 | /*------------------------------------------------------------------------- |
| 18973 | Extract response and send it to UMAC |
| 18974 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18975 | wpalMemoryCopy( &halNvDownloadRsp, |
| 18976 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18977 | sizeof(halNvDownloadRsp)); |
| 18978 | |
| 18979 | wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status); |
| 18980 | |
| 18981 | if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18982 | (pWDICtx->wdiNvBlobInfo.usCurrentFragment != |
| 18983 | pWDICtx->wdiNvBlobInfo.usTotalFragment )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18984 | { |
| 18985 | WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18986 | (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18987 | } |
| 18988 | else |
| 18989 | { |
| 18990 | /*Reset the Nv related global information in WDI context information */ |
| 18991 | pWDICtx->wdiNvBlobInfo.usTotalFragment = 0; |
| 18992 | pWDICtx->wdiNvBlobInfo.usFragmentSize = 0; |
| 18993 | pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0; |
| 18994 | /*call WDA callback function for last fragment */ |
| 18995 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB; |
| 18996 | wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData); |
| 18997 | } |
| 18998 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18999 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19000 | } |
| 19001 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 19002 | /** |
| 19003 | @brief Process Add TSpec Rsp function (called when a response |
| 19004 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19005 | |
| 19006 | @param pWDICtx: pointer to the WLAN DAL context |
| 19007 | pEventData: pointer to the event information structure |
| 19008 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19009 | @see |
| 19010 | @return Result of the function call |
| 19011 | */ |
| 19012 | WDI_Status |
| 19013 | WDI_ProcessAggrAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19014 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19015 | WDI_ControlBlockType* pWDICtx, |
| 19016 | WDI_EventInfoType* pEventData |
| 19017 | ) |
| 19018 | { |
| 19019 | WDI_Status wdiStatus; |
| 19020 | tAggrAddTsRspParams aggrAddTsRsp; |
| 19021 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb; |
| 19022 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19023 | |
| 19024 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19025 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19026 | -------------------------------------------------------------------------*/ |
| 19027 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19028 | ( NULL == pEventData->pEventData)) |
| 19029 | { |
| 19030 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19031 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19032 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19033 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19034 | } |
| 19035 | |
| 19036 | wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 19037 | |
| 19038 | /*------------------------------------------------------------------------- |
| 19039 | Extract response and send it to UMAC |
| 19040 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19041 | wpalMemoryCopy( &aggrAddTsRsp, |
| 19042 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19043 | sizeof(aggrAddTsRsp)); |
| 19044 | |
| 19045 | /* What is the difference between status0 and status1? */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19046 | wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19047 | |
| 19048 | /*Notify UMAC*/ |
| 19049 | wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 19050 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19051 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19052 | }/*WDI_ProcessAddTSpecRsp*/ |
| 19053 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 19054 | |
| 19055 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19056 | @brief WDI_ProcessHostResumeRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19057 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19058 | |
| 19059 | @param pWDICtx: pointer to the WLAN DAL context |
| 19060 | pEventData: pointer to the event information structure |
| 19061 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19062 | @see |
| 19063 | @return Result of the function call |
| 19064 | */ |
| 19065 | WDI_Status |
| 19066 | WDI_ProcessHostResumeRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19067 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19068 | WDI_ControlBlockType* pWDICtx, |
| 19069 | WDI_EventInfoType* pEventData |
| 19070 | ) |
| 19071 | { |
| 19072 | WDI_SuspendResumeRspParamsType wdiResumeRspParams; |
| 19073 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
| 19074 | tHalHostResumeRspParams hostResumeRspMsg; |
| 19075 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19076 | |
| 19077 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19078 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19079 | -------------------------------------------------------------------------*/ |
| 19080 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19081 | ( NULL == pEventData->pEventData)) |
| 19082 | { |
| 19083 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19084 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19085 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19086 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19087 | } |
| 19088 | |
| 19089 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB; |
| 19090 | |
| 19091 | /*------------------------------------------------------------------------- |
| 19092 | Extract response and send it to UMAC |
| 19093 | -------------------------------------------------------------------------*/ |
| 19094 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19095 | wpalMemoryCopy( &hostResumeRspMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19096 | (wpt_uint8*)pEventData->pEventData, |
| 19097 | sizeof(hostResumeRspMsg)); |
| 19098 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19099 | wdiResumeRspParams.wdiStatus = |
| 19100 | WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19101 | |
| 19102 | /*Notify UMAC*/ |
| 19103 | wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData); |
| 19104 | |
| 19105 | return WDI_STATUS_SUCCESS; |
| 19106 | } |
| 19107 | |
| 19108 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19109 | @brief Process Set Tx PER Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19110 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19111 | |
| 19112 | @param pWDICtx: pointer to the WLAN DAL context |
| 19113 | pEventData: pointer to the event information structure |
| 19114 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19115 | @see |
| 19116 | @return Result of the function call |
| 19117 | */ |
| 19118 | WDI_Status |
| 19119 | WDI_ProcessSetTxPerTrackingRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19120 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19121 | WDI_ControlBlockType* pWDICtx, |
| 19122 | WDI_EventInfoType* pEventData |
| 19123 | ) |
| 19124 | { |
| 19125 | WDI_Status wdiStatus; |
| 19126 | eHalStatus halStatus; |
| 19127 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb; |
| 19128 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19129 | |
| 19130 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19131 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19132 | -------------------------------------------------------------------------*/ |
| 19133 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19134 | ( NULL == pEventData->pEventData)) |
| 19135 | { |
| 19136 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19137 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19138 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19139 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19140 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19141 | |
| 19142 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19143 | |
| 19144 | /*------------------------------------------------------------------------- |
| 19145 | Extract response and send it to UMAC |
| 19146 | -------------------------------------------------------------------------*/ |
| 19147 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19148 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19149 | |
| 19150 | /*Notify UMAC*/ |
| 19151 | pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 19152 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19153 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19154 | }/*WDI_ProcessSetTxPerTrackingRsp*/ |
| 19155 | |
| 19156 | /*========================================================================== |
| 19157 | Indications from HAL |
| 19158 | ==========================================================================*/ |
| 19159 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19160 | @brief Process Low RSSI Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19161 | indication of this kind is being received over the bus |
| 19162 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19163 | |
| 19164 | @param pWDICtx: pointer to the WLAN DAL context |
| 19165 | pEventData: pointer to the event information structure |
| 19166 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19167 | @see |
| 19168 | @return Result of the function call |
| 19169 | */ |
| 19170 | WDI_Status |
| 19171 | WDI_ProcessLowRSSIInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19172 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19173 | WDI_ControlBlockType* pWDICtx, |
| 19174 | WDI_EventInfoType* pEventData |
| 19175 | ) |
| 19176 | { |
| 19177 | WDI_LowLevelIndType wdiInd; |
| 19178 | tHalRSSINotificationIndMsg halRSSINotificationIndMsg; |
| 19179 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19180 | |
| 19181 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19182 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19183 | -------------------------------------------------------------------------*/ |
| 19184 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19185 | ( NULL == pEventData->pEventData)) |
| 19186 | { |
| 19187 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19188 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19189 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19190 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19191 | } |
| 19192 | |
| 19193 | /*------------------------------------------------------------------------- |
| 19194 | Extract indication and send it to UMAC |
| 19195 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19196 | wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams, |
| 19197 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19198 | sizeof(tHalRSSINotification)); |
| 19199 | |
| 19200 | /*Fill in the indication parameters*/ |
| 19201 | wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND; |
| 19202 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross = |
| 19203 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross; |
| 19204 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross = |
| 19205 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross; |
| 19206 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross = |
| 19207 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross; |
| 19208 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross = |
| 19209 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross; |
| 19210 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross = |
| 19211 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross; |
| 19212 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross = |
| 19213 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross; |
Madan Mohan Koyyalamudi | 313a593 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 19214 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.avgRssi = |
| 19215 | halRSSINotificationIndMsg.rssiNotificationParams.avgRssi; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19216 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19217 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19218 | { |
| 19219 | /*Notify UMAC of indication*/ |
| 19220 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19221 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19222 | |
| 19223 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19224 | }/*WDI_ProcessLowRSSIInd*/ |
| 19225 | |
| 19226 | |
| 19227 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19228 | @brief Process Missed Beacon Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19229 | an indication of this kind is being received over the |
| 19230 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19231 | |
| 19232 | @param pWDICtx: pointer to the WLAN DAL context |
| 19233 | pEventData: pointer to the event information structure |
| 19234 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19235 | @see |
| 19236 | @return Result of the function call |
| 19237 | */ |
| 19238 | WDI_Status |
| 19239 | WDI_ProcessMissedBeaconInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19240 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19241 | WDI_ControlBlockType* pWDICtx, |
| 19242 | WDI_EventInfoType* pEventData |
| 19243 | ) |
| 19244 | { |
| 19245 | WDI_Status wdiStatus; |
| 19246 | eHalStatus halStatus; |
| 19247 | WDI_LowLevelIndType wdiInd; |
Leela Venkata Kiran Kumar Reddy Chirala | 949300d | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 19248 | tpHalMissedBeaconIndParams halMissedBeaconIndParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19249 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19250 | |
| 19251 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19252 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19253 | -------------------------------------------------------------------------*/ |
| 19254 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19255 | ( NULL == pEventData->pEventData)) |
| 19256 | { |
| 19257 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19258 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19259 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19260 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19261 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 949300d | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 19262 | halMissedBeaconIndParams = (tpHalMissedBeaconIndParams)pEventData->pEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19263 | /*------------------------------------------------------------------------- |
| 19264 | Extract indication and send it to UMAC |
| 19265 | -------------------------------------------------------------------------*/ |
| 19266 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 19267 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19268 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19269 | |
| 19270 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19271 | wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND; |
Leela Venkata Kiran Kumar Reddy Chirala | 949300d | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 19272 | wdiInd.wdiIndicationData.wdiMissedBeaconInd.bssIdx = |
| 19273 | halMissedBeaconIndParams->bssIdx; |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19274 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19275 | { |
| 19276 | /*Notify UMAC*/ |
| 19277 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19278 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19279 | |
| 19280 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19281 | }/*WDI_ProcessMissedBeaconInd*/ |
| 19282 | |
| 19283 | |
| 19284 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19285 | @brief Process Unk Addr Frame Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19286 | an indication of this kind is being received over the |
| 19287 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19288 | |
| 19289 | @param pWDICtx: pointer to the WLAN DAL context |
| 19290 | pEventData: pointer to the event information structure |
| 19291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19292 | @see |
| 19293 | @return Result of the function call |
| 19294 | */ |
| 19295 | WDI_Status |
| 19296 | WDI_ProcessUnkAddrFrameInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19297 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19298 | WDI_ControlBlockType* pWDICtx, |
| 19299 | WDI_EventInfoType* pEventData |
| 19300 | ) |
| 19301 | { |
| 19302 | WDI_Status wdiStatus; |
| 19303 | eHalStatus halStatus; |
| 19304 | WDI_LowLevelIndType wdiInd; |
| 19305 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19306 | |
| 19307 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19308 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19309 | -------------------------------------------------------------------------*/ |
| 19310 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19311 | ( NULL == pEventData->pEventData)) |
| 19312 | { |
| 19313 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19314 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19315 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19316 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19317 | } |
| 19318 | |
| 19319 | /*------------------------------------------------------------------------- |
| 19320 | Extract indication and send it to UMAC |
| 19321 | -------------------------------------------------------------------------*/ |
| 19322 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 19323 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19324 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19325 | |
| 19326 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19327 | wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19328 | /* ! TO DO - fill in from HAL struct: |
| 19329 | wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/ |
| 19330 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19331 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19332 | { |
| 19333 | /*Notify UMAC*/ |
| 19334 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19335 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19336 | |
| 19337 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19338 | }/*WDI_ProcessUnkAddrFrameInd*/ |
| 19339 | |
| 19340 | |
| 19341 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19342 | @brief Process MIC Failure Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19343 | indication of this kind is being received over the bus |
| 19344 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19345 | |
| 19346 | @param pWDICtx: pointer to the WLAN DAL context |
| 19347 | pEventData: pointer to the event information structure |
| 19348 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19349 | @see |
| 19350 | @return Result of the function call |
| 19351 | */ |
| 19352 | WDI_Status |
| 19353 | WDI_ProcessMicFailureInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19354 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19355 | WDI_ControlBlockType* pWDICtx, |
| 19356 | WDI_EventInfoType* pEventData |
| 19357 | ) |
| 19358 | { |
| 19359 | WDI_LowLevelIndType wdiInd; |
| 19360 | tpSirMicFailureInd pHalMicFailureInd; |
| 19361 | |
| 19362 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19363 | |
| 19364 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19365 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19366 | -------------------------------------------------------------------------*/ |
| 19367 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19368 | ( NULL == pEventData->pEventData)) |
| 19369 | { |
| 19370 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19371 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19372 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19373 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19374 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19376 | pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData; |
| 19377 | /*------------------------------------------------------------------------- |
| 19378 | Extract indication and send it to UMAC |
| 19379 | -------------------------------------------------------------------------*/ |
| 19380 | |
| 19381 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19382 | wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19383 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId, |
| 19384 | pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN); |
| 19385 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr, |
| 19386 | pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN); |
| 19387 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr, |
| 19388 | pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN); |
| 19389 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr, |
| 19390 | pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19391 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19392 | pHalMicFailureInd->info.multicast; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19393 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19394 | pHalMicFailureInd->info.IV1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19395 | wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19396 | pHalMicFailureInd->info.keyId; |
| 19397 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC, |
| 19398 | pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE); |
| 19399 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr, |
| 19400 | pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN); |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19401 | |
| 19402 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19403 | { |
| 19404 | /*Notify UMAC*/ |
| 19405 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19406 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19407 | |
| 19408 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19409 | }/*WDI_ProcessMicFailureInd*/ |
| 19410 | |
| 19411 | |
| 19412 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19413 | @brief Process Fatal Failure Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19414 | an indication of this kind is being received over the |
| 19415 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19416 | |
| 19417 | @param pWDICtx: pointer to the WLAN DAL context |
| 19418 | pEventData: pointer to the event information structure |
| 19419 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19420 | @see |
| 19421 | @return Result of the function call |
| 19422 | */ |
| 19423 | WDI_Status |
| 19424 | WDI_ProcessFatalErrorInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19425 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19426 | WDI_ControlBlockType* pWDICtx, |
| 19427 | WDI_EventInfoType* pEventData |
| 19428 | ) |
| 19429 | { |
| 19430 | WDI_Status wdiStatus; |
| 19431 | eHalStatus halStatus; |
| 19432 | WDI_LowLevelIndType wdiInd; |
| 19433 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19434 | |
| 19435 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19436 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19437 | -------------------------------------------------------------------------*/ |
| 19438 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19439 | ( NULL == pEventData->pEventData)) |
| 19440 | { |
| 19441 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19442 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19443 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19444 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19445 | } |
| 19446 | |
| 19447 | /*------------------------------------------------------------------------- |
| 19448 | Extract indication and send it to UMAC |
| 19449 | -------------------------------------------------------------------------*/ |
| 19450 | |
| 19451 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 19452 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19453 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19454 | |
| 19455 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19456 | "Fatal failure received from device %d ", halStatus ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19457 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19458 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19459 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 19460 | wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19461 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19462 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19463 | { |
| 19464 | /*Notify UMAC*/ |
| 19465 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19466 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19467 | |
| 19468 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19469 | }/*WDI_ProcessFatalErrorInd*/ |
| 19470 | |
| 19471 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19472 | @brief Process Delete STA Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19473 | an indication of this kind is being received over the |
| 19474 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19475 | |
| 19476 | @param pWDICtx: pointer to the WLAN DAL context |
| 19477 | pEventData: pointer to the event information structure |
| 19478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19479 | @see |
| 19480 | @return Result of the function call |
| 19481 | */ |
| 19482 | WDI_Status |
| 19483 | WDI_ProcessDelSTAInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19484 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19485 | WDI_ControlBlockType* pWDICtx, |
| 19486 | WDI_EventInfoType* pEventData |
| 19487 | ) |
| 19488 | { |
| 19489 | tDeleteStaContextParams halDelSTACtx; |
| 19490 | WDI_LowLevelIndType wdiInd; |
| 19491 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19492 | |
| 19493 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19494 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19495 | -------------------------------------------------------------------------*/ |
| 19496 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19497 | ( NULL == pEventData->pEventData)) |
| 19498 | { |
| 19499 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19500 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19501 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19502 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19503 | } |
| 19504 | |
| 19505 | /*------------------------------------------------------------------------- |
| 19506 | Extract indication and send it to UMAC |
| 19507 | -------------------------------------------------------------------------*/ |
| 19508 | |
| 19509 | /* Parameters need to be unpacked according to HAL struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19510 | wpalMemoryCopy( &halDelSTACtx, |
| 19511 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19512 | sizeof(halDelSTACtx)); |
| 19513 | |
| 19514 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19515 | wdiInd.wdiIndicationType = WDI_DEL_STA_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19516 | |
| 19517 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2, |
| 19518 | halDelSTACtx.addr2, WDI_MAC_ADDR_LEN); |
| 19519 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID, |
| 19520 | halDelSTACtx.bssId, WDI_MAC_ADDR_LEN); |
| 19521 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19522 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19523 | halDelSTACtx.assocId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19524 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19525 | halDelSTACtx.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19526 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode = |
| 19527 | halDelSTACtx.reasonCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19528 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19529 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19530 | { |
| 19531 | /*Notify UMAC*/ |
| 19532 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19533 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19534 | |
| 19535 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19536 | }/*WDI_ProcessDelSTAInd*/ |
| 19537 | |
| 19538 | /** |
| 19539 | *@brief Process Coex Indication function (called when |
| 19540 | an indication of this kind is being received over the |
| 19541 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19542 | |
| 19543 | @param pWDICtx: pointer to the WLAN DAL context |
| 19544 | pEventData: pointer to the event information structure |
| 19545 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19546 | @see |
| 19547 | @return Result of the function call |
| 19548 | */ |
| 19549 | WDI_Status |
| 19550 | WDI_ProcessCoexInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19551 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19552 | WDI_ControlBlockType* pWDICtx, |
| 19553 | WDI_EventInfoType* pEventData |
| 19554 | ) |
| 19555 | { |
| 19556 | WDI_LowLevelIndType wdiInd; |
| 19557 | tCoexIndMsg halCoexIndMsg; |
| 19558 | wpt_uint32 index; |
| 19559 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19560 | |
| 19561 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19562 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19563 | -------------------------------------------------------------------------*/ |
| 19564 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19565 | ( NULL == pEventData->pEventData )) |
| 19566 | { |
| 19567 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19568 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19569 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19570 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19571 | } |
| 19572 | |
| 19573 | /*------------------------------------------------------------------------- |
| 19574 | Extract indication and send it to UMAC |
| 19575 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19576 | wpalMemoryCopy( &halCoexIndMsg.coexIndParams, |
| 19577 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19578 | sizeof(halCoexIndMsg.coexIndParams) ); |
| 19579 | |
| 19580 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19581 | wdiInd.wdiIndicationType = WDI_COEX_IND; |
| 19582 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19583 | for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++) |
| 19584 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19585 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19586 | } |
| 19587 | |
| 19588 | // DEBUG |
| 19589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19590 | "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19591 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType, |
| 19592 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0], |
| 19593 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1], |
| 19594 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2], |
| 19595 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19596 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19597 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19598 | { |
| 19599 | /*Notify UMAC*/ |
| 19600 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19601 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19602 | |
| 19603 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19604 | }/*WDI_ProcessCoexInd*/ |
| 19605 | |
| 19606 | /** |
| 19607 | *@brief Process Tx Complete Indication function (called when |
| 19608 | an indication of this kind is being received over the |
| 19609 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19610 | |
| 19611 | @param pWDICtx: pointer to the WLAN DAL context |
| 19612 | pEventData: pointer to the event information structure |
| 19613 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19614 | @see |
| 19615 | @return Result of the function call |
| 19616 | */ |
| 19617 | WDI_Status |
| 19618 | WDI_ProcessTxCompleteInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19619 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19620 | WDI_ControlBlockType* pWDICtx, |
| 19621 | WDI_EventInfoType* pEventData |
| 19622 | ) |
| 19623 | { |
| 19624 | WDI_LowLevelIndType wdiInd; |
| 19625 | tTxComplIndMsg halTxComplIndMsg; |
| 19626 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19627 | |
| 19628 | /*------------------------------------------------------------------------- |
| 19629 | Sanity check |
| 19630 | -------------------------------------------------------------------------*/ |
| 19631 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19632 | ( NULL == pEventData->pEventData )) |
| 19633 | { |
| 19634 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19635 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19636 | WDI_ASSERT( 0 ); |
| 19637 | return WDI_STATUS_E_FAILURE; |
| 19638 | } |
| 19639 | |
| 19640 | /*------------------------------------------------------------------------- |
| 19641 | Extract indication and send it to UMAC |
| 19642 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19643 | wpalMemoryCopy( &halTxComplIndMsg.txComplParams, |
| 19644 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19645 | sizeof(halTxComplIndMsg.txComplParams) ); |
| 19646 | |
| 19647 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19648 | wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND; |
| 19649 | wdiInd.wdiIndicationData.tx_complete_status |
| 19650 | = halTxComplIndMsg.txComplParams.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19651 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19652 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19653 | { |
| 19654 | /*Notify UMAC*/ |
| 19655 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19656 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19657 | |
| 19658 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19659 | }/*WDI_ProcessTxCompleteInd*/ |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 19660 | #ifdef FEATURE_WLAN_TDLS |
| 19661 | /** |
| 19662 | *@brief Process TDLS Indication function (called when |
| 19663 | an indication of this kind is being received over the |
| 19664 | bus from HAL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19665 | |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 19666 | @param pWDICtx: pointer to the WLAN DAL context |
| 19667 | pEventData: pointer to the event information structure |
| 19668 | |
| 19669 | @see |
| 19670 | @return Result of the function call |
| 19671 | */ |
| 19672 | WDI_Status |
| 19673 | WDI_ProcessTdlsInd |
| 19674 | ( |
| 19675 | WDI_ControlBlockType* pWDICtx, |
| 19676 | WDI_EventInfoType* pEventData |
| 19677 | ) |
| 19678 | { |
| 19679 | WDI_LowLevelIndType wdiInd; |
| 19680 | tTdlsIndMsg halTdlsIndMsg; |
| 19681 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19682 | |
| 19683 | /*------------------------------------------------------------------------- |
| 19684 | Sanity check |
| 19685 | -------------------------------------------------------------------------*/ |
| 19686 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19687 | ( NULL == pEventData->pEventData )) |
| 19688 | { |
| 19689 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19690 | "%s: Invalid parameters", __func__); |
| 19691 | WDI_ASSERT( 0 ); |
| 19692 | return WDI_STATUS_E_FAILURE; |
| 19693 | } |
| 19694 | |
| 19695 | /*------------------------------------------------------------------------- |
| 19696 | Extract indication and send it to UMAC |
| 19697 | -------------------------------------------------------------------------*/ |
| 19698 | wpalMemoryCopy( &halTdlsIndMsg.tdlsIndParams, |
| 19699 | pEventData->pEventData, |
| 19700 | sizeof(halTdlsIndMsg.tdlsIndParams) ); |
| 19701 | |
| 19702 | /*Fill in the indication parameters*/ |
| 19703 | wdiInd.wdiIndicationType = WDI_TDLS_IND; |
| 19704 | |
| 19705 | wdiInd.wdiIndicationData.wdiTdlsIndInfo.status |
| 19706 | = halTdlsIndMsg.tdlsIndParams.status; |
| 19707 | |
| 19708 | wdiInd.wdiIndicationData.wdiTdlsIndInfo.staIdx |
| 19709 | = halTdlsIndMsg.tdlsIndParams.staIdx; |
| 19710 | |
| 19711 | wdiInd.wdiIndicationData.wdiTdlsIndInfo.reasonCode |
| 19712 | = halTdlsIndMsg.tdlsIndParams.reasonCode; |
| 19713 | |
| 19714 | /*Notify UMAC*/ |
| 19715 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19716 | |
| 19717 | return WDI_STATUS_SUCCESS; |
| 19718 | }/*WDI_ProcessTdlsInd*/ |
| 19719 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19720 | /** |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 19721 | *@brief Process Noa Start Indication function (called when |
| 19722 | an indication of this kind is being received over the |
| 19723 | bus from HAL) |
| 19724 | |
| 19725 | @param pWDICtx: pointer to the WLAN DAL context |
| 19726 | pEventData: pointer to the event information structure |
| 19727 | |
| 19728 | @see |
| 19729 | @return Result of the function call |
| 19730 | */ |
| 19731 | WDI_Status |
| 19732 | WDI_ProcessP2pNoaStartInd |
| 19733 | ( |
| 19734 | WDI_ControlBlockType* pWDICtx, |
| 19735 | WDI_EventInfoType* pEventData |
| 19736 | ) |
| 19737 | { |
| 19738 | WDI_LowLevelIndType wdiInd; |
| 19739 | tNoaStartIndMsg halNoaStartIndMsg; |
| 19740 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19741 | |
| 19742 | /*------------------------------------------------------------------------- |
| 19743 | Sanity check |
| 19744 | -------------------------------------------------------------------------*/ |
| 19745 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19746 | ( NULL == pEventData->pEventData )) |
| 19747 | { |
| 19748 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19749 | "%s: Invalid parameters", __func__); |
| 19750 | WDI_ASSERT( 0 ); |
| 19751 | return WDI_STATUS_E_FAILURE; |
| 19752 | } |
| 19753 | |
| 19754 | /*------------------------------------------------------------------------- |
| 19755 | Extract indication and send it to UMAC |
| 19756 | -------------------------------------------------------------------------*/ |
| 19757 | wpalMemoryCopy( &halNoaStartIndMsg.noaStartIndParams, |
| 19758 | pEventData->pEventData, |
| 19759 | sizeof(halNoaStartIndMsg.noaStartIndParams) ); |
| 19760 | |
| 19761 | /*Fill in the indication parameters*/ |
| 19762 | wdiInd.wdiIndicationType = WDI_P2P_NOA_START_IND; |
| 19763 | |
| 19764 | wdiInd.wdiIndicationData.wdiP2pNoaStartInfo.status |
| 19765 | = halNoaStartIndMsg.noaStartIndParams.status; |
| 19766 | |
| 19767 | wdiInd.wdiIndicationData.wdiP2pNoaStartInfo.bssIdx |
| 19768 | = halNoaStartIndMsg.noaStartIndParams.bssIdx; |
| 19769 | |
| 19770 | /*Notify UMAC*/ |
| 19771 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19772 | |
| 19773 | return WDI_STATUS_SUCCESS; |
| 19774 | }/*WDI_ProcessNoaAttrInd*/ |
| 19775 | |
| 19776 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19777 | *@brief Process Noa Attr Indication function (called when |
| 19778 | an indication of this kind is being received over the |
| 19779 | bus from HAL) |
| 19780 | |
| 19781 | @param pWDICtx: pointer to the WLAN DAL context |
| 19782 | pEventData: pointer to the event information structure |
| 19783 | |
| 19784 | @see |
| 19785 | @return Result of the function call |
| 19786 | */ |
| 19787 | WDI_Status |
| 19788 | WDI_ProcessP2pNoaAttrInd |
| 19789 | ( |
| 19790 | WDI_ControlBlockType* pWDICtx, |
| 19791 | WDI_EventInfoType* pEventData |
| 19792 | ) |
| 19793 | { |
| 19794 | WDI_LowLevelIndType wdiInd; |
| 19795 | tNoaAttrIndMsg halNoaAttrIndMsg; |
| 19796 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19797 | |
| 19798 | /*------------------------------------------------------------------------- |
| 19799 | Sanity check |
| 19800 | -------------------------------------------------------------------------*/ |
| 19801 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19802 | ( NULL == pEventData->pEventData )) |
| 19803 | { |
| 19804 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19805 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19806 | WDI_ASSERT( 0 ); |
| 19807 | return WDI_STATUS_E_FAILURE; |
| 19808 | } |
| 19809 | |
| 19810 | /*------------------------------------------------------------------------- |
| 19811 | Extract indication and send it to UMAC |
| 19812 | -------------------------------------------------------------------------*/ |
| 19813 | wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams, |
| 19814 | pEventData->pEventData, |
| 19815 | sizeof(halNoaAttrIndMsg.noaAttrIndParams) ); |
| 19816 | |
| 19817 | /*Fill in the indication parameters*/ |
| 19818 | wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19819 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19820 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status |
| 19821 | = halNoaAttrIndMsg.noaAttrIndParams.status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19823 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex |
| 19824 | = halNoaAttrIndMsg.noaAttrIndParams.index; |
| 19825 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag |
| 19826 | = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag; |
| 19827 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin |
| 19828 | = halNoaAttrIndMsg.noaAttrIndParams.ctWin; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19830 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt |
| 19831 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt; |
| 19832 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration |
| 19833 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration; |
| 19834 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval |
| 19835 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval; |
| 19836 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime |
| 19837 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19838 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19839 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt |
| 19840 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt; |
| 19841 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration |
| 19842 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration; |
| 19843 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval |
| 19844 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval; |
| 19845 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime |
| 19846 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime; |
| 19847 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19848 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19849 | { |
| 19850 | /*Notify UMAC*/ |
| 19851 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19852 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19853 | |
| 19854 | return WDI_STATUS_SUCCESS; |
| 19855 | }/*WDI_ProcessNoaAttrInd*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19856 | |
| 19857 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19858 | @brief Process Tx PER Hit Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19859 | an indication of this kind is being received over the |
| 19860 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19861 | |
| 19862 | @param pWDICtx: pointer to the WLAN DAL context |
| 19863 | pEventData: pointer to the event information structure |
| 19864 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19865 | @see |
| 19866 | @return Result of the function call |
| 19867 | */ |
| 19868 | WDI_Status |
| 19869 | WDI_ProcessTxPerHitInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19870 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19871 | WDI_ControlBlockType* pWDICtx, |
| 19872 | WDI_EventInfoType* pEventData |
| 19873 | ) |
| 19874 | { |
| 19875 | WDI_LowLevelIndType wdiInd; |
| 19876 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19878 | /*------------------------------------------------------------------------- |
| 19879 | Extract indication and send it to UMAC |
| 19880 | -------------------------------------------------------------------------*/ |
| 19881 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19882 | wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND; |
| 19883 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19884 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19885 | { |
| 19886 | /*Notify UMAC*/ |
| 19887 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19888 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19889 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19890 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19891 | }/*WDI_ProcessTxPerHitInd*/ |
| 19892 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19893 | /** |
| 19894 | @brief WDI_ProcessFTMCommandReq |
| 19895 | Process FTM Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19896 | |
| 19897 | @param pWDICtx: pointer to the WLAN DAL context |
| 19898 | pEventData: pointer to the event information structure |
| 19899 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19900 | @see |
| 19901 | @return Result of the function call |
| 19902 | */ |
| 19903 | WDI_Status |
| 19904 | WDI_ProcessFTMCommandReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19905 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19906 | WDI_ControlBlockType* pWDICtx, |
| 19907 | WDI_EventInfoType* pEventData |
| 19908 | ) |
| 19909 | { |
| 19910 | WDI_FTMCommandReqType *ftmCommandReq = NULL; |
| 19911 | wpt_uint8 *ftmCommandBuffer = NULL; |
| 19912 | wpt_uint16 dataOffset; |
| 19913 | wpt_uint16 bufferSize; |
| 19914 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19915 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19916 | -------------------------------------------------------------------------*/ |
| 19917 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19918 | ( NULL == pEventData->pEventData)) |
| 19919 | |
| 19920 | { |
| 19921 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19922 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19923 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19924 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19925 | } |
| 19926 | |
| 19927 | ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData; |
| 19928 | |
| 19929 | /* Get MSG Buffer */ |
| 19930 | WDI_GetMessageBuffer(pWDICtx, |
| 19931 | WDI_FTM_CMD_REQ, |
| 19932 | ftmCommandReq->bodyLength, |
| 19933 | &ftmCommandBuffer, |
| 19934 | &dataOffset, |
| 19935 | &bufferSize); |
| 19936 | |
| 19937 | wpalMemoryCopy(ftmCommandBuffer + dataOffset, |
| 19938 | ftmCommandReq->FTMCommandBody, |
| 19939 | ftmCommandReq->bodyLength); |
| 19940 | |
| 19941 | /* Send MSG */ |
| 19942 | return WDI_SendMsg(pWDICtx, |
| 19943 | ftmCommandBuffer, |
| 19944 | bufferSize, |
| 19945 | pEventData->pCBfnc, |
| 19946 | pEventData->pUserData, |
| 19947 | WDI_FTM_CMD_RESP); |
| 19948 | } |
| 19949 | |
| 19950 | /** |
| 19951 | @brief WDI_ProcessFTMCommandRsp |
| 19952 | Process FTM Command Response from HAL, simply route to HDD FTM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19953 | |
| 19954 | @param pWDICtx: pointer to the WLAN DAL context |
| 19955 | pEventData: pointer to the event information structure |
| 19956 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19957 | @see |
| 19958 | @return Result of the function call |
| 19959 | */ |
| 19960 | WDI_Status |
| 19961 | WDI_ProcessFTMCommandRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19962 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19963 | WDI_ControlBlockType* pWDICtx, |
| 19964 | WDI_EventInfoType* pEventData |
| 19965 | ) |
| 19966 | { |
| 19967 | WDI_FTMCommandRspCb ftmCMDRspCb; |
| 19968 | tProcessPttRspParams *ftmCMDRspData = NULL; |
| 19969 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19970 | |
| 19971 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19972 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19973 | -------------------------------------------------------------------------*/ |
| 19974 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19975 | ( NULL == pEventData->pEventData)) |
| 19976 | { |
| 19977 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19978 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19979 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19980 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19981 | } |
| 19982 | |
| 19983 | ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB; |
| 19984 | |
| 19985 | ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData; |
| 19986 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19987 | wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer, |
| 19988 | (void *)&ftmCMDRspData->pttMsgBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19989 | ftmCMDRspData->pttMsgBuffer.msgBodyLength); |
| 19990 | |
| 19991 | /*Notify UMAC*/ |
| 19992 | ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData); |
| 19993 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19994 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19995 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19996 | /** |
| 19997 | @brief WDI_ProcessHalDumpCmdReq |
| 19998 | Process hal dump Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19999 | |
| 20000 | @param pWDICtx: pointer to the WLAN DAL context |
| 20001 | pEventData: pointer to the event information structure |
| 20002 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20003 | @see |
| 20004 | @return Result of the function call |
| 20005 | */ |
| 20006 | WDI_Status |
| 20007 | WDI_ProcessHALDumpCmdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20008 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20009 | WDI_ControlBlockType* pWDICtx, |
| 20010 | WDI_EventInfoType* pEventData |
| 20011 | ) |
| 20012 | { |
| 20013 | WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL; |
| 20014 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL; |
| 20015 | wpt_uint16 usDataOffset = 0; |
| 20016 | wpt_uint16 usSendSize = 0; |
| 20017 | tHalDumpCmdReqMsg halDumpCmdReqMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20018 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20019 | |
| 20020 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20021 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20022 | -------------------------------------------------------------------------*/ |
| 20023 | if (( NULL == pEventData ) || |
| 20024 | ( NULL == pEventData->pEventData) || |
| 20025 | ( NULL == pEventData->pCBfnc )) |
| 20026 | { |
| 20027 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20028 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20029 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20030 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20031 | } |
| 20032 | |
| 20033 | pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData; |
| 20034 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc; |
| 20035 | |
| 20036 | /* Copying the HAL DUMP Command Information HAL Structure*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20037 | halDumpCmdReqMsg.dumpCmdReqParams.argument1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20038 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20039 | halDumpCmdReqMsg.dumpCmdReqParams.argument2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20040 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20041 | halDumpCmdReqMsg.dumpCmdReqParams.argument3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20042 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20043 | halDumpCmdReqMsg.dumpCmdReqParams.argument4 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20044 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20045 | halDumpCmdReqMsg.dumpCmdReqParams.argument5 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20046 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20047 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20048 | /*----------------------------------------------------------------------- |
| 20049 | Get message buffer |
| 20050 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20051 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20052 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams), |
| 20053 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20054 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20055 | (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) ))) |
| 20056 | { |
| 20057 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20058 | "Unable to get send buffer in HAL Dump Command req %x %x %x", |
| 20059 | pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb); |
| 20060 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20061 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20062 | } |
| 20063 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20064 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 20065 | &halDumpCmdReqMsg.dumpCmdReqParams, |
| 20066 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20067 | |
| 20068 | pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20069 | pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20070 | |
| 20071 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20072 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20073 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20074 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 20075 | wdiHALDumpCmdRspCb, pEventData->pUserData, |
| 20076 | WDI_HAL_DUMP_CMD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20077 | } |
| 20078 | |
| 20079 | /** |
| 20080 | @brief WDI_ProcessHalDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20081 | Process hal Dump Command Response from HAL, simply route to HDD |
| 20082 | |
| 20083 | @param pWDICtx: pointer to the WLAN DAL context |
| 20084 | pEventData: pointer to the event information structure |
| 20085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20086 | @see |
| 20087 | @return Result of the function call |
| 20088 | */ |
| 20089 | WDI_Status |
| 20090 | WDI_ProcessHALDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20091 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20092 | WDI_ControlBlockType* pWDICtx, |
| 20093 | WDI_EventInfoType* pEventData |
| 20094 | ) |
| 20095 | { |
| 20096 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb; |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 20097 | tHalDumpCmdRspParams halDumpCmdRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20098 | WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp; |
| 20099 | |
| 20100 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20101 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20102 | -------------------------------------------------------------------------*/ |
| 20103 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 20104 | ( NULL == pEventData->pEventData)) |
| 20105 | { |
| 20106 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20107 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20108 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20109 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20110 | } |
| 20111 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20112 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20113 | |
| 20114 | /*Initialize the WDI Response structure */ |
| 20115 | wdiHALDumpCmdRsp.usBufferLen = 0; |
| 20116 | wdiHALDumpCmdRsp.pBuffer = NULL; |
| 20117 | |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 20118 | wpalMemoryCopy( &halDumpCmdRspParams, |
| 20119 | pEventData->pEventData, |
| 20120 | sizeof(tHalDumpCmdRspParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20121 | |
| 20122 | wdiHALDumpCmdRsp.wdiStatus = |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 20123 | WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20124 | |
| 20125 | if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 20126 | (halDumpCmdRspParams.rspLength != 0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20127 | { |
| 20128 | /* Copy the response data */ |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 20129 | wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams.rspLength; |
| 20130 | wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams.rspLength); |
| 20131 | |
| 20132 | wpalMemoryCopy( wdiHALDumpCmdRsp.pBuffer, |
| 20133 | &halDumpCmdRspParams.rspBuffer, |
Gopichand Nakkala | a57ad93 | 2013-04-04 15:40:10 +0530 | [diff] [blame] | 20134 | halDumpCmdRspParams.rspLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20135 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20136 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20137 | /*Notify UMAC*/ |
| 20138 | wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData); |
| 20139 | |
| 20140 | if(wdiHALDumpCmdRsp.pBuffer != NULL) |
| 20141 | { |
| 20142 | /* Free the allocated buffer */ |
| 20143 | wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer); |
| 20144 | } |
| 20145 | return WDI_STATUS_SUCCESS; |
| 20146 | } |
| 20147 | |
| 20148 | /*========================================================================== |
| 20149 | CONTRL TRANSPORT INTERACTION |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20150 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20151 | Callback function registered with the control transport - for receiving |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20152 | notifications and packets |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20153 | ==========================================================================*/ |
| 20154 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20155 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20156 | when it wishes to send up a notification like the ones |
| 20157 | mentioned above. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20158 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20159 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20160 | |
| 20161 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20162 | wctsEvent: the event being notified |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20163 | wctsNotifyCBData: the callback data of the user |
| 20164 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20165 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20166 | |
| 20167 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20168 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20169 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20170 | WDI_NotifyMsgCTSCB |
| 20171 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20172 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20173 | WCTS_NotifyEventType wctsEvent, |
| 20174 | void* wctsNotifyCBData |
| 20175 | ) |
| 20176 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20177 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20178 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20179 | |
| 20180 | if (NULL == pWDICtx ) |
| 20181 | { |
| 20182 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20183 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20184 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20185 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20186 | } |
| 20187 | |
| 20188 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 20189 | { |
| 20190 | /* callback presumably occurred after close */ |
| 20191 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20192 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20193 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20194 | } |
| 20195 | |
| 20196 | if ( WCTS_EVENT_OPEN == wctsEvent ) |
| 20197 | { |
| 20198 | /*Flag must be set atomically as it is checked from incoming request |
| 20199 | functions*/ |
| 20200 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20201 | pWDICtx->bCTOpened = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20202 | |
| 20203 | /*Nothing to do - so try to dequeue any pending request that may have |
| 20204 | occurred while we were trying to establish this*/ |
| 20205 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20206 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20207 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20208 | else if ( WCTS_EVENT_CLOSE == wctsEvent ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20209 | { |
| 20210 | /*Flag must be set atomically as it is checked from incoming request |
| 20211 | functions*/ |
| 20212 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20213 | pWDICtx->bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20214 | |
| 20215 | /*No other request will be processed from now on - fail all*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20216 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20217 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 20218 | |
| 20219 | /*Notify that the Control Channel is closed */ |
| 20220 | wpalEventSet(&pWDICtx->wctsActionEvent); |
| 20221 | } |
| 20222 | |
| 20223 | }/*WDI_NotifyMsgCTSCB*/ |
| 20224 | |
| 20225 | |
| 20226 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20227 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20228 | when it wishes to send up a packet received over the |
| 20229 | bus. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20230 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20231 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20232 | |
| 20233 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20234 | pMsg: the packet |
| 20235 | uLen: the packet length |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20236 | wctsRxMsgCBData: the callback data of the user |
| 20237 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20238 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20239 | |
| 20240 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20241 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20242 | void |
| 20243 | WDI_RXMsgCTSCB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20244 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20245 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20246 | void* pMsg, |
| 20247 | wpt_uint32 uLen, |
| 20248 | void* wctsRxMsgCBData |
| 20249 | ) |
| 20250 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20251 | tHalMsgHeader *pHalMsgHeader; |
| 20252 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20253 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData; |
| 20254 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20255 | |
| 20256 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20257 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20258 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20259 | if ((NULL == pWDICtx ) || ( NULL == pMsg ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20260 | ( uLen < sizeof(tHalMsgHeader))) |
| 20261 | { |
| 20262 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20263 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20264 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20265 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20266 | } |
| 20267 | |
| 20268 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 20269 | { |
| 20270 | /* callback presumably occurred after close */ |
| 20271 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20272 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20273 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20274 | } |
| 20275 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20276 | /*The RX Callback is expected to be serialized in the proper control thread |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20277 | context - so no serialization is necessary here |
| 20278 | ! - revisit this assumption */ |
| 20279 | |
| 20280 | pHalMsgHeader = (tHalMsgHeader *)pMsg; |
| 20281 | |
| 20282 | if ( uLen != pHalMsgHeader->msgLen ) |
| 20283 | { |
| 20284 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20285 | "Invalid packet received from HAL - catastrophic failure"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20286 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); |
| 20287 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20288 | } |
| 20289 | |
| 20290 | wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType ); |
| 20291 | |
| 20292 | /*The message itself starts after the header*/ |
| 20293 | wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader); |
| 20294 | wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader); |
| 20295 | wdiEventData.pCBfnc = gWDICb.pfncRspCB; |
| 20296 | wdiEventData.pUserData = gWDICb.pRspCBUserData; |
| 20297 | |
| 20298 | |
| 20299 | if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 20300 | { |
| 20301 | /*Stop the timer as the response was received */ |
| 20302 | /*!UT - check for potential race conditions between stop and response */ |
| 20303 | wpalTimerStop(&pWDICtx->wptResponseTimer); |
| 20304 | } |
| 20305 | /* Check if we receive a response message which is not expected */ |
| 20306 | else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN ) |
| 20307 | { |
| 20308 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 20309 | "Received response %s (%d) when expecting %s (%d) - catastrophic failure", |
| 20310 | WDI_getRespMsgString(wdiEventData.wdiResponse), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20311 | wdiEventData.wdiResponse, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20312 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 20313 | pWDICtx->wdiExpectedResponse); |
| 20314 | /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */ |
| 20315 | return; |
| 20316 | } |
| 20317 | |
| 20318 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20319 | "Rx smth from HAL: %d", wdiEventData.wdiResponse); |
| 20320 | |
| 20321 | /*Post response event to the state machine*/ |
| 20322 | WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData); |
| 20323 | |
| 20324 | }/*WDI_RXMsgCTSCB*/ |
| 20325 | |
| 20326 | |
| 20327 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20328 | Internal Helper Routines |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20329 | ========================================================================*/ |
| 20330 | |
| 20331 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20332 | @brief WDI_CleanCB - internal helper routine used to clean the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20333 | WDI Main Control Block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20334 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20335 | @param pWDICtx - pointer to the control block |
| 20336 | |
| 20337 | @return Result of the function call |
| 20338 | */ |
| 20339 | WPT_INLINE WDI_Status |
| 20340 | WDI_CleanCB |
| 20341 | ( |
| 20342 | WDI_ControlBlockType* pWDICtx |
| 20343 | ) |
| 20344 | { |
| 20345 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20346 | |
| 20347 | /*Clean the WDI Control Block*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20348 | wpalMemoryZero( pWDICtx, sizeof(*pWDICtx)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20349 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20350 | pWDICtx->uGlobalState = WDI_MAX_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20351 | pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS; |
| 20352 | pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS; |
| 20353 | |
| 20354 | WDI_ResetAssocSessions( pWDICtx ); |
| 20355 | |
| 20356 | return WDI_STATUS_SUCCESS; |
| 20357 | }/*WDI_CleanCB*/ |
| 20358 | |
| 20359 | |
| 20360 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20361 | @brief Process request helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20362 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20363 | |
| 20364 | @param pWDICtx: pointer to the WLAN DAL context |
| 20365 | pEventData: pointer to the event information structure |
| 20366 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20367 | @see |
| 20368 | @return Result of the function call |
| 20369 | */ |
| 20370 | WPT_INLINE WDI_Status |
| 20371 | WDI_ProcessRequest |
| 20372 | ( |
| 20373 | WDI_ControlBlockType* pWDICtx, |
| 20374 | WDI_EventInfoType* pEventData |
| 20375 | ) |
| 20376 | { |
| 20377 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20378 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20379 | /*!! Skip sanity check as this is called from the FSM functionss which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20380 | already checked these pointers*/ |
| 20381 | |
| 20382 | if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) && |
| 20383 | ( NULL != pfnReqProcTbl[pEventData->wdiRequest] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20384 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20385 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20386 | "Calling request processing function for req %s (%d) %x", |
| 20387 | WDI_getReqMsgString(pEventData->wdiRequest), |
| 20388 | pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]); |
| 20389 | return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData); |
| 20390 | } |
| 20391 | else |
| 20392 | { |
| 20393 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20394 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20395 | pEventData->wdiRequest); |
| 20396 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 20397 | } |
| 20398 | }/*WDI_ProcessRequest*/ |
| 20399 | |
| 20400 | |
| 20401 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20402 | @brief Get message helper function - it allocates memory for a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20403 | message that is to be sent to HAL accross the bus and |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20404 | prefixes it with a send message header |
| 20405 | |
| 20406 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20407 | wdiReqType: type of the request being sent |
| 20408 | uBufferLen: message buffer len |
| 20409 | pMsgBuffer: resulting allocated buffer |
| 20410 | pusDataOffset: offset in the buffer where the caller |
| 20411 | can start copying its message data |
| 20412 | puBufferSize: the resulting buffer size (offset+buff |
| 20413 | len) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20414 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20415 | @see |
| 20416 | @return Result of the function call |
| 20417 | */ |
| 20418 | WDI_Status |
| 20419 | WDI_GetMessageBuffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20420 | ( |
| 20421 | WDI_ControlBlockType* pWDICtx, |
| 20422 | WDI_RequestEnumType wdiReqType, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20423 | wpt_uint16 usBufferLen, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20424 | wpt_uint8** pMsgBuffer, |
| 20425 | wpt_uint16* pusDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20426 | wpt_uint16* pusBufferSize |
| 20427 | ) |
| 20428 | { |
| 20429 | tHalMsgHeader halMsgHeader; |
| 20430 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20431 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20432 | /*!! No sanity check here as we trust the called - ! check this assumption |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20433 | again*/ |
| 20434 | |
| 20435 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20436 | Try to allocate message buffer from PAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20437 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20438 | *pusBufferSize = sizeof(halMsgHeader) + usBufferLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20439 | *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize); |
| 20440 | if ( NULL == *pMsgBuffer ) |
| 20441 | { |
| 20442 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20443 | "Unable to allocate message buffer for req %s (%d)", |
| 20444 | WDI_getReqMsgString(wdiReqType), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20445 | wdiReqType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20446 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20447 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20448 | } |
| 20449 | |
| 20450 | /*------------------------------------------------------------------------- |
| 20451 | Fill in the message header |
| 20452 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20453 | halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType); |
| 20454 | /* Fill msgVersion */ |
| 20455 | #ifdef WLAN_FEATURE_11AC |
| 20456 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 20457 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20458 | else |
| 20459 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 20460 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20461 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20462 | halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen; |
| 20463 | *pusDataOffset = sizeof(halMsgHeader); |
| 20464 | wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader)); |
| 20465 | |
| 20466 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20467 | }/*WDI_GetMessageBuffer*/ |
| 20468 | |
| 20469 | |
| 20470 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20471 | @brief Send message helper function - sends a message over the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20472 | bus using the control tranport and saves some info in |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20473 | the CB |
| 20474 | |
| 20475 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20476 | pSendBuffer: buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20478 | usSendSize size of the buffer to be sent |
| 20479 | pRspCb: response callback - save in the WDI |
| 20480 | CB |
| 20481 | pUserData: user data associated with the |
| 20482 | callback |
| 20483 | wdiExpectedResponse: the code of the response that is |
| 20484 | expected to be rx-ed for this request |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20486 | @see |
| 20487 | @return Result of the function call |
| 20488 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20489 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20490 | WDI_SendMsg |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20491 | ( |
| 20492 | WDI_ControlBlockType* pWDICtx, |
| 20493 | wpt_uint8* pSendBuffer, |
| 20494 | wpt_uint32 usSendSize, |
| 20495 | void* pRspCb, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20496 | void* pUserData, |
| 20497 | WDI_ResponseEnumType wdiExpectedResponse |
| 20498 | ) |
| 20499 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20500 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20501 | wpt_uint32 ret; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20502 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20503 | |
| 20504 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20505 | Save needed info in the CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20506 | ------------------------------------------------------------------------*/ |
| 20507 | pWDICtx->pRspCBUserData = pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20508 | pWDICtx->pfncRspCB = pRspCb; |
| 20509 | pWDICtx->wdiExpectedResponse = wdiExpectedResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20510 | |
| 20511 | /*----------------------------------------------------------------------- |
| 20512 | Call the CTS to send this message over - free message afterwards |
| 20513 | - notify transport failure |
| 20514 | Note: CTS is reponsible for freeing the message buffer. |
| 20515 | -----------------------------------------------------------------------*/ |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20516 | ret = WCTS_SendMessage(pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize); |
| 20517 | if ((eWLAN_PAL_STATUS_SUCCESS != ret) && |
| 20518 | (eWLAN_PAL_STATUS_E_RESOURCES != ret)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20519 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20520 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20521 | "Failed to send message over the bus - catastrophic failure"); |
| 20522 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20523 | wdiStatus = WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20524 | } |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20525 | else |
| 20526 | { |
| 20527 | /* even when message was placed in CTS deferred Q, we will treat it |
| 20528 | success but log this info |
| 20529 | */ |
| 20530 | if (eWLAN_PAL_STATUS_E_RESOURCES == ret) |
| 20531 | { |
| 20532 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 20533 | "WDI_SendMsg: message placed in CTS deferred Q, expected " |
| 20534 | "response %s (%d)", |
| 20535 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 20536 | pWDICtx->wdiExpectedResponse); |
Gopichand Nakkala | 0f662fa | 2012-12-23 08:30:59 -0800 | [diff] [blame] | 20537 | WDI_ASSERT(0); |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20538 | } |
| 20539 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20540 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20541 | /*Check if originator provided a request status callback*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20542 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 20543 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20544 | /*Inform originator whether request went through or not*/ |
| 20545 | WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB; |
| 20546 | void *callbackContext = pWDICtx->pReqStatusUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20547 | pWDICtx->wdiReqStatusCB = NULL; |
| 20548 | pWDICtx->pReqStatusUserData = NULL; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20549 | callback(wdiStatus, callbackContext); |
| 20550 | |
| 20551 | /*For WDI requests which have registered a request callback, |
| 20552 | inform the WDA caller of the same via setting the return value |
| 20553 | (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt |
| 20554 | end up repeating the functonality in the req callback for the |
| 20555 | WDI_STATUS_E_FAILURE case*/ |
| 20556 | if (wdiStatus == WDI_STATUS_E_FAILURE) |
| 20557 | wdiStatus = WDI_STATUS_PENDING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20558 | } |
| 20559 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20560 | if ( wdiStatus == WDI_STATUS_SUCCESS ) |
| 20561 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20562 | /*Start timer for the expected response */ |
| 20563 | wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT); |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20564 | |
| 20565 | /*cache current timestamp for debugging */ |
Gopichand Nakkala | 0f662fa | 2012-12-23 08:30:59 -0800 | [diff] [blame] | 20566 | pWDICtx->uTimeStampRspTmrStart = wpalGetSystemTime(); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20567 | } |
| 20568 | else |
| 20569 | { |
Jeff Johnson | 1920a72 | 2012-12-10 14:28:09 -0800 | [diff] [blame] | 20570 | /*Inform upper stack layers that a transport fatal error occurred*/ |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20571 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 20572 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20573 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20574 | return wdiStatus; |
| 20575 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20576 | }/*WDI_SendMsg*/ |
| 20577 | |
| 20578 | |
| 20579 | |
| 20580 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20581 | @brief Send indication helper function - sends a message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20582 | the bus using the control transport and saves some info |
| 20583 | in the CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20584 | |
| 20585 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20586 | pSendBuffer: buffer to be sent |
| 20587 | usSendSize: size of the buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20589 | @see |
| 20590 | @return Result of the function call |
| 20591 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20592 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20593 | WDI_SendIndication |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20594 | ( |
| 20595 | WDI_ControlBlockType* pWDICtx, |
| 20596 | wpt_uint8* pSendBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20597 | wpt_uint32 usSendSize |
| 20598 | ) |
| 20599 | { |
| 20600 | wpt_uint32 uStatus ; |
| 20601 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20602 | |
| 20603 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20604 | Call the CTS to send this message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20605 | Note: CTS is reponsible for freeing the message buffer. |
| 20606 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20607 | uStatus = WCTS_SendMessage( pWDICtx->wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20608 | (void*)pSendBuffer, usSendSize ); |
| 20609 | |
| 20610 | /*Inform Upper MAC about the outcome of the request*/ |
| 20611 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 20612 | { |
| 20613 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20614 | "Send indication status : %d", uStatus); |
| 20615 | |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20616 | /* even if CTS placed indication into its deferred Q, we treat it |
| 20617 | * as success and let CTS drain its queue as per smd interrupt to CTS |
| 20618 | */ |
| 20619 | pWDICtx->wdiReqStatusCB( ((uStatus != eWLAN_PAL_STATUS_SUCCESS) && (uStatus != eWLAN_PAL_STATUS_E_RESOURCES)) ? WDI_STATUS_E_FAILURE: WDI_STATUS_SUCCESS, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20620 | pWDICtx->pReqStatusUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20621 | } |
| 20622 | |
| 20623 | /*If sending of the message failed - it is considered catastrophic and |
| 20624 | indicates an error with the device*/ |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20625 | if (( eWLAN_PAL_STATUS_SUCCESS != uStatus) && |
| 20626 | ( eWLAN_PAL_STATUS_E_RESOURCES != uStatus)) |
| 20627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20628 | { |
| 20629 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20630 | "Failed to send indication over the bus - catastrophic failure"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20631 | |
| 20632 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 20633 | return WDI_STATUS_E_FAILURE; |
| 20634 | } |
| 20635 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20636 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20637 | }/*WDI_SendIndication*/ |
| 20638 | |
| 20639 | |
| 20640 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20641 | @brief WDI_DetectedDeviceError - called internally by DAL when |
| 20642 | it has detected a failure in the device |
| 20643 | |
| 20644 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20645 | usErrorCode: error code detected by WDI or received |
| 20646 | from HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20647 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20648 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20649 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20650 | */ |
| 20651 | void |
| 20652 | WDI_DetectedDeviceError |
| 20653 | ( |
| 20654 | WDI_ControlBlockType* pWDICtx, |
| 20655 | wpt_uint16 usErrorCode |
| 20656 | ) |
| 20657 | { |
| 20658 | WDI_LowLevelIndType wdiInd; |
| 20659 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20660 | |
| 20661 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20662 | "Device Error detected code: %d - transitioning to stopped state", |
| 20663 | usErrorCode); |
| 20664 | |
| 20665 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 20666 | |
| 20667 | WDI_STATableStop(pWDICtx); |
| 20668 | |
| 20669 | WDI_ResetAssocSessions(pWDICtx); |
| 20670 | |
| 20671 | /*Set the expected state transition to stopped - because the device |
| 20672 | experienced a failure*/ |
| 20673 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 20674 | |
| 20675 | /*Transition to stopped to fail all incomming requests from this point on*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20676 | WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20677 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20678 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20679 | |
| 20680 | /*TO DO: - there should be an attempt to reset the device here*/ |
| 20681 | |
| 20682 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 20683 | |
| 20684 | /*------------------------------------------------------------------------ |
| 20685 | Notify UMAC if a handler is registered |
| 20686 | ------------------------------------------------------------------------*/ |
| 20687 | if (pWDICtx->wdiLowLevelIndCB) |
| 20688 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20689 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 20690 | wdiInd.wdiIndicationData.usErrorCode = usErrorCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20691 | |
| 20692 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData); |
| 20693 | } |
| 20694 | }/*WDI_DetectedDeviceError*/ |
| 20695 | |
| 20696 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20697 | @brief This callback is invoked by the wpt when a timer that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20698 | we started on send message has expire - this should |
| 20699 | never happen - it means device is stuck and cannot |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20700 | reply - trigger catastrophic failure |
| 20701 | @param |
| 20702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20703 | pUserData: the callback data of the user (ptr to WDI CB) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20704 | |
| 20705 | @see |
| 20706 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20707 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20708 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20709 | WDI_ResponseTimerCB |
| 20710 | ( |
| 20711 | void *pUserData |
| 20712 | ) |
| 20713 | { |
| 20714 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 20715 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20716 | |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20717 | if (NULL == pWDICtx) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20718 | { |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20719 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20720 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20721 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20722 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20723 | } |
| 20724 | |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20725 | /*cache current timestamp for debugging */ |
Gopichand Nakkala | 0f662fa | 2012-12-23 08:30:59 -0800 | [diff] [blame] | 20726 | pWDICtx->uTimeStampRspTmrExp = wpalGetSystemTime(); |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20727 | |
| 20728 | /* If response timer is running at this time that means this timer |
| 20729 | * event is not for the last request but rather last-to-last request and |
| 20730 | * this timer event has come after we recevied respone for last-to-last |
| 20731 | * message |
| 20732 | */ |
| 20733 | if (VOS_TIMER_STATE_RUNNING == wpalTimerGetCurStatus(&pWDICtx->wptResponseTimer)) |
| 20734 | { |
| 20735 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 20736 | "WDI_ResponseTimerCB: timer in running state on timer event, " |
| 20737 | "ignore tmr event, timeStampTmrStart: %ld, timeStampTmrExp: %ld", |
| 20738 | pWDICtx->uTimeStampRspTmrStart, pWDICtx->uTimeStampRspTmrExp); |
| 20739 | return; |
| 20740 | } |
| 20741 | |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20742 | if (WDI_MAX_RESP != pWDICtx->wdiExpectedResponse) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20743 | { |
| 20744 | |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20745 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20746 | "Timeout occurred while waiting for %s (%d) message from device " |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20747 | " - catastrophic failure, timeStampTmrStart: %ld, timeStampTmrExp: %ld", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20748 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20749 | pWDICtx->wdiExpectedResponse, pWDICtx->uTimeStampRspTmrStart, |
| 20750 | pWDICtx->uTimeStampRspTmrExp); |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20751 | |
| 20752 | /* WDI timeout means Riva is not responding or SMD communication to Riva |
| 20753 | * is not happening. The only possible way to recover from this error |
| 20754 | * is to initiate SSR from APPS. |
| 20755 | * There is also an option to re-enable wifi, which will eventually |
| 20756 | * trigger SSR |
| 20757 | */ |
| 20758 | if (gWDICb.bEnableSSR == false) |
| 20759 | { |
| 20760 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 20761 | "SSR is not enabled on WDI timeout"); |
| 20762 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 20763 | return; |
| 20764 | } |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 20765 | #ifndef WDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20766 | wpalWcnssResetIntr(); |
| 20767 | /* if this timer fires, it means Riva did not receive the FIQ */ |
| 20768 | wpalTimerStart(&pWDICtx->ssrTimer, WDI_SSR_TIMEOUT); |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 20769 | #else |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20770 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 20771 | wpalWlanReload(); |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 20772 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20773 | } |
| 20774 | else |
| 20775 | { |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 20776 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20777 | "Timeout occurred but not waiting for any response %d " |
| 20778 | "timeStampTmrStart: %ld, timeStampTmrExp: %ld", |
| 20779 | pWDICtx->wdiExpectedResponse, pWDICtx->uTimeStampRspTmrStart, |
| 20780 | pWDICtx->uTimeStampRspTmrExp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20781 | } |
| 20782 | |
| 20783 | return; |
| 20784 | |
| 20785 | }/*WDI_ResponseTimerCB*/ |
| 20786 | |
| 20787 | |
| 20788 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20789 | @brief Process response helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20790 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20791 | |
| 20792 | @param pWDICtx: pointer to the WLAN DAL context |
| 20793 | pEventData: pointer to the event information structure |
| 20794 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20795 | @see |
| 20796 | @return Result of the function call |
| 20797 | */ |
| 20798 | WPT_INLINE WDI_Status |
| 20799 | WDI_ProcessResponse |
| 20800 | ( |
| 20801 | WDI_ControlBlockType* pWDICtx, |
| 20802 | WDI_EventInfoType* pEventData |
| 20803 | ) |
| 20804 | { |
| 20805 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20806 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20807 | /* Skip sanity check as this is called from the FSM functions which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20808 | already checked these pointers |
| 20809 | ! - revisit this assumption */ |
| 20810 | if (( pEventData->wdiResponse < WDI_MAX_RESP ) && |
| 20811 | ( NULL != pfnRspProcTbl[pEventData->wdiResponse] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20812 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20813 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20814 | "Calling response processing function for resp %s (%d) %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20815 | WDI_getRespMsgString(pEventData->wdiResponse), |
| 20816 | pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]); |
| 20817 | return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData); |
| 20818 | } |
| 20819 | else |
| 20820 | { |
| 20821 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20822 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20823 | pEventData->wdiResponse); |
| 20824 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 20825 | } |
| 20826 | }/*WDI_ProcessResponse*/ |
| 20827 | |
| 20828 | |
| 20829 | /*========================================================================= |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20830 | QUEUE SUPPORT UTILITY FUNCTIONS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20831 | =========================================================================*/ |
| 20832 | |
| 20833 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20834 | @brief Utility function used by the DAL Core to help queue a |
| 20835 | request that cannot be processed right away. |
| 20836 | @param |
| 20837 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20838 | pWDICtx: - pointer to the WDI control block |
| 20839 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20840 | queued |
| 20841 | |
| 20842 | @see |
| 20843 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20844 | */ |
| 20845 | WDI_Status |
| 20846 | WDI_QueuePendingReq |
| 20847 | ( |
| 20848 | WDI_ControlBlockType* pWDICtx, |
| 20849 | WDI_EventInfoType* pEventData |
| 20850 | ) |
| 20851 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20852 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20853 | WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20854 | void* pEventInfo = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20855 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20856 | |
| 20857 | if ( NULL == pEventDataQueue ) |
| 20858 | { |
| 20859 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20860 | "Cannot allocate memory for queueing"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20861 | WDI_ASSERT(0); |
| 20862 | return WDI_STATUS_MEM_FAILURE; |
| 20863 | } |
| 20864 | |
| 20865 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 20866 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 20867 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 20868 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20869 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20870 | |
| 20871 | if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL ) |
| 20872 | { |
| 20873 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20874 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20875 | if ( NULL == pEventInfo ) |
| 20876 | { |
| 20877 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20878 | "Cannot allocate memory for queueing event data info"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20879 | WDI_ASSERT(0); |
| 20880 | wpalMemoryFree(pEventDataQueue); |
| 20881 | return WDI_STATUS_MEM_FAILURE; |
| 20882 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20883 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20884 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 20885 | |
| 20886 | } |
| 20887 | pEventDataQueue->pEventData = pEventInfo; |
| 20888 | |
| 20889 | /*Send wpt a pointer to the node (this is the 1st element in the event data)*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20890 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20891 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20892 | wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20893 | |
| 20894 | return WDI_STATUS_SUCCESS; |
| 20895 | }/*WDI_QueuePendingReq*/ |
| 20896 | |
| 20897 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20898 | @brief Callback function for serializing queued message |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20899 | processing in the control context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20900 | @param |
| 20901 | |
| 20902 | pMsg - pointer to the message |
| 20903 | |
| 20904 | @see |
| 20905 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20906 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20907 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20908 | WDI_PALCtrlMsgCB |
| 20909 | ( |
| 20910 | wpt_msg *pMsg |
| 20911 | ) |
| 20912 | { |
| 20913 | WDI_EventInfoType* pEventData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20914 | WDI_ControlBlockType* pWDICtx = NULL; |
| 20915 | WDI_Status wdiStatus; |
| 20916 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20917 | void* pUserData; |
| 20918 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20919 | |
| 20920 | if (( NULL == pMsg )|| |
| 20921 | ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) || |
| 20922 | ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext ))) |
| 20923 | { |
| 20924 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20925 | "Invalid message received on serialize ctrl context API"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20926 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20927 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20928 | } |
| 20929 | |
| 20930 | /*Transition back to the state that we had before serialization |
| 20931 | - serialization transitions us to BUSY to stop any incomming requests |
| 20932 | ! TO DO L: possible race condition here if a request comes in between the |
| 20933 | state transition and the post function*/ |
| 20934 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20935 | WDI_STATE_TRANSITION( pWDICtx, pMsg->val); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20936 | |
| 20937 | /*----------------------------------------------------------------------- |
| 20938 | Check to see what type of event we are serializing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20939 | - responses are never expected to come through here |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20940 | -----------------------------------------------------------------------*/ |
| 20941 | switch ( pEventData->wdiRequest ) |
| 20942 | { |
| 20943 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20944 | case WDI_STOP_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20945 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData); |
| 20946 | break; |
| 20947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20948 | case WDI_NV_DOWNLOAD_REQ: |
| 20949 | // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT. |
| 20950 | // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly. |
| 20951 | if (pWDICtx->uGlobalState == WDI_STARTED_ST) |
| 20952 | { |
| 20953 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20954 | "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20955 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 20956 | } |
| 20957 | else |
| 20958 | { |
| 20959 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData); |
| 20960 | } |
| 20961 | |
| 20962 | break; |
| 20963 | |
| 20964 | default: |
| 20965 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 20966 | break; |
| 20967 | }/*switch ( pEventData->wdiRequest )*/ |
| 20968 | |
| 20969 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 20970 | { |
| 20971 | WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData); |
| 20972 | |
| 20973 | if ( NULL != pfnReqStatusCB ) |
| 20974 | { |
| 20975 | /*Fail the request*/ |
| 20976 | pfnReqStatusCB( wdiStatus, pUserData); |
| 20977 | } |
| 20978 | } |
| 20979 | |
| 20980 | /* Free data - that was allocated when queueing*/ |
| 20981 | if( pEventData != NULL ) |
| 20982 | { |
| 20983 | if( pEventData->pEventData != NULL ) |
| 20984 | { |
| 20985 | wpalMemoryFree(pEventData->pEventData); |
| 20986 | } |
| 20987 | wpalMemoryFree(pEventData); |
| 20988 | } |
| 20989 | |
| 20990 | if( pMsg != NULL ) |
| 20991 | { |
| 20992 | wpalMemoryFree(pMsg); |
| 20993 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20995 | }/*WDI_PALCtrlMsgCB*/ |
| 20996 | |
| 20997 | /** |
| 20998 | @brief Utility function used by the DAL Core to help dequeue |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20999 | and schedule for execution a pending request |
| 21000 | @param |
| 21001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21002 | pWDICtx: - pointer to the WDI control block |
| 21003 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21004 | queued |
| 21005 | |
| 21006 | @see |
| 21007 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21008 | */ |
| 21009 | WDI_Status |
| 21010 | WDI_DequeuePendingReq |
| 21011 | ( |
| 21012 | WDI_ControlBlockType* pWDICtx |
| 21013 | ) |
| 21014 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21015 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21016 | WDI_EventInfoType* pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21017 | wpt_msg* palMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21018 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21019 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21020 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21021 | |
| 21022 | if ( NULL == pNode ) |
| 21023 | { |
| 21024 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21025 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21026 | return WDI_STATUS_SUCCESS; |
| 21027 | } |
| 21028 | |
| 21029 | /*The node actually points to the 1st element inside the Event Data struct - |
| 21030 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21031 | pEventData = (WDI_EventInfoType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21032 | |
| 21033 | /*Serialize processing in the control thread |
| 21034 | !TO DO: - check to see if these are all the messages params that need |
| 21035 | to be filled in*/ |
| 21036 | palMsg = wpalMemoryAllocate(sizeof(wpt_msg)); |
| 21037 | |
| 21038 | if ( NULL == palMsg ) |
| 21039 | { |
| 21040 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21041 | "WDI_DequeuePendingReq: Cannot allocate memory for palMsg."); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21042 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21043 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21044 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21045 | palMsg->pContext = pWDICtx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21046 | palMsg->callback = WDI_PALCtrlMsgCB; |
| 21047 | palMsg->ptr = pEventData; |
| 21048 | |
| 21049 | /*Save the global state as we need it on the other side*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21050 | palMsg->val = pWDICtx->uGlobalState; |
| 21051 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21052 | /*Transition back to BUSY as we need to handle a queued request*/ |
| 21053 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21054 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21055 | wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg); |
| 21056 | |
| 21057 | return WDI_STATUS_PENDING; |
| 21058 | }/*WDI_DequeuePendingReq*/ |
| 21059 | |
| 21060 | |
| 21061 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21062 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21063 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21064 | away.- The assoc requests will be queued by BSSID |
| 21065 | @param |
| 21066 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21067 | pWDICtx: - pointer to the WDI control block |
| 21068 | pEventData: pointer to the evnt info that needs to be queued |
| 21069 | macBSSID: bssid |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21070 | |
| 21071 | @see |
| 21072 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21073 | */ |
| 21074 | WDI_Status |
| 21075 | WDI_QueueNewAssocRequest |
| 21076 | ( |
| 21077 | WDI_ControlBlockType* pWDICtx, |
| 21078 | WDI_EventInfoType* pEventData, |
| 21079 | wpt_macAddr macBSSID |
| 21080 | ) |
| 21081 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21082 | wpt_uint8 i; |
| 21083 | WDI_BSSSessionType* pSession = NULL; |
| 21084 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21085 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21086 | void* pEventInfo; |
| 21087 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21088 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21089 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21090 | |
| 21091 | /*------------------------------------------------------------------------ |
| 21092 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21093 | ------------------------------------------------------------------------*/ |
| 21094 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21095 | { |
| 21096 | if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse ) |
| 21097 | { |
| 21098 | /*Found an empty session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21099 | pSession = &pWDICtx->aBSSSessions[i]; |
| 21100 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21101 | } |
| 21102 | } |
| 21103 | |
| 21104 | if ( i >= WDI_MAX_BSS_SESSIONS ) |
| 21105 | { |
| 21106 | /*Cannot find any empty sessions*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21107 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21108 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21110 | /*------------------------------------------------------------------------ |
| 21111 | Fill in the BSSID for this session and set the usage flag |
| 21112 | ------------------------------------------------------------------------*/ |
| 21113 | wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21114 | pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21115 | |
| 21116 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21117 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21118 | ------------------------------------------------------------------------*/ |
| 21119 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 21120 | if ( NULL == pEventDataQueue ) |
| 21121 | { |
| 21122 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21123 | "%s: Cannot allocate memory for queue node", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21124 | WDI_ASSERT(0); |
| 21125 | return WDI_STATUS_MEM_FAILURE; |
| 21126 | } |
| 21127 | |
| 21128 | pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType)); |
| 21129 | if ( NULL == pSessionIdElement ) |
| 21130 | { |
| 21131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21132 | "%s: Cannot allocate memory for session ID", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21133 | WDI_ASSERT(0); |
| 21134 | wpalMemoryFree(pEventDataQueue); |
| 21135 | return WDI_STATUS_MEM_FAILURE; |
| 21136 | } |
| 21137 | |
| 21138 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 21139 | if ( NULL == pEventInfo ) |
| 21140 | { |
| 21141 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21142 | "%s: Cannot allocate memory for event data info", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21143 | WDI_ASSERT(0); |
| 21144 | wpalMemoryFree(pSessionIdElement); |
| 21145 | wpalMemoryFree(pEventDataQueue); |
| 21146 | return WDI_STATUS_MEM_FAILURE; |
| 21147 | } |
| 21148 | |
| 21149 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 21150 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 21151 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 21152 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21153 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21154 | |
| 21155 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 21156 | pEventDataQueue->pEventData = pEventInfo; |
| 21157 | |
| 21158 | /*Send wpt a pointer to the node (this is the 1st element in the event data)*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21159 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21160 | |
| 21161 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21162 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21163 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21164 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21165 | |
| 21166 | /*We need to maintain a separate list that keeps track of the order in which |
| 21167 | the new assoc requests are being queued such that we can start processing |
| 21168 | them in the order that they had arrived*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21169 | pSessionIdElement->ucIndex = i; |
| 21170 | pNode = (wpt_list_node*)pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21171 | |
| 21172 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 21173 | "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21174 | wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21175 | |
| 21176 | /*Return pending as this is what the status of the request is since it has |
| 21177 | been queued*/ |
| 21178 | return WDI_STATUS_PENDING; |
| 21179 | }/*WDI_QueueNewAssocRequest*/ |
| 21180 | |
| 21181 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21182 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21183 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21184 | away.- The assoc requests will be queued by BSSID |
| 21185 | @param |
| 21186 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21187 | pWDICtx: - pointer to the WDI control block |
| 21188 | pSession: - session in which to queue |
| 21189 | pEventData: pointer to the event info that needs to be |
| 21190 | queued |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21191 | |
| 21192 | @see |
| 21193 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21194 | */ |
| 21195 | WDI_Status |
| 21196 | WDI_QueueAssocRequest |
| 21197 | ( |
| 21198 | WDI_ControlBlockType* pWDICtx, |
| 21199 | WDI_BSSSessionType* pSession, |
| 21200 | WDI_EventInfoType* pEventData |
| 21201 | ) |
| 21202 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21203 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21204 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21205 | void* pEventInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21206 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21207 | |
| 21208 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21209 | Sanity check |
| 21210 | ------------------------------------------------------------------------*/ |
| 21211 | if (( NULL == pSession ) || ( NULL == pWDICtx )) |
| 21212 | { |
| 21213 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21214 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21215 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21216 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21217 | } |
| 21218 | |
| 21219 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21220 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21221 | ------------------------------------------------------------------------*/ |
| 21222 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 21223 | if ( NULL == pEventDataQueue ) |
| 21224 | { |
| 21225 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21226 | "%s: Cannot allocate memory for queueing", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21227 | WDI_ASSERT(0); |
| 21228 | return WDI_STATUS_MEM_FAILURE; |
| 21229 | } |
| 21230 | |
| 21231 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 21232 | if ( NULL == pEventInfo ) |
| 21233 | { |
| 21234 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 21235 | "%s: Cannot allocate memory for queueing event data info", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21236 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21237 | WDI_ASSERT(0); |
| 21238 | wpalMemoryFree(pEventDataQueue); |
| 21239 | return WDI_STATUS_MEM_FAILURE; |
| 21240 | } |
| 21241 | |
| 21242 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 21243 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 21244 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 21245 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21246 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21247 | pEventDataQueue->pEventData = pEventInfo; |
| 21248 | |
| 21249 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 21250 | |
| 21251 | /*Send wpt a pointer to the node (this is the 1st element in the event data)*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21252 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21253 | |
| 21254 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21255 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21256 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21257 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21258 | |
| 21259 | /*The result of this operation is pending because the request has been |
| 21260 | queued and it will be processed at a later moment in time */ |
| 21261 | return WDI_STATUS_PENDING; |
| 21262 | }/*WDI_QueueAssocRequest*/ |
| 21263 | |
| 21264 | /** |
| 21265 | @brief Utility function used by the DAL Core to help dequeue |
| 21266 | an association request that was pending |
| 21267 | The request will be queued up in front of the main |
| 21268 | pending queue for imediate processing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21269 | @param |
| 21270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21271 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21272 | |
| 21273 | |
| 21274 | @see |
| 21275 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21276 | */ |
| 21277 | WDI_Status |
| 21278 | WDI_DequeueAssocRequest |
| 21279 | ( |
| 21280 | WDI_ControlBlockType* pWDICtx |
| 21281 | ) |
| 21282 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21283 | wpt_list_node* pNode = NULL; |
| 21284 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21285 | WDI_BSSSessionType* pSession; |
| 21286 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21287 | |
| 21288 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21289 | Sanity check |
| 21290 | ------------------------------------------------------------------------*/ |
| 21291 | if ( NULL == pWDICtx ) |
| 21292 | { |
| 21293 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21294 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21295 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21296 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21297 | } |
| 21298 | |
| 21299 | /*------------------------------------------------------------------------ |
| 21300 | An association has been completed => a new association can occur |
| 21301 | Check to see if there are any pending associations -> |
| 21302 | If so , transfer all the pending requests into the busy queue for |
| 21303 | processing |
| 21304 | These requests have arrived prior to the requests in the busy queue |
| 21305 | (bc they needed to be processed in order to be placed in this queue) |
| 21306 | => they will be placed at the front of the busy queue |
| 21307 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21308 | wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21309 | |
| 21310 | if ( NULL == pNode ) |
| 21311 | { |
| 21312 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21313 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21314 | return WDI_STATUS_SUCCESS; |
| 21315 | } |
| 21316 | |
| 21317 | /*The node actually points to the 1st element inside the Session Id struct - |
| 21318 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21319 | pSessionIdElement = (WDI_NextSessionIdType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21320 | |
| 21321 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 21322 | "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex); |
| 21323 | |
| 21324 | if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS ) |
| 21325 | { |
| 21326 | pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex]; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21328 | /*Transfer all the pending requests in this assoc queue to |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21329 | the front of the main waiting queue for subsequent execution*/ |
| 21330 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21331 | while ( NULL != pNode ) |
| 21332 | { |
| 21333 | /*Place it in front of the main pending list*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21334 | wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode); |
| 21335 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21336 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21337 | pSession->bAssocReqQueued = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21338 | } |
| 21339 | else |
| 21340 | { |
| 21341 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21342 | "Invalid session id queued up for assoc"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21343 | WPAL_ASSERT(0); |
| 21344 | wpalMemoryFree(pSessionIdElement); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21345 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21346 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21347 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21348 | /*Clean this up as it is no longer needed in order to prevent memory leak*/ |
| 21349 | wpalMemoryFree(pSessionIdElement); |
| 21350 | return WDI_STATUS_SUCCESS; |
| 21351 | }/*WDI_DequeueAssocRequest*/ |
| 21352 | |
| 21353 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21354 | @brief Utility function used by the DAL Core to clear any |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21355 | pending requests - all req cb will be called with |
| 21356 | failure and the queue will be emptied. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21357 | @param |
| 21358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21359 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21360 | |
| 21361 | @see |
| 21362 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21363 | */ |
| 21364 | WDI_Status |
| 21365 | WDI_ClearPendingRequests |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21366 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21367 | WDI_ControlBlockType* pWDICtx |
| 21368 | ) |
| 21369 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21370 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21371 | WDI_EventInfoType* pEventDataQueue = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21372 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21373 | void* pUserData; |
| 21374 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21375 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21376 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21377 | |
| 21378 | /*------------------------------------------------------------------------ |
| 21379 | Go through all the requests and fail them - this will only be called |
| 21380 | when device is being stopped or an error was detected - either case the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21381 | pending requests can no longer be sent down to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21382 | ------------------------------------------------------------------------*/ |
| 21383 | while( pNode ) |
| 21384 | { |
| 21385 | /*The node actually points to the 1st element inside the Event Data struct - |
| 21386 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21387 | pEventDataQueue = (WDI_EventInfoType*)pNode; |
| 21388 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21389 | WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData); |
| 21390 | if ( NULL != pfnReqStatusCB ) |
| 21391 | { |
| 21392 | /*Fail the request*/ |
| 21393 | pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData); |
| 21394 | } |
| 21395 | /* Free data - that was allocated when queueing */ |
| 21396 | if ( pEventDataQueue->pEventData != NULL ) |
| 21397 | { |
| 21398 | wpalMemoryFree(pEventDataQueue->pEventData); |
| 21399 | } |
| 21400 | wpalMemoryFree(pEventDataQueue); |
| 21401 | |
| 21402 | if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS) |
| 21403 | { |
| 21404 | break; |
| 21405 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21406 | } |
| 21407 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21408 | return WDI_STATUS_SUCCESS; |
| 21409 | }/*WDI_ClearPendingRequests*/ |
| 21410 | |
| 21411 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21412 | @brief Helper routine used to init the BSS Sessions in the WDI control block |
| 21413 | |
| 21414 | |
| 21415 | @param pWDICtx: pointer to the WLAN DAL context |
| 21416 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21417 | @see |
| 21418 | */ |
| 21419 | void |
| 21420 | WDI_ResetAssocSessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21421 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21422 | WDI_ControlBlockType* pWDICtx |
| 21423 | ) |
| 21424 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21425 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21426 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21427 | |
| 21428 | /*------------------------------------------------------------------------- |
| 21429 | No Sanity check |
| 21430 | -------------------------------------------------------------------------*/ |
| 21431 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21432 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21433 | wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21434 | pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST; |
| 21435 | pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX; |
| 21436 | pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX; |
| 21437 | } |
| 21438 | }/*WDI_ResetAssocSessions*/ |
| 21439 | |
| 21440 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21441 | @brief Helper routine used to find a session based on the BSSID |
| 21442 | |
| 21443 | |
| 21444 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21445 | macBSSID: BSSID of the session |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21446 | pSession: pointer to the session (if found) |
| 21447 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21448 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21449 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21450 | */ |
| 21451 | wpt_uint8 |
| 21452 | WDI_FindAssocSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21453 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21454 | WDI_ControlBlockType* pWDICtx, |
| 21455 | wpt_macAddr macBSSID, |
| 21456 | WDI_BSSSessionType** ppSession |
| 21457 | ) |
| 21458 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21459 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21460 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21461 | |
| 21462 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21463 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21464 | -------------------------------------------------------------------------*/ |
| 21465 | if ( NULL == ppSession ) |
| 21466 | { |
| 21467 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21468 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21469 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21470 | } |
| 21471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21472 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21473 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21474 | /*------------------------------------------------------------------------ |
| 21475 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21476 | ------------------------------------------------------------------------*/ |
| 21477 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21478 | { |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 21479 | if ( (pWDICtx->aBSSSessions[i].bInUse == eWLAN_PAL_TRUE) && |
| 21480 | (eWLAN_PAL_TRUE == |
| 21481 | wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, |
| 21482 | WDI_MAC_ADDR_LEN)) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21483 | { |
| 21484 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21485 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21486 | return i; |
| 21487 | } |
| 21488 | } |
| 21489 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21490 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21491 | }/*WDI_FindAssocSession*/ |
| 21492 | |
| 21493 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21494 | @brief Helper routine used to find a session based on the BSSID |
| 21495 | |
| 21496 | |
| 21497 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21498 | ucBSSIdx: BSS Index of the session |
| 21499 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21500 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21501 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21502 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21503 | */ |
| 21504 | wpt_uint8 |
| 21505 | WDI_FindAssocSessionByBSSIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21506 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21507 | WDI_ControlBlockType* pWDICtx, |
| 21508 | wpt_uint16 ucBSSIdx, |
| 21509 | WDI_BSSSessionType** ppSession |
| 21510 | ) |
| 21511 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21512 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21513 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21514 | |
| 21515 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21516 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21517 | -------------------------------------------------------------------------*/ |
| 21518 | if ( NULL == ppSession ) |
| 21519 | { |
| 21520 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21521 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21522 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21523 | } |
| 21524 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21525 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21526 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21527 | /*------------------------------------------------------------------------ |
| 21528 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21529 | ------------------------------------------------------------------------*/ |
| 21530 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21531 | { |
| 21532 | if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx ) |
| 21533 | { |
| 21534 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21535 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21536 | return i; |
| 21537 | } |
| 21538 | } |
| 21539 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21540 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21541 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 21542 | |
| 21543 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21544 | @brief Helper routine used to find a session based on the BSSID |
| 21545 | |
| 21546 | |
| 21547 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21548 | ucBSSIdx: BSS Index of the session |
| 21549 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21551 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21552 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21553 | */ |
| 21554 | wpt_uint8 |
| 21555 | WDI_FindAssocSessionByIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21556 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21557 | WDI_ControlBlockType* pWDICtx, |
| 21558 | wpt_uint16 usIdx, |
| 21559 | WDI_BSSSessionType** ppSession |
| 21560 | ) |
| 21561 | { |
| 21562 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21563 | |
| 21564 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21565 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21566 | -------------------------------------------------------------------------*/ |
| 21567 | if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS ) |
| 21568 | { |
| 21569 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21570 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21571 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21572 | } |
| 21573 | |
| 21574 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21575 | *ppSession = &pWDICtx->aBSSSessions[usIdx]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21576 | |
| 21577 | return usIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21578 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21579 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 21580 | |
| 21581 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21582 | @brief Helper routine used to find an empty session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21583 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21584 | |
| 21585 | |
| 21586 | @param pWDICtx: pointer to the WLAN DAL context |
| 21587 | pSession: pointer to the session (if found) |
| 21588 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21589 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21590 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21591 | */ |
| 21592 | wpt_uint8 |
| 21593 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21594 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21595 | WDI_ControlBlockType* pWDICtx, |
| 21596 | WDI_BSSSessionType** ppSession |
| 21597 | ) |
| 21598 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21599 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21600 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21601 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21602 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21603 | -------------------------------------------------------------------------*/ |
| 21604 | if ( NULL == ppSession ) |
| 21605 | { |
| 21606 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21607 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21608 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21609 | } |
| 21610 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21611 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21612 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21613 | /*------------------------------------------------------------------------ |
| 21614 | Search for a session that it is not in use |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21615 | ------------------------------------------------------------------------*/ |
| 21616 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21617 | { |
| 21618 | if ( ! pWDICtx->aBSSSessions[i].bInUse ) |
| 21619 | { |
| 21620 | /*Found a session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21621 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21622 | return i; |
| 21623 | } |
| 21624 | } |
| 21625 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21626 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21627 | }/*WDI_FindEmptySession*/ |
| 21628 | |
| 21629 | |
| 21630 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21631 | @brief Helper routine used to get the total count of active |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21632 | sessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21633 | |
| 21634 | |
| 21635 | @param pWDICtx: pointer to the WLAN DAL context |
Hoonki Lee | 2659997 | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 21636 | macBSSID: pointer to BSSID. If NULL, get all the session. |
| 21637 | If not NULL, count ActiveSession by excluding (TRUE) or including (FALSE) skipBSSID. |
| 21638 | skipBSSID: if TRUE, get all the sessions except matching to macBSSID. If FALSE, get all session. |
| 21639 | This argument is ignored if macBSSID is NULL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21640 | @see |
| 21641 | @return Number of sessions in use |
| 21642 | */ |
| 21643 | wpt_uint8 |
| 21644 | WDI_GetActiveSessionsCount |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21645 | ( |
Hoonki Lee | 2659997 | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 21646 | WDI_ControlBlockType* pWDICtx, |
| 21647 | wpt_macAddr macBSSID, |
| 21648 | wpt_boolean skipBSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21649 | ) |
| 21650 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21651 | wpt_uint8 i, ucCount = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21652 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21653 | |
| 21654 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21655 | Count all sessions in use |
| 21656 | ------------------------------------------------------------------------*/ |
| 21657 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21658 | { |
Hoonki Lee | 2659997 | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 21659 | if ( macBSSID && skipBSSID && |
| 21660 | (eWLAN_PAL_TRUE == |
| 21661 | wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, |
| 21662 | WDI_MAC_ADDR_LEN))) |
| 21663 | { |
| 21664 | continue; |
| 21665 | } |
| 21666 | else if ( pWDICtx->aBSSSessions[i].bInUse ) |
| 21667 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21668 | ucCount++; |
Hoonki Lee | 2659997 | 2013-04-24 01:21:58 -0700 | [diff] [blame] | 21669 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21670 | } |
| 21671 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21672 | return ucCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21673 | }/*WDI_GetActiveSessionsCount*/ |
| 21674 | |
| 21675 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21676 | @brief Helper routine used to delete session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21677 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21678 | |
| 21679 | |
| 21680 | @param pWDICtx: pointer to the WLAN DAL context |
| 21681 | pSession: pointer to the session (if found) |
| 21682 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21683 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21684 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21685 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21686 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21687 | WDI_DeleteSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21688 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21689 | WDI_ControlBlockType* pWDICtx, |
| 21690 | WDI_BSSSessionType* ppSession |
| 21691 | ) |
| 21692 | { |
| 21693 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21694 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21695 | -------------------------------------------------------------------------*/ |
| 21696 | if ( NULL == ppSession ) |
| 21697 | { |
| 21698 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21699 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21700 | return ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21701 | } |
| 21702 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21703 | /*------------------------------------------------------------------------ |
| 21704 | Reset the entries int session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21705 | ------------------------------------------------------------------------*/ |
| 21706 | wpal_list_destroy(&ppSession->wptPendingQueue); |
| 21707 | wpalMemoryZero(ppSession, sizeof(*ppSession)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21708 | ppSession->wdiAssocState = WDI_ASSOC_INIT_ST; |
| 21709 | ppSession->bInUse = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21710 | ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE; |
| 21711 | wpal_list_init(&ppSession->wptPendingQueue); |
| 21712 | |
| 21713 | }/*WDI_DeleteSession*/ |
| 21714 | |
| 21715 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21716 | @brief Utility function to add the broadcast STA to the the STA table. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21717 | The bcast STA ID is assigned by HAL and must be valid. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21718 | @param |
| 21719 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21720 | WDI_AddStaParams: - pointer to the WDI Add STA params |
| 21721 | usBcastStaIdx: - Broadcast STA index passed by HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21722 | |
| 21723 | @see |
| 21724 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21725 | */ |
| 21726 | void |
| 21727 | WDI_AddBcastSTAtoSTATable |
| 21728 | ( |
| 21729 | WDI_ControlBlockType* pWDICtx, |
| 21730 | WDI_AddStaParams * staParams, |
| 21731 | wpt_uint16 usBcastStaIdx |
| 21732 | ) |
| 21733 | { |
| 21734 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 21735 | wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 21736 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21737 | |
| 21738 | /*--------------------------------------------------------------------- |
| 21739 | Sanity check |
| 21740 | ---------------------------------------------------------------------*/ |
| 21741 | if ( NULL == staParams ) |
| 21742 | { |
| 21743 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21744 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21745 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21746 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21747 | } |
| 21748 | |
| 21749 | wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex; |
| 21750 | wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature; |
| 21751 | wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex; |
| 21752 | wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature; |
| 21753 | wdiAddSTAParam.dpuIndex = staParams->dpuIndex; |
| 21754 | wdiAddSTAParam.dpuSig = staParams->dpuSig; |
| 21755 | wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID, |
| 21756 | WDI_MAC_ADDR_LEN ); |
| 21757 | wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN ); |
| 21758 | wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx; |
| 21759 | wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable; |
| 21760 | wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled; |
| 21761 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST; |
| 21762 | wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled; |
| 21763 | wdiAddSTAParam.ucSTAIdx = usBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21765 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 21766 | } |
| 21767 | |
| 21768 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21769 | @brief NV blob will be divided into fragments of size 4kb and |
| 21770 | Sent to HAL |
| 21771 | |
| 21772 | @param pWDICtx: pointer to the WLAN DAL context |
| 21773 | pEventData: pointer to the event information structure |
| 21774 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21775 | @see |
| 21776 | @return Result of the function call |
| 21777 | */ |
| 21778 | |
| 21779 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21780 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21781 | WDI_ControlBlockType* pWDICtx, |
| 21782 | WDI_EventInfoType* pEventData |
| 21783 | ) |
| 21784 | { |
| 21785 | |
| 21786 | tHalNvImgDownloadReqMsg halNvImgDownloadParam; |
| 21787 | wpt_uint8* pSendBuffer = NULL; |
| 21788 | wpt_uint16 usDataOffset = 0; |
| 21789 | wpt_uint16 usSendSize = 0; |
| 21790 | wpt_uint16 usCurrentFragmentSize =0; |
| 21791 | wpt_uint8* pSrcBuffer = NULL; |
| 21792 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ; |
| 21793 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 21794 | |
| 21795 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc; |
| 21796 | WDI_ASSERT(NULL != wdiNvDownloadRspCb); |
| 21797 | pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData; |
| 21798 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21799 | /* Sanity Check is done by the caller */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21800 | pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress; |
| 21801 | |
| 21802 | /* Update the current Fragment Number */ |
| 21803 | pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1; |
| 21804 | |
| 21805 | /*Update the HAL REQ structure */ |
| 21806 | /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/ |
| 21807 | halNvImgDownloadParam.nvImageReqParams.fragNumber = |
| 21808 | pWDICtx->wdiNvBlobInfo.usCurrentFragment-1; |
| 21809 | |
| 21810 | /* Divide the NV Image to size of 'FRAGMENT_SIZE' fragments and send it to HAL. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21811 | If the size of the Image is less than 'FRAGMENT_SIZE' then in one iteration total |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21812 | image will be sent to HAL*/ |
| 21813 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21814 | if(pWDICtx->wdiNvBlobInfo.usTotalFragment |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21815 | == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21816 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21817 | /* Taking care of boundry condition */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21818 | if( !(usCurrentFragmentSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21819 | pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE )) |
| 21820 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 21821 | |
| 21822 | /*Update the HAL REQ structure */ |
| 21823 | halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1; |
| 21824 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize; |
| 21825 | |
| 21826 | } |
| 21827 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21828 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21829 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 21830 | |
| 21831 | /*Update the HAL REQ structure */ |
| 21832 | halNvImgDownloadParam.nvImageReqParams.isLastFragment =0; |
| 21833 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize; |
| 21834 | } |
| 21835 | |
| 21836 | /*----------------------------------------------------------------------- |
| 21837 | Get message buffer |
| 21838 | -----------------------------------------------------------------------*/ |
| 21839 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ, |
| 21840 | sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize, |
| 21841 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21842 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21843 | (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize ))) |
| 21844 | { |
| 21845 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 21846 | "Unable to get send buffer in NV Download req %x %x ", |
| 21847 | pEventData, pwdiNvDownloadReqParams); |
| 21848 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21849 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21850 | } |
| 21851 | |
| 21852 | /* Copying the Hal NV download REQ structure */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21853 | wpalMemoryCopy(pSendBuffer + usDataOffset , |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21854 | &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams)); |
| 21855 | |
| 21856 | /* Appending the NV image fragment */ |
| 21857 | wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams), |
| 21858 | (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE), |
| 21859 | usCurrentFragmentSize); |
| 21860 | |
| 21861 | pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21862 | pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21864 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 21865 | wdiNvDownloadRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21866 | WDI_NV_DOWNLOAD_RESP); |
| 21867 | |
| 21868 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21869 | /*============================================================================ |
| 21870 | Helper inline functions for |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21871 | ============================================================================*/ |
| 21872 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21873 | @brief Helper routine used to find a session based on the BSSID |
| 21874 | @param pContext: pointer to the WLAN DAL context |
| 21875 | @param pDPContext: pointer to the Datapath context |
| 21876 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21877 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21878 | @return |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21879 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21880 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21881 | WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext) |
| 21882 | { |
| 21883 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 21884 | |
| 21885 | pCB->pDPContext = pDPContext; |
| 21886 | return; |
| 21887 | } |
| 21888 | |
| 21889 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21890 | @brief Helper routine used to find a session based on the BSSID |
| 21891 | |
| 21892 | |
| 21893 | @param pContext: pointer to the WLAN DAL context |
| 21894 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21895 | @see |
| 21896 | @return pointer to Datapath context |
| 21897 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21898 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21899 | WDI_DS_GetDatapathContext (void *pContext) |
| 21900 | { |
| 21901 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 21902 | return pCB->pDPContext; |
| 21903 | } |
| 21904 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21905 | @brief Helper routine used to find a session based on the BSSID |
| 21906 | |
| 21907 | |
| 21908 | @param pContext: pointer to the WLAN DAL context |
| 21909 | @param pDTDriverContext: pointer to the Transport Driver context |
| 21910 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21911 | @see |
| 21912 | @return void |
| 21913 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21914 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21915 | WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext) |
| 21916 | { |
| 21917 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 21918 | |
| 21919 | pCB->pDTDriverContext = pDTDriverContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21920 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21921 | } |
| 21922 | |
| 21923 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21924 | @brief Helper routine used to find a session based on the BSSID |
| 21925 | |
| 21926 | |
| 21927 | @param pWDICtx: pointer to the WLAN DAL context |
| 21928 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21929 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21930 | @return pointer to datapath context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21931 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21932 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21933 | WDT_GetTransportDriverContext (void *pContext) |
| 21934 | { |
| 21935 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21936 | return(pCB->pDTDriverContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21937 | } |
| 21938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21939 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21940 | Helper inline converters |
| 21941 | ============================================================================*/ |
| 21942 | /*Convert WDI driver type into HAL driver type*/ |
| 21943 | WPT_STATIC WPT_INLINE WDI_Status |
| 21944 | WDI_HAL_2_WDI_STATUS |
| 21945 | ( |
| 21946 | eHalStatus halStatus |
| 21947 | ) |
| 21948 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21949 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21950 | the chances of getting inlined*/ |
| 21951 | switch( halStatus ) |
| 21952 | { |
| 21953 | case eHAL_STATUS_SUCCESS: |
| 21954 | case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 21955 | case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 21956 | return WDI_STATUS_SUCCESS; |
| 21957 | case eHAL_STATUS_FAILURE: |
| 21958 | return WDI_STATUS_E_FAILURE; |
| 21959 | case eHAL_STATUS_FAILED_ALLOC: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21960 | return WDI_STATUS_MEM_FAILURE; |
| 21961 | /*The rest of the HAL error codes must be kept hidden from the UMAC as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21962 | they refer to specific internal modules of our device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21963 | default: |
| 21964 | return WDI_STATUS_DEV_INTERNAL_FAILURE; |
| 21965 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21966 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21967 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21968 | }/*WDI_HAL_2_WDI_STATUS*/ |
| 21969 | |
| 21970 | /*Convert WDI request type into HAL request type*/ |
| 21971 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 21972 | WDI_2_HAL_REQ_TYPE |
| 21973 | ( |
| 21974 | WDI_RequestEnumType wdiReqType |
| 21975 | ) |
| 21976 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21977 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21978 | the chances of getting inlined*/ |
| 21979 | switch( wdiReqType ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21980 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21981 | case WDI_START_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21982 | return WLAN_HAL_START_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21983 | case WDI_STOP_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21984 | return WLAN_HAL_STOP_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21985 | case WDI_INIT_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21986 | return WLAN_HAL_INIT_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21987 | case WDI_START_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21988 | return WLAN_HAL_START_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21989 | case WDI_END_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21990 | return WLAN_HAL_END_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21991 | case WDI_FINISH_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21992 | return WLAN_HAL_FINISH_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21993 | case WDI_JOIN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21994 | return WLAN_HAL_JOIN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21995 | case WDI_CONFIG_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21996 | return WLAN_HAL_CONFIG_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21997 | case WDI_DEL_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21998 | return WLAN_HAL_DELETE_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21999 | case WDI_POST_ASSOC_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22000 | return WLAN_HAL_POST_ASSOC_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22001 | case WDI_DEL_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22002 | return WLAN_HAL_DELETE_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22003 | case WDI_SET_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22004 | return WLAN_HAL_SET_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22005 | case WDI_RMV_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22006 | return WLAN_HAL_RMV_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22007 | case WDI_SET_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22008 | return WLAN_HAL_SET_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22009 | case WDI_RMV_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22010 | return WLAN_HAL_RMV_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22011 | case WDI_SET_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22012 | return WLAN_HAL_SET_BCASTKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22013 | case WDI_RMV_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22014 | //Some conflict in the old code - check this: return WLAN_HAL_RMV_BCASTKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22015 | return WLAN_HAL_RMV_STAKEY_REQ; |
| 22016 | case WDI_ADD_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22017 | return WLAN_HAL_ADD_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22018 | case WDI_DEL_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22019 | return WLAN_HAL_DEL_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22020 | case WDI_UPD_EDCA_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22021 | return WLAN_HAL_UPD_EDCA_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22022 | case WDI_ADD_BA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22023 | return WLAN_HAL_ADD_BA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22024 | case WDI_DEL_BA_REQ: |
| 22025 | return WLAN_HAL_DEL_BA_REQ; |
| 22026 | #ifdef FEATURE_WLAN_CCX |
| 22027 | case WDI_TSM_STATS_REQ: |
| 22028 | return WLAN_HAL_TSM_STATS_REQ; |
| 22029 | #endif |
| 22030 | case WDI_CH_SWITCH_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22031 | return WLAN_HAL_CH_SWITCH_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22032 | case WDI_CONFIG_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22033 | return WLAN_HAL_CONFIG_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22034 | case WDI_SET_LINK_ST_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22035 | return WLAN_HAL_SET_LINK_ST_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22036 | case WDI_GET_STATS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22037 | return WLAN_HAL_GET_STATS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22038 | case WDI_UPDATE_CFG_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22039 | return WLAN_HAL_UPDATE_CFG_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22040 | case WDI_ADD_BA_SESSION_REQ: |
| 22041 | return WLAN_HAL_ADD_BA_SESSION_REQ; |
| 22042 | case WDI_TRIGGER_BA_REQ: |
| 22043 | return WLAN_HAL_TRIGGER_BA_REQ; |
| 22044 | case WDI_UPD_BCON_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22045 | return WLAN_HAL_UPDATE_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22046 | case WDI_SND_BCON_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22047 | return WLAN_HAL_SEND_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22048 | case WDI_UPD_PROBE_RSP_TEMPLATE_REQ: |
| 22049 | return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ; |
| 22050 | case WDI_SET_MAX_TX_POWER_REQ: |
| 22051 | return WLAN_HAL_SET_MAX_TX_POWER_REQ; |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 22052 | case WDI_SET_TX_POWER_REQ: |
| 22053 | return WLAN_HAL_SET_TX_POWER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22054 | case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ: |
| 22055 | return WLAN_HAL_SET_P2P_GONOA_REQ; |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 22056 | #ifdef FEATURE_WLAN_TDLS |
| 22057 | case WDI_TDLS_LINK_ESTABLISH_REQ: |
| 22058 | return WLAN_HAL_TDLS_LINK_ESTABLISHED_REQ; |
| 22059 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22060 | case WDI_ENTER_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22061 | return WLAN_HAL_ENTER_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22062 | case WDI_EXIT_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22063 | return WLAN_HAL_EXIT_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22064 | case WDI_ENTER_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22065 | return WLAN_HAL_ENTER_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22066 | case WDI_EXIT_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22067 | return WLAN_HAL_EXIT_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22068 | case WDI_ENTER_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22069 | return WLAN_HAL_ENTER_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22070 | case WDI_EXIT_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22071 | return WLAN_HAL_EXIT_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22072 | case WDI_SET_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22073 | return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22074 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22075 | return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22076 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22077 | return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22078 | case WDI_SET_BEACON_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22079 | return WLAN_HAL_ADD_BCN_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22080 | case WDI_REM_BEACON_FILTER_REQ: |
| 22081 | return WLAN_HAL_REM_BCN_FILTER_REQ; |
| 22082 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 22083 | return WLAN_HAL_SET_RSSI_THRESH_REQ; |
| 22084 | case WDI_HOST_OFFLOAD_REQ: |
| 22085 | return WLAN_HAL_HOST_OFFLOAD_REQ; |
| 22086 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 22087 | return WLAN_HAL_ADD_WOWL_BCAST_PTRN; |
| 22088 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 22089 | return WLAN_HAL_DEL_WOWL_BCAST_PTRN; |
| 22090 | case WDI_WOWL_ENTER_REQ: |
| 22091 | return WLAN_HAL_ENTER_WOWL_REQ; |
| 22092 | case WDI_WOWL_EXIT_REQ: |
| 22093 | return WLAN_HAL_EXIT_WOWL_REQ; |
| 22094 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 22095 | return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
| 22096 | case WDI_NV_DOWNLOAD_REQ: |
| 22097 | return WLAN_HAL_DOWNLOAD_NV_REQ; |
| 22098 | case WDI_FLUSH_AC_REQ: |
| 22099 | return WLAN_HAL_TL_HAL_FLUSH_AC_REQ; |
| 22100 | case WDI_BTAMP_EVENT_REQ: |
| 22101 | return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ; |
| 22102 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 22103 | case WDI_AGGR_ADD_TS_REQ: |
| 22104 | return WLAN_HAL_AGGR_ADD_TS_REQ; |
| 22105 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22106 | case WDI_FTM_CMD_REQ: |
| 22107 | return WLAN_HAL_PROCESS_PTT_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22108 | case WDI_ADD_STA_SELF_REQ: |
| 22109 | return WLAN_HAL_ADD_STA_SELF_REQ; |
| 22110 | case WDI_DEL_STA_SELF_REQ: |
| 22111 | return WLAN_HAL_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22112 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 22113 | case WDI_START_OEM_DATA_REQ: |
| 22114 | return WLAN_HAL_START_OEM_DATA_REQ; |
| 22115 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22116 | case WDI_HOST_RESUME_REQ: |
| 22117 | return WLAN_HAL_HOST_RESUME_REQ; |
| 22118 | case WDI_HOST_SUSPEND_IND: |
| 22119 | return WLAN_HAL_HOST_SUSPEND_IND; |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 22120 | case WDI_TRAFFIC_STATS_IND: |
| 22121 | return WLAN_HAL_CLASS_B_STATS_IND; |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 22122 | #ifdef WLAN_FEATURE_11W |
| 22123 | case WDI_EXCLUDE_UNENCRYPTED_IND: |
| 22124 | return WLAN_HAL_EXCLUDE_UNENCRYPTED_IND; |
| 22125 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22126 | case WDI_KEEP_ALIVE_REQ: |
| 22127 | return WLAN_HAL_KEEP_ALIVE_REQ; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 22128 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 22129 | case WDI_ROAM_SCAN_OFFLOAD_REQ: |
| 22130 | return WLAN_ROAM_SCAN_OFFLOAD_REQ; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 22131 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22132 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 22133 | case WDI_SET_PREF_NETWORK_REQ: |
| 22134 | return WLAN_HAL_SET_PREF_NETWORK_REQ; |
| 22135 | case WDI_SET_RSSI_FILTER_REQ: |
| 22136 | return WLAN_HAL_SET_RSSI_FILTER_REQ; |
| 22137 | case WDI_UPDATE_SCAN_PARAMS_REQ: |
| 22138 | return WLAN_HAL_UPDATE_SCAN_PARAM_REQ; |
| 22139 | #endif // FEATURE_WLAN_SCAN_PNO |
| 22140 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 22141 | return WLAN_HAL_SET_TX_PER_TRACKING_REQ; |
| 22142 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 22143 | case WDI_8023_MULTICAST_LIST_REQ: |
| 22144 | return WLAN_HAL_8023_MULTICAST_LIST_REQ; |
| 22145 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22146 | return WLAN_HAL_SET_PACKET_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22147 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 22148 | return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ; |
| 22149 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 22150 | return WLAN_HAL_CLEAR_PACKET_FILTER_REQ; |
| 22151 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 22152 | case WDI_HAL_DUMP_CMD_REQ: |
| 22153 | return WLAN_HAL_DUMP_COMMAND_REQ; |
| 22154 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 22155 | case WDI_GTK_OFFLOAD_REQ: |
| 22156 | return WLAN_HAL_GTK_OFFLOAD_REQ; |
| 22157 | case WDI_GTK_OFFLOAD_GETINFO_REQ: |
| 22158 | return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ; |
| 22159 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 22160 | |
| 22161 | case WDI_INIT_SCAN_CON_REQ: |
| 22162 | return WLAN_HAL_INIT_SCAN_CON_REQ; |
| 22163 | case WDI_SET_POWER_PARAMS_REQ: |
| 22164 | return WLAN_HAL_SET_POWER_PARAMS_REQ; |
| 22165 | case WDI_SET_TM_LEVEL_REQ: |
| 22166 | return WLAN_HAL_SET_THERMAL_MITIGATION_REQ; |
| 22167 | case WDI_FEATURE_CAPS_EXCHANGE_REQ: |
| 22168 | return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 22169 | #ifdef WLAN_FEATURE_11AC |
| 22170 | case WDI_UPDATE_VHT_OP_MODE_REQ: |
| 22171 | return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ; |
| 22172 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 22173 | case WDI_GET_ROAM_RSSI_REQ: |
| 22174 | return WLAN_HAL_GET_ROAM_RSSI_REQ; |
Sundaresan Ramachandran | 811a2f9 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 22175 | case WDI_DHCP_START_IND: |
| 22176 | return WLAN_HAL_DHCP_START_IND; |
| 22177 | case WDI_DHCP_STOP_IND: |
| 22178 | return WLAN_HAL_DHCP_STOP_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22179 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22180 | return WLAN_HAL_MSG_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22181 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22182 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22183 | }/*WDI_2_HAL_REQ_TYPE*/ |
| 22184 | |
| 22185 | /*Convert WDI response type into HAL response type*/ |
| 22186 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 22187 | HAL_2_WDI_RSP_TYPE |
| 22188 | ( |
| 22189 | tHalHostMsgType halMsg |
| 22190 | ) |
| 22191 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22192 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22193 | the chances of getting inlined*/ |
| 22194 | switch( halMsg ) |
| 22195 | { |
| 22196 | case WLAN_HAL_START_RSP: |
| 22197 | return WDI_START_RESP; |
| 22198 | case WLAN_HAL_STOP_RSP: |
| 22199 | return WDI_STOP_RESP; |
| 22200 | case WLAN_HAL_INIT_SCAN_RSP: |
| 22201 | return WDI_INIT_SCAN_RESP; |
| 22202 | case WLAN_HAL_START_SCAN_RSP: |
| 22203 | return WDI_START_SCAN_RESP; |
| 22204 | case WLAN_HAL_END_SCAN_RSP: |
| 22205 | return WDI_END_SCAN_RESP; |
| 22206 | case WLAN_HAL_FINISH_SCAN_RSP: |
| 22207 | return WDI_FINISH_SCAN_RESP; |
| 22208 | case WLAN_HAL_CONFIG_STA_RSP: |
| 22209 | return WDI_CONFIG_STA_RESP; |
| 22210 | case WLAN_HAL_DELETE_STA_RSP: |
| 22211 | return WDI_DEL_STA_RESP; |
| 22212 | case WLAN_HAL_CONFIG_BSS_RSP: |
| 22213 | return WDI_CONFIG_BSS_RESP; |
| 22214 | case WLAN_HAL_DELETE_BSS_RSP: |
| 22215 | return WDI_DEL_BSS_RESP; |
| 22216 | case WLAN_HAL_JOIN_RSP: |
| 22217 | return WDI_JOIN_RESP; |
| 22218 | case WLAN_HAL_POST_ASSOC_RSP: |
| 22219 | return WDI_POST_ASSOC_RESP; |
| 22220 | case WLAN_HAL_SET_BSSKEY_RSP: |
| 22221 | return WDI_SET_BSS_KEY_RESP; |
| 22222 | case WLAN_HAL_SET_STAKEY_RSP: |
| 22223 | return WDI_SET_STA_KEY_RESP; |
| 22224 | case WLAN_HAL_RMV_BSSKEY_RSP: |
| 22225 | return WDI_RMV_BSS_KEY_RESP; |
| 22226 | case WLAN_HAL_RMV_STAKEY_RSP: |
| 22227 | return WDI_RMV_STA_KEY_RESP; |
| 22228 | case WLAN_HAL_SET_BCASTKEY_RSP: |
| 22229 | return WDI_SET_STA_BCAST_KEY_RESP; |
| 22230 | //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP: |
| 22231 | // return WDI_RMV_STA_BCAST_KEY_RESP; |
| 22232 | case WLAN_HAL_ADD_TS_RSP: |
| 22233 | return WDI_ADD_TS_RESP; |
| 22234 | case WLAN_HAL_DEL_TS_RSP: |
| 22235 | return WDI_DEL_TS_RESP; |
| 22236 | case WLAN_HAL_UPD_EDCA_PARAMS_RSP: |
| 22237 | return WDI_UPD_EDCA_PRMS_RESP; |
| 22238 | case WLAN_HAL_ADD_BA_RSP: |
| 22239 | return WDI_ADD_BA_RESP; |
| 22240 | case WLAN_HAL_DEL_BA_RSP: |
| 22241 | return WDI_DEL_BA_RESP; |
| 22242 | #ifdef FEATURE_WLAN_CCX |
| 22243 | case WLAN_HAL_TSM_STATS_RSP: |
| 22244 | return WDI_TSM_STATS_RESP; |
| 22245 | #endif |
| 22246 | case WLAN_HAL_CH_SWITCH_RSP: |
| 22247 | return WDI_CH_SWITCH_RESP; |
| 22248 | case WLAN_HAL_SET_LINK_ST_RSP: |
| 22249 | return WDI_SET_LINK_ST_RESP; |
| 22250 | case WLAN_HAL_GET_STATS_RSP: |
| 22251 | return WDI_GET_STATS_RESP; |
| 22252 | case WLAN_HAL_UPDATE_CFG_RSP: |
| 22253 | return WDI_UPDATE_CFG_RESP; |
| 22254 | case WLAN_HAL_ADD_BA_SESSION_RSP: |
| 22255 | return WDI_ADD_BA_SESSION_RESP; |
| 22256 | case WLAN_HAL_TRIGGER_BA_RSP: |
| 22257 | return WDI_TRIGGER_BA_RESP; |
| 22258 | case WLAN_HAL_UPDATE_BEACON_RSP: |
| 22259 | return WDI_UPD_BCON_PRMS_RESP; |
| 22260 | case WLAN_HAL_SEND_BEACON_RSP: |
| 22261 | return WDI_SND_BCON_RESP; |
| 22262 | case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP: |
| 22263 | return WDI_UPD_PROBE_RSP_TEMPLATE_RESP; |
| 22264 | /*Indications*/ |
| 22265 | case WLAN_HAL_RSSI_NOTIFICATION_IND: |
| 22266 | return WDI_HAL_RSSI_NOTIFICATION_IND; |
| 22267 | case WLAN_HAL_MISSED_BEACON_IND: |
| 22268 | return WDI_HAL_MISSED_BEACON_IND; |
| 22269 | case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND: |
| 22270 | return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND; |
| 22271 | case WLAN_HAL_MIC_FAILURE_IND: |
| 22272 | return WDI_HAL_MIC_FAILURE_IND; |
| 22273 | case WLAN_HAL_FATAL_ERROR_IND: |
| 22274 | return WDI_HAL_FATAL_ERROR_IND; |
| 22275 | case WLAN_HAL_DELETE_STA_CONTEXT_IND: |
| 22276 | return WDI_HAL_DEL_STA_IND; |
| 22277 | case WLAN_HAL_COEX_IND: |
| 22278 | return WDI_HAL_COEX_IND; |
| 22279 | case WLAN_HAL_OTA_TX_COMPL_IND: |
| 22280 | return WDI_HAL_TX_COMPLETE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22281 | case WLAN_HAL_P2P_NOA_ATTR_IND: |
| 22282 | return WDI_HAL_P2P_NOA_ATTR_IND; |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 22283 | case WLAN_HAL_P2P_NOA_START_IND: |
| 22284 | return WDI_HAL_P2P_NOA_START_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22285 | case WLAN_HAL_TX_PER_HIT_IND: |
| 22286 | return WDI_HAL_TX_PER_HIT_IND; |
| 22287 | case WLAN_HAL_SET_MAX_TX_POWER_RSP: |
| 22288 | return WDI_SET_MAX_TX_POWER_RESP; |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 22289 | case WLAN_HAL_SET_TX_POWER_RSP: |
| 22290 | return WDI_SET_TX_POWER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22291 | case WLAN_HAL_SET_P2P_GONOA_RSP: |
| 22292 | return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP; |
Gopichand Nakkala | efe3a23 | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 22293 | #ifdef FEATURE_WLAN_TDLS |
| 22294 | case WLAN_HAL_TDLS_LINK_ESTABLISHED_RSP: |
| 22295 | return WDI_TDLS_LINK_ESTABLISH_REQ_RESP; |
| 22296 | case WLAN_HAL_TDLS_IND: |
| 22297 | return WDI_HAL_TDLS_IND; |
| 22298 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22299 | case WLAN_HAL_ENTER_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22300 | return WDI_ENTER_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22301 | case WLAN_HAL_EXIT_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22302 | return WDI_EXIT_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22303 | case WLAN_HAL_ENTER_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22304 | return WDI_ENTER_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22305 | case WLAN_HAL_EXIT_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22306 | return WDI_EXIT_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22307 | case WLAN_HAL_ENTER_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22308 | return WDI_ENTER_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22309 | case WLAN_HAL_EXIT_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22310 | return WDI_EXIT_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22311 | case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22312 | return WDI_SET_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22313 | case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22314 | return WDI_UPDATE_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22315 | case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22316 | return WDI_CONFIGURE_RXP_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22317 | case WLAN_HAL_ADD_BCN_FILTER_RSP: |
| 22318 | return WDI_SET_BEACON_FILTER_RESP; |
| 22319 | case WLAN_HAL_REM_BCN_FILTER_RSP: |
| 22320 | return WDI_REM_BEACON_FILTER_RESP; |
| 22321 | case WLAN_HAL_SET_RSSI_THRESH_RSP: |
| 22322 | return WDI_SET_RSSI_THRESHOLDS_RESP; |
| 22323 | case WLAN_HAL_HOST_OFFLOAD_RSP: |
| 22324 | return WDI_HOST_OFFLOAD_RESP; |
| 22325 | case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP: |
| 22326 | return WDI_WOWL_ADD_BC_PTRN_RESP; |
| 22327 | case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP: |
| 22328 | return WDI_WOWL_DEL_BC_PTRN_RESP; |
| 22329 | case WLAN_HAL_ENTER_WOWL_RSP: |
| 22330 | return WDI_WOWL_ENTER_RESP; |
| 22331 | case WLAN_HAL_EXIT_WOWL_RSP: |
| 22332 | return WDI_WOWL_EXIT_RESP; |
| 22333 | case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP: |
| 22334 | return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP; |
| 22335 | case WLAN_HAL_DOWNLOAD_NV_RSP: |
| 22336 | return WDI_NV_DOWNLOAD_RESP; |
| 22337 | case WLAN_HAL_TL_HAL_FLUSH_AC_RSP: |
| 22338 | return WDI_FLUSH_AC_RESP; |
| 22339 | case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP: |
| 22340 | return WDI_BTAMP_EVENT_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22341 | case WLAN_HAL_PROCESS_PTT_RSP: |
| 22342 | return WDI_FTM_CMD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22343 | case WLAN_HAL_ADD_STA_SELF_RSP: |
| 22344 | return WDI_ADD_STA_SELF_RESP; |
| 22345 | case WLAN_HAL_DEL_STA_SELF_RSP: |
| 22346 | return WDI_DEL_STA_SELF_RESP; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22347 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 22348 | case WLAN_HAL_START_OEM_DATA_RSP: |
| 22349 | return WDI_START_OEM_DATA_RESP; |
| 22350 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22351 | case WLAN_HAL_HOST_RESUME_RSP: |
| 22352 | return WDI_HOST_RESUME_RESP; |
| 22353 | case WLAN_HAL_KEEP_ALIVE_RSP: |
| 22354 | return WDI_KEEP_ALIVE_RESP; |
| 22355 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 22356 | case WLAN_HAL_SET_PREF_NETWORK_RSP: |
| 22357 | return WDI_SET_PREF_NETWORK_RESP; |
| 22358 | case WLAN_HAL_SET_RSSI_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22359 | return WDI_SET_RSSI_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22360 | case WLAN_HAL_UPDATE_SCAN_PARAM_RSP: |
| 22361 | return WDI_UPDATE_SCAN_PARAMS_RESP; |
| 22362 | case WLAN_HAL_PREF_NETW_FOUND_IND: |
| 22363 | return WDI_HAL_PREF_NETWORK_FOUND_IND; |
| 22364 | #endif // FEATURE_WLAN_SCAN_PNO |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 22365 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 22366 | case WLAN_ROAM_SCAN_OFFLOAD_RSP: |
| 22367 | return WDI_ROAM_SCAN_OFFLOAD_RESP; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 22368 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22369 | case WLAN_HAL_SET_TX_PER_TRACKING_RSP: |
| 22370 | return WDI_SET_TX_PER_TRACKING_RESP; |
| 22371 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 22372 | case WLAN_HAL_8023_MULTICAST_LIST_RSP: |
| 22373 | return WDI_8023_MULTICAST_LIST_RESP; |
| 22374 | case WLAN_HAL_SET_PACKET_FILTER_RSP: |
| 22375 | return WDI_RECEIVE_FILTER_SET_FILTER_RESP; |
| 22376 | case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP: |
| 22377 | return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP; |
| 22378 | case WLAN_HAL_CLEAR_PACKET_FILTER_RSP: |
| 22379 | return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP; |
| 22380 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 22381 | |
| 22382 | case WLAN_HAL_DUMP_COMMAND_RSP: |
| 22383 | return WDI_HAL_DUMP_CMD_RESP; |
| 22384 | case WLAN_HAL_SET_POWER_PARAMS_RSP: |
| 22385 | return WDI_SET_POWER_PARAMS_RESP; |
| 22386 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 22387 | case WLAN_HAL_AGGR_ADD_TS_RSP: |
| 22388 | return WDI_AGGR_ADD_TS_RESP; |
| 22389 | #endif |
| 22390 | |
| 22391 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 22392 | case WLAN_HAL_GTK_OFFLOAD_RSP: |
| 22393 | return WDI_GTK_OFFLOAD_RESP; |
| 22394 | case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP: |
| 22395 | return WDI_GTK_OFFLOAD_GETINFO_RESP; |
| 22396 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 22397 | #ifdef WLAN_WAKEUP_EVENTS |
| 22398 | case WLAN_HAL_WAKE_REASON_IND: |
| 22399 | return WDI_HAL_WAKE_REASON_IND; |
| 22400 | #endif // WLAN_WAKEUP_EVENTS |
| 22401 | |
| 22402 | case WLAN_HAL_SET_THERMAL_MITIGATION_RSP: |
| 22403 | return WDI_SET_TM_LEVEL_RESP; |
| 22404 | case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP: |
| 22405 | return WDI_FEATURE_CAPS_EXCHANGE_RESP; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 22406 | #ifdef WLAN_FEATURE_11AC |
| 22407 | case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP: |
| 22408 | return WDI_UPDATE_VHT_OP_MODE_RESP; |
| 22409 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 22410 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 22411 | case WLAN_HAL_GET_ROAM_RSSI_RSP: |
| 22412 | return WDI_GET_ROAM_RSSI_RESP; |
| 22413 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22414 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22415 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22416 | } |
| 22417 | |
| 22418 | }/*HAL_2_WDI_RSP_TYPE*/ |
| 22419 | |
| 22420 | |
| 22421 | /*Convert WDI driver type into HAL driver type*/ |
| 22422 | WPT_STATIC WPT_INLINE tDriverType |
| 22423 | WDI_2_HAL_DRV_TYPE |
| 22424 | ( |
| 22425 | WDI_DriverType wdiDriverType |
| 22426 | ) |
| 22427 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22428 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22429 | the chances of getting inlined*/ |
| 22430 | switch( wdiDriverType ) |
| 22431 | { |
| 22432 | case WDI_DRIVER_TYPE_PRODUCTION: |
| 22433 | return eDRIVER_TYPE_PRODUCTION; |
| 22434 | case WDI_DRIVER_TYPE_MFG: |
| 22435 | return eDRIVER_TYPE_MFG; |
| 22436 | case WDI_DRIVER_TYPE_DVT: |
| 22437 | return eDRIVER_TYPE_DVT; |
| 22438 | } |
| 22439 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22440 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22441 | }/*WDI_2_HAL_DRV_TYPE*/ |
| 22442 | |
| 22443 | |
| 22444 | /*Convert WDI stop reason into HAL stop reason*/ |
| 22445 | WPT_STATIC WPT_INLINE tHalStopType |
| 22446 | WDI_2_HAL_STOP_REASON |
| 22447 | ( |
| 22448 | WDI_StopType wdiDriverType |
| 22449 | ) |
| 22450 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22451 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22452 | the chances of getting inlined*/ |
| 22453 | switch( wdiDriverType ) |
| 22454 | { |
| 22455 | case WDI_STOP_TYPE_SYS_RESET: |
| 22456 | return HAL_STOP_TYPE_SYS_RESET; |
Yue Ma | 7062749 | 2013-03-28 11:33:46 -0700 | [diff] [blame] | 22457 | case WDI_STOP_TYPE_SYS_DEEP_SLEEP: |
| 22458 | return HAL_STOP_TYPE_SYS_DEEP_SLEEP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22459 | case WDI_STOP_TYPE_RF_KILL: |
| 22460 | return HAL_STOP_TYPE_RF_KILL; |
| 22461 | } |
| 22462 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22463 | return HAL_STOP_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22464 | }/*WDI_2_HAL_STOP_REASON*/ |
| 22465 | |
| 22466 | |
| 22467 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 22468 | WPT_STATIC WPT_INLINE eHalSysMode |
| 22469 | WDI_2_HAL_SCAN_MODE |
| 22470 | ( |
| 22471 | WDI_ScanMode wdiScanMode |
| 22472 | ) |
| 22473 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22474 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22475 | the chances of getting inlined*/ |
| 22476 | switch( wdiScanMode ) |
| 22477 | { |
| 22478 | case WDI_SCAN_MODE_NORMAL: |
| 22479 | return eHAL_SYS_MODE_NORMAL; |
| 22480 | case WDI_SCAN_MODE_LEARN: |
| 22481 | return eHAL_SYS_MODE_LEARN; |
| 22482 | case WDI_SCAN_MODE_SCAN: |
| 22483 | return eHAL_SYS_MODE_SCAN; |
| 22484 | case WDI_SCAN_MODE_PROMISC: |
| 22485 | return eHAL_SYS_MODE_PROMISC; |
| 22486 | case WDI_SCAN_MODE_SUSPEND_LINK: |
| 22487 | return eHAL_SYS_MODE_SUSPEND_LINK; |
Madan Mohan Koyyalamudi | 9b87678 | 2012-10-11 16:22:51 -0700 | [diff] [blame] | 22488 | case WDI_SCAN_MODE_ROAM_SCAN: |
| 22489 | return eHAL_SYS_MODE_ROAM_SCAN; |
| 22490 | case WDI_SCAN_MODE_ROAM_SUSPEND_LINK: |
| 22491 | return eHAL_SYS_MODE_ROAM_SUSPEND_LINK; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22492 | } |
| 22493 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22494 | return eHAL_SYS_MODE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22495 | }/*WDI_2_HAL_SCAN_MODE*/ |
| 22496 | |
| 22497 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22498 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22499 | WDI_2_HAL_SEC_CH_OFFSET |
| 22500 | ( |
| 22501 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 22502 | ) |
| 22503 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22504 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22505 | the chances of getting inlined*/ |
| 22506 | switch( wdiSecChOffset ) |
| 22507 | { |
| 22508 | case WDI_SECONDARY_CHANNEL_OFFSET_NONE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22509 | return PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22510 | case WDI_SECONDARY_CHANNEL_OFFSET_UP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22511 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22512 | case WDI_SECONDARY_CHANNEL_OFFSET_DOWN: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22513 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 22514 | #ifdef WLAN_FEATURE_11AC |
| 22515 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 22516 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 22517 | case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 22518 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 22519 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 22520 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 22521 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 22522 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 22523 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 22524 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 22525 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 22526 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 22527 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 22528 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 22529 | #endif |
| 22530 | default: |
| 22531 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22532 | } |
| 22533 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22534 | return PHY_CHANNEL_BONDING_STATE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22535 | }/*WDI_2_HAL_SEC_CH_OFFSET*/ |
| 22536 | |
| 22537 | /*Convert WDI BSS type into HAL BSS type*/ |
| 22538 | WPT_STATIC WPT_INLINE tSirBssType |
| 22539 | WDI_2_HAL_BSS_TYPE |
| 22540 | ( |
| 22541 | WDI_BssType wdiBSSType |
| 22542 | ) |
| 22543 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22544 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22545 | the chances of getting inlined*/ |
| 22546 | switch( wdiBSSType ) |
| 22547 | { |
| 22548 | case WDI_INFRASTRUCTURE_MODE: |
| 22549 | return eSIR_INFRASTRUCTURE_MODE; |
| 22550 | case WDI_INFRA_AP_MODE: |
| 22551 | return eSIR_INFRA_AP_MODE; |
| 22552 | case WDI_IBSS_MODE: |
| 22553 | return eSIR_IBSS_MODE; |
| 22554 | case WDI_BTAMP_STA_MODE: |
| 22555 | return eSIR_BTAMP_STA_MODE; |
| 22556 | case WDI_BTAMP_AP_MODE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22557 | return eSIR_BTAMP_AP_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22558 | case WDI_BSS_AUTO_MODE: |
| 22559 | return eSIR_AUTO_MODE; |
| 22560 | } |
| 22561 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22562 | return eSIR_DONOT_USE_BSS_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22563 | }/*WDI_2_HAL_BSS_TYPE*/ |
| 22564 | |
| 22565 | /*Convert WDI NW type into HAL NW type*/ |
| 22566 | WPT_STATIC WPT_INLINE tSirNwType |
| 22567 | WDI_2_HAL_NW_TYPE |
| 22568 | ( |
| 22569 | WDI_NwType wdiNWType |
| 22570 | ) |
| 22571 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22572 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22573 | the chances of getting inlined*/ |
| 22574 | switch( wdiNWType ) |
| 22575 | { |
| 22576 | case WDI_11A_NW_TYPE: |
| 22577 | return eSIR_11A_NW_TYPE; |
| 22578 | case WDI_11B_NW_TYPE: |
| 22579 | return eSIR_11B_NW_TYPE; |
| 22580 | case WDI_11G_NW_TYPE: |
| 22581 | return eSIR_11G_NW_TYPE; |
| 22582 | case WDI_11N_NW_TYPE: |
| 22583 | return eSIR_11N_NW_TYPE; |
| 22584 | } |
| 22585 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22586 | return eSIR_DONOT_USE_NW_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22587 | }/*WDI_2_HAL_NW_TYPE*/ |
| 22588 | |
| 22589 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 22590 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 22591 | WDI_2_HAL_CB_STATE |
| 22592 | ( |
| 22593 | WDI_PhyChanBondState wdiCbState |
| 22594 | ) |
| 22595 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22596 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22597 | the chances of getting inlined*/ |
| 22598 | switch ( wdiCbState ) |
| 22599 | { |
| 22600 | case WDI_PHY_SINGLE_CHANNEL_CENTERED: |
| 22601 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 22602 | case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 22603 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 22604 | case WDI_PHY_DOUBLE_CHANNEL_CENTERED: |
| 22605 | return PHY_DOUBLE_CHANNEL_CENTERED; |
| 22606 | case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 22607 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22608 | #ifdef WLAN_FEATURE_11AC |
| 22609 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 22610 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 22611 | case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 22612 | return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; |
| 22613 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 22614 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 22615 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 22616 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 22617 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 22618 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
| 22619 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 22620 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 22621 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 22622 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 22623 | #endif |
| 22624 | case WDI_MAX_CB_STATE: |
| 22625 | default: |
| 22626 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22627 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22628 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22629 | return PHY_CHANNEL_BONDING_STATE_MAX; |
| 22630 | }/*WDI_2_HAL_CB_STATE*/ |
| 22631 | |
| 22632 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 22633 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 22634 | WDI_2_HAL_HT_OPER_MODE |
| 22635 | ( |
| 22636 | WDI_HTOperatingMode wdiHTOperMode |
| 22637 | ) |
| 22638 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22639 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22640 | the chances of getting inlined*/ |
| 22641 | switch ( wdiHTOperMode ) |
| 22642 | { |
| 22643 | case WDI_HT_OP_MODE_PURE: |
| 22644 | return eSIR_HT_OP_MODE_PURE; |
| 22645 | case WDI_HT_OP_MODE_OVERLAP_LEGACY: |
| 22646 | return eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 22647 | case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT: |
| 22648 | return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 22649 | case WDI_HT_OP_MODE_MIXED: |
| 22650 | return eSIR_HT_OP_MODE_MIXED; |
| 22651 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22653 | return eSIR_HT_OP_MODE_MAX; |
| 22654 | }/*WDI_2_HAL_HT_OPER_MODE*/ |
| 22655 | |
| 22656 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 22657 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 22658 | WDI_2_HAL_MIMO_PS |
| 22659 | ( |
| 22660 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 22661 | ) |
| 22662 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22663 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22664 | the chances of getting inlined*/ |
| 22665 | switch ( wdiHTOperMode ) |
| 22666 | { |
| 22667 | case WDI_HT_MIMO_PS_STATIC: |
| 22668 | return eSIR_HT_MIMO_PS_STATIC; |
| 22669 | case WDI_HT_MIMO_PS_DYNAMIC: |
| 22670 | return eSIR_HT_MIMO_PS_DYNAMIC; |
| 22671 | case WDI_HT_MIMO_PS_NA: |
| 22672 | return eSIR_HT_MIMO_PS_NA; |
| 22673 | case WDI_HT_MIMO_PS_NO_LIMIT: |
| 22674 | return eSIR_HT_MIMO_PS_NO_LIMIT; |
| 22675 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22677 | return eSIR_HT_MIMO_PS_MAX; |
| 22678 | }/*WDI_2_HAL_MIMO_PS*/ |
| 22679 | |
| 22680 | /*Convert WDI ENC type into HAL ENC type*/ |
| 22681 | WPT_STATIC WPT_INLINE tAniEdType |
| 22682 | WDI_2_HAL_ENC_TYPE |
| 22683 | ( |
| 22684 | WDI_EncryptType wdiEncType |
| 22685 | ) |
| 22686 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22687 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22688 | the chances of getting inlined*/ |
| 22689 | switch ( wdiEncType ) |
| 22690 | { |
| 22691 | case WDI_ENCR_NONE: |
| 22692 | return eSIR_ED_NONE; |
| 22693 | |
| 22694 | case WDI_ENCR_WEP40: |
| 22695 | return eSIR_ED_WEP40; |
| 22696 | |
| 22697 | case WDI_ENCR_WEP104: |
| 22698 | return eSIR_ED_WEP104; |
| 22699 | |
| 22700 | case WDI_ENCR_TKIP: |
| 22701 | return eSIR_ED_TKIP; |
| 22702 | |
| 22703 | case WDI_ENCR_CCMP: |
| 22704 | return eSIR_ED_CCMP; |
| 22705 | |
| 22706 | case WDI_ENCR_AES_128_CMAC: |
| 22707 | return eSIR_ED_AES_128_CMAC; |
| 22708 | #if defined(FEATURE_WLAN_WAPI) |
| 22709 | case WDI_ENCR_WPI: |
| 22710 | return eSIR_ED_WPI; |
| 22711 | #endif |
| 22712 | default: |
| 22713 | return eSIR_ED_NOT_IMPLEMENTED; |
| 22714 | } |
| 22715 | |
| 22716 | }/*WDI_2_HAL_ENC_TYPE*/ |
| 22717 | |
| 22718 | /*Convert WDI WEP type into HAL WEP type*/ |
| 22719 | WPT_STATIC WPT_INLINE tAniWepType |
| 22720 | WDI_2_HAL_WEP_TYPE |
| 22721 | ( |
| 22722 | WDI_WepType wdiWEPType |
| 22723 | ) |
| 22724 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22725 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22726 | the chances of getting inlined*/ |
| 22727 | switch ( wdiWEPType ) |
| 22728 | { |
| 22729 | case WDI_WEP_STATIC: |
| 22730 | return eSIR_WEP_STATIC; |
| 22731 | |
| 22732 | case WDI_WEP_DYNAMIC: |
| 22733 | return eSIR_WEP_DYNAMIC; |
| 22734 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22735 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22736 | return eSIR_WEP_MAX; |
| 22737 | }/*WDI_2_HAL_WEP_TYPE*/ |
| 22738 | |
| 22739 | WPT_STATIC WPT_INLINE tSirLinkState |
| 22740 | WDI_2_HAL_LINK_STATE |
| 22741 | ( |
| 22742 | WDI_LinkStateType wdiLinkState |
| 22743 | ) |
| 22744 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22745 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22746 | the chances of getting inlined*/ |
| 22747 | switch ( wdiLinkState ) |
| 22748 | { |
| 22749 | case WDI_LINK_IDLE_STATE: |
| 22750 | return eSIR_LINK_IDLE_STATE; |
| 22751 | |
| 22752 | case WDI_LINK_PREASSOC_STATE: |
| 22753 | return eSIR_LINK_PREASSOC_STATE; |
| 22754 | |
| 22755 | case WDI_LINK_POSTASSOC_STATE: |
| 22756 | return eSIR_LINK_POSTASSOC_STATE; |
| 22757 | |
| 22758 | case WDI_LINK_AP_STATE: |
| 22759 | return eSIR_LINK_AP_STATE; |
| 22760 | |
| 22761 | case WDI_LINK_IBSS_STATE: |
| 22762 | return eSIR_LINK_IBSS_STATE; |
| 22763 | |
| 22764 | case WDI_LINK_BTAMP_PREASSOC_STATE: |
| 22765 | return eSIR_LINK_BTAMP_PREASSOC_STATE; |
| 22766 | |
| 22767 | case WDI_LINK_BTAMP_POSTASSOC_STATE: |
| 22768 | return eSIR_LINK_BTAMP_POSTASSOC_STATE; |
| 22769 | |
| 22770 | case WDI_LINK_BTAMP_AP_STATE: |
| 22771 | return eSIR_LINK_BTAMP_AP_STATE; |
| 22772 | |
| 22773 | case WDI_LINK_BTAMP_STA_STATE: |
| 22774 | return eSIR_LINK_BTAMP_STA_STATE; |
| 22775 | |
| 22776 | case WDI_LINK_LEARN_STATE: |
| 22777 | return eSIR_LINK_LEARN_STATE; |
| 22778 | |
| 22779 | case WDI_LINK_SCAN_STATE: |
| 22780 | return eSIR_LINK_SCAN_STATE; |
| 22781 | |
| 22782 | case WDI_LINK_FINISH_SCAN_STATE: |
| 22783 | return eSIR_LINK_FINISH_SCAN_STATE; |
| 22784 | |
| 22785 | case WDI_LINK_INIT_CAL_STATE: |
| 22786 | return eSIR_LINK_INIT_CAL_STATE; |
| 22787 | |
| 22788 | case WDI_LINK_FINISH_CAL_STATE: |
| 22789 | return eSIR_LINK_FINISH_CAL_STATE; |
| 22790 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22791 | case WDI_LINK_LISTEN_STATE: |
| 22792 | return eSIR_LINK_LISTEN_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22793 | |
Gopichand Nakkala | d1a95af | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 22794 | case WDI_LINK_SEND_ACTION_STATE: |
| 22795 | return eSIR_LINK_SEND_ACTION_STATE; |
| 22796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22797 | default: |
| 22798 | return eSIR_LINK_MAX; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22799 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22800 | } |
| 22801 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22802 | /*Translate a STA Context from WDI into HAL*/ |
| 22803 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22804 | void |
| 22805 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22806 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22807 | tConfigStaParams* phalConfigSta, |
| 22808 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 22809 | ) |
| 22810 | { |
| 22811 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22812 | #ifdef WLAN_FEATURE_11AC |
| 22813 | /* Get the Version 1 Handler */ |
| 22814 | tConfigStaParams_V1* phalConfigSta_V1 = NULL; |
| 22815 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 22816 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22817 | phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22818 | } |
| 22819 | #endif |
| 22820 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22821 | the chances of getting inlined*/ |
| 22822 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22823 | wpalMemoryCopy(phalConfigSta->bssId, |
| 22824 | pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN); |
| 22825 | |
| 22826 | wpalMemoryCopy(phalConfigSta->staMac, |
| 22827 | pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22828 | |
| 22829 | phalConfigSta->assocId = pwdiConfigSta->usAssocId; |
| 22830 | phalConfigSta->staType = pwdiConfigSta->wdiSTAType; |
| 22831 | phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported; |
| 22832 | phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval; |
| 22833 | phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled; |
| 22834 | phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable; |
| 22835 | phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet; |
| 22836 | phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode; |
| 22837 | phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection; |
| 22838 | phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize; |
| 22839 | phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity; |
| 22840 | phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize; |
| 22841 | phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz; |
| 22842 | phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz; |
| 22843 | phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled; |
| 22844 | phalConfigSta->action = pwdiConfigSta->wdiAction; |
| 22845 | phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD; |
| 22846 | phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen; |
| 22847 | phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable; |
| 22848 | phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport; |
| 22849 | phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio; |
| 22850 | phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz; |
| 22851 | phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22852 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22853 | phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS); |
| 22854 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22855 | phalConfigSta->supportedRates.opRateMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22856 | pwdiConfigSta->wdiSupportedRates.opRateMode; |
| 22857 | for(i = 0; i < SIR_NUM_11B_RATES; i ++) |
| 22858 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22859 | phalConfigSta->supportedRates.llbRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22860 | pwdiConfigSta->wdiSupportedRates.llbRates[i]; |
| 22861 | } |
| 22862 | for(i = 0; i < SIR_NUM_11A_RATES; i ++) |
| 22863 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22864 | phalConfigSta->supportedRates.llaRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22865 | pwdiConfigSta->wdiSupportedRates.llaRates[i]; |
| 22866 | } |
| 22867 | for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++) |
| 22868 | { |
| 22869 | phalConfigSta->supportedRates.aniLegacyRates[i] = |
| 22870 | pwdiConfigSta->wdiSupportedRates.aLegacyRates[i]; |
| 22871 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22872 | phalConfigSta->supportedRates.aniEnhancedRateBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22873 | pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap; |
| 22874 | for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++) |
| 22875 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22876 | phalConfigSta->supportedRates.supportedMCSSet[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22877 | pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i]; |
| 22878 | } |
| 22879 | phalConfigSta->supportedRates.rxHighestDataRate = |
| 22880 | pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate; |
| 22881 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22882 | #ifdef WLAN_FEATURE_11AC |
| 22883 | if(phalConfigSta_V1 != NULL) |
| 22884 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22885 | phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap; |
| 22886 | phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate; |
| 22887 | phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap; |
| 22888 | phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22889 | } |
| 22890 | #endif |
| 22891 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22892 | phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22893 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22894 | #ifdef WLAN_FEATURE_11AC |
| 22895 | if(phalConfigSta_V1 != NULL) |
| 22896 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22897 | phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta; |
| 22898 | phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet; |
Shailender Karmuchi | 31f9ebe | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 22899 | phalConfigSta_V1->vhtTxBFEnabled = pwdiConfigSta->ucVhtTxBFEnabled; |
Gopichand Nakkala | b7ed0a6 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 22900 | phalConfigSta_V1->htLdpcEnabled = pwdiConfigSta->ucHtLdpcEnabled; |
| 22901 | phalConfigSta_V1->vhtLdpcEnabled = pwdiConfigSta->ucVhtLdpcEnabled; |
| 22902 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22903 | } |
| 22904 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22905 | }/*WDI_CopyWDIStaCtxToHALStaCtx*/; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22906 | |
| 22907 | /*Translate a Rate set info from WDI into HAL*/ |
| 22908 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22909 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22910 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22911 | tSirMacRateSet* pHalRateSet, |
| 22912 | WDI_RateSet* pwdiRateSet |
| 22913 | ) |
| 22914 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22915 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22916 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22917 | |
| 22918 | pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )? |
| 22919 | pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX; |
| 22920 | |
| 22921 | for ( i = 0; i < pHalRateSet->numRates; i++ ) |
| 22922 | { |
| 22923 | pHalRateSet->rate[i] = pwdiRateSet->aRates[i]; |
| 22924 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22925 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22926 | }/*WDI_CopyWDIRateSetToHALRateSet*/ |
| 22927 | |
| 22928 | |
| 22929 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 22930 | WPT_STATIC WPT_INLINE void |
| 22931 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22932 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22933 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 22934 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 22935 | ) |
| 22936 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22937 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22938 | the chances of getting inlined*/ |
| 22939 | |
| 22940 | phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd; |
| 22941 | phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci; |
| 22942 | phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm; |
| 22943 | phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn; |
| 22944 | |
| 22945 | phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max; |
| 22946 | phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min; |
| 22947 | phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit; |
| 22948 | }/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/ |
| 22949 | |
| 22950 | |
| 22951 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 22952 | WPT_STATIC WPT_INLINE void |
| 22953 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 22954 | ( |
| 22955 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 22956 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 22957 | ) |
| 22958 | { |
| 22959 | pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer; |
| 22960 | pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type; |
| 22961 | pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType; |
| 22962 | pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS; |
| 22963 | pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS; |
| 22964 | pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag; |
| 22965 | pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry; |
| 22966 | pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt; |
| 22967 | pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData; |
| 22968 | pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep; |
| 22969 | pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order; |
| 22970 | |
| 22971 | pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo; |
| 22972 | pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi; |
| 22973 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22974 | wpalMemoryCopy(pmacMgmtHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22975 | pwdiMacMgmtHdr->da, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22976 | wpalMemoryCopy(pmacMgmtHdr->sa, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22977 | pwdiMacMgmtHdr->sa, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22978 | wpalMemoryCopy(pmacMgmtHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22979 | pwdiMacMgmtHdr->bssId, 6); |
| 22980 | |
| 22981 | pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum; |
| 22982 | pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo; |
| 22983 | pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi; |
| 22984 | |
| 22985 | }/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/ |
| 22986 | |
| 22987 | |
| 22988 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 22989 | WPT_STATIC WPT_INLINE void |
| 22990 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 22991 | ( |
| 22992 | tConfigBssParams* phalConfigBSS, |
| 22993 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 22994 | ) |
| 22995 | { |
| 22996 | |
| 22997 | wpt_uint8 keyIndex = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22998 | #ifdef WLAN_FEATURE_11AC |
| 22999 | /* Get the Version 1 Handler */ |
| 23000 | tConfigBssParams_V1* phalConfigBSS_V1 = NULL; |
| 23001 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 23002 | phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23003 | #endif |
| 23004 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23005 | wpalMemoryCopy( phalConfigBSS->bssId, |
| 23006 | pwdiConfigBSS->macBSSID, |
| 23007 | WDI_MAC_ADDR_LEN); |
| 23008 | |
| 23009 | #ifdef HAL_SELF_STA_PER_BSS |
| 23010 | wpalMemoryCopy( phalConfigBSS->selfMacAddr, |
| 23011 | pwdiConfigBSS->macSelfAddr, |
| 23012 | WDI_MAC_ADDR_LEN); |
| 23013 | #endif |
| 23014 | |
| 23015 | phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType); |
| 23016 | |
| 23017 | phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode; |
| 23018 | phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType); |
| 23019 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23020 | phalConfigBSS->shortSlotTimeSupported = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23021 | pwdiConfigBSS->ucShortSlotTimeSupported; |
| 23022 | phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist; |
| 23023 | phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist; |
| 23024 | phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist; |
| 23025 | phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist; |
| 23026 | phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23027 | phalConfigBSS->fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23028 | pwdiConfigBSS->ucTXOPProtectionFullSupport; |
| 23029 | phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode; |
| 23030 | phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval; |
| 23031 | phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod; |
| 23032 | phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet; |
| 23033 | phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel; |
| 23034 | phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel; |
| 23035 | phalConfigBSS->action = pwdiConfigBSS->wdiAction; |
| 23036 | phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable; |
| 23037 | phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled; |
| 23038 | phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled; |
| 23039 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23040 | phalConfigBSS->htOperMode = |
| 23041 | WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23042 | |
| 23043 | phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection; |
| 23044 | phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit; |
| 23045 | phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn; |
| 23046 | phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn; |
| 23047 | |
| 23048 | #ifdef WLAN_FEATURE_VOWIFI |
| 23049 | phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower; |
| 23050 | #endif |
| 23051 | |
| 23052 | /*! Used 32 as magic number because that is how the ssid is declared inside the |
| 23053 | hal header - hal needs a macro for it */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23054 | phalConfigBSS->ssId.length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23055 | (pwdiConfigBSS->wdiSSID.ucLength <= 32)? |
| 23056 | pwdiConfigBSS->wdiSSID.ucLength : 32; |
| 23057 | wpalMemoryCopy(phalConfigBSS->ssId.ssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23058 | pwdiConfigBSS->wdiSSID.sSSID, |
| 23059 | phalConfigBSS->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23060 | |
| 23061 | WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext, |
| 23062 | &pwdiConfigBSS->wdiSTAContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23063 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23064 | WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet, |
| 23065 | &pwdiConfigBSS->wdiRateSet); |
| 23066 | |
| 23067 | phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid; |
| 23068 | |
| 23069 | if(phalConfigBSS->edcaParamsValid) |
| 23070 | { |
| 23071 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe, |
| 23072 | &pwdiConfigBSS->wdiBEEDCAParams); |
| 23073 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk, |
| 23074 | &pwdiConfigBSS->wdiBKEDCAParams); |
| 23075 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi, |
| 23076 | &pwdiConfigBSS->wdiVIEDCAParams); |
| 23077 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo, |
| 23078 | &pwdiConfigBSS->wdiVOEDCAParams); |
| 23079 | } |
| 23080 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23081 | phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23082 | |
| 23083 | phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn; |
| 23084 | |
| 23085 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 23086 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23087 | phalConfigBSS->extSetStaKeyParamValid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23088 | pwdiConfigBSS->bExtSetStaKeyParamValid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23090 | if( phalConfigBSS->extSetStaKeyParamValid ) |
| 23091 | { |
| 23092 | /*----------------------------------------------------------------------- |
| 23093 | Copy the STA Key parameters into the HAL message |
| 23094 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23095 | phalConfigBSS->extSetStaKeyParam.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23096 | WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType); |
| 23097 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23098 | phalConfigBSS->extSetStaKeyParam.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23099 | WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType ); |
| 23100 | |
| 23101 | phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx; |
| 23102 | |
| 23103 | phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx; |
| 23104 | |
| 23105 | phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc; |
| 23106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23107 | for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ; |
| 23108 | keyIndex++) |
| 23109 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23110 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23111 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId; |
| 23112 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast = |
| 23113 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast; |
| 23114 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection = |
| 23115 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection; |
| 23116 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23117 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23118 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23119 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23120 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23121 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23122 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength; |
| 23123 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23124 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23125 | WDI_MAX_KEY_LENGTH); |
| 23126 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23127 | } |
| 23128 | else/* phalConfigBSS->extSetStaKeyParamValid is not set */ |
| 23129 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23130 | wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23131 | sizeof(phalConfigBSS->extSetStaKeyParam) ); |
| 23132 | } |
| 23133 | |
| 23134 | #endif /*WLAN_FEATURE_VOWIFI_11R*/ |
| 23135 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23136 | #ifdef WLAN_FEATURE_11AC |
| 23137 | if(phalConfigBSS_V1 != NULL) |
| 23138 | { |
| 23139 | phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta; |
| 23140 | phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet; |
| 23141 | } |
| 23142 | #endif |
| 23143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23144 | }/*WDI_CopyWDIConfigBSSToHALConfigBSS*/ |
| 23145 | |
| 23146 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23147 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23148 | pointed to by user data */ |
| 23149 | WPT_STATIC WPT_INLINE void |
| 23150 | WDI_ExtractRequestCBFromEvent |
| 23151 | ( |
| 23152 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23153 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23154 | void** ppUserData |
| 23155 | ) |
| 23156 | { |
| 23157 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23158 | switch ( pEvent->wdiRequest ) |
| 23159 | { |
| 23160 | case WDI_START_REQ: |
| 23161 | *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23162 | *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData; |
| 23163 | break; |
| 23164 | case WDI_STOP_REQ: |
| 23165 | *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23166 | *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData; |
| 23167 | break; |
| 23168 | case WDI_INIT_SCAN_REQ: |
| 23169 | *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23170 | *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 23171 | break; |
| 23172 | case WDI_START_SCAN_REQ: |
| 23173 | *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23174 | *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 23175 | break; |
| 23176 | case WDI_END_SCAN_REQ: |
| 23177 | *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23178 | *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 23179 | break; |
| 23180 | case WDI_FINISH_SCAN_REQ: |
| 23181 | *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23182 | *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 23183 | break; |
| 23184 | case WDI_JOIN_REQ: |
| 23185 | *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23186 | *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData; |
| 23187 | break; |
| 23188 | case WDI_CONFIG_BSS_REQ: |
| 23189 | *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23190 | *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 23191 | break; |
| 23192 | case WDI_DEL_BSS_REQ: |
| 23193 | *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23194 | *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 23195 | break; |
| 23196 | case WDI_POST_ASSOC_REQ: |
| 23197 | *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23198 | *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData; |
| 23199 | break; |
| 23200 | case WDI_DEL_STA_REQ: |
| 23201 | *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23202 | *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 23203 | break; |
| 23204 | case WDI_DEL_STA_SELF_REQ: |
| 23205 | *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23206 | *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData; |
| 23207 | break; |
| 23208 | |
| 23209 | case WDI_SET_BSS_KEY_REQ: |
| 23210 | *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23211 | *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 23212 | break; |
| 23213 | case WDI_RMV_BSS_KEY_REQ: |
| 23214 | *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23215 | *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 23216 | break; |
| 23217 | case WDI_SET_STA_KEY_REQ: |
| 23218 | *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23219 | *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 23220 | break; |
| 23221 | case WDI_RMV_STA_KEY_REQ: |
| 23222 | *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23223 | *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 23224 | break; |
| 23225 | case WDI_ADD_TS_REQ: |
| 23226 | *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23227 | *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 23228 | break; |
| 23229 | case WDI_DEL_TS_REQ: |
| 23230 | *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23231 | *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 23232 | break; |
| 23233 | case WDI_UPD_EDCA_PRMS_REQ: |
| 23234 | *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23235 | *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData; |
| 23236 | break; |
| 23237 | case WDI_ADD_BA_SESSION_REQ: |
| 23238 | *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23239 | *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData; |
| 23240 | break; |
| 23241 | case WDI_DEL_BA_REQ: |
| 23242 | *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23243 | *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 23244 | break; |
| 23245 | #ifdef FEATURE_WLAN_CCX |
| 23246 | case WDI_TSM_STATS_REQ: |
| 23247 | *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23248 | *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23249 | break; |
| 23250 | #endif |
| 23251 | case WDI_CH_SWITCH_REQ: |
| 23252 | *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23253 | *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData; |
| 23254 | break; |
| 23255 | case WDI_CONFIG_STA_REQ: |
| 23256 | *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23257 | *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 23258 | break; |
| 23259 | case WDI_SET_LINK_ST_REQ: |
| 23260 | *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23261 | *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData; |
| 23262 | break; |
| 23263 | case WDI_GET_STATS_REQ: |
| 23264 | *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23265 | *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23266 | break; |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 23267 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 23268 | case WDI_GET_ROAM_RSSI_REQ: |
| 23269 | *ppfnReqCB = ((WDI_GetRoamRssiReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23270 | *ppUserData = ((WDI_GetRoamRssiReqParamsType*)pEvent->pEventData)->pUserData; |
| 23271 | break; |
| 23272 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23273 | case WDI_UPDATE_CFG_REQ: |
| 23274 | *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23275 | *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData; |
| 23276 | break; |
| 23277 | case WDI_ADD_BA_REQ: |
| 23278 | *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23279 | *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 23280 | break; |
| 23281 | case WDI_TRIGGER_BA_REQ: |
| 23282 | *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23283 | *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 23284 | break; |
| 23285 | case WDI_UPD_BCON_PRMS_REQ: |
| 23286 | *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23287 | *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 23288 | break; |
| 23289 | case WDI_SND_BCON_REQ: |
| 23290 | *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23291 | *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 23292 | break; |
| 23293 | case WDI_ENTER_BMPS_REQ: |
| 23294 | *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23295 | *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23296 | break; |
| 23297 | case WDI_EXIT_BMPS_REQ: |
| 23298 | *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23299 | *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23300 | break; |
| 23301 | case WDI_ENTER_UAPSD_REQ: |
| 23302 | *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23303 | *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 23304 | break; |
Yue Ma | c0bbc0d | 2013-04-12 11:47:39 -0700 | [diff] [blame] | 23305 | case WDI_EXIT_UAPSD_REQ: |
| 23306 | *ppfnReqCB = ((WDI_ExitUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23307 | *ppUserData = ((WDI_ExitUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 23308 | break; |
| 23309 | case WDI_SET_UAPSD_PARAM_REQ: |
| 23310 | *ppfnReqCB = ((WDI_SetUapsdAcParamsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23311 | *ppUserData = ((WDI_SetUapsdAcParamsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23312 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23313 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
| 23314 | *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23315 | *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 23316 | break; |
| 23317 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
| 23318 | *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23319 | *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 23320 | break; |
| 23321 | case WDI_SET_BEACON_FILTER_REQ: |
| 23322 | *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23323 | *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 23324 | break; |
| 23325 | case WDI_REM_BEACON_FILTER_REQ: |
| 23326 | *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23327 | *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23328 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23329 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 23330 | *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23331 | *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23332 | break; |
| 23333 | case WDI_HOST_OFFLOAD_REQ: |
| 23334 | *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23335 | *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData; |
| 23336 | break; |
| 23337 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 23338 | *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23339 | *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 23340 | break; |
| 23341 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 23342 | *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23343 | *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 23344 | break; |
| 23345 | case WDI_WOWL_ENTER_REQ: |
| 23346 | *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23347 | *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData; |
| 23348 | break; |
Yue Ma | c0bbc0d | 2013-04-12 11:47:39 -0700 | [diff] [blame] | 23349 | case WDI_WOWL_EXIT_REQ: |
| 23350 | *ppfnReqCB = ((WDI_WowlExitReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23351 | *ppUserData = ((WDI_WowlExitReqParamsType*)pEvent->pEventData)->pUserData; |
| 23352 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23353 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 23354 | *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23355 | *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData; |
| 23356 | break; |
| 23357 | case WDI_FLUSH_AC_REQ: |
| 23358 | *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23359 | *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData; |
| 23360 | break; |
| 23361 | case WDI_BTAMP_EVENT_REQ: |
| 23362 | *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23363 | *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData; |
| 23364 | break; |
| 23365 | case WDI_KEEP_ALIVE_REQ: |
| 23366 | *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23367 | *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData; |
| 23368 | break; |
Yue Ma | c0bbc0d | 2013-04-12 11:47:39 -0700 | [diff] [blame] | 23369 | #if defined FEATURE_WLAN_SCAN_PNO |
| 23370 | case WDI_SET_PREF_NETWORK_REQ: |
| 23371 | *ppfnReqCB = ((WDI_PNOScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23372 | *ppUserData = ((WDI_PNOScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 23373 | break; |
| 23374 | case WDI_SET_RSSI_FILTER_REQ: |
| 23375 | *ppfnReqCB = ((WDI_SetRssiFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23376 | *ppUserData = ((WDI_SetRssiFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 23377 | break; |
| 23378 | case WDI_UPDATE_SCAN_PARAMS_REQ: |
| 23379 | *ppfnReqCB = ((WDI_UpdateScanParamsInfoType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23380 | *ppUserData = ((WDI_UpdateScanParamsInfoType*)pEvent->pEventData)->pUserData; |
| 23381 | break; |
| 23382 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23383 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 23384 | *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23385 | *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData; |
Tushnim Bhattacharyya | e39194c | 2013-03-08 10:15:42 -0800 | [diff] [blame] | 23386 | break; |
Yue Ma | c0bbc0d | 2013-04-12 11:47:39 -0700 | [diff] [blame] | 23387 | #if defined WLAN_FEATURE_PACKET_FILTERING |
| 23388 | case WDI_8023_MULTICAST_LIST_REQ: |
| 23389 | *ppfnReqCB = ((WDI_RcvFltPktSetMcListReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23390 | *ppUserData = ((WDI_RcvFltPktSetMcListReqParamsType*)pEvent->pEventData)->pUserData; |
| 23391 | break; |
Tushnim Bhattacharyya | e39194c | 2013-03-08 10:15:42 -0800 | [diff] [blame] | 23392 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
| 23393 | *ppfnReqCB = ((WDI_SetRcvPktFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23394 | *ppUserData = ((WDI_SetRcvPktFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 23395 | break; |
| 23396 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 23397 | *ppfnReqCB = ((WDI_RcvFltPktMatchCntReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23398 | *ppUserData = ((WDI_RcvFltPktMatchCntReqParamsType*)pEvent->pEventData)->pUserData; |
| 23399 | break; |
| 23400 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 23401 | *ppfnReqCB = ((WDI_RcvFltPktClearReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23402 | *ppUserData = ((WDI_RcvFltPktClearReqParamsType*)pEvent->pEventData)->pUserData; |
| 23403 | break; |
Yue Ma | c0bbc0d | 2013-04-12 11:47:39 -0700 | [diff] [blame] | 23404 | #endif |
| 23405 | case WDI_SET_POWER_PARAMS_REQ: |
| 23406 | *ppfnReqCB = ((WDI_SetPowerParamsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 23407 | *ppUserData = ((WDI_SetPowerParamsReqParamsType*)pEvent->pEventData)->pUserData; |
| 23408 | break; |
| 23409 | #if defined WLAN_FEATURE_GTK_OFFLOAD |
| 23410 | case WDI_GTK_OFFLOAD_REQ: |
| 23411 | *ppfnReqCB = ((WDI_GtkOffloadReqMsg*)pEvent->pEventData)->wdiReqStatusCB; |
| 23412 | *ppUserData = ((WDI_GtkOffloadReqMsg*)pEvent->pEventData)->pUserData; |
| 23413 | break; |
| 23414 | case WDI_GTK_OFFLOAD_GETINFO_REQ: |
| 23415 | *ppfnReqCB = ((WDI_GtkOffloadGetInfoReqMsg*)pEvent->pEventData)->wdiReqStatusCB; |
| 23416 | *ppUserData = ((WDI_GtkOffloadGetInfoReqMsg*)pEvent->pEventData)->pUserData; |
| 23417 | break; |
| 23418 | #endif |
Tushnim Bhattacharyya | e39194c | 2013-03-08 10:15:42 -0800 | [diff] [blame] | 23419 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23420 | default: |
| 23421 | *ppfnReqCB = NULL; |
| 23422 | *ppUserData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23423 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23424 | } |
| 23425 | }/*WDI_ExtractRequestCBFromEvent*/ |
| 23426 | |
| 23427 | |
| 23428 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23429 | @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23430 | frame xtl is enabled for a particular STA. |
| 23431 | |
| 23432 | WDI_PostAssocReq must have been called. |
| 23433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23434 | @param uSTAIdx: STA index |
| 23435 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23436 | @see WDI_PostAssocReq |
| 23437 | @return Result of the function call |
| 23438 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23439 | wpt_boolean |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23440 | WDI_IsHwFrameTxTranslationCapable |
| 23441 | ( |
| 23442 | wpt_uint8 uSTAIdx |
| 23443 | ) |
| 23444 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23445 | /*!! FIX ME - this must eventually be per station - for now just feedback |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23446 | uma value*/ |
| 23447 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23448 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23449 | ------------------------------------------------------------------------*/ |
| 23450 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23451 | { |
| 23452 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23453 | "WDI API call before module is initialized - Fail request"); |
| 23454 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23455 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23456 | } |
| 23457 | |
Gopichand Nakkala | ba26127 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 23458 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 23459 | if (IS_VSTA_IDX(uSTAIdx)) |
| 23460 | { |
| 23461 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23462 | "STA %d is a Virtual STA, " |
| 23463 | "HW frame translation disabled", uSTAIdx); |
| 23464 | return eWLAN_PAL_FALSE; |
| 23465 | } |
| 23466 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23468 | return gWDICb.bFrameTransEnabled; |
| 23469 | }/*WDI_IsHwFrameTxTranslationCapable*/ |
| 23470 | |
| 23471 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 23472 | /** |
| 23473 | @brief WDI_SetPreferredNetworkList |
| 23474 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23475 | @param pwdiPNOScanReqParams: the Set PNO as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23476 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23478 | wdiPNOScanCb: callback for passing back the response |
| 23479 | of the Set PNO operation received from the |
| 23480 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23482 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23483 | callback |
| 23484 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23485 | @return Result of the function call |
| 23486 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23487 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23488 | WDI_SetPreferredNetworkReq |
| 23489 | ( |
| 23490 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 23491 | WDI_PNOScanCb wdiPNOScanCb, |
| 23492 | void* pUserData |
| 23493 | ) |
| 23494 | { |
| 23495 | WDI_EventInfoType wdiEventData = {{0}}; |
| 23496 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23497 | |
| 23498 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23499 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23500 | ------------------------------------------------------------------------*/ |
| 23501 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23502 | { |
| 23503 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23504 | "WDI API call before module is initialized - Fail request"); |
| 23505 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23506 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23507 | } |
| 23508 | |
| 23509 | /*------------------------------------------------------------------------ |
| 23510 | Fill in Event data and post to the Main FSM |
| 23511 | ------------------------------------------------------------------------*/ |
| 23512 | wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23513 | wdiEventData.pEventData = pwdiPNOScanReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23514 | wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23515 | wdiEventData.pCBfnc = wdiPNOScanCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23516 | wdiEventData.pUserData = pUserData; |
| 23517 | |
| 23518 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23519 | } |
| 23520 | |
| 23521 | |
| 23522 | /** |
| 23523 | @brief WDI_SetRssiFilterReq |
| 23524 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23525 | @param pwdiRssiFilterReqParams: the Set RSSI Filter as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23526 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23527 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23528 | wdiRssiFilterCb: callback for passing back the response |
| 23529 | of the Set RSSI Filter operation received from the |
| 23530 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23531 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23532 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23533 | callback |
| 23534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23535 | @return Result of the function call |
| 23536 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23537 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23538 | WDI_SetRssiFilterReq |
| 23539 | ( |
| 23540 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams, |
| 23541 | WDI_RssiFilterCb wdiRssiFilterCb, |
| 23542 | void* pUserData |
| 23543 | ) |
| 23544 | { |
| 23545 | WDI_EventInfoType wdiEventData = {{0}}; |
| 23546 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23547 | |
| 23548 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23549 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23550 | ------------------------------------------------------------------------*/ |
| 23551 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23552 | { |
| 23553 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23554 | "WDI API call before module is initialized - Fail request"); |
| 23555 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23556 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23557 | } |
| 23558 | |
| 23559 | /*------------------------------------------------------------------------ |
| 23560 | Fill in Event data and post to the Main FSM |
| 23561 | ------------------------------------------------------------------------*/ |
| 23562 | wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23563 | wdiEventData.pEventData = pwdiRssiFilterReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23564 | wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23565 | wdiEventData.pCBfnc = wdiRssiFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23566 | wdiEventData.pUserData = pUserData; |
| 23567 | |
| 23568 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23569 | }/*WDI_SetRssiFilterReq*/ |
| 23570 | |
| 23571 | /** |
| 23572 | @brief WDI_UpdateScanParamsReq |
| 23573 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23574 | @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23575 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23576 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23577 | wdiUpdateScanParamsCb: callback for passing back the response |
| 23578 | of the Set PNO operation received from the |
| 23579 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23580 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23581 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23582 | callback |
| 23583 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23584 | @return Result of the function call |
| 23585 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23586 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23587 | WDI_UpdateScanParamsReq |
| 23588 | ( |
| 23589 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType, |
| 23590 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb, |
| 23591 | void* pUserData |
| 23592 | ) |
| 23593 | { |
| 23594 | WDI_EventInfoType wdiEventData = {{0}}; |
| 23595 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23596 | |
| 23597 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23598 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23599 | ------------------------------------------------------------------------*/ |
| 23600 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23601 | { |
| 23602 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23603 | "WDI API call before module is initialized - Fail request"); |
| 23604 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23605 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23606 | } |
| 23607 | |
| 23608 | /*------------------------------------------------------------------------ |
| 23609 | Fill in Event data and post to the Main FSM |
| 23610 | ------------------------------------------------------------------------*/ |
| 23611 | wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23612 | wdiEventData.pEventData = pwdiUpdateScanParamsInfoType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23613 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23614 | wdiEventData.pCBfnc = wdiUpdateScanParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23615 | wdiEventData.pUserData = pUserData; |
| 23616 | |
| 23617 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23618 | } |
| 23619 | |
| 23620 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23621 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23622 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23623 | |
| 23624 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23625 | pwdiPNOScanReqParams: pointer to the info received |
| 23626 | from upper layers |
| 23627 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23628 | and its size |
| 23629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23630 | @return Result of the function call |
| 23631 | */ |
| 23632 | |
| 23633 | WDI_Status |
| 23634 | WDI_PackPreferredNetworkList |
| 23635 | ( |
| 23636 | WDI_ControlBlockType* pWDICtx, |
| 23637 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 23638 | wpt_uint8** ppSendBuffer, |
| 23639 | wpt_uint16* pSize |
| 23640 | ) |
| 23641 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23642 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23643 | wpt_uint16 usDataOffset = 0; |
| 23644 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23645 | tpPrefNetwListParams pPrefNetwListParams = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23646 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23647 | /*----------------------------------------------------------------------- |
| 23648 | Get message buffer |
| 23649 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23650 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23651 | sizeof(tPrefNetwListParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23652 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23653 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParams) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23654 | { |
| 23655 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23656 | "Unable to get send buffer in Set PNO req %x ", |
| 23657 | pwdiPNOScanReqParams); |
| 23658 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23659 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23660 | } |
| 23661 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23662 | pPrefNetwListParams = (tpPrefNetwListParams)(pSendBuffer + usDataOffset); |
| 23663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23664 | /*------------------------------------------------------------------------- |
| 23665 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 23666 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23667 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23668 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23669 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23670 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 23671 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23672 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23673 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23674 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23675 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23676 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 23677 | |
| 23678 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23679 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23680 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 23681 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 23682 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 23683 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23684 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23685 | { |
| 23686 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23687 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23688 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 23689 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23690 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23691 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23692 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23693 | |
| 23694 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23695 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23696 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23697 | |
| 23698 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23699 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23700 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23701 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23702 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23703 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23704 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 23705 | (pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount < |
| 23706 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 23707 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount : |
| 23708 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23709 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23710 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23711 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23712 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23713 | |
| 23714 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23715 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23716 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 23717 | |
| 23718 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23719 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23720 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 23721 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23722 | } |
| 23723 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23724 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23725 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23726 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 23727 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 23728 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 23729 | |
| 23730 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23731 | "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23732 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23733 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 23734 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 23735 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23736 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23737 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23738 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23739 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23740 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23741 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 23742 | } |
| 23743 | |
| 23744 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23745 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23746 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 23747 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23748 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23749 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23750 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23751 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23752 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23753 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23754 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23755 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23756 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 23757 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23758 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23759 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23760 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23761 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23762 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23763 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23764 | |
| 23765 | /*Set the output values*/ |
| 23766 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23767 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23768 | |
| 23769 | return WDI_STATUS_SUCCESS; |
| 23770 | }/*WDI_PackPreferredNetworkList*/ |
| 23771 | |
| 23772 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23773 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23774 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23775 | |
| 23776 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23777 | pwdiPNOScanReqParams: pointer to the info received |
| 23778 | from upper layers |
| 23779 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23780 | and its size |
| 23781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23782 | @return Result of the function call |
| 23783 | */ |
| 23784 | |
| 23785 | WDI_Status |
| 23786 | WDI_PackPreferredNetworkListNew |
| 23787 | ( |
| 23788 | WDI_ControlBlockType* pWDICtx, |
| 23789 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 23790 | wpt_uint8** ppSendBuffer, |
| 23791 | wpt_uint16* pSize |
| 23792 | ) |
| 23793 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23794 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23795 | wpt_uint16 usDataOffset = 0; |
| 23796 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23797 | tpPrefNetwListParamsNew pPrefNetwListParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23798 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23799 | |
| 23800 | /*----------------------------------------------------------------------- |
| 23801 | Get message buffer |
| 23802 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23803 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23804 | sizeof(tPrefNetwListParamsNew), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23805 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23806 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParamsNew) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23807 | { |
| 23808 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23809 | "Unable to get send buffer in Set PNO req %x ", |
| 23810 | pwdiPNOScanReqParams); |
| 23811 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23812 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23813 | } |
| 23814 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23815 | pPrefNetwListParams = (tpPrefNetwListParamsNew)(pSendBuffer + usDataOffset); |
| 23816 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23817 | /*------------------------------------------------------------------------- |
| 23818 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 23819 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23820 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23821 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23822 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23823 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 23824 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23825 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23826 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23827 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23828 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23829 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 23830 | |
| 23831 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23832 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23833 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 23834 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 23835 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 23836 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23837 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23838 | { |
| 23839 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23840 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23841 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 23842 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23843 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23844 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23845 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23846 | |
| 23847 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23848 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23849 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23850 | |
| 23851 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23852 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23853 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23854 | |
| 23855 | /*SSID bcast type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23856 | pPrefNetwListParams->aNetworks[i].bcastNetworkType = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23857 | (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23858 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23859 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23860 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23861 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23862 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount; |
| 23863 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23864 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23865 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23866 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23867 | |
| 23868 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23869 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23870 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 23871 | |
| 23872 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23873 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23874 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 23875 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23876 | } |
| 23877 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23878 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23879 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23880 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 23881 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 23882 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 23883 | |
| 23884 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23885 | "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23886 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23887 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 23888 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 23889 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23890 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23891 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23892 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23893 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23894 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23895 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 23896 | } |
| 23897 | |
| 23898 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23899 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23900 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 23901 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23902 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23903 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23904 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23905 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23906 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23907 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23908 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23909 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23910 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 23911 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23912 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23913 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23914 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23915 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23916 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23917 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23918 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23919 | |
| 23920 | /*Set the output values*/ |
| 23921 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23922 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23923 | |
| 23924 | return WDI_STATUS_SUCCESS; |
| 23925 | }/*WDI_PackPreferredNetworkListNew*/ |
| 23926 | |
| 23927 | /** |
| 23928 | @brief Process Set Preferred Network List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23929 | |
| 23930 | @param pWDICtx: pointer to the WLAN DAL context |
| 23931 | pEventData: pointer to the event information structure |
| 23932 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23933 | @return Result of the function call |
| 23934 | */ |
| 23935 | WDI_Status |
| 23936 | WDI_ProcessSetPreferredNetworkReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23937 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23938 | WDI_ControlBlockType* pWDICtx, |
| 23939 | WDI_EventInfoType* pEventData |
| 23940 | ) |
| 23941 | { |
| 23942 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL; |
| 23943 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23944 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23945 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23946 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23947 | |
| 23948 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23949 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23950 | -------------------------------------------------------------------------*/ |
| 23951 | if (( NULL == pEventData ) || |
| 23952 | ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) || |
| 23953 | ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc))) |
| 23954 | { |
| 23955 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23956 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23957 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23958 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23959 | } |
| 23960 | |
| 23961 | /*------------------------------------------------------------------------- |
| 23962 | Pack the PNO request structure based on version |
| 23963 | -------------------------------------------------------------------------*/ |
| 23964 | if ( pWDICtx->wdiPNOVersion > 0 ) |
| 23965 | { |
| 23966 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23967 | "%s: PNO new version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23968 | pWDICtx->wdiPNOVersion); |
| 23969 | |
| 23970 | wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams, |
| 23971 | &pSendBuffer, &usSendSize); |
| 23972 | } |
| 23973 | else |
| 23974 | { |
| 23975 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23976 | "%s: PNO old version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23977 | pWDICtx->wdiPNOVersion); |
| 23978 | |
| 23979 | wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams, |
| 23980 | &pSendBuffer, &usSendSize); |
| 23981 | } |
| 23982 | |
| 23983 | if (( WDI_STATUS_SUCCESS != wdiStatus )|| |
| 23984 | ( NULL == pSendBuffer )||( 0 == usSendSize )) |
| 23985 | { |
| 23986 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23987 | "%s: failed to pack request parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23988 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23989 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23990 | } |
| 23991 | |
| 23992 | pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23993 | pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23994 | |
| 23995 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23996 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23997 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23998 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23999 | wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24000 | } |
| 24001 | |
| 24002 | /** |
| 24003 | @brief Process Set RSSI Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24004 | |
| 24005 | @param pWDICtx: pointer to the WLAN DAL context |
| 24006 | pEventData: pointer to the event information structure |
| 24007 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24008 | @see |
| 24009 | @return Result of the function call |
| 24010 | */ |
| 24011 | WDI_Status |
| 24012 | WDI_ProcessSetRssiFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24013 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24014 | WDI_ControlBlockType* pWDICtx, |
| 24015 | WDI_EventInfoType* pEventData |
| 24016 | ) |
| 24017 | { |
| 24018 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL; |
| 24019 | WDI_RssiFilterCb wdiRssiFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24020 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24021 | wpt_uint16 usDataOffset = 0; |
| 24022 | wpt_uint16 usSendSize = 0; |
| 24023 | wpt_uint8 ucRssiThreshold; |
| 24024 | |
| 24025 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24026 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24027 | -------------------------------------------------------------------------*/ |
| 24028 | if (( NULL == pEventData ) || |
| 24029 | ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) || |
| 24030 | ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc))) |
| 24031 | { |
| 24032 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24033 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24034 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24035 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24036 | } |
| 24037 | |
| 24038 | /*----------------------------------------------------------------------- |
| 24039 | Get message buffer |
| 24040 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24041 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24042 | sizeof(ucRssiThreshold), |
| 24043 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24044 | ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) ))) |
| 24045 | { |
| 24046 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24047 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 24048 | pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb); |
| 24049 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24050 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24051 | } |
| 24052 | |
| 24053 | ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold; |
| 24054 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24055 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24056 | &ucRssiThreshold, |
| 24057 | sizeof(ucRssiThreshold)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24058 | |
| 24059 | pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24060 | pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24061 | |
| 24062 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24063 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24064 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24065 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24066 | wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24067 | } |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24068 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 24069 | /** |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24070 | @brief WDI_RoamScanOffloadReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24071 | |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24072 | @param pwdiRoamScanOffloadReqParams: the LookupReq as specified |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24073 | by the Device Interface |
| 24074 | |
| 24075 | wdiRoamOffloadScancb: callback for passing back the response |
| 24076 | of the Roam Candidate Lookup Req operation received from the |
| 24077 | device |
| 24078 | |
| 24079 | pUserData: user data will be passed back with the |
| 24080 | callback |
| 24081 | @return Result of the function call |
| 24082 | */ |
| 24083 | WDI_Status |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24084 | WDI_RoamScanOffloadReq |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24085 | ( |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24086 | WDI_RoamScanOffloadReqParamsType* pwdiRoamScanOffloadReqParams, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24087 | WDI_RoamOffloadScanCb wdiRoamOffloadScancb, |
| 24088 | void* pUserData |
| 24089 | ) |
| 24090 | { |
| 24091 | WDI_EventInfoType wdiEventData = {{0}}; |
| 24092 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24093 | |
| 24094 | /*------------------------------------------------------------------------ |
| 24095 | Sanity Check |
| 24096 | ------------------------------------------------------------------------*/ |
| 24097 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24098 | { |
| 24099 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24100 | "WDI API call before module is initialized - Fail request"); |
| 24101 | |
| 24102 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24103 | } |
| 24104 | |
| 24105 | /*------------------------------------------------------------------------ |
| 24106 | Fill in Event data and post to the Main FSM |
| 24107 | ------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24108 | wdiEventData.wdiRequest = WDI_ROAM_SCAN_OFFLOAD_REQ; |
| 24109 | wdiEventData.pEventData = pwdiRoamScanOffloadReqParams; |
| 24110 | wdiEventData.uEventDataSize = sizeof(*pwdiRoamScanOffloadReqParams); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24111 | wdiEventData.pCBfnc = wdiRoamOffloadScancb; |
| 24112 | wdiEventData.pUserData = pUserData; |
| 24113 | |
| 24114 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24115 | } |
| 24116 | |
| 24117 | void |
| 24118 | WDI_wdiEdTypeEncToEdTypeEnc(tEdType *EdType, WDI_EdType wdiEdType) |
| 24119 | { |
| 24120 | switch (wdiEdType) |
| 24121 | { |
| 24122 | case WDI_ED_NONE: |
| 24123 | *EdType = eED_NONE; |
| 24124 | break; |
| 24125 | case WDI_ED_WEP40: |
| 24126 | case WDI_ED_WEP104: |
| 24127 | *EdType = eED_WEP; |
| 24128 | break; |
| 24129 | case WDI_ED_TKIP: |
| 24130 | *EdType = eED_TKIP; |
| 24131 | break; |
| 24132 | case WDI_ED_CCMP: |
| 24133 | #ifdef WLAN_FEATURE_11W |
| 24134 | case WDI_ED_AES_128_CMAC: |
| 24135 | #endif |
| 24136 | *EdType = eED_CCMP; |
| 24137 | break; |
| 24138 | #ifdef FEATURE_WLAN_WAPI |
| 24139 | case WDI_ED_WPI: |
| 24140 | *EdType = eED_WPI; |
| 24141 | break; |
| 24142 | #endif |
| 24143 | case WDI_ED_ANY: |
| 24144 | *EdType = eED_ANY; |
| 24145 | break; |
| 24146 | |
| 24147 | default: |
| 24148 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24149 | "%s: Unknown Encryption Type", __func__); |
| 24150 | break; |
| 24151 | } |
| 24152 | } |
| 24153 | |
| 24154 | /** |
| 24155 | @brief Helper function to pack Start Roam Candidate Lookup |
| 24156 | Request parameters |
| 24157 | |
| 24158 | @param pWDICtx: pointer to the WLAN DAL context |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24159 | pwdiRoamScanOffloadReqParams: pointer to the info received |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24160 | from upper layers |
| 24161 | ppSendBuffer, pSize - out pointers of the packed buffer |
| 24162 | and its size |
| 24163 | |
| 24164 | @return Result of the function call |
| 24165 | */ |
| 24166 | |
| 24167 | WDI_Status |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24168 | WDI_PackRoamScanOffloadParams |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24169 | ( |
| 24170 | WDI_ControlBlockType* pWDICtx, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24171 | WDI_RoamScanOffloadReqParamsType* pwdiRoamScanOffloadReqParams, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24172 | wpt_uint8** ppSendBuffer, |
| 24173 | wpt_uint16* pSize |
| 24174 | ) |
| 24175 | { |
| 24176 | wpt_uint8* pSendBuffer = NULL; |
| 24177 | wpt_uint16 usDataOffset = 0; |
| 24178 | wpt_uint16 usSendSize = 0; |
| 24179 | tpRoamCandidateListParams pRoamCandidateListParams = NULL; |
| 24180 | wpt_uint8 i; |
| 24181 | /*----------------------------------------------------------------------- |
| 24182 | Get message buffer |
| 24183 | -----------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24184 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ROAM_SCAN_OFFLOAD_REQ, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24185 | sizeof(tRoamCandidateListParams), |
| 24186 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Varun Reddy Yeturu | 7cfcd61 | 2013-06-03 11:31:52 -0700 | [diff] [blame] | 24187 | ( usSendSize < (usDataOffset + sizeof(tRoamCandidateListParams) ))) |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24188 | { |
| 24189 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24190 | "Unable to get send buffer in Start Roam Candidate Lookup Req %x ", |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24191 | pwdiRoamScanOffloadReqParams); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24192 | WDI_ASSERT(0); |
| 24193 | return WDI_STATUS_E_FAILURE; |
| 24194 | } |
| 24195 | pRoamCandidateListParams = (tpRoamCandidateListParams)(pSendBuffer + usDataOffset); |
Varun Reddy Yeturu | 7cfcd61 | 2013-06-03 11:31:52 -0700 | [diff] [blame] | 24196 | wpalMemoryZero(pRoamCandidateListParams, sizeof(tRoamCandidateListParams)); |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24197 | pRoamCandidateListParams->RoamScanOffloadEnabled = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.RoamScanOffloadEnabled; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24198 | wpalMemoryCopy(pRoamCandidateListParams->ConnectedNetwork.currAPbssid, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24199 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.currAPbssid, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24200 | HAL_MAC_ADDR_LEN); |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24201 | pRoamCandidateListParams->ConnectedNetwork.authentication = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.authentication; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24202 | WDI_wdiEdTypeEncToEdTypeEnc(&pRoamCandidateListParams->ConnectedNetwork.encryption, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24203 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.encryption); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24204 | WDI_wdiEdTypeEncToEdTypeEnc(&pRoamCandidateListParams->ConnectedNetwork.mcencryption, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24205 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.mcencryption); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24206 | |
| 24207 | pRoamCandidateListParams->ConnectedNetwork.ssId.length |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24208 | = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.ssId.ucLength; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24209 | wpalMemoryCopy( pRoamCandidateListParams->ConnectedNetwork.ssId.ssId, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24210 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.ssId.sSSID, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24211 | pRoamCandidateListParams->ConnectedNetwork.ssId.length); |
| 24212 | wpalMemoryCopy(pRoamCandidateListParams->ConnectedNetwork.ChannelCache, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24213 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.ChannelCache, |
| 24214 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.ChannelCount ); |
| 24215 | pRoamCandidateListParams->ConnectedNetwork.ChannelCount = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ConnectedNetwork.ChannelCount; |
| 24216 | pRoamCandidateListParams->ChannelCacheType = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ChannelCacheType ; |
| 24217 | pRoamCandidateListParams->LookupThreshold = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.LookupThreshold; |
| 24218 | pRoamCandidateListParams->RoamRssiDiff = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.RoamRssiDiff ; |
| 24219 | pRoamCandidateListParams->Command = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.Command ; |
| 24220 | pRoamCandidateListParams->StartScanReason = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.StartScanReason ; |
| 24221 | pRoamCandidateListParams->NeighborScanTimerPeriod = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.NeighborScanTimerPeriod ; |
| 24222 | pRoamCandidateListParams->NeighborRoamScanRefreshPeriod = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.NeighborRoamScanRefreshPeriod ; |
| 24223 | pRoamCandidateListParams->NeighborScanChannelMinTime = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.NeighborScanChannelMinTime ; |
| 24224 | pRoamCandidateListParams->NeighborScanChannelMaxTime = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.NeighborScanChannelMaxTime ; |
| 24225 | pRoamCandidateListParams->EmptyRefreshScanPeriod = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.EmptyRefreshScanPeriod ; |
| 24226 | pRoamCandidateListParams->IsCCXEnabled = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.IsCCXEnabled ; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24227 | wpalMemoryCopy(pRoamCandidateListParams->ValidChannelList, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24228 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ValidChannelList, |
| 24229 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ValidChannelCount); |
| 24230 | pRoamCandidateListParams->ValidChannelCount = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.ValidChannelCount; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24231 | |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24232 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_HIGH, |
| 24233 | "Values are ssid = %s, RoamOffloadScan=%d,Command=%d," |
| 24234 | "StartScanReason=%d,NeighborScanTimerPeriod=%d," |
| 24235 | "NeighborRoamScanRefreshPeriod=%d,NeighborScanChannelMinTime=%d," |
| 24236 | "NeighborScanChannelMaxTime = %d,EmptyRefreshScanPeriod=%d," |
| 24237 | "mdiePresent=%d,MDID=%d, auth=%d, uce=%d, mce=%d, nProbes=%d," |
| 24238 | "HomeAwayTime=%d\n", |
| 24239 | pRoamCandidateListParams->ConnectedNetwork.ssId.ssId, |
| 24240 | pRoamCandidateListParams->RoamScanOffloadEnabled, |
| 24241 | pRoamCandidateListParams->Command, |
| 24242 | pRoamCandidateListParams->StartScanReason, |
| 24243 | pRoamCandidateListParams->NeighborScanTimerPeriod, |
| 24244 | pRoamCandidateListParams->NeighborRoamScanRefreshPeriod, |
| 24245 | pRoamCandidateListParams->NeighborScanChannelMinTime, |
| 24246 | pRoamCandidateListParams->NeighborScanChannelMaxTime, |
| 24247 | pRoamCandidateListParams->EmptyRefreshScanPeriod, |
| 24248 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.MDID.mdiePresent, |
| 24249 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.MDID.mobilityDomain, |
| 24250 | pRoamCandidateListParams->ConnectedNetwork.authentication, |
| 24251 | pRoamCandidateListParams->ConnectedNetwork.encryption, |
| 24252 | pRoamCandidateListParams->ConnectedNetwork.mcencryption, |
| 24253 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.nProbes, |
| 24254 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.HomeAwayTime); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24255 | pRoamCandidateListParams->us24GProbeSize = |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24256 | (pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.us24GProbeSize< |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24257 | WLAN_HAL_ROAM_SCAN_MAX_PROBE_SIZE)? |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24258 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.us24GProbeSize: |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24259 | WLAN_HAL_ROAM_SCAN_MAX_PROBE_SIZE; |
| 24260 | wpalMemoryCopy(pRoamCandidateListParams->a24GProbeTemplate, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24261 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.a24GProbeTemplate, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24262 | pRoamCandidateListParams->us24GProbeSize); |
| 24263 | pRoamCandidateListParams->us5GProbeSize = |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24264 | (pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.us5GProbeSize< |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24265 | WLAN_HAL_ROAM_SCAN_MAX_PROBE_SIZE)? |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24266 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.us5GProbeSize: |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24267 | WLAN_HAL_ROAM_SCAN_MAX_PROBE_SIZE; |
| 24268 | wpalMemoryCopy(pRoamCandidateListParams->a5GProbeTemplate, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24269 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.a5GProbeTemplate, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24270 | pRoamCandidateListParams->us5GProbeSize); |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24271 | pRoamCandidateListParams->MDID.mdiePresent = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.MDID.mdiePresent; |
| 24272 | pRoamCandidateListParams->MDID.mobilityDomain = pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.MDID.mobilityDomain; |
| 24273 | pRoamCandidateListParams->nProbes = |
| 24274 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.nProbes; |
| 24275 | pRoamCandidateListParams->HomeAwayTime = |
| 24276 | pwdiRoamScanOffloadReqParams->wdiRoamOffloadScanInfo.HomeAwayTime; |
| 24277 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_HIGH,"Valid Channel List"); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24278 | for (i=0; i<pRoamCandidateListParams->ValidChannelCount ; i++) |
| 24279 | { |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24280 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_HIGH,"%d", pRoamCandidateListParams->ValidChannelList[i]); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24281 | } |
| 24282 | |
| 24283 | |
| 24284 | /*Set the output values*/ |
| 24285 | *ppSendBuffer = pSendBuffer; |
| 24286 | *pSize = usSendSize; |
| 24287 | return WDI_STATUS_SUCCESS; |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24288 | }/*WDI_PackRoamScanOffloadParams*/ |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24289 | |
| 24290 | /** |
| 24291 | @brief Process Start Roam Candidate Lookup Request function |
| 24292 | |
| 24293 | @param pWDICtx: pointer to the WLAN DAL context |
| 24294 | pEventData: pointer to the event information structure |
| 24295 | |
| 24296 | @return Result of the function call |
| 24297 | */ |
| 24298 | WDI_Status |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24299 | WDI_ProcessRoamScanOffloadReq |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24300 | ( |
| 24301 | WDI_ControlBlockType* pWDICtx, |
| 24302 | WDI_EventInfoType* pEventData |
| 24303 | ) |
| 24304 | { |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24305 | WDI_RoamScanOffloadReqParamsType* pwdiRoamScanOffloadReqParams = NULL; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24306 | WDI_RoamOffloadScanCb wdiRoamOffloadScancb = NULL; |
| 24307 | wpt_uint8* pSendBuffer = NULL; |
| 24308 | wpt_uint16 usSendSize = 0; |
| 24309 | WDI_Status wdiStatus; |
| 24310 | /*------------------------------------------------------------------------- |
| 24311 | Sanity check |
| 24312 | -------------------------------------------------------------------------*/ |
| 24313 | if (( NULL == pEventData ) || |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24314 | ( NULL == (pwdiRoamScanOffloadReqParams = (WDI_RoamScanOffloadReqParamsType*)pEventData->pEventData)) || |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24315 | ( NULL == (wdiRoamOffloadScancb = (WDI_RoamOffloadScanCb)pEventData->pCBfnc))) |
| 24316 | { |
| 24317 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24318 | "%s: Invalid parameters", __func__); |
| 24319 | WDI_ASSERT(0); |
| 24320 | return WDI_STATUS_E_FAILURE; |
| 24321 | } |
| 24322 | |
| 24323 | /*------------------------------------------------------------------------- |
| 24324 | Pack the Start Roam Candidate Lookup request structure based on version |
| 24325 | -------------------------------------------------------------------------*/ |
| 24326 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24327 | "%s: Packing Roam Candidate Lookup request ", __func__); |
| 24328 | |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24329 | wdiStatus = WDI_PackRoamScanOffloadParams( pWDICtx, pwdiRoamScanOffloadReqParams, |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24330 | &pSendBuffer, &usSendSize); |
| 24331 | |
| 24332 | if (( WDI_STATUS_SUCCESS != wdiStatus )|| |
| 24333 | ( NULL == pSendBuffer )||( 0 == usSendSize )) |
| 24334 | { |
| 24335 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24336 | "%s: failed to pack request parameters", __func__); |
| 24337 | WDI_ASSERT(0); |
| 24338 | return wdiStatus; |
| 24339 | } |
| 24340 | |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24341 | pWDICtx->wdiReqStatusCB = pwdiRoamScanOffloadReqParams->wdiReqStatusCB; |
| 24342 | pWDICtx->pReqStatusUserData = pwdiRoamScanOffloadReqParams->pUserData; |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24343 | |
| 24344 | /*------------------------------------------------------------------------- |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24345 | Send WDI_ROAM_SCAN_OFFLOAD_REQ to HAL |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24346 | -------------------------------------------------------------------------*/ |
| 24347 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24348 | wdiRoamOffloadScancb, pEventData->pUserData, WDI_ROAM_SCAN_OFFLOAD_RESP); |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24349 | } |
| 24350 | |
| 24351 | /** |
| 24352 | @brief Process Start Roam Candidate Lookup Rsp function (called when a |
| 24353 | response is being received over the bus from HAL) |
| 24354 | |
| 24355 | @param pWDICtx: pointer to the WLAN DAL context |
| 24356 | pEventData: pointer to the event information structure |
| 24357 | |
| 24358 | @see |
| 24359 | @return Result of the function call |
| 24360 | */ |
| 24361 | WDI_Status |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24362 | WDI_ProcessRoamScanOffloadRsp |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24363 | ( |
| 24364 | WDI_ControlBlockType* pWDICtx, |
| 24365 | WDI_EventInfoType* pEventData |
| 24366 | ) |
| 24367 | { |
| 24368 | WDI_Status wdiStatus; |
| 24369 | eHalStatus halStatus; |
| 24370 | WDI_RoamOffloadScanCb wdiRoamOffloadScancb = NULL; |
| 24371 | |
| 24372 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24373 | |
| 24374 | /*------------------------------------------------------------------------- |
| 24375 | Sanity check |
| 24376 | -------------------------------------------------------------------------*/ |
| 24377 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24378 | ( NULL == pEventData->pEventData )) |
| 24379 | { |
| 24380 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24381 | "%s: Invalid parameters", __func__); |
| 24382 | WDI_ASSERT(0); |
| 24383 | return WDI_STATUS_E_FAILURE; |
| 24384 | } |
| 24385 | |
| 24386 | wdiRoamOffloadScancb = (WDI_RoamOffloadScanCb)pWDICtx->pfncRspCB; |
| 24387 | |
| 24388 | /*------------------------------------------------------------------------- |
| 24389 | Extract response and send it to UMAC |
| 24390 | -------------------------------------------------------------------------*/ |
| 24391 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24392 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24393 | |
| 24394 | /*Notify UMAC*/ |
| 24395 | wdiRoamOffloadScancb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24396 | |
| 24397 | return WDI_STATUS_SUCCESS; |
Varun Reddy Yeturu | 2fa7f8e | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 24398 | }/* WDI_ProcessRoamScanOffloadRsp */ |
Varun Reddy Yeturu | 0861470 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 24399 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24400 | |
| 24401 | /** |
| 24402 | @brief Process Update Scan Params function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24403 | |
| 24404 | @param pWDICtx: pointer to the WLAN DAL context |
| 24405 | pEventData: pointer to the event information structure |
| 24406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24407 | @see |
| 24408 | @return Result of the function call |
| 24409 | */ |
| 24410 | WDI_Status |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24411 | WDI_PackUpdateScanParamsReq |
| 24412 | ( |
| 24413 | WDI_ControlBlockType* pWDICtx, |
| 24414 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams, |
| 24415 | wpt_uint8** ppSendBuffer, |
| 24416 | wpt_uint16* pSize |
| 24417 | ) |
| 24418 | { |
| 24419 | wpt_uint8* pSendBuffer = NULL; |
| 24420 | wpt_uint16 usDataOffset = 0; |
| 24421 | wpt_uint16 usSendSize = 0; |
| 24422 | tUpdateScanParams updateScanParams = {0}; |
| 24423 | |
| 24424 | |
Varun Reddy Yeturu | 9163b67 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 24425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24426 | "Begin WDI Update Scan Parameters Old Style Params"); |
| 24427 | /*----------------------------------------------------------------------- |
| 24428 | Get message buffer |
| 24429 | -----------------------------------------------------------------------*/ |
| 24430 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
| 24431 | sizeof(updateScanParams), |
| 24432 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24433 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 24434 | { |
| 24435 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24436 | "Unable to get send buffer in Update Scan Params req %x", |
| 24437 | pwdiUpdateScanParams); |
| 24438 | WDI_ASSERT(0); |
| 24439 | return WDI_STATUS_E_FAILURE; |
| 24440 | } |
| 24441 | |
| 24442 | // |
| 24443 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 24444 | // |
| 24445 | |
| 24446 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 24447 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
| 24448 | |
| 24449 | updateScanParams.ucChannelCount = |
| 24450 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 24451 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 24452 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 24453 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
| 24454 | |
| 24455 | wpalMemoryCopy( updateScanParams.aChannels, |
| 24456 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 24457 | updateScanParams.ucChannelCount); |
| 24458 | |
| 24459 | |
| 24460 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 24461 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 24462 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 24463 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 24464 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 24465 | |
| 24466 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24467 | &updateScanParams, |
| 24468 | sizeof(updateScanParams)); |
| 24469 | |
| 24470 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
| 24471 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
| 24472 | |
Varun Reddy Yeturu | 9163b67 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 24473 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24474 | "End Update Scan Parameters Old Style"); |
| 24475 | |
| 24476 | /*Set the output values*/ |
| 24477 | *ppSendBuffer = pSendBuffer; |
| 24478 | *pSize = usSendSize; |
| 24479 | |
| 24480 | return WDI_STATUS_SUCCESS; |
| 24481 | } |
| 24482 | |
| 24483 | /** |
| 24484 | @brief Process Update Scan Params function |
| 24485 | |
| 24486 | @param pWDICtx: pointer to the WLAN DAL context |
| 24487 | pEventData: pointer to the event information structure |
| 24488 | |
| 24489 | @see |
| 24490 | @return Result of the function call |
| 24491 | */ |
| 24492 | WDI_Status |
| 24493 | WDI_PackUpdateScanParamsReqEx |
| 24494 | ( |
| 24495 | WDI_ControlBlockType* pWDICtx, |
| 24496 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams, |
| 24497 | wpt_uint8** ppSendBuffer, |
| 24498 | wpt_uint16* pSize |
| 24499 | ) |
| 24500 | { |
| 24501 | wpt_uint8* pSendBuffer = NULL; |
| 24502 | wpt_uint16 usDataOffset = 0; |
| 24503 | wpt_uint16 usSendSize = 0; |
| 24504 | tUpdateScanParamsEx updateScanParams = {0}; |
| 24505 | |
| 24506 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24507 | /*----------------------------------------------------------------------- |
| 24508 | Get message buffer |
| 24509 | -----------------------------------------------------------------------*/ |
| 24510 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
| 24511 | sizeof(updateScanParams), |
| 24512 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24513 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 24514 | { |
| 24515 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24516 | "Unable to get send buffer in Update Scan Params Ex req %x", |
| 24517 | pwdiUpdateScanParams); |
| 24518 | WDI_ASSERT(0); |
| 24519 | return WDI_STATUS_E_FAILURE; |
| 24520 | } |
| 24521 | |
| 24522 | // |
| 24523 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 24524 | // |
| 24525 | |
| 24526 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 24527 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
| 24528 | |
| 24529 | updateScanParams.ucChannelCount = |
| 24530 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 24531 | WLAN_HAL_PNO_MAX_NETW_CHANNELS_EX)? |
| 24532 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 24533 | WLAN_HAL_PNO_MAX_NETW_CHANNELS_EX; |
| 24534 | |
| 24535 | wpalMemoryCopy( updateScanParams.aChannels, |
| 24536 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 24537 | updateScanParams.ucChannelCount); |
| 24538 | |
| 24539 | |
| 24540 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 24541 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 24542 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 24543 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 24544 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 24545 | |
| 24546 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24547 | &updateScanParams, |
| 24548 | sizeof(updateScanParams)); |
| 24549 | |
| 24550 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
| 24551 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
| 24552 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24553 | /*Set the output values*/ |
| 24554 | *ppSendBuffer = pSendBuffer; |
| 24555 | *pSize = usSendSize; |
| 24556 | |
| 24557 | return WDI_STATUS_SUCCESS; |
| 24558 | } |
| 24559 | |
| 24560 | /** |
| 24561 | @brief Process Update Scan Params function |
| 24562 | |
| 24563 | @param pWDICtx: pointer to the WLAN DAL context |
| 24564 | pEventData: pointer to the event information structure |
| 24565 | |
| 24566 | @see |
| 24567 | @return Result of the function call |
| 24568 | */ |
| 24569 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24570 | WDI_ProcessUpdateScanParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24571 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24572 | WDI_ControlBlockType* pWDICtx, |
| 24573 | WDI_EventInfoType* pEventData |
| 24574 | ) |
| 24575 | { |
| 24576 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL; |
| 24577 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24578 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24579 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 1f11a39 | 2012-12-27 17:31:42 -0800 | [diff] [blame] | 24580 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24581 | |
| 24582 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24583 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24584 | -------------------------------------------------------------------------*/ |
| 24585 | if (( NULL == pEventData ) || |
| 24586 | ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) || |
| 24587 | ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc))) |
| 24588 | { |
| 24589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24590 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24591 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24592 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24593 | } |
| 24594 | |
| 24595 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24596 | "Begin WDI Update Scan Parameters"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24597 | |
| 24598 | // |
| 24599 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 24600 | // |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24601 | if ( pWDICtx->wlanVersion.revision < 1 ) |
| 24602 | { |
Madan Mohan Koyyalamudi | 1f11a39 | 2012-12-27 17:31:42 -0800 | [diff] [blame] | 24603 | wdiStatus = WDI_PackUpdateScanParamsReq( pWDICtx, pwdiUpdateScanParams, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24604 | &pSendBuffer, &usSendSize); |
| 24605 | } |
| 24606 | else |
| 24607 | { |
Madan Mohan Koyyalamudi | 1f11a39 | 2012-12-27 17:31:42 -0800 | [diff] [blame] | 24608 | wdiStatus = WDI_PackUpdateScanParamsReqEx( pWDICtx, pwdiUpdateScanParams, |
| 24609 | &pSendBuffer, &usSendSize); |
| 24610 | } |
| 24611 | |
| 24612 | if(WDI_STATUS_SUCCESS != wdiStatus) |
| 24613 | { |
| 24614 | //memory allocation failed |
| 24615 | return WDI_STATUS_E_FAILURE; |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24616 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24617 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24618 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24619 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24620 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24621 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 24622 | wdiUpdateScanParamsCb, pEventData->pUserData, |
| 24623 | WDI_UPDATE_SCAN_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24624 | } |
| 24625 | |
| 24626 | /** |
| 24627 | @brief Process Preferred Network Found Indication function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24628 | |
| 24629 | @param pWDICtx: pointer to the WLAN DAL context |
| 24630 | pEventData: pointer to the event information structure |
| 24631 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24632 | @see |
| 24633 | @return Result of the function call |
| 24634 | */ |
| 24635 | WDI_Status |
| 24636 | WDI_ProcessPrefNetworkFoundInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24637 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24638 | WDI_ControlBlockType* pWDICtx, |
| 24639 | WDI_EventInfoType* pEventData |
| 24640 | ) |
| 24641 | { |
Srikant Kuppa | 0f67905 | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 24642 | WDI_LowLevelIndType wdiInd; |
| 24643 | tpPrefNetwFoundParams pNetwFoundParams; |
| 24644 | wpt_uint32 msgsize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24645 | |
| 24646 | |
| 24647 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24648 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24649 | -------------------------------------------------------------------------*/ |
| 24650 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24651 | ( NULL == pEventData->pEventData )) |
| 24652 | { |
| 24653 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24654 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24655 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24656 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24657 | } |
| 24658 | |
| 24659 | /*------------------------------------------------------------------------- |
| 24660 | Extract indication and send it to UMAC |
| 24661 | -------------------------------------------------------------------------*/ |
Srikant Kuppa | 0f67905 | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 24662 | pNetwFoundParams = (tpPrefNetwFoundParams)(pEventData->pEventData); |
| 24663 | |
| 24664 | msgsize = sizeof(tPrefNetwFoundParams) + pNetwFoundParams->frameLength; |
| 24665 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.pData = |
| 24666 | (wpt_uint8 *)wpalMemoryAllocate(msgsize); |
| 24667 | |
| 24668 | if (NULL == wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.pData) |
| 24669 | { |
| 24670 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24671 | "%s: fail to allocate memory", __func__); |
| 24672 | return WDI_STATUS_MEM_FAILURE; |
| 24673 | } |
| 24674 | |
| 24675 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength = |
| 24676 | (pNetwFoundParams->ssId.length < 32 )? |
| 24677 | pNetwFoundParams->ssId.length : 32; |
| 24678 | wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 24679 | pNetwFoundParams->ssId.ssId, |
| 24680 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength); |
| 24681 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi = pNetwFoundParams->rssi; |
| 24682 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.frameLength = |
| 24683 | pNetwFoundParams->frameLength; |
| 24684 | wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.pData, |
| 24685 | (wpt_uint8 *)pEventData->pEventData + sizeof(tPrefNetwFoundParams), |
| 24686 | pNetwFoundParams->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24687 | |
| 24688 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24689 | wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24690 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24691 | // DEBUG |
| 24692 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 24693 | "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)", |
| 24694 | wdiInd.wdiIndicationType, |
| 24695 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 24696 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi ); |
| 24697 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 24698 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 24699 | { |
| 24700 | /*Notify UMAC*/ |
| 24701 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 24702 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24703 | |
| 24704 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24705 | } |
| 24706 | |
| 24707 | /** |
| 24708 | @brief Process PNO Rsp function (called when a |
| 24709 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24710 | |
| 24711 | @param pWDICtx: pointer to the WLAN DAL context |
| 24712 | pEventData: pointer to the event information structure |
| 24713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24714 | @see |
| 24715 | @return Result of the function call |
| 24716 | */ |
| 24717 | WDI_Status |
| 24718 | WDI_ProcessSetPreferredNetworkRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24719 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24720 | WDI_ControlBlockType* pWDICtx, |
| 24721 | WDI_EventInfoType* pEventData |
| 24722 | ) |
| 24723 | { |
| 24724 | WDI_Status wdiStatus; |
| 24725 | eHalStatus halStatus; |
| 24726 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
| 24727 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24728 | |
| 24729 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24730 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24731 | -------------------------------------------------------------------------*/ |
| 24732 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24733 | ( NULL == pEventData->pEventData )) |
| 24734 | { |
| 24735 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24736 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24737 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24738 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24739 | } |
| 24740 | |
| 24741 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24742 | wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24743 | |
| 24744 | /*------------------------------------------------------------------------- |
| 24745 | Extract response and send it to UMAC |
| 24746 | -------------------------------------------------------------------------*/ |
| 24747 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24748 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24749 | |
| 24750 | /*Notify UMAC*/ |
| 24751 | wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24752 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24753 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24754 | }/*WDI_ProcessSetPreferredNetworkRsp*/ |
| 24755 | |
| 24756 | /** |
| 24757 | @brief Process RSSI Filter Rsp function (called when a |
| 24758 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24759 | |
| 24760 | @param pWDICtx: pointer to the WLAN DAL context |
| 24761 | pEventData: pointer to the event information structure |
| 24762 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24763 | @see |
| 24764 | @return Result of the function call |
| 24765 | */ |
| 24766 | WDI_Status |
| 24767 | WDI_ProcessSetRssiFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24768 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24769 | WDI_ControlBlockType* pWDICtx, |
| 24770 | WDI_EventInfoType* pEventData |
| 24771 | ) |
| 24772 | { |
| 24773 | WDI_Status wdiStatus; |
| 24774 | eHalStatus halStatus; |
| 24775 | WDI_RssiFilterCb wdiRssiFilterCb; |
| 24776 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24777 | |
| 24778 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24779 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24780 | -------------------------------------------------------------------------*/ |
| 24781 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24782 | ( NULL == pEventData->pEventData )) |
| 24783 | { |
| 24784 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24785 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24786 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24787 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24788 | } |
| 24789 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24790 | wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24791 | |
| 24792 | /*------------------------------------------------------------------------- |
| 24793 | Extract response and send it to UMAC |
| 24794 | -------------------------------------------------------------------------*/ |
| 24795 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24796 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24797 | |
| 24798 | /*Notify UMAC*/ |
| 24799 | wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24800 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24801 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24802 | }/*WDI_ProcessSetRssiFilterRsp*/ |
| 24803 | |
| 24804 | /** |
| 24805 | @brief Process Update Scan Params Rsp function (called when a |
| 24806 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24807 | |
| 24808 | @param pWDICtx: pointer to the WLAN DAL context |
| 24809 | pEventData: pointer to the event information structure |
| 24810 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24811 | @see |
| 24812 | @return Result of the function call |
| 24813 | */ |
| 24814 | WDI_Status |
| 24815 | WDI_ProcessUpdateScanParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24816 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24817 | WDI_ControlBlockType* pWDICtx, |
| 24818 | WDI_EventInfoType* pEventData |
| 24819 | ) |
| 24820 | { |
| 24821 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24822 | tUpdateScanParamsResp halUpdScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24823 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24824 | wpt_uint32 uStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24825 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24826 | |
| 24827 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24828 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24829 | -------------------------------------------------------------------------*/ |
| 24830 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24831 | ( NULL == pEventData->pEventData )) |
| 24832 | { |
| 24833 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24834 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24835 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24836 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24837 | } |
| 24838 | |
| 24839 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24840 | "Process UPD scan params ptr : %x", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24841 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24842 | wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24843 | |
| 24844 | /*------------------------------------------------------------------------- |
| 24845 | Extract response and send it to UMAC |
| 24846 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24847 | wpalMemoryCopy( (void *)&halUpdScanParams.status, |
| 24848 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24849 | sizeof(halUpdScanParams.status)); |
| 24850 | |
| 24851 | uStatus = halUpdScanParams.status; |
| 24852 | |
| 24853 | /*Extract PNO version - 1st bit of the status */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24854 | pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24855 | |
| 24856 | /*Remove version bit*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24857 | uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24858 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24859 | wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24860 | |
| 24861 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24862 | "UPD Scan Parameters rsp with status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24863 | halUpdScanParams.status); |
| 24864 | |
| 24865 | /*Notify UMAC*/ |
| 24866 | wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24867 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24868 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24869 | } |
| 24870 | #endif // FEATURE_WLAN_SCAN_PNO |
| 24871 | |
| 24872 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24873 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24874 | WDI_8023MulticastListReq |
| 24875 | ( |
| 24876 | WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo, |
| 24877 | WDI_8023MulticastListCb wdi8023MulticastListCallback, |
| 24878 | void* pUserData |
| 24879 | ) |
| 24880 | { |
| 24881 | WDI_EventInfoType wdiEventData; |
| 24882 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24883 | |
| 24884 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24885 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24886 | |
| 24887 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24888 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24889 | ------------------------------------------------------------------------*/ |
| 24890 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24891 | { |
| 24892 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24893 | "WDI API call before module is initialized - Fail request"); |
| 24894 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24895 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24896 | } |
| 24897 | |
| 24898 | /*------------------------------------------------------------------------ |
| 24899 | Fill in Event data and post to the Main FSM |
| 24900 | ------------------------------------------------------------------------*/ |
| 24901 | wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24902 | wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24903 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24904 | wdiEventData.pCBfnc = wdi8023MulticastListCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24905 | wdiEventData.pUserData = pUserData; |
| 24906 | |
| 24907 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24908 | } |
| 24909 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24910 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24911 | WDI_ReceiveFilterSetFilterReq |
| 24912 | ( |
| 24913 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo, |
| 24914 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback, |
| 24915 | void* pUserData |
| 24916 | ) |
| 24917 | { |
| 24918 | WDI_EventInfoType wdiEventData; |
| 24919 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24920 | |
| 24921 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24922 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24923 | |
| 24924 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24925 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24926 | ------------------------------------------------------------------------*/ |
| 24927 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24928 | { |
| 24929 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24930 | "WDI API call before module is initialized - Fail request"); |
| 24931 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24932 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24933 | } |
| 24934 | |
| 24935 | /*------------------------------------------------------------------------ |
| 24936 | Fill in Event data and post to the Main FSM |
| 24937 | ------------------------------------------------------------------------*/ |
| 24938 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24939 | wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo; |
| 24940 | wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) + |
Yue Ma | a450e8a | 2013-03-18 18:05:27 -0700 | [diff] [blame] | 24941 | (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 24942 | * sizeof(WDI_RcvPktFilterFieldParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24943 | wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24944 | wdiEventData.pUserData = pUserData; |
| 24945 | |
| 24946 | |
| 24947 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24948 | } |
| 24949 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24950 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24951 | WDI_FilterMatchCountReq |
| 24952 | ( |
| 24953 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo, |
| 24954 | WDI_FilterMatchCountCb wdiFilterMatchCountCallback, |
| 24955 | void* pUserData |
| 24956 | ) |
| 24957 | { |
| 24958 | WDI_EventInfoType wdiEventData; |
| 24959 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24960 | |
| 24961 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24962 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24963 | |
| 24964 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24965 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24966 | ------------------------------------------------------------------------*/ |
| 24967 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24968 | { |
| 24969 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24970 | "WDI API call before module is initialized - Fail request"); |
| 24971 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24972 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24973 | } |
| 24974 | |
| 24975 | /*------------------------------------------------------------------------ |
| 24976 | Fill in Event data and post to the Main FSM |
| 24977 | ------------------------------------------------------------------------*/ |
| 24978 | wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24979 | wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24980 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24981 | wdiEventData.pCBfnc = wdiFilterMatchCountCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24982 | wdiEventData.pUserData = pUserData; |
| 24983 | |
| 24984 | |
| 24985 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24986 | } |
| 24987 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24988 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24989 | WDI_ReceiveFilterClearFilterReq |
| 24990 | ( |
| 24991 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo, |
| 24992 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback, |
| 24993 | void* pUserData |
| 24994 | ) |
| 24995 | { |
| 24996 | WDI_EventInfoType wdiEventData; |
| 24997 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24998 | |
| 24999 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25000 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25001 | |
| 25002 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25003 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25004 | ------------------------------------------------------------------------*/ |
| 25005 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25006 | { |
| 25007 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25008 | "WDI API call before module is initialized - Fail request"); |
| 25009 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25010 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25011 | } |
| 25012 | |
| 25013 | /*------------------------------------------------------------------------ |
| 25014 | Fill in Event data and post to the Main FSM |
| 25015 | ------------------------------------------------------------------------*/ |
| 25016 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25017 | wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25018 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25019 | wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25020 | wdiEventData.pUserData = pUserData; |
| 25021 | |
| 25022 | |
| 25023 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25024 | } |
| 25025 | |
| 25026 | /** |
| 25027 | @brief Process 8023 Multicast List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25028 | |
| 25029 | @param pWDICtx: pointer to the WLAN DAL context |
| 25030 | pEventData: pointer to the event information structure |
| 25031 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25032 | @see |
| 25033 | @return Result of the function call |
| 25034 | */ |
| 25035 | WDI_Status |
| 25036 | WDI_Process8023MulticastListReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25037 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25038 | WDI_ControlBlockType* pWDICtx, |
| 25039 | WDI_EventInfoType* pEventData |
| 25040 | ) |
| 25041 | { |
| 25042 | WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL; |
| 25043 | WDI_8023MulticastListCb wdi8023MulticastListCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25044 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25045 | wpt_uint16 usDataOffset = 0; |
| 25046 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25047 | tpHalRcvFltMcAddrListType pRcvFltMcAddrListType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25048 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25049 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 25050 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25051 | |
| 25052 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25053 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25054 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25055 | pRcvFltMcAddrListType = wpalMemoryAllocate(sizeof(tHalRcvFltMcAddrListType)) ; |
| 25056 | if( NULL == pRcvFltMcAddrListType ) |
| 25057 | { |
| 25058 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25059 | "Failed to alloc in WDI_Process8023MulticastListReq"); |
| 25060 | return WDI_STATUS_E_FAILURE; |
| 25061 | } |
| 25062 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25063 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25064 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25065 | -------------------------------------------------------------------------*/ |
| 25066 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25067 | ( NULL == (pwdiFltPktSetMcListReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25068 | (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25069 | ( NULL == (wdi8023MulticastListCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25070 | (WDI_8023MulticastListCb)pEventData->pCBfnc))) |
| 25071 | { |
| 25072 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25073 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25074 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25075 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25076 | return WDI_STATUS_E_FAILURE; |
| 25077 | } |
| 25078 | |
| 25079 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 25080 | pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId, |
| 25081 | &pBSSSes); |
| 25082 | if ( NULL == pBSSSes ) |
| 25083 | { |
| 25084 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25085 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25086 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25087 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25088 | } |
| 25089 | |
| 25090 | /*----------------------------------------------------------------------- |
| 25091 | Get message buffer |
| 25092 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25093 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 25094 | WDI_8023_MULTICAST_LIST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25095 | sizeof(tHalRcvFltMcAddrListType), |
| 25096 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25097 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType)))) |
| 25098 | { |
| 25099 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25100 | "Unable to get send buffer in " |
| 25101 | "WDI_Process8023MulticastListReq() %x %x %x", |
| 25102 | pEventData, pwdiFltPktSetMcListReqParamsType, |
| 25103 | wdi8023MulticastListCb); |
Yue Ma | 7062749 | 2013-03-28 11:33:46 -0700 | [diff] [blame] | 25104 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25105 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25106 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25107 | } |
| 25108 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25109 | pRcvFltMcAddrListType->cMulticastAddr = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25110 | pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25111 | for( i = 0; i < pRcvFltMcAddrListType->cMulticastAddr; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25112 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25113 | wpalMemoryCopy(pRcvFltMcAddrListType->multicastAddr[i], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25114 | pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i], |
| 25115 | sizeof(tSirMacAddr)); |
| 25116 | } |
| 25117 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25118 | pRcvFltMcAddrListType->bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25119 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25120 | pRcvFltMcAddrListType, |
| 25121 | sizeof(tHalRcvFltMcAddrListType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25122 | |
| 25123 | pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25124 | pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25125 | |
| 25126 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 25127 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25128 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25129 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25130 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25131 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25132 | wdi8023MulticastListCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25133 | WDI_8023_MULTICAST_LIST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25134 | } |
| 25135 | |
| 25136 | /** |
| 25137 | @brief Process Receive Filter Set Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25138 | |
| 25139 | @param pWDICtx: pointer to the WLAN DAL context |
| 25140 | pEventData: pointer to the event information structure |
| 25141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25142 | @see |
| 25143 | @return Result of the function call |
| 25144 | */ |
| 25145 | WDI_Status |
| 25146 | WDI_ProcessReceiveFilterSetFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25147 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25148 | WDI_ControlBlockType* pWDICtx, |
| 25149 | WDI_EventInfoType* pEventData |
| 25150 | ) |
| 25151 | { |
| 25152 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL; |
| 25153 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25154 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25155 | wpt_uint16 usDataOffset = 0; |
| 25156 | wpt_uint16 usSendSize = 0; |
| 25157 | wpt_uint32 usRcvPktFilterCfgSize; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25158 | tHalRcvPktFilterCfgType *pRcvPktFilterCfg = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25159 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25160 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 25161 | WDI_BSSSessionType* pBSSSes = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25162 | tHalSessionizedRcvPktFilterCfgType *pSessRcvPktFilterCfg = NULL; |
| 25163 | wpt_uint32 usSessRcvPktFilterCfgSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25164 | |
| 25165 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25166 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25167 | |
| 25168 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25169 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25170 | -------------------------------------------------------------------------*/ |
| 25171 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25172 | ( NULL == (pwdiSetRcvPktFilterReqInfo = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25173 | (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25174 | ( NULL == (wdiReceiveFilterSetFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25175 | (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc))) |
| 25176 | { |
| 25177 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25178 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25179 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25180 | return WDI_STATUS_E_FAILURE; |
| 25181 | } |
| 25182 | |
| 25183 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 25184 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId, |
| 25185 | &pBSSSes); |
| 25186 | if ( NULL == pBSSSes ) |
| 25187 | { |
| 25188 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25189 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25190 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25191 | } |
| 25192 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25193 | if( WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
| 25194 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25195 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25196 | usSessRcvPktFilterCfgSize = sizeof(tHalSessionizedRcvPktFilterCfgType) + |
| 25197 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 25198 | * sizeof(tHalSessionizedRcvPktFilterCfgType)); |
| 25199 | |
| 25200 | pSessRcvPktFilterCfg = (tHalSessionizedRcvPktFilterCfgType *)wpalMemoryAllocate( |
| 25201 | usSessRcvPktFilterCfgSize); |
| 25202 | |
| 25203 | if(NULL == pSessRcvPktFilterCfg) |
| 25204 | { |
| 25205 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25206 | "%s: Failed to allocate memory for " |
| 25207 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25208 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25209 | WDI_ASSERT(0); |
| 25210 | return WDI_STATUS_E_FAILURE; |
| 25211 | } |
| 25212 | |
| 25213 | wpalMemoryZero(pSessRcvPktFilterCfg, usSessRcvPktFilterCfgSize); |
| 25214 | |
| 25215 | /*----------------------------------------------------------------------- |
| 25216 | Get message buffer |
| 25217 | -----------------------------------------------------------------------*/ |
| 25218 | |
| 25219 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ, |
| 25220 | usSessRcvPktFilterCfgSize, |
| 25221 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25222 | ( usSendSize < (usDataOffset + usSessRcvPktFilterCfgSize))) |
| 25223 | { |
| 25224 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25225 | "Unable to get send buffer in " |
| 25226 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 25227 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 25228 | wdiReceiveFilterSetFilterCb); |
| 25229 | WDI_ASSERT(0); |
| 25230 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 25231 | return WDI_STATUS_E_FAILURE; |
| 25232 | } |
| 25233 | |
| 25234 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25235 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
| 25236 | usSendSize,pSessRcvPktFilterCfg); |
| 25237 | |
| 25238 | pSessRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 25239 | pSessRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 25240 | pSessRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 25241 | pSessRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
| 25242 | |
| 25243 | pSessRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx; |
| 25244 | |
| 25245 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25246 | "Out: FID %d FT %d",pSessRcvPktFilterCfg->filterId, |
| 25247 | pSessRcvPktFilterCfg->filterType); |
| 25248 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25249 | "NParams %d CT %d",pSessRcvPktFilterCfg->numParams, |
| 25250 | pSessRcvPktFilterCfg->coleasceTime); |
| 25251 | |
| 25252 | for ( i = 0; i < pSessRcvPktFilterCfg->numParams; i++ ) |
| 25253 | { |
| 25254 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 25255 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 25256 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 25257 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 25258 | pSessRcvPktFilterCfg->paramsData[i].dataOffset = |
| 25259 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 25260 | pSessRcvPktFilterCfg->paramsData[i].dataLength = |
| 25261 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
| 25262 | |
| 25263 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].compareData, |
| 25264 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 25265 | 8); |
| 25266 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].dataMask, |
| 25267 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 25268 | 8); |
| 25269 | |
| 25270 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25271 | "Out:Proto %d Comp Flag %d \n", |
| 25272 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer, |
| 25273 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 25274 | |
| 25275 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25276 | "Data Offset %d Data Len %d\n", |
| 25277 | pSessRcvPktFilterCfg->paramsData[i].dataOffset, |
| 25278 | pSessRcvPktFilterCfg->paramsData[i].dataLength); |
| 25279 | |
| 25280 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25281 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 25282 | pSessRcvPktFilterCfg->paramsData[i].compareData[0], |
| 25283 | pSessRcvPktFilterCfg->paramsData[i].compareData[1], |
| 25284 | pSessRcvPktFilterCfg->paramsData[i].compareData[2], |
| 25285 | pSessRcvPktFilterCfg->paramsData[i].compareData[3], |
| 25286 | pSessRcvPktFilterCfg->paramsData[i].compareData[4], |
| 25287 | pSessRcvPktFilterCfg->paramsData[i].compareData[5]); |
| 25288 | |
| 25289 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25290 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 25291 | pSessRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 25292 | pSessRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 25293 | pSessRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 25294 | pSessRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 25295 | pSessRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 25296 | pSessRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 25297 | } |
| 25298 | |
| 25299 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25300 | pSessRcvPktFilterCfg, |
| 25301 | usSessRcvPktFilterCfgSize); |
| 25302 | |
| 25303 | |
| 25304 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 25305 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
| 25306 | |
| 25307 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 25308 | |
| 25309 | } |
| 25310 | /*If SLM_SESSIONIZATION is not supported then do this */ |
| 25311 | else |
| 25312 | { |
| 25313 | usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) + |
| 25314 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 25315 | * sizeof(tHalRcvPktFilterParams)); |
| 25316 | |
| 25317 | pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25318 | usRcvPktFilterCfgSize); |
| 25319 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25320 | if(NULL == pRcvPktFilterCfg) |
| 25321 | { |
| 25322 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25323 | "%s: Failed to allocate memory for " |
| 25324 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25325 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25326 | WDI_ASSERT(0); |
| 25327 | return WDI_STATUS_E_FAILURE; |
| 25328 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25329 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25330 | wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25331 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25332 | /*----------------------------------------------------------------------- |
| 25333 | Get message buffer |
| 25334 | -----------------------------------------------------------------------*/ |
| 25335 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25336 | usRcvPktFilterCfgSize, |
| 25337 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25338 | ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize))) |
| 25339 | { |
| 25340 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25341 | "Unable to get send buffer in " |
| 25342 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 25343 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 25344 | wdiReceiveFilterSetFilterCb); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25345 | WDI_ASSERT(0); |
| 25346 | wpalMemoryFree(pRcvPktFilterCfg); |
| 25347 | return WDI_STATUS_E_FAILURE; |
| 25348 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25349 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25350 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25351 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25352 | usSendSize,usRcvPktFilterCfgSize); |
| 25353 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25354 | pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 25355 | pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 25356 | pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 25357 | pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25358 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25359 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25360 | "Out: FID %d FT %d",pRcvPktFilterCfg->filterId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25361 | pRcvPktFilterCfg->filterType); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25362 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25363 | "NParams %d CT %d",pRcvPktFilterCfg->numParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25364 | pRcvPktFilterCfg->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25365 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25366 | for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ ) |
| 25367 | { |
| 25368 | pRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 25369 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 25370 | pRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 25371 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 25372 | pRcvPktFilterCfg->paramsData[i].dataOffset = |
| 25373 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 25374 | pRcvPktFilterCfg->paramsData[i].dataLength = |
| 25375 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25376 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25377 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25378 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 25379 | 8); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25380 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25381 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 25382 | 8); |
| 25383 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25384 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25385 | "Out:Proto %d Comp Flag %d \n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25386 | pRcvPktFilterCfg->paramsData[i].protocolLayer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25387 | pRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 25388 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25389 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 25390 | "Data Offset %d Data Len %d\n", |
| 25391 | pRcvPktFilterCfg->paramsData[i].dataOffset, |
| 25392 | pRcvPktFilterCfg->paramsData[i].dataLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25393 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25394 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 25395 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 25396 | pRcvPktFilterCfg->paramsData[i].compareData[0], |
| 25397 | pRcvPktFilterCfg->paramsData[i].compareData[1], |
| 25398 | pRcvPktFilterCfg->paramsData[i].compareData[2], |
| 25399 | pRcvPktFilterCfg->paramsData[i].compareData[3], |
| 25400 | pRcvPktFilterCfg->paramsData[i].compareData[4], |
| 25401 | pRcvPktFilterCfg->paramsData[i].compareData[5]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25402 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25403 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25404 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 25405 | pRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 25406 | pRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 25407 | pRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 25408 | pRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 25409 | pRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 25410 | pRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 25411 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25412 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25413 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25414 | pRcvPktFilterCfg, |
| 25415 | usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25416 | |
| 25417 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25418 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 25419 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25420 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25421 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25422 | "%s",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25423 | wpalMemoryFree(pRcvPktFilterCfg); |
| 25424 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25425 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25426 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25427 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25428 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25429 | wdiReceiveFilterSetFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25430 | WDI_RECEIVE_FILTER_SET_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25431 | } |
| 25432 | |
| 25433 | /** |
| 25434 | @brief Process Packet Filter Match Count Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25435 | |
| 25436 | @param pWDICtx: pointer to the WLAN DAL context |
| 25437 | pEventData: pointer to the event information structure |
| 25438 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25439 | @see |
| 25440 | @return Result of the function call |
| 25441 | */ |
| 25442 | WDI_Status |
| 25443 | WDI_ProcessFilterMatchCountReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25444 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25445 | WDI_ControlBlockType* pWDICtx, |
| 25446 | WDI_EventInfoType* pEventData |
| 25447 | ) |
| 25448 | { |
| 25449 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType = |
| 25450 | NULL; |
| 25451 | WDI_FilterMatchCountCb wdiFilterMatchCountCb = |
| 25452 | NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25453 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25454 | wpt_uint16 usDataOffset = 0; |
| 25455 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25456 | tHalRcvFltPktMatchCntReqParams rcvFltPktMatchCntReqParam = {0}; |
| 25457 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 25458 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25459 | |
| 25460 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25461 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25462 | |
| 25463 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25464 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25465 | -------------------------------------------------------------------------*/ |
| 25466 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25467 | ( NULL == (pwdiRcvFltPktMatchCntReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25468 | (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25469 | ( NULL == (wdiFilterMatchCountCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25470 | (WDI_FilterMatchCountCb)pEventData->pCBfnc))) |
| 25471 | { |
| 25472 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25473 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25474 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25475 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25476 | } |
| 25477 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25478 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 25479 | pwdiRcvFltPktMatchCntReqParamsType->bssId, |
| 25480 | &pBSSSes); |
| 25481 | if ( NULL == pBSSSes ) |
| 25482 | { |
| 25483 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25484 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25485 | return WDI_STATUS_E_FAILURE; |
| 25486 | } |
| 25487 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25488 | /*----------------------------------------------------------------------- |
| 25489 | Get message buffer |
| 25490 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25491 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 25492 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25493 | sizeof(tHalRcvFltPktMatchCntReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25494 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25495 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktMatchCntReqParams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25496 | { |
| 25497 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25498 | "Unable to get send buffer in " |
| 25499 | "WDI_ProcessFilterMatchCountReq() %x %x %x", |
| 25500 | pEventData, pwdiRcvFltPktMatchCntReqParamsType, |
| 25501 | wdiFilterMatchCountCb); |
| 25502 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25503 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25504 | } |
| 25505 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25506 | rcvFltPktMatchCntReqParam.bssIdx = pBSSSes->ucBSSIdx; |
| 25507 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25508 | &rcvFltPktMatchCntReqParam, |
| 25509 | sizeof(rcvFltPktMatchCntReqParam)); |
| 25510 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25511 | // |
| 25512 | // Don't need to fill send buffer other than header |
| 25513 | // |
| 25514 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25515 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25516 | |
| 25517 | |
| 25518 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25519 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25520 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25521 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25522 | wdiFilterMatchCountCb, |
| 25523 | pEventData->pUserData, |
| 25524 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25525 | } |
| 25526 | |
| 25527 | /** |
| 25528 | @brief Process Receive Filter Clear Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25529 | |
| 25530 | @param pWDICtx: pointer to the WLAN DAL context |
| 25531 | pEventData: pointer to the event information structure |
| 25532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25533 | @see |
| 25534 | @return Result of the function call |
| 25535 | */ |
| 25536 | WDI_Status |
| 25537 | WDI_ProcessReceiveFilterClearFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25538 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25539 | WDI_ControlBlockType* pWDICtx, |
| 25540 | WDI_EventInfoType* pEventData |
| 25541 | ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25542 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25543 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL; |
| 25544 | WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25545 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25546 | wpt_uint16 usDataOffset = 0; |
| 25547 | wpt_uint16 usSendSize = 0; |
| 25548 | tHalRcvFltPktClearParam rcvFltPktClearParam; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25549 | wpt_uint8 ucCurrentSessionId = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25550 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25551 | |
| 25552 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25553 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25554 | |
| 25555 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25556 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25557 | -------------------------------------------------------------------------*/ |
| 25558 | if (( NULL == pEventData ) || |
| 25559 | ( NULL == (pwdiRcvFltPktClearReqParamsType = |
| 25560 | (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25561 | ( NULL == (wdiRcvFltPktClearFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25562 | (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc))) |
| 25563 | { |
| 25564 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25565 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25566 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25567 | return WDI_STATUS_E_FAILURE; |
| 25568 | } |
| 25569 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25570 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25571 | pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId, |
| 25572 | &pBSSSes); |
| 25573 | if ( NULL == pBSSSes ) |
| 25574 | { |
| 25575 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25576 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25577 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25578 | } |
| 25579 | |
| 25580 | /*----------------------------------------------------------------------- |
| 25581 | Get message buffer |
| 25582 | -----------------------------------------------------------------------*/ |
| 25583 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25584 | WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25585 | sizeof(tHalRcvFltPktClearParam), |
| 25586 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25587 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam)))) |
| 25588 | { |
| 25589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25590 | "Unable to get send buffer in " |
| 25591 | "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x", |
| 25592 | pEventData, pwdiRcvFltPktClearReqParamsType, |
| 25593 | wdiRcvFltPktClearFilterCb); |
| 25594 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25595 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25596 | } |
| 25597 | |
| 25598 | |
| 25599 | rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25600 | filterClearParam.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25601 | rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25602 | filterClearParam.filterId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25603 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25604 | rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx; |
| 25605 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25606 | &rcvFltPktClearParam, |
| 25607 | sizeof(rcvFltPktClearParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25608 | |
| 25609 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25610 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25611 | |
| 25612 | |
| 25613 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25614 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25615 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25616 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25617 | wdiRcvFltPktClearFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25618 | WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25619 | } |
| 25620 | |
| 25621 | /** |
| 25622 | @brief Process 8023 Multicast List Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25623 | |
| 25624 | @param pWDICtx: pointer to the WLAN DAL context |
| 25625 | pEventData: pointer to the event information structure |
| 25626 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25627 | @see |
| 25628 | @return Result of the function call |
| 25629 | */ |
| 25630 | WDI_Status |
| 25631 | WDI_Process8023MulticastListRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25632 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25633 | WDI_ControlBlockType* pWDICtx, |
| 25634 | WDI_EventInfoType* pEventData |
| 25635 | ) |
| 25636 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25637 | eHalStatus halStatus; |
| 25638 | WDI_8023MulticastListCb wdi8023MulticastListCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25639 | tHalRcvFltPktSetMcListRspType halRcvFltPktSetMcListRsp; |
| 25640 | WDI_RcvFltPktSetMcListRspParamsType wdiRcvFltPktSetMcListRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25641 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25642 | |
| 25643 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25644 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25645 | |
| 25646 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25647 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25648 | -------------------------------------------------------------------------*/ |
| 25649 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25650 | ( NULL == pEventData->pEventData )) |
| 25651 | { |
| 25652 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25653 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25654 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25655 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25656 | } |
| 25657 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25658 | wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25659 | |
| 25660 | /*------------------------------------------------------------------------- |
| 25661 | Extract response and send it to UMAC |
| 25662 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25663 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25664 | { |
| 25665 | wpalMemoryCopy( &halRcvFltPktSetMcListRsp, |
| 25666 | pEventData->pEventData, |
| 25667 | sizeof(halRcvFltPktSetMcListRsp)); |
| 25668 | |
| 25669 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = |
| 25670 | WDI_HAL_2_WDI_STATUS(halRcvFltPktSetMcListRsp.status); |
| 25671 | wdiRcvFltPktSetMcListRspInfo.bssIdx = |
| 25672 | halRcvFltPktSetMcListRsp.bssIdx; |
| 25673 | } |
| 25674 | else |
| 25675 | { |
| 25676 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25677 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25678 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25679 | |
| 25680 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25681 | wdi8023MulticastListCb(&wdiRcvFltPktSetMcListRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25682 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25683 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25684 | } |
| 25685 | |
| 25686 | /** |
| 25687 | @brief Process Set Rsp function (called when a |
| 25688 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25689 | |
| 25690 | @param pWDICtx: pointer to the WLAN DAL context |
| 25691 | pEventData: pointer to the event information structure |
| 25692 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25693 | @see |
| 25694 | @return Result of the function call |
| 25695 | */ |
| 25696 | WDI_Status |
| 25697 | WDI_ProcessReceiveFilterSetFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25698 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25699 | WDI_ControlBlockType* pWDICtx, |
| 25700 | WDI_EventInfoType* pEventData |
| 25701 | ) |
| 25702 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25703 | eHalStatus halStatus; |
| 25704 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25705 | tHalSetPktFilterRspParams halSetPktFilterRspParams; |
| 25706 | WDI_SetRcvPktFilterRspParamsType wdiSetRcvPktFilterRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25707 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25708 | |
| 25709 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25710 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25711 | |
| 25712 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25713 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25714 | -------------------------------------------------------------------------*/ |
| 25715 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25716 | ( NULL == pEventData->pEventData )) |
| 25717 | { |
| 25718 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25719 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25720 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25721 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25722 | } |
| 25723 | |
| 25724 | wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25725 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25726 | |
| 25727 | /*------------------------------------------------------------------------- |
| 25728 | Extract response and send it to UMAC |
| 25729 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25730 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25731 | { |
| 25732 | wpalMemoryCopy( &halSetPktFilterRspParams, |
| 25733 | pEventData->pEventData, |
| 25734 | sizeof(halSetPktFilterRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25735 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25736 | wdiSetRcvPktFilterRspInfo.bssIdx = halSetPktFilterRspParams.bssIdx; |
| 25737 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halSetPktFilterRspParams.status); |
| 25738 | } |
| 25739 | else |
| 25740 | { |
| 25741 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25742 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25743 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25744 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25745 | wdiReceiveFilterSetFilterCb(&wdiSetRcvPktFilterRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25746 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25747 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25748 | } |
| 25749 | |
| 25750 | /** |
| 25751 | @brief Process Packet Filter Match Count Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25752 | |
| 25753 | @param pWDICtx: pointer to the WLAN DAL context |
| 25754 | pEventData: pointer to the event information structure |
| 25755 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25756 | @see |
| 25757 | @return Result of the function call |
| 25758 | */ |
| 25759 | WDI_Status |
| 25760 | WDI_ProcessFilterMatchCountRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25761 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25762 | WDI_ControlBlockType* pWDICtx, |
| 25763 | WDI_EventInfoType* pEventData |
| 25764 | ) |
| 25765 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25766 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25767 | WDI_FilterMatchCountCb wdiFilterMatchCountCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25768 | tHalRcvFltPktMatchRspParams halRcvFltrPktMatachRsp; |
| 25769 | WDI_RcvFltPktMatchCntRspParamsType wdiRcvFltPktMatchRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25770 | |
| 25771 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25772 | |
| 25773 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25774 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25775 | |
| 25776 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25777 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25778 | -------------------------------------------------------------------------*/ |
| 25779 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25780 | ( NULL == pEventData->pEventData )) |
| 25781 | { |
| 25782 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25783 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25784 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25785 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25786 | } |
| 25787 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25788 | wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25789 | |
| 25790 | /*------------------------------------------------------------------------- |
| 25791 | Extract response and send it to UMAC |
| 25792 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25793 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25794 | { |
| 25795 | wpalMemoryCopy( &halRcvFltrPktMatachRsp, |
| 25796 | pEventData->pEventData, |
| 25797 | sizeof(halRcvFltrPktMatachRsp)); |
| 25798 | |
| 25799 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halRcvFltrPktMatachRsp.status); |
| 25800 | wdiRcvFltPktMatchRspParams.bssIdx = halRcvFltrPktMatachRsp.bssIdx; |
| 25801 | } |
| 25802 | else |
| 25803 | { |
| 25804 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25805 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25806 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25807 | |
| 25808 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25809 | wdiFilterMatchCountCb(&wdiRcvFltPktMatchRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25810 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25811 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25812 | } |
| 25813 | |
| 25814 | /** |
| 25815 | @brief Process Receive Filter Clear Filter Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25816 | |
| 25817 | @param pWDICtx: pointer to the WLAN DAL context |
| 25818 | pEventData: pointer to the event information structure |
| 25819 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25820 | @see |
| 25821 | @return Result of the function call |
| 25822 | */ |
| 25823 | WDI_Status |
| 25824 | WDI_ProcessReceiveFilterClearFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25825 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25826 | WDI_ControlBlockType* pWDICtx, |
| 25827 | WDI_EventInfoType* pEventData |
| 25828 | ) |
| 25829 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25830 | eHalStatus halStatus; |
| 25831 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25832 | tHalRcvFltPktClearParam halRcvFltPktClearRspMsg; |
| 25833 | WDI_RcvFltPktClearRspParamsType wdiRcvFltPktClearRspParamsType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25834 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25835 | |
| 25836 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25837 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25838 | |
| 25839 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25840 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25841 | -------------------------------------------------------------------------*/ |
| 25842 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25843 | ( NULL == pEventData->pEventData )) |
| 25844 | { |
| 25845 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25846 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25847 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25848 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25849 | } |
| 25850 | |
| 25851 | wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25852 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25853 | |
| 25854 | /*------------------------------------------------------------------------- |
| 25855 | Extract response and send it to UMAC |
| 25856 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25857 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25858 | { |
| 25859 | wpalMemoryCopy( &halRcvFltPktClearRspMsg, |
| 25860 | pEventData->pEventData, |
| 25861 | sizeof(halRcvFltPktClearRspMsg)); |
| 25862 | |
| 25863 | wdiRcvFltPktClearRspParamsType.wdiStatus = |
| 25864 | WDI_HAL_2_WDI_STATUS(halRcvFltPktClearRspMsg.status); |
| 25865 | wdiRcvFltPktClearRspParamsType.bssIdx = |
| 25866 | halRcvFltPktClearRspMsg.bssIdx; |
| 25867 | } |
| 25868 | else |
| 25869 | { |
| 25870 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25871 | wdiRcvFltPktClearRspParamsType.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25872 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25873 | |
| 25874 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25875 | wdiReceiveFilterClearFilterCb(&wdiRcvFltPktClearRspParamsType, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25876 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25877 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25878 | } |
| 25879 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 25880 | |
| 25881 | /** |
| 25882 | @brief Process Shutdown Rsp function |
| 25883 | There is no shutdown response comming from HAL |
| 25884 | - function just kept for simmetry |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25885 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25886 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25887 | pEventData: pointer to the event information structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25888 | |
| 25889 | @see |
| 25890 | @return Result of the function call |
| 25891 | */ |
| 25892 | WDI_Status |
| 25893 | WDI_ProcessShutdownRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25894 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25895 | WDI_ControlBlockType* pWDICtx, |
| 25896 | WDI_EventInfoType* pEventData |
| 25897 | ) |
| 25898 | { |
| 25899 | /*There is no shutdown response comming from HAL - function just kept for |
| 25900 | simmetry */ |
| 25901 | WDI_ASSERT(0); |
| 25902 | return WDI_STATUS_SUCCESS; |
| 25903 | }/*WDI_ProcessShutdownRsp*/ |
| 25904 | |
| 25905 | /** |
| 25906 | @brief WDI_SetPowerParamsReq |
| 25907 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25908 | @param pwdiPowerParamsReqParams: the Set Power Params as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25909 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25910 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25911 | wdiPowerParamsCb: callback for passing back the response |
| 25912 | of the Set Power Params operation received from the |
| 25913 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25915 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25916 | callback |
| 25917 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25918 | @return Result of the function call |
| 25919 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25920 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25921 | WDI_SetPowerParamsReq |
| 25922 | ( |
| 25923 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams, |
| 25924 | WDI_SetPowerParamsCb wdiPowerParamsCb, |
| 25925 | void* pUserData |
| 25926 | ) |
| 25927 | { |
| 25928 | WDI_EventInfoType wdiEventData; |
| 25929 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25930 | |
| 25931 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25932 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25933 | ------------------------------------------------------------------------*/ |
| 25934 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25935 | { |
| 25936 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25937 | "WDI API call before module is initialized - Fail request"); |
| 25938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25939 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25940 | } |
| 25941 | |
| 25942 | /*------------------------------------------------------------------------ |
| 25943 | Fill in Event data and post to the Main FSM |
| 25944 | ------------------------------------------------------------------------*/ |
| 25945 | wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25946 | wdiEventData.pEventData = pwdiPowerParamsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25947 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25948 | wdiEventData.pCBfnc = wdiPowerParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25949 | wdiEventData.pUserData = pUserData; |
| 25950 | |
| 25951 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25952 | }/*WDI_SetPowerParamsReq*/ |
| 25953 | |
| 25954 | /** |
| 25955 | @brief Process Set Power Params Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25956 | |
| 25957 | @param pWDICtx: pointer to the WLAN DAL context |
| 25958 | pEventData: pointer to the event information structure |
| 25959 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25960 | @see |
| 25961 | @return Result of the function call |
| 25962 | */ |
| 25963 | WDI_Status |
| 25964 | WDI_ProcessSetPowerParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25965 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25966 | WDI_ControlBlockType* pWDICtx, |
| 25967 | WDI_EventInfoType* pEventData |
| 25968 | ) |
| 25969 | { |
| 25970 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL; |
| 25971 | WDI_SetPowerParamsCb wdiPowerParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25972 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25973 | wpt_uint16 usDataOffset = 0; |
| 25974 | wpt_uint16 usSendSize = 0; |
| 25975 | tSetPowerParamsType powerParams; |
| 25976 | |
| 25977 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25978 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25979 | -------------------------------------------------------------------------*/ |
| 25980 | if (( NULL == pEventData ) || |
| 25981 | ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) || |
| 25982 | ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc))) |
| 25983 | { |
| 25984 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25985 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25986 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25987 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25988 | } |
| 25989 | |
| 25990 | /*----------------------------------------------------------------------- |
| 25991 | Get message buffer |
| 25992 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25993 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25994 | sizeof(powerParams), |
| 25995 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25996 | ( usSendSize < (usDataOffset + sizeof(powerParams) ))) |
| 25997 | { |
| 25998 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25999 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 26000 | pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb); |
| 26001 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26002 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26003 | } |
| 26004 | |
| 26005 | /* Ignore DTIM */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26006 | powerParams.uIgnoreDTIM = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26007 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM; |
| 26008 | |
| 26009 | /*DTIM Period*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26010 | powerParams.uDTIMPeriod = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26011 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod; |
| 26012 | |
| 26013 | /* Listen Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26014 | powerParams.uListenInterval= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26015 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval; |
| 26016 | |
| 26017 | /* Broadcast Multicas Filter */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26018 | powerParams.uBcastMcastFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26019 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter; |
| 26020 | |
| 26021 | /* Beacon Early Termination */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26022 | powerParams.uEnableBET = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26023 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET; |
| 26024 | |
| 26025 | /* Beacon Early Termination Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26026 | powerParams.uBETInterval = |
| 26027 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26028 | |
Yue Ma | 0da1949 | 2013-05-13 17:01:29 -0700 | [diff] [blame] | 26029 | /* MAX LI for modulated DTIM */ |
| 26030 | powerParams.uMaxLIModulatedDTIM = |
| 26031 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uMaxLIModulatedDTIM; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26032 | |
| 26033 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 26034 | &powerParams, |
| 26035 | sizeof(powerParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26036 | |
| 26037 | pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26038 | pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26039 | |
| 26040 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26041 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26042 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26043 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 26044 | wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26045 | } |
| 26046 | |
| 26047 | /** |
| 26048 | @brief Process Power Params Rsp function (called when a |
| 26049 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26050 | |
| 26051 | @param pWDICtx: pointer to the WLAN DAL context |
| 26052 | pEventData: pointer to the event information structure |
| 26053 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26054 | @see |
| 26055 | @return Result of the function call |
| 26056 | */ |
| 26057 | WDI_Status |
| 26058 | WDI_ProcessSetPowerParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26059 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26060 | WDI_ControlBlockType* pWDICtx, |
| 26061 | WDI_EventInfoType* pEventData |
| 26062 | ) |
| 26063 | { |
| 26064 | WDI_Status wdiStatus; |
| 26065 | eHalStatus halStatus; |
| 26066 | WDI_SetPowerParamsCb wdiPowerParamsCb; |
| 26067 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26068 | |
| 26069 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26070 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26071 | -------------------------------------------------------------------------*/ |
| 26072 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26073 | ( NULL == pEventData->pEventData )) |
| 26074 | { |
| 26075 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26076 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26077 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26078 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26079 | } |
| 26080 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26081 | wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26082 | |
| 26083 | /*------------------------------------------------------------------------- |
| 26084 | Extract response and send it to UMAC |
| 26085 | -------------------------------------------------------------------------*/ |
| 26086 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26087 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26088 | |
| 26089 | /*Notify UMAC*/ |
| 26090 | wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 26091 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26092 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26093 | }/*WDI_ProcessSetPowerParamsRsp*/ |
| 26094 | |
Sundaresan Ramachandran | 811a2f9 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 26095 | /** |
| 26096 | @brief WDI_dhcpStartInd |
| 26097 | Host will send an event to the FW when DHCP is initiated |
| 26098 | |
| 26099 | @param |
| 26100 | WDI_DHCPInd: DHCP Indication |
| 26101 | @see |
| 26102 | @return Result of the function call |
| 26103 | */ |
| 26104 | WDI_Status |
| 26105 | WDI_dhcpStartInd |
| 26106 | ( |
| 26107 | WDI_DHCPInd *wdiDHCPInd |
| 26108 | ) |
| 26109 | { |
| 26110 | WDI_EventInfoType wdiEventData; |
| 26111 | |
| 26112 | /*------------------------------------------------------------------------ |
| 26113 | Sanity Check |
| 26114 | ------------------------------------------------------------------------*/ |
| 26115 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 26116 | { |
| 26117 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26118 | "WDI API call before module is initialized - Fail request"); |
| 26119 | |
| 26120 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26121 | } |
| 26122 | |
| 26123 | wdiEventData.wdiRequest = WDI_DHCP_START_IND; |
| 26124 | wdiEventData.pEventData = wdiDHCPInd; |
| 26125 | wdiEventData.uEventDataSize = sizeof(wdiDHCPInd); |
| 26126 | wdiEventData.pCBfnc = NULL; |
| 26127 | wdiEventData.pUserData = NULL; |
| 26128 | |
| 26129 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 26130 | } |
| 26131 | |
| 26132 | |
| 26133 | /** |
| 26134 | @brief WDI_dhcpStopInd |
| 26135 | Host will send an event to the FW when DHCP is completed |
| 26136 | |
| 26137 | @param |
| 26138 | WDI_DHCPInd: DHCP Indication |
| 26139 | @see |
| 26140 | @return Result of the function call |
| 26141 | */ |
| 26142 | WDI_Status |
| 26143 | WDI_dhcpStopInd |
| 26144 | ( |
| 26145 | WDI_DHCPInd *wdiDHCPInd |
| 26146 | ) |
| 26147 | { |
| 26148 | WDI_EventInfoType wdiEventData; |
| 26149 | |
| 26150 | /*------------------------------------------------------------------------ |
| 26151 | Sanity Check |
| 26152 | ------------------------------------------------------------------------*/ |
| 26153 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 26154 | { |
| 26155 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26156 | "WDI API call before module is initialized - Fail request"); |
| 26157 | |
| 26158 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26159 | } |
| 26160 | |
| 26161 | wdiEventData.wdiRequest = WDI_DHCP_STOP_IND; |
| 26162 | wdiEventData.pEventData = wdiDHCPInd; |
| 26163 | wdiEventData.uEventDataSize = sizeof(wdiDHCPInd); |
| 26164 | wdiEventData.pCBfnc = NULL; |
| 26165 | wdiEventData.pUserData = NULL; |
| 26166 | |
| 26167 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 26168 | } |
| 26169 | |
| 26170 | |
| 26171 | /** |
| 26172 | @brief Process DHCP Start Indication message and post it to HAL |
| 26173 | |
| 26174 | @param pWDICtx: pointer to the WLAN DAL context |
| 26175 | pEventData: pointer to the event information structure |
| 26176 | |
| 26177 | @see |
| 26178 | @return Result of the function call |
| 26179 | */ |
| 26180 | WDI_Status |
| 26181 | WDI_ProcessDHCPStartInd |
| 26182 | ( |
| 26183 | WDI_ControlBlockType* pWDICtx, |
| 26184 | WDI_EventInfoType* pEventData |
| 26185 | ) |
| 26186 | { |
| 26187 | wpt_uint8* pSendBuffer = NULL; |
| 26188 | wpt_uint16 usDataOffset = 0; |
| 26189 | wpt_uint16 usSendSize = 0; |
| 26190 | wpt_uint16 usLen = 0; |
| 26191 | WDI_DHCPInd* pwdiDHCPInd = NULL; |
| 26192 | tDHCPInfo* pDHCPInfo; |
| 26193 | |
| 26194 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26195 | |
| 26196 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 26197 | "%s", __func__); |
| 26198 | |
| 26199 | /*------------------------------------------------------------------------- |
| 26200 | Sanity check |
| 26201 | -------------------------------------------------------------------------*/ |
| 26202 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 26203 | { |
| 26204 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 26205 | "%s: Invalid parameters", __func__); |
| 26206 | WDI_ASSERT(0); |
| 26207 | return WDI_STATUS_E_FAILURE; |
| 26208 | } |
| 26209 | pwdiDHCPInd = (WDI_DHCPInd*)pEventData->pEventData; |
| 26210 | /*----------------------------------------------------------------------- |
| 26211 | Get message buffer |
| 26212 | -----------------------------------------------------------------------*/ |
| 26213 | |
| 26214 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 26215 | WDI_DHCP_START_IND, |
| 26216 | sizeof(tDHCPInfo), |
| 26217 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 26218 | ( usSendSize < (usDataOffset + usLen ))) |
| 26219 | { |
| 26220 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 26221 | "Unable to get send buffer in DHCP Start req %p ", |
| 26222 | pEventData); |
| 26223 | WDI_ASSERT(0); |
| 26224 | return WDI_STATUS_E_FAILURE; |
| 26225 | } |
| 26226 | |
| 26227 | pDHCPInfo = (tDHCPInfo*)pSendBuffer+usDataOffset; |
| 26228 | pDHCPInfo->device_mode = pwdiDHCPInd->device_mode; |
| 26229 | wpalMemoryCopy(pDHCPInfo->macAddr, pwdiDHCPInd->macAddr, |
| 26230 | WDI_MAC_ADDR_LEN); |
| 26231 | |
| 26232 | pWDICtx->pReqStatusUserData = NULL; |
| 26233 | pWDICtx->pfncRspCB = NULL; |
| 26234 | |
| 26235 | /*------------------------------------------------------------------------- |
| 26236 | Send DHCP Start Indication to HAL |
| 26237 | -------------------------------------------------------------------------*/ |
| 26238 | return WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
| 26239 | |
| 26240 | }/*WDI_ProcessDHCPStartInd*/ |
| 26241 | |
| 26242 | /** |
| 26243 | @brief Process DHCP Stop indication message and post it to HAL |
| 26244 | |
| 26245 | @param pWDICtx: pointer to the WLAN DAL context |
| 26246 | pEventData: pointer to the event information structure |
| 26247 | |
| 26248 | @see |
| 26249 | @return Result of the function call |
| 26250 | */ |
| 26251 | WDI_Status |
| 26252 | WDI_ProcessDHCPStopInd |
| 26253 | ( |
| 26254 | WDI_ControlBlockType* pWDICtx, |
| 26255 | WDI_EventInfoType* pEventData |
| 26256 | ) |
| 26257 | { |
| 26258 | wpt_uint8* pSendBuffer = NULL; |
| 26259 | wpt_uint16 usDataOffset = 0; |
| 26260 | wpt_uint16 usSendSize = 0; |
| 26261 | wpt_uint16 usLen = 0; |
| 26262 | WDI_DHCPInd* pwdiDHCPInd = NULL; |
| 26263 | tDHCPInfo* pDHCPInfo; |
| 26264 | |
| 26265 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26266 | |
| 26267 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 26268 | "%s", __func__); |
| 26269 | |
| 26270 | /*------------------------------------------------------------------------- |
| 26271 | Sanity check |
| 26272 | -------------------------------------------------------------------------*/ |
| 26273 | |
| 26274 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 26275 | { |
| 26276 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 26277 | "%s: Invalid parameters", __func__); |
| 26278 | WDI_ASSERT(0); |
| 26279 | return WDI_STATUS_E_FAILURE; |
| 26280 | } |
| 26281 | pwdiDHCPInd = (WDI_DHCPInd*)pEventData->pEventData; |
| 26282 | /*----------------------------------------------------------------------- |
| 26283 | Get message buffer |
| 26284 | -----------------------------------------------------------------------*/ |
| 26285 | |
| 26286 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 26287 | WDI_DHCP_STOP_IND, |
| 26288 | sizeof(tDHCPInfo), |
| 26289 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 26290 | ( usSendSize < (usDataOffset + usLen ))) |
| 26291 | { |
| 26292 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 26293 | "Unable to get send buffer in DHCP Start req %p ", |
| 26294 | pEventData); |
| 26295 | WDI_ASSERT(0); |
| 26296 | return WDI_STATUS_E_FAILURE; |
| 26297 | } |
| 26298 | |
| 26299 | pDHCPInfo = (tDHCPInfo*)pSendBuffer+usDataOffset; |
| 26300 | pDHCPInfo->device_mode = pwdiDHCPInd->device_mode; |
| 26301 | wpalMemoryCopy(pDHCPInfo->macAddr, pwdiDHCPInd->macAddr, |
| 26302 | WDI_MAC_ADDR_LEN); |
| 26303 | |
| 26304 | pWDICtx->pReqStatusUserData = NULL; |
| 26305 | pWDICtx->pfncRspCB = NULL; |
| 26306 | /*------------------------------------------------------------------------- |
| 26307 | Send DHCP Stop indication to HAL |
| 26308 | -------------------------------------------------------------------------*/ |
| 26309 | return WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
| 26310 | |
| 26311 | }/*WDI_ProcessDHCPStopInd*/ |
| 26312 | |
| 26313 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26314 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 26315 | /** |
| 26316 | @brief WDI_GTKOffloadReq will be called when the upper MAC |
| 26317 | wants to set GTK Rekey Counter while in power save. Upon |
| 26318 | the call of this API the WLAN DAL will pack and send a |
| 26319 | HAL GTK offload request message to the lower RIVA |
| 26320 | sub-system if DAL is in state STARTED. |
| 26321 | |
| 26322 | In state BUSY this request will be queued. Request won't |
| 26323 | be allowed in any other state. |
| 26324 | |
| 26325 | WDI_PostAssocReq must have been called. |
| 26326 | |
| 26327 | @param pwdiGtkOffloadParams: the GTK offload as specified |
| 26328 | by the Device Interface |
| 26329 | |
| 26330 | wdiGtkOffloadCb: callback for passing back the response |
| 26331 | of the GTK offload operation received from the device |
| 26332 | |
| 26333 | pUserData: user data will be passed back with the |
| 26334 | callback |
| 26335 | |
| 26336 | @see WDI_PostAssocReq |
| 26337 | @return Result of the function call |
| 26338 | */ |
| 26339 | WDI_Status |
| 26340 | WDI_GTKOffloadReq |
| 26341 | ( |
| 26342 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg, |
| 26343 | WDI_GtkOffloadCb wdiGtkOffloadCb, |
| 26344 | void* pUserData |
| 26345 | ) |
| 26346 | { |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26347 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26348 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26349 | |
| 26350 | /*------------------------------------------------------------------------ |
| 26351 | Sanity Check |
| 26352 | ------------------------------------------------------------------------*/ |
| 26353 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 26354 | { |
| 26355 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26356 | "WDI API call before module is initialized - Fail request"); |
| 26357 | |
| 26358 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26359 | } |
| 26360 | |
| 26361 | /*------------------------------------------------------------------------ |
| 26362 | Fill in Event data and post to the Main FSM |
| 26363 | ------------------------------------------------------------------------*/ |
| 26364 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ; |
| 26365 | wdiEventData.pEventData = pwdiGtkOffloadReqMsg; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 26366 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26367 | wdiEventData.pCBfnc = wdiGtkOffloadCb; |
| 26368 | wdiEventData.pUserData = pUserData; |
| 26369 | |
| 26370 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 26371 | } |
| 26372 | |
| 26373 | |
| 26374 | /** |
| 26375 | @brief WDI_GTKOffloadGetInfoReq will be called when the upper |
| 26376 | MAC wants to get GTK Rekey Counter while in power save. |
| 26377 | Upon the call of this API the WLAN DAL will pack and |
| 26378 | send a HAL GTK offload request message to the lower RIVA |
| 26379 | sub-system if DAL is in state STARTED. |
| 26380 | |
| 26381 | In state BUSY this request will be queued. Request won't |
| 26382 | be allowed in any other state. |
| 26383 | |
| 26384 | WDI_PostAssocReq must have been called. |
| 26385 | |
| 26386 | @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload |
| 26387 | Information Message as specified by the |
| 26388 | Device Interface |
| 26389 | |
| 26390 | wdiGtkOffloadGetInfoCb: callback for passing back the |
| 26391 | response of the GTK offload operation received from the |
| 26392 | device |
| 26393 | |
| 26394 | pUserData: user data will be passed back with the |
| 26395 | callback |
| 26396 | |
| 26397 | @see WDI_PostAssocReq |
| 26398 | @return Result of the function call |
| 26399 | */ |
| 26400 | WDI_Status |
| 26401 | WDI_GTKOffloadGetInfoReq |
| 26402 | ( |
| 26403 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg, |
| 26404 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb, |
| 26405 | void* pUserData |
| 26406 | ) |
| 26407 | { |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26408 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26409 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26410 | |
| 26411 | /*------------------------------------------------------------------------ |
| 26412 | Sanity Check |
| 26413 | ------------------------------------------------------------------------*/ |
| 26414 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 26415 | { |
| 26416 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26417 | "WDI API call before module is initialized - Fail request"); |
| 26418 | |
| 26419 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26420 | } |
| 26421 | |
| 26422 | /*------------------------------------------------------------------------ |
| 26423 | Fill in Event data and post to the Main FSM |
| 26424 | ------------------------------------------------------------------------*/ |
| 26425 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ; |
| 26426 | wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg; |
| 26427 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg); |
| 26428 | wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb; |
| 26429 | wdiEventData.pUserData = pUserData; |
| 26430 | |
| 26431 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 26432 | } |
| 26433 | |
| 26434 | |
| 26435 | /** |
| 26436 | @brief Process set GTK Offload Request function |
| 26437 | |
| 26438 | @param pWDICtx: pointer to the WLAN DAL context |
| 26439 | pEventData: pointer to the event information structure |
| 26440 | |
| 26441 | @see |
| 26442 | @return Result of the function call |
| 26443 | */ |
| 26444 | WDI_Status |
| 26445 | WDI_ProcessGTKOffloadReq |
| 26446 | ( |
| 26447 | WDI_ControlBlockType* pWDICtx, |
| 26448 | WDI_EventInfoType* pEventData |
| 26449 | ) |
| 26450 | { |
| 26451 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL; |
| 26452 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
| 26453 | wpt_uint8* pSendBuffer = NULL; |
| 26454 | wpt_uint16 usDataOffset = 0; |
| 26455 | wpt_uint16 usSendSize = 0; |
| 26456 | tHalGtkOffloadReqParams gtkOffloadReqParams = {0}; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26457 | wpt_uint8 ucCurrentSessionId = 0; |
| 26458 | WDI_BSSSessionType* pBSSSes = NULL; |
| 26459 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26460 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26461 | |
| 26462 | /*------------------------------------------------------------------------- |
| 26463 | Sanity check |
| 26464 | -------------------------------------------------------------------------*/ |
| 26465 | if (( NULL == pEventData ) || |
| 26466 | ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) || |
| 26467 | ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc))) |
| 26468 | { |
| 26469 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26470 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26471 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26472 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26473 | } |
| 26474 | |
| 26475 | /*----------------------------------------------------------------------- |
| 26476 | Get message buffer |
| 26477 | -----------------------------------------------------------------------*/ |
| 26478 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ, |
| 26479 | sizeof(gtkOffloadReqParams), |
| 26480 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 26481 | ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) ))) |
| 26482 | { |
| 26483 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26484 | "Unable to get send buffer in GTK offload req %x %x %x", |
| 26485 | pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb); |
| 26486 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26487 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26488 | } |
| 26489 | |
| 26490 | // |
| 26491 | // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams |
| 26492 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26493 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 26494 | pwdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId, |
| 26495 | &pBSSSes); |
| 26496 | if ( NULL == pBSSSes ) |
| 26497 | { |
| 26498 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26499 | " %s : Association for this BSSID does not exist", __func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26500 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26501 | } |
| 26502 | |
| 26503 | gtkOffloadReqParams.bssIdx = pBSSSes->ucBSSIdx; |
| 26504 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26505 | gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags; |
| 26506 | // Copy KCK |
| 26507 | wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16); |
| 26508 | // Copy KEK |
| 26509 | wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16); |
| 26510 | // Copy KeyReplayCounter |
| 26511 | wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t)); |
| 26512 | |
| 26513 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 26514 | >kOffloadReqParams, |
| 26515 | sizeof(gtkOffloadReqParams)); |
| 26516 | |
| 26517 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB; |
| 26518 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData; |
| 26519 | |
| 26520 | /*------------------------------------------------------------------------- |
| 26521 | Send Get STA Request to HAL |
| 26522 | -------------------------------------------------------------------------*/ |
| 26523 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 26524 | wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26525 | |
| 26526 | fail: |
| 26527 | // Release the message buffer so we don't leak |
| 26528 | wpalMemoryFree(pSendBuffer); |
| 26529 | |
| 26530 | failRequest: |
| 26531 | //WDA should have failure check to avoid the memory leak |
| 26532 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26533 | } |
| 26534 | |
| 26535 | |
| 26536 | /** |
| 26537 | @brief Process GTK Offload Get Information Request function |
| 26538 | |
| 26539 | @param pWDICtx: pointer to the WLAN DAL context |
| 26540 | pEventData: pointer to the event information structure |
| 26541 | |
| 26542 | @see |
| 26543 | @return Result of the function call |
| 26544 | */ |
| 26545 | WDI_Status |
| 26546 | WDI_ProcessGTKOffloadGetInfoReq |
| 26547 | ( |
| 26548 | WDI_ControlBlockType* pWDICtx, |
| 26549 | WDI_EventInfoType* pEventData |
| 26550 | ) |
| 26551 | { |
| 26552 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL; |
| 26553 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
| 26554 | wpt_uint8* pSendBuffer = NULL; |
| 26555 | wpt_uint16 usDataOffset = 0; |
| 26556 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26557 | tHalGtkOffloadGetInfoReqParams halGtkOffloadGetInfoReqParams; |
| 26558 | wpt_uint8 ucCurrentSessionId = 0; |
| 26559 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26560 | |
| 26561 | /*------------------------------------------------------------------------- |
| 26562 | Sanity check |
| 26563 | -------------------------------------------------------------------------*/ |
| 26564 | if (( NULL == pEventData ) || |
| 26565 | ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) || |
| 26566 | ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc))) |
| 26567 | { |
| 26568 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26569 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26570 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26571 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26572 | } |
| 26573 | |
| 26574 | /*----------------------------------------------------------------------- |
| 26575 | Get message buffer |
| 26576 | -----------------------------------------------------------------------*/ |
| 26577 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26578 | sizeof(halGtkOffloadGetInfoReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26579 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26580 | ( usSendSize < ( usDataOffset + sizeof(halGtkOffloadGetInfoReqParams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26581 | { |
| 26582 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26583 | "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x", |
| 26584 | pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb); |
| 26585 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26586 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26587 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26588 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 26589 | pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId, |
| 26590 | &pBSSSes); |
| 26591 | if ( NULL == pBSSSes ) |
| 26592 | { |
| 26593 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26594 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26595 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26596 | } |
| 26597 | halGtkOffloadGetInfoReqParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26598 | |
| 26599 | // |
| 26600 | // Don't need to fill send buffer other than header |
| 26601 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26602 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 26603 | &halGtkOffloadGetInfoReqParams, |
| 26604 | sizeof(halGtkOffloadGetInfoReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26605 | |
| 26606 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB; |
| 26607 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData; |
| 26608 | |
| 26609 | /*------------------------------------------------------------------------- |
| 26610 | Send Get STA Request to HAL |
| 26611 | -------------------------------------------------------------------------*/ |
| 26612 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 26613 | wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 26614 | fail: |
| 26615 | // Release the message buffer so we don't leak |
| 26616 | wpalMemoryFree(pSendBuffer); |
| 26617 | |
| 26618 | failRequest: |
| 26619 | //WDA should have failure check to avoid the memory leak |
| 26620 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26621 | } |
| 26622 | |
| 26623 | /** |
| 26624 | @brief Process host offload Rsp function (called when a |
| 26625 | response is being received over the bus from HAL) |
| 26626 | |
| 26627 | @param pWDICtx: pointer to the WLAN DAL context |
| 26628 | pEventData: pointer to the event information structure |
| 26629 | |
| 26630 | @see |
| 26631 | @return Result of the function call |
| 26632 | */ |
| 26633 | WDI_Status |
| 26634 | WDI_ProcessGtkOffloadRsp |
| 26635 | ( |
| 26636 | WDI_ControlBlockType* pWDICtx, |
| 26637 | WDI_EventInfoType* pEventData |
| 26638 | ) |
| 26639 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26640 | eHalStatus halStatus; |
| 26641 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26642 | tHalGtkOffloadRspParams halGtkOffloadRspParams; |
| 26643 | WDI_GtkOffloadRspParams wdiGtkOffloadRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26644 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26645 | |
| 26646 | wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB; |
| 26647 | |
| 26648 | /*------------------------------------------------------------------------- |
| 26649 | Sanity check |
| 26650 | -------------------------------------------------------------------------*/ |
| 26651 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26652 | ( NULL == pEventData->pEventData)) |
| 26653 | { |
| 26654 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26655 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26656 | WDI_ASSERT(0); |
| 26657 | return WDI_STATUS_E_FAILURE; |
| 26658 | } |
| 26659 | |
| 26660 | /*------------------------------------------------------------------------- |
| 26661 | Extract response and send it to UMAC |
| 26662 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26663 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 26664 | { |
| 26665 | wpalMemoryCopy( &halGtkOffloadRspParams, |
| 26666 | pEventData->pEventData, |
| 26667 | sizeof(halGtkOffloadRspParams)); |
| 26668 | |
| 26669 | wdiGtkOffloadRsparams.ulStatus = |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26670 | WDI_HAL_2_WDI_STATUS(halGtkOffloadRspParams.ulStatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26671 | wdiGtkOffloadRsparams.bssIdx = |
| 26672 | halGtkOffloadRspParams.bssIdx; |
| 26673 | } |
| 26674 | else |
| 26675 | { |
| 26676 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 26677 | wdiGtkOffloadRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 26678 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26679 | |
| 26680 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26681 | wdiGtkOffloadCb( &wdiGtkOffloadRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26682 | |
| 26683 | return WDI_STATUS_SUCCESS; |
| 26684 | } |
| 26685 | |
| 26686 | /** |
| 26687 | @brief Process GTK Offload Get Information Response function |
| 26688 | |
| 26689 | @param pWDICtx: pointer to the WLAN DAL context |
| 26690 | pEventData: pointer to the event information structure |
| 26691 | |
| 26692 | @see |
| 26693 | @return Result of the function call |
| 26694 | */ |
| 26695 | WDI_Status |
| 26696 | WDI_ProcessGTKOffloadGetInfoRsp |
| 26697 | ( |
| 26698 | WDI_ControlBlockType* pWDICtx, |
| 26699 | WDI_EventInfoType* pEventData |
| 26700 | ) |
| 26701 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26702 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26703 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26704 | tHalGtkOffloadGetInfoRspParams halGtkOffloadGetInfoRspParams; |
| 26705 | WDI_GtkOffloadGetInfoRspParams wdiGtkOffloadGetInfoRsparams; |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26706 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26707 | |
| 26708 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26709 | |
| 26710 | wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB; |
| 26711 | |
| 26712 | /*------------------------------------------------------------------------- |
| 26713 | Sanity check |
| 26714 | -------------------------------------------------------------------------*/ |
| 26715 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26716 | ( NULL == pEventData->pEventData )) |
| 26717 | { |
| 26718 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26719 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26720 | WDI_ASSERT(0); |
| 26721 | return WDI_STATUS_E_FAILURE; |
| 26722 | } |
| 26723 | |
| 26724 | /*------------------------------------------------------------------------- |
| 26725 | Extract response and send it to UMAC |
| 26726 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26727 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 26728 | { |
| 26729 | wpalMemoryCopy( &halGtkOffloadGetInfoRspParams, |
| 26730 | pEventData->pEventData, |
| 26731 | sizeof(halGtkOffloadGetInfoRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26732 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26733 | wdiGtkOffloadGetInfoRsparams.ulStatus = |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26734 | WDI_HAL_2_WDI_STATUS(halGtkOffloadGetInfoRspParams.ulStatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26735 | wdiGtkOffloadGetInfoRsparams.ullKeyReplayCounter = |
| 26736 | halGtkOffloadGetInfoRspParams.ullKeyReplayCounter; |
| 26737 | wdiGtkOffloadGetInfoRsparams.ulTotalRekeyCount = |
| 26738 | halGtkOffloadGetInfoRspParams.ulTotalRekeyCount; |
| 26739 | wdiGtkOffloadGetInfoRsparams.ulGTKRekeyCount = |
| 26740 | halGtkOffloadGetInfoRspParams.ulGTKRekeyCount; |
| 26741 | wdiGtkOffloadGetInfoRsparams.ulIGTKRekeyCount = |
| 26742 | halGtkOffloadGetInfoRspParams.ulIGTKRekeyCount; |
Gopichand Nakkala | 11cc1a9 | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 26743 | |
| 26744 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 26745 | WDI_FindAssocSessionByBSSIdx(pWDICtx, halGtkOffloadGetInfoRspParams.bssIdx, |
| 26746 | &pBSSSes); |
| 26747 | |
| 26748 | if ( NULL == pBSSSes ) |
| 26749 | { |
| 26750 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26751 | "Association sequence for this BSS does not exist or " |
| 26752 | "association no longer in progress - mysterious HAL response"); |
| 26753 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 26754 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26755 | } |
| 26756 | |
| 26757 | wpalMemoryCopy(wdiGtkOffloadGetInfoRsparams.bssId, pBSSSes->macBSSID, |
| 26758 | sizeof (wpt_macAddr)); |
| 26759 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26760 | } |
| 26761 | else |
| 26762 | { |
| 26763 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 26764 | wdiGtkOffloadGetInfoRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 26765 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26766 | /*Notify UMAC*/ |
| 26767 | //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 26768 | //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 26769 | wdiGtkOffloadGetInfoCb(&wdiGtkOffloadGetInfoRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26770 | |
| 26771 | return WDI_STATUS_SUCCESS; |
| 26772 | } |
| 26773 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 26774 | |
| 26775 | #ifdef WLAN_WAKEUP_EVENTS |
| 26776 | WDI_Status |
| 26777 | WDI_ProcessWakeReasonInd |
| 26778 | ( |
| 26779 | WDI_ControlBlockType* pWDICtx, |
| 26780 | WDI_EventInfoType* pEventData |
| 26781 | ) |
| 26782 | { |
| 26783 | WDI_LowLevelIndType *pWdiInd; |
| 26784 | tpWakeReasonParams pWakeReasonParams; |
| 26785 | wpt_uint32 allocSize = 0; |
| 26786 | |
| 26787 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26788 | "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26789 | |
| 26790 | /*------------------------------------------------------------------------- |
| 26791 | Sanity check |
| 26792 | -------------------------------------------------------------------------*/ |
| 26793 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26794 | ( NULL == pEventData->pEventData )) |
| 26795 | { |
| 26796 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26797 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26798 | WDI_ASSERT( 0 ); |
| 26799 | return WDI_STATUS_E_FAILURE; |
| 26800 | } |
| 26801 | |
| 26802 | /*------------------------------------------------------------------------- |
| 26803 | Extract indication and send it to UMAC |
| 26804 | -------------------------------------------------------------------------*/ |
| 26805 | pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData); |
| 26806 | |
| 26807 | allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1); |
| 26808 | |
| 26809 | //Allocate memory for WDI_WakeReasonIndType structure |
| 26810 | pWdiInd = wpalMemoryAllocate(allocSize) ; |
| 26811 | |
| 26812 | if(NULL == pWdiInd) |
| 26813 | { |
| 26814 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26815 | "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26816 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26817 | WDI_ASSERT(0); |
| 26818 | return WDI_STATUS_E_FAILURE; |
| 26819 | } |
| 26820 | |
| 26821 | wpalMemoryZero(pWdiInd, allocSize); |
| 26822 | |
| 26823 | /* Fill in the indication parameters*/ |
| 26824 | // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams |
| 26825 | pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND; |
| 26826 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason; |
| 26827 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg; |
| 26828 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen; |
| 26829 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen; |
| 26830 | wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]), |
| 26831 | &(pWakeReasonParams->aDataStart[0]), |
| 26832 | pWakeReasonParams->ulStoredDataLen); |
| 26833 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 26834 | |
| 26835 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 26836 | { |
| 26837 | /*Notify UMAC*/ |
| 26838 | pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData ); |
| 26839 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26840 | |
| 26841 | //Free memory allocated for WDI_WakeReasonIndType structure |
| 26842 | wpalMemoryFree(pWdiInd); |
| 26843 | |
| 26844 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26845 | "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26846 | |
| 26847 | return WDI_STATUS_SUCCESS; |
| 26848 | } |
| 26849 | #endif // WLAN_WAKEUP_EVENTS |
| 26850 | |
| 26851 | void WDI_GetWcnssCompiledApiVersion |
| 26852 | ( |
| 26853 | WDI_WlanVersionType *pWcnssApiVersion |
| 26854 | ) |
| 26855 | { |
| 26856 | pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR; |
| 26857 | pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR; |
| 26858 | pWcnssApiVersion->version = WLAN_HAL_VER_VERSION; |
| 26859 | pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION; |
| 26860 | } |
| 26861 | |
| 26862 | /** |
| 26863 | @brief Process Set TM Level Rsp function (called when a |
| 26864 | response is being received over the bus from HAL) |
| 26865 | |
| 26866 | @param pWDICtx: pointer to the WLAN DAL context |
| 26867 | pEventData: pointer to the event information structure |
| 26868 | |
| 26869 | @see |
| 26870 | @return Result of the function call |
| 26871 | */ |
| 26872 | WDI_Status |
| 26873 | WDI_ProcessSetTmLevelRsp |
| 26874 | ( |
| 26875 | WDI_ControlBlockType* pWDICtx, |
| 26876 | WDI_EventInfoType* pEventData |
| 26877 | ) |
| 26878 | { |
| 26879 | WDI_Status wdiStatus; |
| 26880 | eHalStatus halStatus; |
| 26881 | WDI_SetTmLevelCb wdiSetTmLevelCb; |
| 26882 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26883 | |
| 26884 | /*------------------------------------------------------------------------- |
| 26885 | Sanity check |
| 26886 | -------------------------------------------------------------------------*/ |
| 26887 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26888 | ( NULL == pEventData->pEventData )) |
| 26889 | { |
| 26890 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26891 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26892 | WDI_ASSERT(0); |
| 26893 | return WDI_STATUS_E_FAILURE; |
| 26894 | } |
| 26895 | |
| 26896 | wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
| 26897 | |
| 26898 | /*------------------------------------------------------------------------- |
| 26899 | Extract response and send it to UMAC |
| 26900 | -------------------------------------------------------------------------*/ |
| 26901 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 26902 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 26903 | |
| 26904 | /*Notify UMAC*/ |
| 26905 | wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 26906 | |
| 26907 | return WDI_STATUS_SUCCESS; |
| 26908 | }/*WDI_ProcessSetTmLevelRsp*/ |
| 26909 | |
| 26910 | /** |
| 26911 | @brief Process Set Thermal Mitigation level Changed request |
| 26912 | |
| 26913 | @param pWDICtx: pointer to the WLAN DAL context |
| 26914 | pEventData: pointer to the event information structure |
| 26915 | |
| 26916 | @see |
| 26917 | @return Result of the function call |
| 26918 | */ |
| 26919 | WDI_Status |
| 26920 | WDI_ProcessSetTmLevelReq |
| 26921 | ( |
| 26922 | WDI_ControlBlockType* pWDICtx, |
| 26923 | WDI_EventInfoType* pEventData |
| 26924 | ) |
| 26925 | { |
| 26926 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL; |
| 26927 | WDI_SetTmLevelCb wdiSetTmLevelCb = NULL; |
| 26928 | wpt_uint8* pSendBuffer = NULL; |
| 26929 | wpt_uint16 usDataOffset = 0; |
| 26930 | wpt_uint16 usSendSize = 0; |
| 26931 | tSetThermalMitgationType halTmMsg; |
| 26932 | |
| 26933 | /*------------------------------------------------------------------------- |
| 26934 | Sanity check |
| 26935 | -------------------------------------------------------------------------*/ |
| 26936 | if (( NULL == pEventData ) || |
| 26937 | ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) || |
| 26938 | ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc))) |
| 26939 | { |
| 26940 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26941 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26942 | WDI_ASSERT(0); |
| 26943 | return WDI_STATUS_E_FAILURE; |
| 26944 | } |
| 26945 | |
| 26946 | /*----------------------------------------------------------------------- |
| 26947 | Get message buffer |
| 26948 | -----------------------------------------------------------------------*/ |
| 26949 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ, |
| 26950 | sizeof(halTmMsg), |
| 26951 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 26952 | ( usSendSize < (usDataOffset + sizeof(halTmMsg) ))) |
| 26953 | { |
| 26954 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26955 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 26956 | pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb); |
| 26957 | WDI_ASSERT(0); |
| 26958 | return WDI_STATUS_E_FAILURE; |
| 26959 | } |
| 26960 | |
| 26961 | halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode; |
| 26962 | halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel; |
| 26963 | |
| 26964 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 26965 | &halTmMsg, |
| 26966 | sizeof(halTmMsg)); |
| 26967 | |
| 26968 | pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData; |
| 26969 | pWDICtx->pfncRspCB = NULL; |
| 26970 | /*------------------------------------------------------------------------- |
| 26971 | Send Get STA Request to HAL |
| 26972 | -------------------------------------------------------------------------*/ |
| 26973 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 26974 | wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP); |
| 26975 | } |
| 26976 | |
| 26977 | /* Fill the value from the global features enabled array to the global capabilities |
| 26978 | * bitmap struct |
| 26979 | */ |
| 26980 | static void |
| 26981 | FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len) |
| 26982 | { |
| 26983 | wpt_int8 i; |
| 26984 | for (i=0; i<len; i++) |
| 26985 | { |
| 26986 | setFeatCaps(fCaps, enabledFeat[i]); |
| 26987 | } |
| 26988 | } |
| 26989 | |
| 26990 | /** |
| 26991 | @brief WDI_featureCapsExchangeReq |
| 26992 | Post feature capability bitmap exchange event. |
| 26993 | Host will send its own capability to FW in this req and |
| 26994 | expect FW to send its capability back as a bitmap in Response |
| 26995 | |
| 26996 | @param |
| 26997 | |
| 26998 | wdiFeatureCapsExchangeCb: callback called on getting the response. |
| 26999 | It is kept to mantain similarity between WDI reqs and if needed, can |
| 27000 | be used in future. Currently, It is set to NULL |
| 27001 | |
| 27002 | pUserData: user data will be passed back with the |
| 27003 | callback |
| 27004 | |
| 27005 | @see |
| 27006 | @return Result of the function call |
| 27007 | */ |
| 27008 | WDI_Status |
| 27009 | WDI_featureCapsExchangeReq |
| 27010 | ( |
| 27011 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb, |
| 27012 | void* pUserData |
| 27013 | ) |
| 27014 | { |
| 27015 | WDI_EventInfoType wdiEventData; |
| 27016 | wpt_int32 fCapsStructSize; |
| 27017 | |
| 27018 | /*------------------------------------------------------------------------ |
| 27019 | Sanity Check |
| 27020 | ------------------------------------------------------------------------*/ |
| 27021 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 27022 | { |
| 27023 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 27024 | "WDI API call before module is initialized - Fail request"); |
| 27025 | |
| 27026 | return WDI_STATUS_E_NOT_ALLOWED; |
| 27027 | } |
| 27028 | |
| 27029 | /* Allocate memory separately for global variable carrying FW caps */ |
| 27030 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 27031 | gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 27032 | if ( NULL == gpHostWlanFeatCaps ) |
| 27033 | { |
| 27034 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 27035 | "Cannot allocate memory for host capability info\n"); |
| 27036 | WDI_ASSERT(0); |
| 27037 | return WDI_STATUS_MEM_FAILURE; |
| 27038 | } |
| 27039 | |
| 27040 | wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize); |
| 27041 | |
| 27042 | /*------------------------------------------------------------------------ |
| 27043 | Fill in Event data and post to the Main FSM |
| 27044 | ------------------------------------------------------------------------*/ |
| 27045 | FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures, |
| 27046 | (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0]))); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 27047 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 27048 | "Host caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27049 | gpHostWlanFeatCaps->featCaps[0], |
| 27050 | gpHostWlanFeatCaps->featCaps[1], |
| 27051 | gpHostWlanFeatCaps->featCaps[2], |
| 27052 | gpHostWlanFeatCaps->featCaps[3] |
| 27053 | ); |
| 27054 | |
| 27055 | wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ; |
| 27056 | wdiEventData.pEventData = gpHostWlanFeatCaps; |
| 27057 | wdiEventData.uEventDataSize = fCapsStructSize; |
| 27058 | wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb; |
| 27059 | wdiEventData.pUserData = pUserData; |
| 27060 | |
| 27061 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 27062 | } |
| 27063 | |
| 27064 | /** |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 27065 | @brief Disable Active mode offload in Host |
| 27066 | |
| 27067 | @param void |
| 27068 | @see |
| 27069 | @return void |
| 27070 | */ |
| 27071 | void |
| 27072 | WDI_disableCapablityFeature(wpt_uint8 feature_index) |
| 27073 | { |
| 27074 | supportEnabledFeatures[feature_index] = 0; |
| 27075 | return; |
| 27076 | } |
| 27077 | |
| 27078 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27079 | @brief Process Host-FW Capability Exchange Request function |
| 27080 | |
| 27081 | @param pWDICtx: pointer to the WLAN DAL context |
| 27082 | pEventData: pointer to the event information structure |
| 27083 | |
| 27084 | @see |
| 27085 | @return Result of the function call |
| 27086 | */ |
| 27087 | WDI_Status |
| 27088 | WDI_ProcessFeatureCapsExchangeReq |
| 27089 | ( |
| 27090 | WDI_ControlBlockType* pWDICtx, |
| 27091 | WDI_EventInfoType* pEventData |
| 27092 | ) |
| 27093 | { |
| 27094 | wpt_uint8* pSendBuffer = NULL; |
| 27095 | wpt_uint16 usDataOffset = 0; |
| 27096 | wpt_uint16 usSendSize = 0; |
| 27097 | wpt_uint16 usLen = 0; |
| 27098 | |
| 27099 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 27100 | |
| 27101 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27102 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27103 | |
| 27104 | /*------------------------------------------------------------------------- |
| 27105 | Sanity check |
| 27106 | -------------------------------------------------------------------------*/ |
| 27107 | /* Call back function is NULL since not required for cap exchange req */ |
| 27108 | if (( NULL == pEventData ) || |
| 27109 | ( NULL == (tWlanFeatCaps *)pEventData->pEventData)) |
| 27110 | { |
| 27111 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27112 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27113 | WDI_ASSERT(0); |
| 27114 | return WDI_STATUS_E_FAILURE; |
| 27115 | } |
| 27116 | |
| 27117 | /*----------------------------------------------------------------------- |
| 27118 | Get message buffer |
| 27119 | -----------------------------------------------------------------------*/ |
| 27120 | usLen = sizeof(tWlanFeatCaps); |
| 27121 | |
| 27122 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 27123 | WDI_FEATURE_CAPS_EXCHANGE_REQ, |
| 27124 | usLen, |
| 27125 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 27126 | ( usSendSize < (usDataOffset + usLen ))) |
| 27127 | { |
| 27128 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 27129 | "Unable to get send buffer in feat caps exchange req %x %x", |
| 27130 | pEventData, (tWlanFeatCaps *)pEventData->pEventData); |
| 27131 | WDI_ASSERT(0); |
| 27132 | return WDI_STATUS_E_FAILURE; |
| 27133 | } |
| 27134 | |
| 27135 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 27136 | "Host Caps - %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27137 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0], |
| 27138 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1], |
| 27139 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2], |
| 27140 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3] |
| 27141 | ); |
| 27142 | |
| 27143 | /* Copy host caps after the offset in the send buffer */ |
| 27144 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 27145 | (tWlanFeatCaps *)pEventData->pEventData, |
| 27146 | usLen); |
| 27147 | |
| 27148 | /*------------------------------------------------------------------------- |
| 27149 | Send Start Request to HAL |
| 27150 | -------------------------------------------------------------------------*/ |
| 27151 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 27152 | (WDI_StartRspCb)pEventData->pCBfnc, |
| 27153 | pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP); |
| 27154 | |
| 27155 | }/*WDI_ProcessFeatureCapsExchangeReq*/ |
| 27156 | |
| 27157 | /** |
| 27158 | @brief Process Host-FW Capability Exchange Response function |
| 27159 | |
| 27160 | @param pWDICtx: pointer to the WLAN DAL context |
| 27161 | pEventData: pointer to the event information structure |
| 27162 | |
| 27163 | @see |
| 27164 | @return Result of the function call |
| 27165 | */ |
| 27166 | WDI_Status |
| 27167 | WDI_ProcessFeatureCapsExchangeRsp |
| 27168 | ( |
| 27169 | WDI_ControlBlockType* pWDICtx, |
| 27170 | WDI_EventInfoType* pEventData |
| 27171 | ) |
| 27172 | { |
| 27173 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb; |
| 27174 | wpt_int32 fCapsStructSize; |
| 27175 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 27176 | |
| 27177 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27178 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27179 | |
| 27180 | /*------------------------------------------------------------------------- |
| 27181 | Sanity check |
| 27182 | -------------------------------------------------------------------------*/ |
| 27183 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 27184 | ( NULL == pEventData->pEventData )) |
| 27185 | { |
| 27186 | /* It will go here when riva is old (doesn't understand this msg) and host is new */ |
| 27187 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27188 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27189 | WDI_ASSERT(0); |
| 27190 | return WDI_STATUS_E_FAILURE; |
| 27191 | } |
| 27192 | |
| 27193 | /* Allocate memory separately for global variable carrying FW caps */ |
| 27194 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 27195 | gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 27196 | if ( NULL == gpFwWlanFeatCaps ) |
| 27197 | { |
| 27198 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 27199 | "Cannot allocate memory for host capability info\n"); |
| 27200 | WDI_ASSERT(0); |
| 27201 | return WDI_STATUS_MEM_FAILURE; |
| 27202 | } |
| 27203 | |
| 27204 | /*------------------------------------------------------------------------- |
| 27205 | Unpack HAL Response Message - the header was already extracted by the |
| 27206 | main Response Handling procedure |
| 27207 | -------------------------------------------------------------------------*/ |
| 27208 | /*------------------------------------------------------------------------- |
| 27209 | Extract response and send it to UMAC |
| 27210 | -------------------------------------------------------------------------*/ |
| 27211 | |
| 27212 | wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData, |
| 27213 | fCapsStructSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 27214 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 27215 | "FW caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27216 | gpFwWlanFeatCaps->featCaps[0], |
| 27217 | gpFwWlanFeatCaps->featCaps[1], |
| 27218 | gpFwWlanFeatCaps->featCaps[2], |
| 27219 | gpFwWlanFeatCaps->featCaps[3] |
| 27220 | ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27221 | wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB; |
| 27222 | |
| 27223 | /*Notify UMAC - there is no callback right now but can be used in future if reqd */ |
| 27224 | if (wdiFeatureCapsExchangeCb != NULL) |
| 27225 | wdiFeatureCapsExchangeCb(NULL, NULL); |
| 27226 | |
| 27227 | return WDI_STATUS_SUCCESS; |
| 27228 | } |
| 27229 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 27230 | #ifdef WLAN_FEATURE_11AC |
| 27231 | WDI_Status |
| 27232 | WDI_ProcessUpdateVHTOpModeRsp |
| 27233 | ( |
| 27234 | WDI_ControlBlockType* pWDICtx, |
| 27235 | WDI_EventInfoType* pEventData |
| 27236 | ) |
| 27237 | { |
| 27238 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 27239 | WDI_Status wdiStatus; |
| 27240 | eHalStatus halStatus; |
| 27241 | |
| 27242 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 27243 | |
| 27244 | /*------------------------------------------------------------------------- |
| 27245 | Sanity check |
| 27246 | -------------------------------------------------------------------------*/ |
| 27247 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 27248 | ( NULL == pEventData->pEventData)) |
| 27249 | { |
| 27250 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27251 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 27252 | WDI_ASSERT(0); |
| 27253 | return WDI_STATUS_E_FAILURE; |
| 27254 | } |
| 27255 | wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc; |
| 27256 | |
| 27257 | /*------------------------------------------------------------------------- |
| 27258 | Extract response and send it to UMAC |
| 27259 | -------------------------------------------------------------------------*/ |
| 27260 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 27261 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 27262 | |
| 27263 | /*Notify UMAC*/ |
| 27264 | wdiVHTOpModeCb( wdiStatus, pEventData->pUserData); |
| 27265 | |
| 27266 | return WDI_STATUS_SUCCESS; |
| 27267 | } |
| 27268 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27269 | /** |
| 27270 | @brief WDI_getHostWlanFeatCaps |
| 27271 | WDI API that returns whether the feature passed to it as enum value in |
| 27272 | "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global |
| 27273 | variable storing host capability bitmap to find this. This can be used by |
| 27274 | other moduels to decide certain things like call different APIs based on |
| 27275 | whether a particular feature is supported. |
| 27276 | |
| 27277 | @param |
| 27278 | |
| 27279 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h. |
| 27280 | |
| 27281 | @see |
| 27282 | @return |
| 27283 | 0 - if the feature is NOT supported in host |
| 27284 | any non-zero value - if the feature is SUPPORTED in host. |
| 27285 | */ |
| 27286 | wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 27287 | { |
| 27288 | wpt_uint8 featSupported = 0; |
| 27289 | if (gpHostWlanFeatCaps != NULL) |
| 27290 | { |
| 27291 | getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported); |
| 27292 | } |
| 27293 | else |
| 27294 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 27295 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 27296 | "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27297 | } |
| 27298 | return featSupported; |
| 27299 | } |
| 27300 | |
| 27301 | /** |
| 27302 | @brief WDI_getFwWlanFeatCaps |
| 27303 | WDI API that returns whether the feature passed to it as enum value in |
| 27304 | "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global |
| 27305 | variable storing host capability bitmap to find this. This can be used by |
| 27306 | other moduels to decide certain things like call different APIs based on |
| 27307 | whether a particular feature is supported. |
| 27308 | |
| 27309 | @param |
| 27310 | |
| 27311 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap |
| 27312 | in wlan_hal_msg.h. |
| 27313 | |
| 27314 | @see |
| 27315 | @return |
| 27316 | 0 - if the feature is NOT supported in FW |
| 27317 | any non-zero value - if the feature is SUPPORTED in FW. |
| 27318 | */ |
| 27319 | wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 27320 | { |
| 27321 | wpt_uint8 featSupported = 0; |
| 27322 | if (gpFwWlanFeatCaps != NULL) |
| 27323 | { |
| 27324 | getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported); |
| 27325 | } |
| 27326 | else |
| 27327 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 27328 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 27329 | "Caps exchange feature NOT supported. Return NOT SUPPORTED for %u feature", feat_enum_value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 27330 | } |
| 27331 | return featSupported; |
| 27332 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 27333 | |
| 27334 | #ifdef WLAN_FEATURE_11AC |
| 27335 | WDI_Status |
| 27336 | WDI_ProcessUpdateVHTOpModeReq |
| 27337 | ( |
| 27338 | WDI_ControlBlockType* pWDICtx, |
| 27339 | WDI_EventInfoType* pEventData |
| 27340 | ) |
| 27341 | { |
| 27342 | WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL; |
| 27343 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 27344 | wpt_uint8* pSendBuffer = NULL; |
| 27345 | wpt_uint16 usDataOffset = 0; |
| 27346 | wpt_uint16 usSendSize = 0; |
| 27347 | |
| 27348 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 27349 | |
| 27350 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27351 | "%s", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 27352 | |
| 27353 | /*------------------------------------------------------------------------- |
| 27354 | Sanity check |
| 27355 | -------------------------------------------------------------------------*/ |
| 27356 | if (( NULL == pEventData ) || |
| 27357 | ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) || |
| 27358 | ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc))) |
| 27359 | { |
| 27360 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27361 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 27362 | WDI_ASSERT(0); |
| 27363 | return WDI_STATUS_E_FAILURE; |
| 27364 | } |
| 27365 | |
| 27366 | /*----------------------------------------------------------------------- |
| 27367 | Get message buffer |
| 27368 | -----------------------------------------------------------------------*/ |
| 27369 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ, |
| 27370 | sizeof(WDI_UpdateVHTOpMode), |
| 27371 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 27372 | ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) ))) |
| 27373 | { |
| 27374 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 27375 | "Unable to get send buffer in update vht opMode req"); |
| 27376 | WDI_ASSERT(0); |
| 27377 | return WDI_STATUS_E_FAILURE; |
| 27378 | } |
| 27379 | |
| 27380 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 27381 | "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId); |
| 27382 | |
| 27383 | wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams, |
| 27384 | sizeof(WDI_UpdateVHTOpMode)); |
| 27385 | |
| 27386 | /*------------------------------------------------------------------------- |
| 27387 | Send Start Request to HAL |
| 27388 | -------------------------------------------------------------------------*/ |
| 27389 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 27390 | wdiVHTOpModeCb, |
| 27391 | pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP); |
| 27392 | |
| 27393 | } |
| 27394 | |
| 27395 | WDI_Status |
| 27396 | WDI_UpdateVHTOpModeReq |
| 27397 | ( |
| 27398 | WDI_UpdateVHTOpMode *pData, |
| 27399 | WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb, |
| 27400 | void* pUserData |
| 27401 | ) |
| 27402 | { |
| 27403 | WDI_EventInfoType wdiEventData; |
| 27404 | |
| 27405 | /*------------------------------------------------------------------------ |
| 27406 | Sanity Check |
| 27407 | ------------------------------------------------------------------------*/ |
| 27408 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 27409 | { |
| 27410 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 27411 | "WDI API call before module is initialized - Fail request"); |
| 27412 | |
| 27413 | return WDI_STATUS_E_NOT_ALLOWED; |
| 27414 | } |
| 27415 | |
| 27416 | /*------------------------------------------------------------------------ |
| 27417 | Fill in Event data and post to the Main FSM |
| 27418 | ------------------------------------------------------------------------*/ |
| 27419 | wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ; |
| 27420 | wdiEventData.pEventData = pData; |
| 27421 | wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode); |
| 27422 | wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb; |
| 27423 | wdiEventData.pUserData = pUserData; |
| 27424 | |
| 27425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 27426 | "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId); |
| 27427 | |
| 27428 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 27429 | |
| 27430 | } |
| 27431 | #endif |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 27432 | |
| 27433 | /** |
| 27434 | @brief WDI_TransportChannelDebug - |
| 27435 | Display DXE Channel debugging information |
| 27436 | User may request to display DXE channel snapshot |
| 27437 | Or if host driver detects any abnormal stcuk may display |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 27438 | |
Jeff Johnson | bf9616f | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 27439 | @param displaySnapshot : Display DXE snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 27440 | @param enableStallDetect : Enable stall detect feature |
| 27441 | This feature will take effect to data performance |
| 27442 | Not integrate till fully verification |
| 27443 | @see |
| 27444 | @return none |
| 27445 | */ |
| 27446 | void WDI_TransportChannelDebug |
| 27447 | ( |
| 27448 | wpt_boolean displaySnapshot, |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 27449 | wpt_boolean toggleStallDetect |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 27450 | ) |
| 27451 | { |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 27452 | WDTS_ChannelDebug(displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 27453 | return; |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 27454 | } |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 27455 | /** |
| 27456 | @brief WDI_SsrTimerCB |
| 27457 | Callback function for SSR timer, if this is called then the graceful |
| 27458 | shutdown for Riva did not happen. |
| 27459 | |
| 27460 | @param pUserData : user data to timer |
| 27461 | |
| 27462 | @see |
| 27463 | @return none |
| 27464 | */ |
| 27465 | void |
| 27466 | WDI_SsrTimerCB |
| 27467 | ( |
| 27468 | void *pUserData |
| 27469 | ) |
| 27470 | { |
| 27471 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 27472 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 27473 | |
| 27474 | if (NULL == pWDICtx ) |
| 27475 | { |
| 27476 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 27477 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 27478 | WDI_ASSERT(0); |
| 27479 | return; |
| 27480 | } |
| 27481 | wpalRivaSubystemRestart(); |
| 27482 | |
| 27483 | return; |
| 27484 | |
| 27485 | }/*WDI_SsrTimerCB*/ |
Gopichand Nakkala | c8ccb56 | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 27486 | |
| 27487 | /** |
| 27488 | @brief WDI_SetEnableSSR - |
| 27489 | This API is called to enable/disable SSR on WDI timeout. |
| 27490 | |
| 27491 | @param enableSSR : enable/disable SSR |
| 27492 | |
| 27493 | @see |
| 27494 | @return none |
| 27495 | */ |
| 27496 | void WDI_SetEnableSSR(wpt_boolean enableSSR) |
| 27497 | { |
| 27498 | gWDICb.bEnableSSR = enableSSR; |
| 27499 | } |