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 | |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 115 | #define FEATURE_NOT_SUPPORTED 128 |
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 |
Mohit Khanna | c0b992f | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 146 | }; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 147 | |
| 148 | /*-------------------------------------------------------------------------- |
| 149 | WLAN DAL State Machine |
| 150 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 151 | WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 152 | { |
| 153 | /*WDI_INIT_ST*/ |
| 154 | {{ |
| 155 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 156 | NULL, /*WDI_STOP_EVENT*/ |
| 157 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 158 | WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/ |
| 159 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
| 160 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 161 | }}, |
| 162 | |
| 163 | /*WDI_STARTED_ST*/ |
| 164 | {{ |
| 165 | WDI_MainStartStarted, /*WDI_START_EVENT*/ |
| 166 | WDI_MainStopStarted, /*WDI_STOP_EVENT*/ |
| 167 | WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/ |
| 168 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 169 | NULL, /*WDI_CLOSE_EVENT*/ |
| 170 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 171 | }}, |
| 172 | |
| 173 | /*WDI_STOPPED_ST*/ |
| 174 | {{ |
| 175 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 176 | WDI_MainStopStopped, /*WDI_STOP_EVENT*/ |
| 177 | NULL, /*WDI_REQUEST_EVENT*/ |
| 178 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 179 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 180 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 181 | }}, |
| 182 | |
| 183 | /*WDI_BUSY_ST*/ |
| 184 | {{ |
| 185 | WDI_MainStartBusy, /*WDI_START_EVENT*/ |
| 186 | WDI_MainStopBusy, /*WDI_STOP_EVENT*/ |
| 187 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 188 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 189 | WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/ |
| 190 | WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/ |
| 191 | }} |
| 192 | }; |
| 193 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 194 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 195 | DAL Request Processing Array - the functions in this table will only be |
| 196 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 197 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 198 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 199 | WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 200 | { |
| 201 | /*INIT*/ |
| 202 | WDI_ProcessStartReq, /* WDI_START_REQ */ |
| 203 | WDI_ProcessStopReq, /* WDI_STOP_REQ */ |
| 204 | WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */ |
| 205 | |
| 206 | /*SCAN*/ |
| 207 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */ |
| 208 | WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */ |
| 209 | WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */ |
| 210 | WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */ |
| 211 | |
| 212 | /*ASSOCIATION*/ |
| 213 | WDI_ProcessJoinReq, /* WDI_JOIN_REQ */ |
| 214 | WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */ |
| 215 | WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */ |
| 216 | WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */ |
| 217 | WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */ |
| 218 | |
| 219 | /* Security */ |
| 220 | WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */ |
| 221 | WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 222 | WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */ |
| 223 | WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 224 | |
| 225 | /* QoS and BA APIs */ |
| 226 | WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */ |
| 227 | WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */ |
| 228 | WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */ |
| 229 | WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */ |
| 230 | WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */ |
| 231 | |
| 232 | /* Miscellaneous Control APIs */ |
| 233 | WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */ |
| 234 | WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */ |
| 235 | WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */ |
| 236 | WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */ |
| 237 | WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */ |
| 238 | |
| 239 | /*BA APIs*/ |
| 240 | WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */ |
| 241 | WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */ |
| 242 | |
| 243 | /*Beacon processing APIs*/ |
| 244 | WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */ |
| 245 | WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */ |
| 246 | |
| 247 | WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */ |
| 248 | WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */ |
| 249 | WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */ |
| 250 | WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 251 | WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 252 | /* PowerSave APIs */ |
| 253 | WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */ |
| 254 | WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */ |
| 255 | WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */ |
| 256 | WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */ |
| 257 | WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */ |
| 258 | WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */ |
| 259 | WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */ |
| 260 | WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */ |
| 261 | WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */ |
| 262 | WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */ |
| 263 | WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */ |
| 264 | WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */ |
| 265 | WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */ |
| 266 | WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */ |
| 267 | WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */ |
| 268 | WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */ |
| 269 | WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */ |
| 270 | WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */ |
| 271 | /*NV Download APIs*/ |
| 272 | WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/ |
| 273 | WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */ |
| 274 | WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */ |
| 275 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 276 | WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */ |
| 277 | #else |
| 278 | NULL, |
| 279 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 280 | WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */ |
| 281 | WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 283 | |
| 284 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 285 | WDI_ProcessStartOemDataReq, /*WDI_START_OEM_DATA_REQ*/ |
| 286 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 287 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 288 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 289 | WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 290 | |
| 291 | WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 292 | |
| 293 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 294 | WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */ |
| 295 | WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */ |
| 296 | WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */ |
| 297 | #else |
| 298 | NULL, |
| 299 | NULL, |
| 300 | NULL, |
| 301 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 302 | |
| 303 | WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 304 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 305 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 306 | /* WDI_8023_MULTICAST_LIST_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 307 | WDI_Process8023MulticastListReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 308 | /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 309 | WDI_ProcessReceiveFilterSetFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 310 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 311 | WDI_ProcessFilterMatchCountReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 313 | WDI_ProcessReceiveFilterClearFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 314 | #else |
| 315 | NULL, |
| 316 | NULL, |
| 317 | NULL, |
| 318 | NULL, |
| 319 | #endif // WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 320 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 321 | WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */ |
| 322 | WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */ |
| 323 | |
| 324 | WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/ |
| 325 | #ifdef FEATURE_WLAN_CCX |
| 326 | WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */ |
| 327 | #else |
| 328 | NULL, |
| 329 | #endif |
| 330 | |
| 331 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 332 | WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */ |
| 333 | WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */ |
| 334 | #else |
| 335 | NULL, |
| 336 | NULL, |
| 337 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 338 | |
| 339 | WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/ |
| 340 | WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 341 | #ifdef WLAN_FEATURE_11AC |
| 342 | WDI_ProcessUpdateVHTOpModeReq, /* WDI_UPDATE_VHT_OP_MODE_REQ */ |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 343 | #else |
| 344 | NULL, |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 345 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 346 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 347 | WDI_ProcessGetRoamRssiReq, /* WDI_GET_ROAM_RSSI_REQ */ |
| 348 | #else |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 349 | NULL, |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 350 | #endif |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 351 | WDI_ProcessSetTxPowerReq, /* WDI_SET_TX_POWER_REQ*/ |
| 352 | /*------------------------------------------------------------------------- |
| 353 | Indications |
| 354 | -------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/ |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 356 | WDI_ProcessTrafficStatsInd, /* WDI_TRAFFIC_STATS_IND*/ |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 357 | #ifdef WLAN_FEATURE_11W |
| 358 | WDI_ProcessExcludeUnencryptInd, /* WDI_EXCLUDE_UNENCRYPTED_IND */ |
| 359 | #else |
| 360 | NULL, |
| 361 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 362 | }; |
| 363 | |
| 364 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 365 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 366 | DAL Request Processing Array - the functions in this table will only be |
| 367 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 368 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 370 | WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 371 | { |
| 372 | /*INIT*/ |
| 373 | WDI_ProcessStartRsp, /* WDI_START_RESP */ |
| 374 | WDI_ProcessStopRsp, /* WDI_STOP_RESP */ |
| 375 | WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */ |
| 376 | |
| 377 | /*SCAN*/ |
| 378 | WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */ |
| 379 | WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */ |
| 380 | WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */ |
| 381 | WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */ |
| 382 | |
| 383 | /* ASSOCIATION*/ |
| 384 | WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */ |
| 385 | WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */ |
| 386 | WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */ |
| 387 | WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */ |
| 388 | WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */ |
| 389 | |
| 390 | /* Security */ |
| 391 | WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */ |
| 392 | WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 393 | WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */ |
| 394 | WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 395 | |
| 396 | /* QoS and BA APIs */ |
| 397 | WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */ |
| 398 | WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */ |
| 399 | WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */ |
| 400 | WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */ |
| 401 | WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */ |
| 402 | |
| 403 | /* Miscellaneous Control APIs */ |
| 404 | WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */ |
| 405 | WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */ |
| 406 | WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */ |
| 407 | WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */ |
| 408 | WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */ |
| 409 | |
| 410 | /* BA APIs*/ |
| 411 | WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */ |
| 412 | WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 413 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 414 | /* IBSS APIs*/ |
| 415 | WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */ |
| 416 | WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */ |
| 417 | |
| 418 | /*Soft AP APIs*/ |
| 419 | WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */ |
| 420 | WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */ |
| 421 | WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */ |
| 422 | WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */ |
| 423 | |
| 424 | /* PowerSave APIs */ |
| 425 | WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */ |
| 426 | WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */ |
| 427 | WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */ |
| 428 | WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */ |
| 429 | WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */ |
| 430 | WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */ |
| 431 | WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */ |
| 432 | WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */ |
| 433 | WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */ |
| 434 | WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */ |
| 435 | WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */ |
| 436 | WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */ |
| 437 | WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */ |
| 438 | WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */ |
| 439 | WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */ |
| 440 | WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */ |
| 441 | WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */ |
| 442 | WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 443 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 444 | |
| 445 | WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/ |
| 446 | |
| 447 | WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */ |
| 448 | WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */ |
| 449 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 450 | WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */ |
| 451 | #else |
| 452 | NULL, |
| 453 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 454 | WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */ |
| 455 | WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 456 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 457 | WDI_ProcessStartOemDataRsp, /*WDI_START_OEM_DATA_RESP*/ |
| 458 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 459 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 460 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 461 | WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/ |
| 462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 463 | WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 464 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 465 | WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 466 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 467 | WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */ |
| 468 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 469 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 470 | WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */ |
| 471 | WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */ |
| 472 | WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */ |
| 473 | #else |
| 474 | NULL, |
| 475 | NULL, |
| 476 | NULL, |
| 477 | #endif // FEATURE_WLAN_SCAN_PNO |
| 478 | |
| 479 | WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */ |
| 480 | |
| 481 | /*--------------------------------------------------------------------- |
| 482 | Indications |
| 483 | ---------------------------------------------------------------------*/ |
| 484 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 485 | /* WDI_8023_MULTICAST_LIST_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 486 | WDI_Process8023MulticastListRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 487 | /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 488 | WDI_ProcessReceiveFilterSetFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 489 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 490 | WDI_ProcessFilterMatchCountRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 491 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 492 | WDI_ProcessReceiveFilterClearFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 493 | #else |
| 494 | NULL, |
| 495 | NULL, |
| 496 | NULL, |
| 497 | NULL, |
| 498 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 499 | |
| 500 | WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */ |
| 501 | WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */ |
| 502 | |
| 503 | WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/ |
| 504 | #ifdef FEATURE_WLAN_CCX |
| 505 | WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */ |
| 506 | #else |
| 507 | NULL, |
| 508 | #endif |
| 509 | |
| 510 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 511 | WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */ |
| 512 | WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 513 | #else |
| 514 | NULL, |
| 515 | NULL, |
| 516 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 517 | WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */ |
| 518 | WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 519 | #ifdef WLAN_FEATURE_11AC |
| 520 | WDI_ProcessUpdateVHTOpModeRsp, /* WDI_UPDATE_VHT_OP_MODE_RESP */ |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 521 | #else |
| 522 | NULL, |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 523 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 524 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 525 | WDI_ProcessGetRoamRssiRsp, /* WDI_GET_ROAM_RSSI_RESP */ |
| 526 | #else |
| 527 | NULL, |
| 528 | #endif |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 529 | WDI_ProcessSetTxPowerRsp, /* WDI_SET_TX_POWER_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 530 | |
| 531 | /*--------------------------------------------------------------------- |
| 532 | Indications |
| 533 | ---------------------------------------------------------------------*/ |
| 534 | WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */ |
| 535 | WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */ |
| 536 | WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */ |
| 537 | WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */ |
| 538 | WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */ |
| 539 | WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */ |
| 540 | |
| 541 | WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */ |
| 542 | |
| 543 | WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */ |
| 544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 545 | WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 546 | |
| 547 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 548 | WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */ |
| 549 | #else |
| 550 | NULL, |
| 551 | #endif // FEATURE_WLAN_SCAN_PNO |
| 552 | |
| 553 | #ifdef WLAN_WAKEUP_EVENTS |
| 554 | WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */ |
| 555 | #else // WLAN_WAKEUP_EVENTS |
| 556 | NULL, |
| 557 | #endif // WLAN_WAKEUP_EVENTS |
| 558 | |
| 559 | WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */ |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 560 | |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 561 | WDI_ProcessP2pNoaStartInd, /* WDI_NOA_START_IND */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 562 | }; |
| 563 | |
| 564 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 565 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 566 | WLAN DAL Global Control Block |
| 567 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 568 | WDI_ControlBlockType gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 569 | static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE; |
| 570 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 571 | const wpt_uint8 szTransportChName[] = "WLAN_CTRL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 572 | |
| 573 | /*Helper routine for retrieving the PAL Context from WDI*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 574 | WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 575 | void* WDI_GET_PAL_CTX( void ) |
| 576 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 577 | return gWDICb.pPALContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 578 | }/*WDI_GET_PAL_CTX*/ |
| 579 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 580 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 581 | Helper inline converters |
| 582 | ============================================================================*/ |
| 583 | /*Convert WDI driver type into HAL driver type*/ |
| 584 | WPT_STATIC WPT_INLINE WDI_Status |
| 585 | WDI_HAL_2_WDI_STATUS |
| 586 | ( |
| 587 | eHalStatus halStatus |
| 588 | ); |
| 589 | |
| 590 | /*Convert WDI request type into HAL request type*/ |
| 591 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 592 | WDI_2_HAL_REQ_TYPE |
| 593 | ( |
| 594 | WDI_RequestEnumType wdiReqType |
| 595 | ); |
| 596 | |
| 597 | /*Convert WDI response type into HAL response type*/ |
| 598 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 599 | HAL_2_WDI_RSP_TYPE |
| 600 | ( |
| 601 | tHalHostMsgType halMsg |
| 602 | ); |
| 603 | |
| 604 | /*Convert WDI driver type into HAL driver type*/ |
| 605 | WPT_STATIC WPT_INLINE tDriverType |
| 606 | WDI_2_HAL_DRV_TYPE |
| 607 | ( |
| 608 | WDI_DriverType wdiDriverType |
| 609 | ); |
| 610 | |
| 611 | /*Convert WDI stop reason into HAL stop reason*/ |
| 612 | WPT_STATIC WPT_INLINE tHalStopType |
| 613 | WDI_2_HAL_STOP_REASON |
| 614 | ( |
| 615 | WDI_StopType wdiStopType |
| 616 | ); |
| 617 | |
| 618 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 619 | WPT_STATIC WPT_INLINE eHalSysMode |
| 620 | WDI_2_HAL_SCAN_MODE |
| 621 | ( |
| 622 | WDI_ScanMode wdiScanMode |
| 623 | ); |
| 624 | |
| 625 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 626 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 627 | WDI_2_HAL_SEC_CH_OFFSET |
| 628 | ( |
| 629 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 630 | ); |
| 631 | |
| 632 | /*Convert WDI BSS type into HAL BSS type*/ |
| 633 | WPT_STATIC WPT_INLINE tSirBssType |
| 634 | WDI_2_HAL_BSS_TYPE |
| 635 | ( |
| 636 | WDI_BssType wdiBSSType |
| 637 | ); |
| 638 | |
| 639 | /*Convert WDI NW type into HAL NW type*/ |
| 640 | WPT_STATIC WPT_INLINE tSirNwType |
| 641 | WDI_2_HAL_NW_TYPE |
| 642 | ( |
| 643 | WDI_NwType wdiNWType |
| 644 | ); |
| 645 | |
| 646 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 647 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 648 | WDI_2_HAL_CB_STATE |
| 649 | ( |
| 650 | WDI_PhyChanBondState wdiCbState |
| 651 | ); |
| 652 | |
| 653 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 654 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 655 | WDI_2_HAL_HT_OPER_MODE |
| 656 | ( |
| 657 | WDI_HTOperatingMode wdiHTOperMode |
| 658 | ); |
| 659 | |
| 660 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 661 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 662 | WDI_2_HAL_MIMO_PS |
| 663 | ( |
| 664 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 665 | ); |
| 666 | |
| 667 | /*Convert WDI ENC type into HAL ENC type*/ |
| 668 | WPT_STATIC WPT_INLINE tAniEdType |
| 669 | WDI_2_HAL_ENC_TYPE |
| 670 | ( |
| 671 | WDI_EncryptType wdiEncType |
| 672 | ); |
| 673 | |
| 674 | /*Convert WDI WEP type into HAL WEP type*/ |
| 675 | WPT_STATIC WPT_INLINE tAniWepType |
| 676 | WDI_2_HAL_WEP_TYPE |
| 677 | ( |
| 678 | WDI_WepType wdiWEPType |
| 679 | ); |
| 680 | |
| 681 | /*Convert WDI Link State into HAL Link State*/ |
| 682 | WPT_STATIC WPT_INLINE tSirLinkState |
| 683 | WDI_2_HAL_LINK_STATE |
| 684 | ( |
| 685 | WDI_LinkStateType wdiLinkState |
| 686 | ); |
| 687 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 688 | /*Translate a STA Context from WDI into HAL*/ |
| 689 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 690 | void |
| 691 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 692 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 693 | tConfigStaParams* phalConfigSta, |
| 694 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 695 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 696 | |
| 697 | /*Translate a Rate set info from WDI into HAL*/ |
| 698 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 699 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 700 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 701 | tSirMacRateSet* pHalRateSet, |
| 702 | WDI_RateSet* pwdiRateSet |
| 703 | ); |
| 704 | |
| 705 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 706 | WPT_STATIC WPT_INLINE void |
| 707 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 708 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 709 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 710 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 711 | ); |
| 712 | |
| 713 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 714 | WPT_STATIC WPT_INLINE void |
| 715 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 716 | ( |
| 717 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 718 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 719 | ); |
| 720 | |
| 721 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 722 | WPT_STATIC WPT_INLINE void |
| 723 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 724 | ( |
| 725 | tConfigBssParams* phalConfigBSS, |
| 726 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 727 | ); |
| 728 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 729 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 730 | pointed to by user data */ |
| 731 | WPT_STATIC WPT_INLINE void |
| 732 | WDI_ExtractRequestCBFromEvent |
| 733 | ( |
| 734 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 735 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 736 | void** ppUserData |
| 737 | ); |
| 738 | |
| 739 | wpt_uint8 |
| 740 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 741 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 742 | WDI_ControlBlockType* pWDICtx, |
| 743 | WDI_BSSSessionType** ppSession |
| 744 | ); |
| 745 | |
| 746 | void |
| 747 | WDI_AddBcastSTAtoSTATable |
| 748 | ( |
| 749 | WDI_ControlBlockType* pWDICtx, |
| 750 | WDI_AddStaParams * staParams, |
| 751 | wpt_uint16 usBcastStaIdx |
| 752 | ); |
| 753 | |
| 754 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 755 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 756 | WDI_ControlBlockType* pWDICtx, |
| 757 | WDI_EventInfoType* pEventData |
| 758 | ); |
| 759 | |
| 760 | void |
| 761 | WDI_SetPowerStateCb |
| 762 | ( |
| 763 | wpt_status status, |
| 764 | unsigned int dxePhyAddr, |
| 765 | void *pContext |
| 766 | ); |
| 767 | |
| 768 | #define CASE_RETURN_STRING( str ) \ |
| 769 | case ( ( str ) ): return( #str ); break \ |
| 770 | |
| 771 | /** |
| 772 | @brief WDI_getReqMsgString prints the WDI request message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 773 | |
| 774 | @param wdiReqMsgId: WDI Message request Id |
| 775 | |
| 776 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | @return Result of the function call |
| 778 | */ |
| 779 | static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId) |
| 780 | { |
| 781 | switch (wdiReqMsgId) |
| 782 | { |
| 783 | CASE_RETURN_STRING( WDI_START_REQ ); |
| 784 | CASE_RETURN_STRING( WDI_STOP_REQ ); |
| 785 | CASE_RETURN_STRING( WDI_CLOSE_REQ ); |
| 786 | CASE_RETURN_STRING( WDI_INIT_SCAN_REQ ); |
| 787 | CASE_RETURN_STRING( WDI_START_SCAN_REQ ); |
| 788 | CASE_RETURN_STRING( WDI_END_SCAN_REQ ); |
| 789 | CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ ); |
| 790 | CASE_RETURN_STRING( WDI_JOIN_REQ ); |
| 791 | CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ ); |
| 792 | CASE_RETURN_STRING( WDI_DEL_BSS_REQ ); |
| 793 | CASE_RETURN_STRING( WDI_POST_ASSOC_REQ ); |
| 794 | CASE_RETURN_STRING( WDI_DEL_STA_REQ ); |
| 795 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ ); |
| 796 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ ); |
| 797 | CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ ); |
| 798 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ ); |
| 799 | CASE_RETURN_STRING( WDI_ADD_TS_REQ ); |
| 800 | CASE_RETURN_STRING( WDI_DEL_TS_REQ ); |
| 801 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ ); |
| 802 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ ); |
| 803 | CASE_RETURN_STRING( WDI_DEL_BA_REQ ); |
| 804 | CASE_RETURN_STRING( WDI_CH_SWITCH_REQ ); |
| 805 | CASE_RETURN_STRING( WDI_CONFIG_STA_REQ ); |
| 806 | CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ ); |
| 807 | CASE_RETURN_STRING( WDI_GET_STATS_REQ ); |
| 808 | CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ ); |
| 809 | CASE_RETURN_STRING( WDI_ADD_BA_REQ ); |
| 810 | CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ ); |
| 811 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ ); |
| 812 | CASE_RETURN_STRING( WDI_SND_BCON_REQ ); |
| 813 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ ); |
| 814 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ ); |
| 815 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ ); |
| 816 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ ); |
| 817 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ ); |
| 818 | CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ ); |
| 819 | CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ ); |
| 820 | CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ ); |
| 821 | CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ ); |
| 822 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ ); |
| 823 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ ); |
| 824 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ ); |
| 825 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ ); |
| 826 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ ); |
| 827 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ); |
| 828 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ ); |
| 829 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ ); |
| 830 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ ); |
| 831 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ ); |
| 832 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ ); |
| 833 | CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ ); |
| 834 | CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ ); |
| 835 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ ); |
| 836 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ ); |
| 837 | CASE_RETURN_STRING( WDI_FLUSH_AC_REQ ); |
| 838 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ ); |
| 839 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ ); |
| 840 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ ); |
| 841 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ ); |
| 842 | CASE_RETURN_STRING( WDI_FTM_CMD_REQ ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 843 | CASE_RETURN_STRING( WDI_START_OEM_DATA_REQ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 844 | CASE_RETURN_STRING( WDI_HOST_RESUME_REQ ); |
| 845 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ); |
| 846 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 847 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ ); |
| 848 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ ); |
| 849 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ ); |
| 850 | #endif |
| 851 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ ); |
| 852 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ ); |
| 853 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ ); |
| 854 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ ); |
| 855 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ ); |
| 856 | CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ ); |
| 857 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ ); |
| 858 | CASE_RETURN_STRING( WDI_SHUTDOWN_REQ ); |
| 859 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ ); |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 860 | CASE_RETURN_STRING( WDI_TRAFFIC_STATS_IND ); |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 861 | CASE_RETURN_STRING( WDI_GET_ROAM_RSSI_REQ ); |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 862 | #ifdef WLAN_FEATURE_11W |
| 863 | CASE_RETURN_STRING( WDI_EXCLUDE_UNENCRYPTED_IND ); |
| 864 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 865 | default: |
| 866 | return "Unknown WDI MessageId"; |
| 867 | } |
| 868 | } |
| 869 | |
| 870 | |
| 871 | |
| 872 | /** |
| 873 | @brief WDI_getRespMsgString prints the WDI resonse message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 874 | |
| 875 | @param wdiRespMsgId: WDI Message response Id |
| 876 | |
| 877 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 878 | @return Result of the function call |
| 879 | */ |
| 880 | static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId) |
| 881 | { |
| 882 | switch (wdiRespMsgId) |
| 883 | { |
| 884 | CASE_RETURN_STRING( WDI_START_RESP ); |
| 885 | CASE_RETURN_STRING( WDI_STOP_RESP ); |
| 886 | CASE_RETURN_STRING( WDI_CLOSE_RESP ); |
| 887 | CASE_RETURN_STRING( WDI_INIT_SCAN_RESP ); |
| 888 | CASE_RETURN_STRING( WDI_START_SCAN_RESP ); |
| 889 | CASE_RETURN_STRING( WDI_END_SCAN_RESP ); |
| 890 | CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP ); |
| 891 | CASE_RETURN_STRING( WDI_JOIN_RESP ); |
| 892 | CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP ); |
| 893 | CASE_RETURN_STRING( WDI_DEL_BSS_RESP ); |
| 894 | CASE_RETURN_STRING( WDI_POST_ASSOC_RESP ); |
| 895 | CASE_RETURN_STRING( WDI_DEL_STA_RESP ); |
| 896 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP ); |
| 897 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP ); |
| 898 | CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP ); |
| 899 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP ); |
| 900 | CASE_RETURN_STRING( WDI_ADD_TS_RESP ); |
| 901 | CASE_RETURN_STRING( WDI_DEL_TS_RESP ); |
| 902 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP ); |
| 903 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP ); |
| 904 | CASE_RETURN_STRING( WDI_DEL_BA_RESP ); |
| 905 | CASE_RETURN_STRING( WDI_CH_SWITCH_RESP ); |
| 906 | CASE_RETURN_STRING( WDI_CONFIG_STA_RESP ); |
| 907 | CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP ); |
| 908 | CASE_RETURN_STRING( WDI_GET_STATS_RESP ); |
| 909 | CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP ); |
| 910 | CASE_RETURN_STRING( WDI_ADD_BA_RESP ); |
| 911 | CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP ); |
| 912 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP ); |
| 913 | CASE_RETURN_STRING( WDI_SND_BCON_RESP ); |
| 914 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP ); |
| 915 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP ); |
| 916 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP ); |
| 917 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP ); |
| 918 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP ); |
| 919 | CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP ); |
| 920 | CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP ); |
| 921 | CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP ); |
| 922 | CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP ); |
| 923 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP ); |
| 924 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP ); |
| 925 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP ); |
| 926 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP ); |
| 927 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP ); |
| 928 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP); |
| 929 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP ); |
| 930 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP ); |
| 931 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP ); |
| 932 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP ); |
| 933 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP ); |
| 934 | CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP ); |
| 935 | CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP ); |
| 936 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP ); |
| 937 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP ); |
| 938 | CASE_RETURN_STRING( WDI_FLUSH_AC_RESP ); |
| 939 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP ); |
| 940 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP ); |
| 941 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP ); |
| 942 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP ); |
| 943 | CASE_RETURN_STRING( WDI_FTM_CMD_RESP ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 944 | CASE_RETURN_STRING( WDI_START_OEM_DATA_RESP ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 945 | CASE_RETURN_STRING( WDI_HOST_RESUME_RESP ); |
| 946 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP); |
| 947 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 948 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP ); |
| 949 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP ); |
| 950 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP ); |
| 951 | #endif |
| 952 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP ); |
| 953 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP ); |
| 954 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP ); |
| 955 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP ); |
| 956 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP ); |
| 957 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP ); |
| 958 | CASE_RETURN_STRING( WDI_SHUTDOWN_RESP ); |
| 959 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP ); |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 960 | CASE_RETURN_STRING( WDI_GET_ROAM_RSSI_RESP ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 961 | default: |
| 962 | return "Unknown WDI MessageId"; |
| 963 | } |
| 964 | } |
| 965 | |
| 966 | /** |
| 967 | @brief WDI_getHALStatusMsgString prints the HAL status in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 968 | |
| 969 | @param halStatusId: HAL status Id |
| 970 | |
| 971 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 972 | @return Result of the function call |
| 973 | */ |
| 974 | static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId) |
| 975 | { |
| 976 | switch (halStatusId) |
| 977 | { |
| 978 | CASE_RETURN_STRING( eHAL_STATUS_SUCCESS ); |
| 979 | CASE_RETURN_STRING( PAL_STATUS_INVAL ); |
| 980 | CASE_RETURN_STRING( PAL_STATUS_ALREADY ); |
| 981 | CASE_RETURN_STRING( PAL_STATUS_EMPTY ); |
| 982 | CASE_RETURN_STRING( PAL_STATUS_FAILURE ); |
| 983 | CASE_RETURN_STRING( eHAL_STATUS_FAILURE ); |
| 984 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER ); |
| 985 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX ); |
| 986 | CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL ); |
| 987 | CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS ); |
| 988 | CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT ); |
| 989 | CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL ); |
| 990 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA ); |
| 991 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID ); |
| 992 | CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID ); |
| 993 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID ); |
| 994 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX ); |
| 995 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL ); |
| 996 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE ); |
| 997 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID ); |
| 998 | CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN ); |
| 999 | CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL ); |
| 1000 | CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL ); |
| 1001 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL ); |
| 1002 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED ); |
| 1003 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID ); |
| 1004 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED ); |
| 1005 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED ); |
| 1006 | CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC ); |
| 1007 | CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL ); |
| 1008 | CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 1009 | CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 1010 | CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED ); |
| 1011 | default: |
| 1012 | return "Unknown HAL status"; |
| 1013 | } |
| 1014 | } |
| 1015 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1016 | /*======================================================================== |
| 1017 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1018 | INITIALIZATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1019 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | ==========================================================================*/ |
| 1021 | |
| 1022 | /** |
| 1023 | @brief WDI_Init is used to initialize the DAL. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1025 | DAL will allocate all the resources it needs. It will open PAL, it will also |
| 1026 | 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] | 1027 | DXE/SMD or any other drivers that they need. |
| 1028 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1029 | @param pOSContext: pointer to the OS context provided by the UMAC |
| 1030 | will be passed on to PAL on Open |
| 1031 | ppWDIGlobalCtx: output pointer of Global Context |
| 1032 | pWdiDevCapability: output pointer of device capability |
| 1033 | |
| 1034 | @return Result of the function call |
| 1035 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1036 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1037 | WDI_Init |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1038 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1039 | void* pOSContext, |
| 1040 | void** ppWDIGlobalCtx, |
| 1041 | WDI_DeviceCapabilityType* pWdiDevCapability, |
| 1042 | unsigned int driverType |
| 1043 | ) |
| 1044 | { |
| 1045 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1046 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1047 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1048 | WCTS_TransportCBsType wctsCBs; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1049 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 1050 | |
| 1051 | /*--------------------------------------------------------------------- |
| 1052 | Sanity check |
| 1053 | ---------------------------------------------------------------------*/ |
| 1054 | if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability )) |
| 1055 | { |
| 1056 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1057 | "Invalid input parameters in WDI_Init"); |
| 1058 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1059 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1060 | } |
| 1061 | |
| 1062 | /*--------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1063 | Check to see if the module has already been initialized or not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1064 | ---------------------------------------------------------------------*/ |
| 1065 | if ( eWLAN_PAL_FALSE != gWDIInitialized ) |
| 1066 | { |
| 1067 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1068 | "WDI module already initialized - return"); |
| 1069 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1070 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1071 | } |
| 1072 | |
| 1073 | /*Module is now initialized - this flag is to ensure the fact that multiple |
| 1074 | init will not happen on WDI |
| 1075 | !! - potential race does exist because read and set are not atomic, |
| 1076 | however an atomic operation would be closely here - reanalyze if necessary*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1077 | gWDIInitialized = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1078 | |
| 1079 | /*Setup the control block */ |
| 1080 | WDI_CleanCB(&gWDICb); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1081 | gWDICb.pOSContext = pOSContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1082 | |
| 1083 | /*Setup the STA Table*/ |
| 1084 | wdiStatus = WDI_STATableInit(&gWDICb); |
| 1085 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1086 | { |
| 1087 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1088 | "%s: Failure while initializing STA Table, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1089 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1090 | goto fail_STATableInit; |
| 1091 | } |
| 1092 | |
| 1093 | /*------------------------------------------------------------------------ |
| 1094 | Open the PAL |
| 1095 | ------------------------------------------------------------------------*/ |
| 1096 | wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext); |
| 1097 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1098 | { |
| 1099 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1100 | "%s: Failed to open PAL, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1101 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1102 | goto fail_wpalOpen; |
| 1103 | } |
| 1104 | |
| 1105 | /*Initialize main synchro mutex - it will be used to ensure integrity of |
| 1106 | the main WDI Control Block*/ |
| 1107 | wptStatus = wpalMutexInit(&gWDICb.wptMutex); |
| 1108 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1109 | { |
| 1110 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1111 | "%s: Failed to init mutex, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1112 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1113 | goto fail_mutex; |
| 1114 | } |
| 1115 | |
| 1116 | /*Initialize the response timer - it will be used to time all messages |
| 1117 | expected as response from device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1118 | wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer, |
| 1119 | WDI_ResponseTimerCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1120 | &gWDICb); |
| 1121 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1122 | { |
| 1123 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1124 | "%s: Failed to init response timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1125 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1126 | goto fail_timer; |
| 1127 | } |
| 1128 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1129 | wptStatus = wpalTimerInit( &gWDICb.ssrTimer, |
| 1130 | WDI_SsrTimerCB, |
| 1131 | &gWDICb); |
| 1132 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1133 | { |
| 1134 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1135 | "%s: Failed to init SSR timer, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1136 | __func__, wptStatus); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1137 | goto fail_timer2; |
| 1138 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1139 | /* Initialize the WDI Pending Request Queue*/ |
| 1140 | wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue)); |
| 1141 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1142 | { |
| 1143 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1144 | "%s: Failed to init pending request queue, 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_pend_queue; |
| 1147 | } |
| 1148 | |
| 1149 | /*Init WDI Pending Assoc Id Queue */ |
| 1150 | wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1151 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1152 | { |
| 1153 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1154 | "%s: Failed to init assoc session queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1155 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1156 | goto fail_assoc_queue; |
| 1157 | } |
| 1158 | |
| 1159 | /*Initialize the BSS sessions pending Queue */ |
| 1160 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1161 | { |
| 1162 | wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1163 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1164 | { |
| 1165 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1166 | "%s: Failed to init BSS %d pending queue, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1167 | __func__, i, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1168 | goto fail_bss_queue; |
| 1169 | } |
| 1170 | } |
| 1171 | |
| 1172 | /*Indicate the control block is sufficiently initialized for callbacks*/ |
| 1173 | gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC; |
| 1174 | |
| 1175 | /*------------------------------------------------------------------------ |
| 1176 | Initialize the Data Path Utility Module |
| 1177 | ------------------------------------------------------------------------*/ |
| 1178 | wdiStatus = WDI_DP_UtilsInit(&gWDICb); |
| 1179 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1180 | { |
| 1181 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1182 | "%s: Failed to initialize the DP Util Module, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1183 | __func__, wdiStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1184 | goto fail_dp_util_init; |
| 1185 | } |
| 1186 | |
| 1187 | /* Init Set power state event */ |
| 1188 | wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1189 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1190 | { |
| 1191 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1192 | "%s: Failed to initialize power state event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1193 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1194 | goto fail_power_event; |
| 1195 | } |
| 1196 | |
| 1197 | /* Init WCTS action event */ |
| 1198 | wptStatus = wpalEventInit(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1199 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1200 | { |
| 1201 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1202 | "%s: Failed to initialize WCTS action event, status %d", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1203 | __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1204 | goto fail_wcts_event; |
| 1205 | } |
| 1206 | |
| 1207 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1208 | Open the Transport Services for Control and Data |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1209 | ------------------------------------------------------------------------*/ |
| 1210 | wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB; |
| 1211 | wctsCBs.wctsNotifyCBData = &gWDICb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1212 | wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1213 | wctsCBs.wctsRxMsgCBData = &gWDICb; |
| 1214 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1215 | gWDICb.bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1216 | gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1217 | WDI_CT_CHANNEL_SIZE, |
| 1218 | &wctsCBs ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1219 | |
| 1220 | if ( NULL == gWDICb.wctsHandle ) |
| 1221 | { |
| 1222 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1223 | "%s: Failed to open WCTS transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1224 | goto fail_wcts_open; |
| 1225 | } |
| 1226 | |
| 1227 | gWDICb.driverMode = (tDriverType)driverType; |
| 1228 | /* FTM mode not need to open Transport Driver */ |
| 1229 | if(eDRIVER_TYPE_MFG != (tDriverType)driverType) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1230 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1231 | /*------------------------------------------------------------------------ |
| 1232 | Open the Data Transport |
| 1233 | ------------------------------------------------------------------------*/ |
| 1234 | if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb)) |
| 1235 | { |
| 1236 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1237 | "%s: Failed to open the DT Transport", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1238 | goto fail_wdts_open; |
| 1239 | } |
| 1240 | } |
| 1241 | |
| 1242 | /*The WDI is initialized - set state to init */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1243 | gWDICb.uGlobalState = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1244 | |
| 1245 | /*Send the context as a ptr to the global WDI Control Block*/ |
| 1246 | *ppWDIGlobalCtx = &gWDICb; |
| 1247 | |
| 1248 | /*Fill in the device capabilities*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1249 | pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1250 | pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations; |
| 1251 | pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids; |
| 1252 | return WDI_STATUS_SUCCESS; |
| 1253 | |
| 1254 | /* ERROR handlers |
| 1255 | Undo everything that completed successfully */ |
| 1256 | |
| 1257 | fail_wdts_open: |
| 1258 | { |
| 1259 | wpt_status eventStatus; |
| 1260 | |
| 1261 | /* Closing WCTS in this scenario is tricky since it has to close |
| 1262 | the SMD channel and then we get notified asynchronously when |
| 1263 | the channel has been closed. So we take some of the logic from |
| 1264 | the "normal" close procedure in WDI_Close() |
| 1265 | */ |
| 1266 | |
| 1267 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1268 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1269 | { |
| 1270 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1271 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1272 | } |
| 1273 | |
| 1274 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1275 | |
| 1276 | /* Wait for WCTS to close the control transport. If we were able |
| 1277 | to reset the event flag, then we'll wait for the event, |
| 1278 | otherwise we'll wait for a maximum amount of time required for |
| 1279 | the channel to be closed */ |
| 1280 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1281 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1282 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1283 | WDI_WCTS_ACTION_TIMEOUT); |
| 1284 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1285 | { |
| 1286 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1287 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1288 | } |
| 1289 | } |
| 1290 | else |
| 1291 | { |
| 1292 | wpalSleep(WDI_WCTS_ACTION_TIMEOUT); |
| 1293 | } |
| 1294 | } |
| 1295 | fail_wcts_open: |
| 1296 | wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1297 | fail_wcts_event: |
| 1298 | wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1299 | fail_power_event: |
| 1300 | WDI_DP_UtilsExit(&gWDICb); |
| 1301 | fail_dp_util_init: |
| 1302 | gWDICb.magic = 0; |
| 1303 | fail_bss_queue: |
| 1304 | /* entries 0 thru i-1 were successfully initialized */ |
| 1305 | while (0 < i) |
| 1306 | { |
| 1307 | i--; |
| 1308 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1309 | } |
| 1310 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1311 | fail_assoc_queue: |
| 1312 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1313 | fail_pend_queue: |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1314 | wpalTimerDelete(&gWDICb.ssrTimer); |
| 1315 | fail_timer2: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1316 | wpalTimerDelete(&gWDICb.wptResponseTimer); |
| 1317 | fail_timer: |
| 1318 | wpalMutexDelete(&gWDICb.wptMutex); |
| 1319 | fail_mutex: |
| 1320 | wpalClose(gWDICb.pPALContext); |
| 1321 | fail_wpalOpen: |
| 1322 | WDI_STATableClose(&gWDICb); |
| 1323 | fail_STATableInit: |
| 1324 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1325 | |
| 1326 | return WDI_STATUS_E_FAILURE; |
| 1327 | |
| 1328 | }/*WDI_Init*/; |
| 1329 | |
| 1330 | /** |
| 1331 | @brief WDI_Start will be called when the upper MAC is ready to |
| 1332 | commence operation with the WLAN Device. Upon the call |
| 1333 | of this API the WLAN DAL will pack and send a HAL Start |
| 1334 | message to the lower RIVA sub-system if the SMD channel |
| 1335 | has been fully opened and the RIVA subsystem is up. |
| 1336 | |
| 1337 | If the RIVA sub-system is not yet up and running DAL |
| 1338 | will queue the request for Open and will wait for the |
| 1339 | SMD notification before attempting to send down the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1340 | message to HAL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1341 | |
| 1342 | WDI_Init must have been called. |
| 1343 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1344 | @param wdiStartParams: the start parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1345 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1346 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1347 | wdiStartRspCb: callback for passing back the response of |
| 1348 | the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1349 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1350 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1351 | callback |
| 1352 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1353 | @see WDI_Start |
| 1354 | @return Result of the function call |
| 1355 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1356 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1357 | WDI_Start |
| 1358 | ( |
| 1359 | WDI_StartReqParamsType* pwdiStartParams, |
| 1360 | WDI_StartRspCb wdiStartRspCb, |
| 1361 | void* pUserData |
| 1362 | ) |
| 1363 | { |
| 1364 | WDI_EventInfoType wdiEventData; |
| 1365 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1366 | |
| 1367 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1368 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1369 | ------------------------------------------------------------------------*/ |
| 1370 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1371 | { |
| 1372 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1373 | "WDI API call before module is initialized - Fail request"); |
| 1374 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1375 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1376 | } |
| 1377 | |
| 1378 | /*------------------------------------------------------------------------ |
| 1379 | Fill in Event data and post to the Main FSM |
| 1380 | ------------------------------------------------------------------------*/ |
| 1381 | wdiEventData.wdiRequest = WDI_START_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1382 | wdiEventData.pEventData = pwdiStartParams; |
| 1383 | wdiEventData.uEventDataSize = sizeof(*pwdiStartParams); |
| 1384 | wdiEventData.pCBfnc = wdiStartRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1385 | wdiEventData.pUserData = pUserData; |
| 1386 | |
| 1387 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1388 | |
| 1389 | }/*WDI_Start*/ |
| 1390 | |
| 1391 | /** |
| 1392 | @brief WDI_Stop will be called when the upper MAC is ready to |
| 1393 | stop any operation with the WLAN Device. Upon the call |
| 1394 | of this API the WLAN DAL will pack and send a HAL Stop |
| 1395 | message to the lower RIVA sub-system if the DAL Core is |
| 1396 | in started state. |
| 1397 | |
| 1398 | In state BUSY this request will be queued. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1399 | |
| 1400 | Request will not be accepted in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1401 | |
| 1402 | WDI_Start must have been called. |
| 1403 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1404 | @param wdiStopParams: the stop parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1405 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1407 | wdiStopRspCb: callback for passing back the response of |
| 1408 | the stop operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1409 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1410 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1411 | callback |
| 1412 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1413 | @see WDI_Start |
| 1414 | @return Result of the function call |
| 1415 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1416 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1417 | WDI_Stop |
| 1418 | ( |
| 1419 | WDI_StopReqParamsType* pwdiStopParams, |
| 1420 | WDI_StopRspCb wdiStopRspCb, |
| 1421 | void* pUserData |
| 1422 | ) |
| 1423 | { |
| 1424 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1425 | WDI_ControlBlockType* pWDICtx = &gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1426 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1427 | |
| 1428 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1429 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1430 | ------------------------------------------------------------------------*/ |
| 1431 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1432 | { |
| 1433 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1434 | "WDI API call before module is initialized - Fail request"); |
| 1435 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1436 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1437 | } |
| 1438 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1439 | /*Access to the global state must be locked before cleaning */ |
| 1440 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 1441 | |
| 1442 | /*Clear all pending request*/ |
| 1443 | WDI_ClearPendingRequests(pWDICtx); |
| 1444 | |
| 1445 | /*We have completed cleaning unlock now*/ |
| 1446 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 1447 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1448 | /* Free the global variables */ |
| 1449 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1450 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1451 | gpHostWlanFeatCaps = NULL; |
| 1452 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1453 | |
| 1454 | /*------------------------------------------------------------------------ |
| 1455 | Fill in Event data and post to the Main FSM |
| 1456 | ------------------------------------------------------------------------*/ |
| 1457 | wdiEventData.wdiRequest = WDI_STOP_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1458 | wdiEventData.pEventData = pwdiStopParams; |
| 1459 | wdiEventData.uEventDataSize = sizeof(*pwdiStopParams); |
| 1460 | wdiEventData.pCBfnc = wdiStopRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1461 | wdiEventData.pUserData = pUserData; |
| 1462 | |
| 1463 | return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData); |
| 1464 | |
| 1465 | }/*WDI_Stop*/ |
| 1466 | |
| 1467 | |
| 1468 | |
| 1469 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1470 | @brief WDI_Close will be called when the upper MAC no longer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1471 | needs to interact with DAL. DAL will free its control |
| 1472 | block. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1473 | |
| 1474 | It is only accepted in state STOPPED. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1475 | |
| 1476 | WDI_Stop must have been called. |
| 1477 | |
| 1478 | @param none |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1480 | @see WDI_Stop |
| 1481 | @return Result of the function call |
| 1482 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1483 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1484 | WDI_Close |
| 1485 | ( |
| 1486 | void |
| 1487 | ) |
| 1488 | { |
| 1489 | wpt_uint8 i; |
| 1490 | WDI_EventInfoType wdiEventData; |
| 1491 | wpt_status wptStatus; |
| 1492 | wpt_status eventStatus; |
| 1493 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1494 | |
| 1495 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1496 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1497 | ------------------------------------------------------------------------*/ |
| 1498 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1499 | { |
| 1500 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1501 | "WDI API call before module is initialized - Fail request"); |
| 1502 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1503 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1504 | } |
| 1505 | |
| 1506 | /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ |
| 1507 | (the control transport will be closed by the FSM and we'll want |
| 1508 | to wait until that completes)*/ |
| 1509 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1510 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1511 | { |
| 1512 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1513 | "%s: Failed to reset WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1514 | /* fall through and try to finish closing via the FSM */ |
| 1515 | } |
| 1516 | |
| 1517 | /*------------------------------------------------------------------------ |
| 1518 | Fill in Event data and post to the Main FSM |
| 1519 | ------------------------------------------------------------------------*/ |
| 1520 | wdiEventData.wdiRequest = WDI_CLOSE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1521 | wdiEventData.pEventData = NULL; |
| 1522 | wdiEventData.uEventDataSize = 0; |
| 1523 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1524 | wdiEventData.pUserData = NULL; |
| 1525 | |
| 1526 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1527 | |
| 1528 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData); |
| 1529 | |
| 1530 | /*Wait for WCTS to close the control transport |
| 1531 | (but only if we were able to reset the event flag*/ |
| 1532 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1533 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1534 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1535 | WDI_WCTS_ACTION_TIMEOUT); |
| 1536 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1537 | { |
| 1538 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1539 | "%s: Failed to wait on WCTS action event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1540 | } |
| 1541 | } |
| 1542 | |
| 1543 | /* Destroy the WCTS action event */ |
| 1544 | wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1545 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1546 | { |
| 1547 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1548 | "WDI Close failed to destroy an event"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1549 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1550 | } |
| 1551 | |
| 1552 | /* Destroy the Set Power State event */ |
| 1553 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1554 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1555 | { |
| 1556 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1557 | "WDI Close failed to destroy an event"); |
| 1558 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1559 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1560 | } |
| 1561 | |
| 1562 | /*------------------------------------------------------------------------ |
| 1563 | Closes the Data Path Utility Module |
| 1564 | ------------------------------------------------------------------------*/ |
| 1565 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1566 | { |
| 1567 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1568 | "WDI Init failed to close the DP Util Module"); |
| 1569 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1570 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1571 | } |
| 1572 | |
| 1573 | /*destroy the BSS sessions pending Queue */ |
| 1574 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1575 | { |
| 1576 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1577 | } |
| 1578 | |
| 1579 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1580 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1581 | |
| 1582 | /* destroy the WDI Pending Request Queue*/ |
| 1583 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1584 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1585 | /*destroy the response timer */ |
| 1586 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
| 1587 | |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1588 | /*destroy the SSR timer */ |
| 1589 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
| 1590 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1591 | /*invalidate the main synchro mutex */ |
| 1592 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1593 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1594 | { |
| 1595 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1596 | "Failed to delete mutex %d", wptStatus); |
| 1597 | WDI_ASSERT(0); |
| 1598 | } |
| 1599 | |
| 1600 | /*Clear control block. note that this will clear the "magic" |
| 1601 | which will inhibit all asynchronous callbacks*/ |
| 1602 | WDI_CleanCB(&gWDICb); |
| 1603 | |
| 1604 | return wptStatus; |
| 1605 | |
| 1606 | }/*WDI_Close*/ |
| 1607 | |
| 1608 | /** |
| 1609 | @brief WDI_Shutdown will be called during 'SSR shutdown' operation. |
| 1610 | This will do most of the WDI stop & close |
| 1611 | operations without doing any handshake with Riva |
| 1612 | |
| 1613 | This will also make sure that the control transport |
| 1614 | will NOT be closed. |
| 1615 | |
| 1616 | This request will not be queued. |
| 1617 | |
| 1618 | |
| 1619 | WDI_Start must have been called. |
| 1620 | |
| 1621 | @param closeTransport: Close control channel if this is set |
| 1622 | |
| 1623 | @return Result of the function call |
| 1624 | */ |
| 1625 | WDI_Status |
| 1626 | WDI_Shutdown |
| 1627 | ( |
| 1628 | wpt_boolean closeTransport |
| 1629 | ) |
| 1630 | { |
| 1631 | WDI_EventInfoType wdiEventData; |
| 1632 | wpt_status wptStatus; |
| 1633 | int i = 0; |
| 1634 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1635 | |
| 1636 | /*------------------------------------------------------------------------ |
| 1637 | Sanity Check |
| 1638 | ------------------------------------------------------------------------*/ |
| 1639 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1640 | { |
| 1641 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1642 | "WDI API call before module is initialized - Fail request"); |
| 1643 | |
| 1644 | return WDI_STATUS_E_NOT_ALLOWED; |
| 1645 | } |
| 1646 | |
| 1647 | /*------------------------------------------------------------------------ |
| 1648 | Fill in Event data and post to the Main FSM |
| 1649 | ------------------------------------------------------------------------*/ |
| 1650 | wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ; |
| 1651 | wdiEventData.pEventData = NULL; |
| 1652 | wdiEventData.uEventDataSize = 0; |
| 1653 | |
| 1654 | /* Shutdown will not be queued, if the state is busy timer will be |
| 1655 | * stopped & this message will be processed.*/ |
| 1656 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData); |
| 1657 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1658 | { |
| 1659 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1660 | "%s: Failed to process shutdown event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1661 | } |
| 1662 | /* Destroy the Set Power State event */ |
| 1663 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1664 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1665 | { |
| 1666 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1667 | "WDI Close failed to destroy an event"); |
| 1668 | |
| 1669 | WDI_ASSERT(0); |
| 1670 | } |
| 1671 | /*------------------------------------------------------------------------ |
| 1672 | Closes the Data Path Utility Module |
| 1673 | ------------------------------------------------------------------------*/ |
| 1674 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1675 | { |
| 1676 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1677 | "WDI Init failed to close the DP Util Module"); |
| 1678 | |
| 1679 | WDI_ASSERT(0); |
| 1680 | } |
| 1681 | if ( closeTransport ) |
| 1682 | { |
| 1683 | /* Close control transport, called from module unload */ |
| 1684 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1685 | } |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1686 | else |
| 1687 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 1688 | /* Riva is crashed then SMD is already closed so cleaning all |
Madan Mohan Koyyalamudi | fab2a7e | 2012-09-28 15:20:00 -0700 | [diff] [blame] | 1689 | the pending messages in the transport queue */ |
| 1690 | WCTS_ClearPendingQueue(gWDICb.wctsHandle); |
| 1691 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1692 | /*destroy the BSS sessions pending Queue */ |
| 1693 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1694 | { |
| 1695 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1696 | } |
| 1697 | |
| 1698 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1699 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1700 | /* destroy the WDI Pending Request Queue*/ |
| 1701 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1702 | /*destroy the response timer */ |
| 1703 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 1704 | /*destroy the SSR timer */ |
| 1705 | wptStatus = wpalTimerDelete( &gWDICb.ssrTimer); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1706 | |
| 1707 | /*invalidate the main synchro mutex */ |
| 1708 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1709 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1710 | { |
| 1711 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1712 | "%s: Failed to delete mutex %d", __func__, wptStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1713 | WDI_ASSERT(0); |
| 1714 | } |
Madan Mohan Koyyalamudi | 3513bf5 | 2012-09-18 17:35:53 -0700 | [diff] [blame] | 1715 | /* Free the global variables */ |
| 1716 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1717 | wpalMemoryFree(gpFwWlanFeatCaps); |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 1718 | gpHostWlanFeatCaps = NULL; |
| 1719 | gpFwWlanFeatCaps = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1720 | /*Clear control block. note that this will clear the "magic" |
| 1721 | which will inhibit all asynchronous callbacks*/ |
| 1722 | WDI_CleanCB(&gWDICb); |
| 1723 | return wptStatus; |
| 1724 | |
| 1725 | }/*WDI_Shutdown*/ |
| 1726 | |
| 1727 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1728 | /*======================================================================== |
| 1729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1730 | SCAN APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1731 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1732 | ==========================================================================*/ |
| 1733 | |
| 1734 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1735 | @brief WDI_InitScanReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1736 | the WLAN Device to get ready for a scan procedure. Upon |
| 1737 | the call of this API the WLAN DAL will pack and send a |
| 1738 | HAL Init Scan request message to the lower RIVA |
| 1739 | sub-system if DAL is in state STARTED. |
| 1740 | |
| 1741 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1742 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1743 | |
| 1744 | WDI_Start must have been called. |
| 1745 | |
| 1746 | @param wdiInitScanParams: the init scan parameters as specified |
| 1747 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1749 | wdiInitScanRspCb: callback for passing back the response |
| 1750 | of the init scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1751 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1752 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1753 | callback |
| 1754 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1755 | @see WDI_Start |
| 1756 | @return Result of the function call |
| 1757 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1758 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1759 | WDI_InitScanReq |
| 1760 | ( |
| 1761 | WDI_InitScanReqParamsType* pwdiInitScanParams, |
| 1762 | WDI_InitScanRspCb wdiInitScanRspCb, |
| 1763 | void* pUserData |
| 1764 | ) |
| 1765 | { |
| 1766 | WDI_EventInfoType wdiEventData; |
| 1767 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1768 | |
| 1769 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1770 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1771 | ------------------------------------------------------------------------*/ |
| 1772 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1773 | { |
| 1774 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1775 | "WDI API call before module is initialized - Fail request"); |
| 1776 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1777 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1778 | } |
| 1779 | |
| 1780 | /*------------------------------------------------------------------------ |
| 1781 | Fill in Event data and post to the Main FSM |
| 1782 | ------------------------------------------------------------------------*/ |
| 1783 | wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1784 | wdiEventData.pEventData = pwdiInitScanParams; |
| 1785 | wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams); |
| 1786 | wdiEventData.pCBfnc = wdiInitScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1787 | wdiEventData.pUserData = pUserData; |
| 1788 | |
| 1789 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1790 | |
| 1791 | }/*WDI_InitScanReq*/ |
| 1792 | |
| 1793 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1794 | @brief WDI_StartScanReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1795 | wishes to change the Scan channel on the WLAN Device. |
| 1796 | Upon the call of this API the WLAN DAL will pack and |
| 1797 | send a HAL Start Scan request message to the lower RIVA |
| 1798 | sub-system if DAL is in state STARTED. |
| 1799 | |
| 1800 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1801 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1802 | |
| 1803 | WDI_InitScanReq must have been called. |
| 1804 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1805 | @param wdiStartScanParams: the start scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1806 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1807 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1808 | wdiStartScanRspCb: callback for passing back the |
| 1809 | response of the start scan operation received from the |
| 1810 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1811 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1812 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1813 | callback |
| 1814 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1815 | @see WDI_InitScanReq |
| 1816 | @return Result of the function call |
| 1817 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1818 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1819 | WDI_StartScanReq |
| 1820 | ( |
| 1821 | WDI_StartScanReqParamsType* pwdiStartScanParams, |
| 1822 | WDI_StartScanRspCb wdiStartScanRspCb, |
| 1823 | void* pUserData |
| 1824 | ) |
| 1825 | { |
| 1826 | WDI_EventInfoType wdiEventData; |
| 1827 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1828 | |
| 1829 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1830 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1831 | ------------------------------------------------------------------------*/ |
| 1832 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1833 | { |
| 1834 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1835 | "WDI API call before module is initialized - Fail request"); |
| 1836 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1837 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1838 | } |
| 1839 | |
| 1840 | /*------------------------------------------------------------------------ |
| 1841 | Fill in Event data and post to the Main FSM |
| 1842 | ------------------------------------------------------------------------*/ |
| 1843 | wdiEventData.wdiRequest = WDI_START_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1844 | wdiEventData.pEventData = pwdiStartScanParams; |
| 1845 | wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams); |
| 1846 | wdiEventData.pCBfnc = wdiStartScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1847 | wdiEventData.pUserData = pUserData; |
| 1848 | |
| 1849 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1850 | |
| 1851 | }/*WDI_StartScanReq*/ |
| 1852 | |
| 1853 | |
| 1854 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1855 | @brief WDI_EndScanReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1856 | wants to end scanning for a particular channel that it |
| 1857 | had set before by calling Scan Start on the WLAN Device. |
| 1858 | Upon the call of this API the WLAN DAL will pack and |
| 1859 | send a HAL End Scan request message to the lower RIVA |
| 1860 | sub-system if DAL is in state STARTED. |
| 1861 | |
| 1862 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1863 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1864 | |
| 1865 | WDI_StartScanReq must have been called. |
| 1866 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1867 | @param wdiEndScanParams: the end scan parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1868 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1869 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1870 | wdiEndScanRspCb: callback for passing back the response |
| 1871 | of the end scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1872 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1873 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1874 | callback |
| 1875 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1876 | @see WDI_StartScanReq |
| 1877 | @return Result of the function call |
| 1878 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1879 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1880 | WDI_EndScanReq |
| 1881 | ( |
| 1882 | WDI_EndScanReqParamsType* pwdiEndScanParams, |
| 1883 | WDI_EndScanRspCb wdiEndScanRspCb, |
| 1884 | void* pUserData |
| 1885 | ) |
| 1886 | { |
| 1887 | WDI_EventInfoType wdiEventData; |
| 1888 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1889 | |
| 1890 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1891 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1892 | ------------------------------------------------------------------------*/ |
| 1893 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1894 | { |
| 1895 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1896 | "WDI API call before module is initialized - Fail request"); |
| 1897 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1898 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1899 | } |
| 1900 | |
| 1901 | /*------------------------------------------------------------------------ |
| 1902 | Fill in Event data and post to the Main FSM |
| 1903 | ------------------------------------------------------------------------*/ |
| 1904 | wdiEventData.wdiRequest = WDI_END_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1905 | wdiEventData.pEventData = pwdiEndScanParams; |
| 1906 | wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams); |
| 1907 | wdiEventData.pCBfnc = wdiEndScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1908 | wdiEventData.pUserData = pUserData; |
| 1909 | |
| 1910 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1911 | |
| 1912 | }/*WDI_EndScanReq*/ |
| 1913 | |
| 1914 | |
| 1915 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1916 | @brief WDI_FinishScanReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1917 | completed the scan process on the WLAN Device. Upon the |
| 1918 | call of this API the WLAN DAL will pack and send a HAL |
| 1919 | Finish Scan Request request message to the lower RIVA |
| 1920 | sub-system if DAL is in state STARTED. |
| 1921 | |
| 1922 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1923 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1924 | |
| 1925 | WDI_InitScanReq must have been called. |
| 1926 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1927 | @param wdiFinishScanParams: the finish scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1928 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1929 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1930 | wdiFinishScanRspCb: callback for passing back the |
| 1931 | response of the finish scan operation received from the |
| 1932 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1933 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1934 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1935 | callback |
| 1936 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1937 | @see WDI_InitScanReq |
| 1938 | @return Result of the function call |
| 1939 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1940 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1941 | WDI_FinishScanReq |
| 1942 | ( |
| 1943 | WDI_FinishScanReqParamsType* pwdiFinishScanParams, |
| 1944 | WDI_FinishScanRspCb wdiFinishScanRspCb, |
| 1945 | void* pUserData |
| 1946 | ) |
| 1947 | { |
| 1948 | WDI_EventInfoType wdiEventData; |
| 1949 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1950 | |
| 1951 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1952 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1953 | ------------------------------------------------------------------------*/ |
| 1954 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1955 | { |
| 1956 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1957 | "WDI API call before module is initialized - Fail request"); |
| 1958 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1959 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1960 | } |
| 1961 | |
| 1962 | /*------------------------------------------------------------------------ |
| 1963 | Fill in Event data and post to the Main FSM |
| 1964 | ------------------------------------------------------------------------*/ |
| 1965 | wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1966 | wdiEventData.pEventData = pwdiFinishScanParams; |
| 1967 | wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams); |
| 1968 | wdiEventData.pCBfnc = wdiFinishScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1969 | wdiEventData.pUserData = pUserData; |
| 1970 | |
| 1971 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1972 | |
| 1973 | }/*WDI_FinishScanReq*/ |
| 1974 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1975 | /*======================================================================== |
| 1976 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1977 | ASSOCIATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1978 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1979 | ==========================================================================*/ |
| 1980 | |
| 1981 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1982 | @brief WDI_JoinReq will be called when the upper MAC is ready |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1983 | to start an association procedure to a BSS. Upon the |
| 1984 | call of this API the WLAN DAL will pack and send a HAL |
| 1985 | Join request message to the lower RIVA sub-system if |
| 1986 | DAL is in state STARTED. |
| 1987 | |
| 1988 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1989 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1990 | |
| 1991 | WDI_Start must have been called. |
| 1992 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1993 | @param wdiJoinParams: the join parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1994 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1995 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1996 | wdiJoinRspCb: callback for passing back the response of |
| 1997 | the join operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1998 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1999 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2000 | callback |
| 2001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2002 | @see WDI_Start |
| 2003 | @return Result of the function call |
| 2004 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2005 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2006 | WDI_JoinReq |
| 2007 | ( |
| 2008 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 2009 | WDI_JoinRspCb wdiJoinRspCb, |
| 2010 | void* pUserData |
| 2011 | ) |
| 2012 | { |
| 2013 | WDI_EventInfoType wdiEventData; |
| 2014 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2015 | |
| 2016 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2017 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2018 | ------------------------------------------------------------------------*/ |
| 2019 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2020 | { |
| 2021 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2022 | "WDI API call before module is initialized - Fail request"); |
| 2023 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2024 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2025 | } |
| 2026 | |
| 2027 | /*------------------------------------------------------------------------ |
| 2028 | Fill in Event data and post to the Main FSM |
| 2029 | ------------------------------------------------------------------------*/ |
| 2030 | wdiEventData.wdiRequest = WDI_JOIN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2031 | wdiEventData.pEventData = pwdiJoinParams; |
| 2032 | wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams); |
| 2033 | wdiEventData.pCBfnc = wdiJoinRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2034 | wdiEventData.pUserData = pUserData; |
| 2035 | |
| 2036 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2037 | |
| 2038 | }/*WDI_JoinReq*/ |
| 2039 | |
| 2040 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2041 | @brief WDI_ConfigBSSReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2042 | wishes to configure the newly acquired or in process of |
| 2043 | being acquired BSS to the HW . Upon the call of this API |
| 2044 | the WLAN DAL will pack and send a HAL Config BSS request |
| 2045 | message to the lower RIVA sub-system if DAL is in state |
| 2046 | STARTED. |
| 2047 | |
| 2048 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2049 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2050 | |
| 2051 | WDI_JoinReq must have been called. |
| 2052 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2053 | @param wdiConfigBSSParams: the config BSS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2054 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2056 | wdiConfigBSSRspCb: callback for passing back the |
| 2057 | response of the config BSS operation received from the |
| 2058 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2060 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2061 | callback |
| 2062 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2063 | @see WDI_JoinReq |
| 2064 | @return Result of the function call |
| 2065 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2066 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2067 | WDI_ConfigBSSReq |
| 2068 | ( |
| 2069 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams, |
| 2070 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb, |
| 2071 | void* pUserData |
| 2072 | ) |
| 2073 | { |
| 2074 | WDI_EventInfoType wdiEventData; |
| 2075 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2076 | |
| 2077 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2078 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2079 | ------------------------------------------------------------------------*/ |
| 2080 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2081 | { |
| 2082 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2083 | "WDI API call before module is initialized - Fail request"); |
| 2084 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2085 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2086 | } |
| 2087 | |
| 2088 | /*------------------------------------------------------------------------ |
| 2089 | Fill in Event data and post to the Main FSM |
| 2090 | ------------------------------------------------------------------------*/ |
| 2091 | wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2092 | wdiEventData.pEventData = pwdiConfigBSSParams; |
| 2093 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams); |
| 2094 | wdiEventData.pCBfnc = wdiConfigBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2095 | wdiEventData.pUserData = pUserData; |
| 2096 | |
| 2097 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2098 | |
| 2099 | }/*WDI_ConfigBSSReq*/ |
| 2100 | |
| 2101 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2102 | @brief WDI_DelBSSReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2103 | disassociating from the BSS and wishes to notify HW. |
| 2104 | Upon the call of this API the WLAN DAL will pack and |
| 2105 | send a HAL Del BSS request message to the lower RIVA |
| 2106 | sub-system if DAL is in state STARTED. |
| 2107 | |
| 2108 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2109 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2110 | |
| 2111 | WDI_ConfigBSSReq or WDI_PostAssocReq must have been called. |
| 2112 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2113 | @param wdiDelBSSParams: the del BSS parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2114 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2115 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2116 | wdiDelBSSRspCb: callback for passing back the response |
| 2117 | of the del bss operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2118 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2119 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2120 | callback |
| 2121 | |
| 2122 | @see WDI_ConfigBSSReq, WDI_PostAssocReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2123 | @return Result of the function call |
| 2124 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2125 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2126 | WDI_DelBSSReq |
| 2127 | ( |
| 2128 | WDI_DelBSSReqParamsType* pwdiDelBSSParams, |
| 2129 | WDI_DelBSSRspCb wdiDelBSSRspCb, |
| 2130 | void* pUserData |
| 2131 | ) |
| 2132 | { |
| 2133 | WDI_EventInfoType wdiEventData; |
| 2134 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2135 | |
| 2136 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2137 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2138 | ------------------------------------------------------------------------*/ |
| 2139 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2140 | { |
| 2141 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2142 | "WDI API call before module is initialized - Fail request"); |
| 2143 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2144 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2145 | } |
| 2146 | |
| 2147 | /*------------------------------------------------------------------------ |
| 2148 | Fill in Event data and post to the Main FSM |
| 2149 | ------------------------------------------------------------------------*/ |
| 2150 | wdiEventData.wdiRequest = WDI_DEL_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2151 | wdiEventData.pEventData = pwdiDelBSSParams; |
| 2152 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams); |
| 2153 | wdiEventData.pCBfnc = wdiDelBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2154 | wdiEventData.pUserData = pUserData; |
| 2155 | |
| 2156 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2157 | |
| 2158 | }/*WDI_DelBSSReq*/ |
| 2159 | |
| 2160 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2161 | @brief WDI_PostAssocReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2162 | associated to a BSS and wishes to configure HW for |
| 2163 | associated state. Upon the call of this API the WLAN DAL |
| 2164 | will pack and send a HAL Post Assoc request message to |
| 2165 | the lower RIVA sub-system if DAL is in state STARTED. |
| 2166 | |
| 2167 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2168 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2169 | |
| 2170 | WDI_JoinReq must have been called. |
| 2171 | |
| 2172 | @param wdiPostAssocReqParams: the assoc parameters as specified |
| 2173 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2174 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2175 | wdiPostAssocRspCb: callback for passing back the |
| 2176 | response of the post assoc operation received from the |
| 2177 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2178 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2179 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2180 | callback |
| 2181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2182 | @see WDI_JoinReq |
| 2183 | @return Result of the function call |
| 2184 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2185 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2186 | WDI_PostAssocReq |
| 2187 | ( |
| 2188 | WDI_PostAssocReqParamsType* pwdiPostAssocReqParams, |
| 2189 | WDI_PostAssocRspCb wdiPostAssocRspCb, |
| 2190 | void* pUserData |
| 2191 | ) |
| 2192 | { |
| 2193 | WDI_EventInfoType wdiEventData; |
| 2194 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2195 | |
| 2196 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2197 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2198 | ------------------------------------------------------------------------*/ |
| 2199 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2200 | { |
| 2201 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2202 | "WDI API call before module is initialized - Fail request"); |
| 2203 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2204 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2205 | } |
| 2206 | |
| 2207 | /*------------------------------------------------------------------------ |
| 2208 | Fill in Event data and post to the Main FSM |
| 2209 | ------------------------------------------------------------------------*/ |
| 2210 | wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2211 | wdiEventData.pEventData = pwdiPostAssocReqParams; |
| 2212 | wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams); |
| 2213 | wdiEventData.pCBfnc = wdiPostAssocRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2214 | wdiEventData.pUserData = pUserData; |
| 2215 | |
| 2216 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2217 | |
| 2218 | }/*WDI_PostAssocReq*/ |
| 2219 | |
| 2220 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2221 | @brief WDI_DelSTAReq will be called when the upper MAC when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2222 | association with another STA has ended and the station |
| 2223 | must be deleted from HW. Upon the call of this API the |
| 2224 | WLAN DAL will pack and send a HAL Del STA request |
| 2225 | message to the lower RIVA sub-system if DAL is in state |
| 2226 | STARTED. |
| 2227 | |
| 2228 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2229 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2230 | |
| 2231 | WDI_PostAssocReq must have been called. |
| 2232 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2233 | @param wdiDelSTAParams: the Del STA parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2234 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2235 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | wdiDelSTARspCb: callback for passing back the response |
| 2237 | of the del STA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2239 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2240 | callback |
| 2241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2242 | @see WDI_PostAssocReq |
| 2243 | @return Result of the function call |
| 2244 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2245 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2246 | WDI_DelSTAReq |
| 2247 | ( |
| 2248 | WDI_DelSTAReqParamsType* pwdiDelSTAParams, |
| 2249 | WDI_DelSTARspCb wdiDelSTARspCb, |
| 2250 | void* pUserData |
| 2251 | ) |
| 2252 | { |
| 2253 | WDI_EventInfoType wdiEventData; |
| 2254 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2255 | |
| 2256 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2257 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2258 | ------------------------------------------------------------------------*/ |
| 2259 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2260 | { |
| 2261 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2262 | "WDI API call before module is initialized - Fail request"); |
| 2263 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2264 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2265 | } |
| 2266 | |
| 2267 | /*------------------------------------------------------------------------ |
| 2268 | Fill in Event data and post to the Main FSM |
| 2269 | ------------------------------------------------------------------------*/ |
| 2270 | wdiEventData.wdiRequest = WDI_DEL_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2271 | wdiEventData.pEventData = pwdiDelSTAParams; |
| 2272 | wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams); |
| 2273 | wdiEventData.pCBfnc = wdiDelSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2274 | wdiEventData.pUserData = pUserData; |
| 2275 | |
| 2276 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2277 | |
| 2278 | }/*WDI_DelSTAReq*/ |
| 2279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2280 | /*======================================================================== |
| 2281 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2282 | SECURITY APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2284 | ==========================================================================*/ |
| 2285 | |
| 2286 | /** |
| 2287 | @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to |
| 2288 | install a BSS encryption key on the HW. Upon the call of this |
| 2289 | API the WLAN DAL will pack and send a Set BSS Key request |
| 2290 | message to the lower RIVA sub-system if DAL is in state |
| 2291 | STARTED. |
| 2292 | |
| 2293 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2294 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2295 | |
| 2296 | WDI_PostAssocReq must have been called. |
| 2297 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2298 | @param wdiSetBSSKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2299 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2300 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2301 | wdiSetBSSKeyRspCb: callback for passing back the |
| 2302 | response of the set BSS Key operation received from the |
| 2303 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2304 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2305 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2306 | callback |
| 2307 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2308 | @see WDI_PostAssocReq |
| 2309 | @return Result of the function call |
| 2310 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2311 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2312 | WDI_SetBSSKeyReq |
| 2313 | ( |
| 2314 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams, |
| 2315 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb, |
| 2316 | void* pUserData |
| 2317 | ) |
| 2318 | { |
| 2319 | WDI_EventInfoType wdiEventData; |
| 2320 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2321 | |
| 2322 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2323 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2324 | ------------------------------------------------------------------------*/ |
| 2325 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2326 | { |
| 2327 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2328 | "WDI API call before module is initialized - Fail request"); |
| 2329 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2330 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2331 | } |
| 2332 | |
| 2333 | /*------------------------------------------------------------------------ |
| 2334 | Fill in Event data and post to the Main FSM |
| 2335 | ------------------------------------------------------------------------*/ |
| 2336 | wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2337 | wdiEventData.pEventData = pwdiSetBSSKeyParams; |
| 2338 | wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams); |
| 2339 | wdiEventData.pCBfnc = wdiSetBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2340 | wdiEventData.pUserData = pUserData; |
| 2341 | |
| 2342 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2343 | |
| 2344 | }/*WDI_SetBSSKeyReq*/ |
| 2345 | |
| 2346 | /** |
| 2347 | @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to |
| 2348 | uninstall a BSS key from HW. Upon the call of this API the |
| 2349 | WLAN DAL will pack and send a HAL Remove BSS Key request |
| 2350 | message to the lower RIVA sub-system if DAL is in state |
| 2351 | STARTED. |
| 2352 | |
| 2353 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2354 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2355 | |
| 2356 | WDI_SetBSSKeyReq must have been called. |
| 2357 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2358 | @param wdiRemoveBSSKeyParams: the remove BSS key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2359 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2361 | wdiRemoveBSSKeyRspCb: callback for passing back the |
| 2362 | response of the remove BSS key operation received from |
| 2363 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2364 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2365 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2366 | callback |
| 2367 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2368 | @see WDI_SetBSSKeyReq |
| 2369 | @return Result of the function call |
| 2370 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2371 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2372 | WDI_RemoveBSSKeyReq |
| 2373 | ( |
| 2374 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams, |
| 2375 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb, |
| 2376 | void* pUserData |
| 2377 | ) |
| 2378 | { |
| 2379 | WDI_EventInfoType wdiEventData; |
| 2380 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2381 | |
| 2382 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2383 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2384 | ------------------------------------------------------------------------*/ |
| 2385 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2386 | { |
| 2387 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2388 | "WDI API call before module is initialized - Fail request"); |
| 2389 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2390 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2391 | } |
| 2392 | |
| 2393 | /*------------------------------------------------------------------------ |
| 2394 | Fill in Event data and post to the Main FSM |
| 2395 | ------------------------------------------------------------------------*/ |
| 2396 | wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2397 | wdiEventData.pEventData = pwdiRemoveBSSKeyParams; |
| 2398 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams); |
| 2399 | wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2400 | wdiEventData.pUserData = pUserData; |
| 2401 | |
| 2402 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2403 | |
| 2404 | }/*WDI_RemoveBSSKeyReq*/ |
| 2405 | |
| 2406 | |
| 2407 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2408 | @brief WDI_SetSTAKeyReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2409 | ready to install a STA(ast) encryption key in HW. Upon |
| 2410 | the call of this API the WLAN DAL will pack and send a |
| 2411 | HAL Set STA Key request message to the lower RIVA |
| 2412 | sub-system if DAL is in state STARTED. |
| 2413 | |
| 2414 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2415 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2416 | |
| 2417 | WDI_PostAssocReq must have been called. |
| 2418 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2419 | @param wdiSetSTAKeyParams: the set STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2420 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2422 | wdiSetSTAKeyRspCb: callback for passing back the |
| 2423 | response of the set STA key operation received from the |
| 2424 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2425 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2426 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2427 | callback |
| 2428 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2429 | @see WDI_PostAssocReq |
| 2430 | @return Result of the function call |
| 2431 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2432 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2433 | WDI_SetSTAKeyReq |
| 2434 | ( |
| 2435 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams, |
| 2436 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb, |
| 2437 | void* pUserData |
| 2438 | ) |
| 2439 | { |
| 2440 | WDI_EventInfoType wdiEventData; |
| 2441 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2442 | |
| 2443 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2444 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2445 | ------------------------------------------------------------------------*/ |
| 2446 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2447 | { |
| 2448 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2449 | "WDI API call before module is initialized - Fail request"); |
| 2450 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2451 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2452 | } |
| 2453 | |
| 2454 | /*------------------------------------------------------------------------ |
| 2455 | Fill in Event data and post to the Main FSM |
| 2456 | ------------------------------------------------------------------------*/ |
| 2457 | wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2458 | wdiEventData.pEventData = pwdiSetSTAKeyParams; |
| 2459 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams); |
| 2460 | wdiEventData.pCBfnc = wdiSetSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2461 | wdiEventData.pUserData = pUserData; |
| 2462 | |
| 2463 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2464 | |
| 2465 | }/*WDI_SetSTAKeyReq*/ |
| 2466 | |
| 2467 | |
| 2468 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2469 | @brief WDI_RemoveSTAKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2470 | wants to uninstall a previously set STA key in HW. Upon |
| 2471 | the call of this API the WLAN DAL will pack and send a |
| 2472 | HAL Remove STA Key request message to the lower RIVA |
| 2473 | sub-system if DAL is in state STARTED. |
| 2474 | |
| 2475 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2476 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2477 | |
| 2478 | WDI_SetSTAKeyReq must have been called. |
| 2479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2480 | @param wdiRemoveSTAKeyParams: the remove STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2481 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2482 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2483 | wdiRemoveSTAKeyRspCb: callback for passing back the |
| 2484 | response of the remove STA key operation received from |
| 2485 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2486 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2487 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2488 | callback |
| 2489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2490 | @see WDI_SetSTAKeyReq |
| 2491 | @return Result of the function call |
| 2492 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2493 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2494 | WDI_RemoveSTAKeyReq |
| 2495 | ( |
| 2496 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams, |
| 2497 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb, |
| 2498 | void* pUserData |
| 2499 | ) |
| 2500 | { |
| 2501 | WDI_EventInfoType wdiEventData; |
| 2502 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2503 | |
| 2504 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2505 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2506 | ------------------------------------------------------------------------*/ |
| 2507 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2508 | { |
| 2509 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2510 | "WDI API call before module is initialized - Fail request"); |
| 2511 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2512 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2513 | } |
| 2514 | |
| 2515 | /*------------------------------------------------------------------------ |
| 2516 | Fill in Event data and post to the Main FSM |
| 2517 | ------------------------------------------------------------------------*/ |
| 2518 | wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2519 | wdiEventData.pEventData = pwdiRemoveSTAKeyParams; |
| 2520 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams); |
| 2521 | wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2522 | wdiEventData.pUserData = pUserData; |
| 2523 | |
| 2524 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2525 | |
| 2526 | }/*WDI_RemoveSTAKeyReq*/ |
| 2527 | |
| 2528 | |
| 2529 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2530 | @brief WDI_SetSTABcastKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2531 | wants to install a STA Bcast encryption key on the HW. |
| 2532 | Upon the call of this API the WLAN DAL will pack and |
| 2533 | send a HAL Start request message to the lower RIVA |
| 2534 | sub-system if DAL is in state STARTED. |
| 2535 | |
| 2536 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2537 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2538 | |
| 2539 | WDI_PostAssocReq must have been called. |
| 2540 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2541 | @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2542 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2543 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2544 | wdiSetSTABcastKeyRspCb: callback for passing back the |
| 2545 | response of the set BSS Key operation received from the |
| 2546 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2547 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2548 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2549 | callback |
| 2550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2551 | @see WDI_PostAssocReq |
| 2552 | @return Result of the function call |
| 2553 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2554 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2555 | WDI_SetSTABcastKeyReq |
| 2556 | ( |
| 2557 | WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams, |
| 2558 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb, |
| 2559 | void* pUserData |
| 2560 | ) |
| 2561 | |
| 2562 | { |
| 2563 | WDI_EventInfoType wdiEventData; |
| 2564 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2565 | |
| 2566 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2567 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2568 | ------------------------------------------------------------------------*/ |
| 2569 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2570 | { |
| 2571 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2572 | "WDI API call before module is initialized - Fail request"); |
| 2573 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2574 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2575 | } |
| 2576 | |
| 2577 | /*------------------------------------------------------------------------ |
| 2578 | Fill in Event data and post to the Main FSM |
| 2579 | ------------------------------------------------------------------------*/ |
| 2580 | wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2581 | wdiEventData.pEventData = pwdiSetSTABcastKeyParams; |
| 2582 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams); |
| 2583 | wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2584 | wdiEventData.pUserData = pUserData; |
| 2585 | |
| 2586 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2587 | |
| 2588 | }/*WDI_SetSTABcastKeyReq*/ |
| 2589 | |
| 2590 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2591 | @brief WDI_RemoveSTABcastKeyReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2592 | MAC wants to uninstall a STA Bcast key from HW. Upon the |
| 2593 | call of this API the WLAN DAL will pack and send a HAL |
| 2594 | Remove STA Bcast Key request message to the lower RIVA |
| 2595 | sub-system if DAL is in state STARTED. |
| 2596 | |
| 2597 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2598 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2599 | |
| 2600 | WDI_SetSTABcastKeyReq must have been called. |
| 2601 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2602 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2603 | parameters as specified by the Device |
| 2604 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2606 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2607 | response of the remove STA Bcast key operation received |
| 2608 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2609 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2610 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2611 | callback |
| 2612 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2613 | @see WDI_SetSTABcastKeyReq |
| 2614 | @return Result of the function call |
| 2615 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2616 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | WDI_RemoveSTABcastKeyReq |
| 2618 | ( |
| 2619 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams, |
| 2620 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb, |
| 2621 | void* pUserData |
| 2622 | ) |
| 2623 | { |
| 2624 | WDI_EventInfoType wdiEventData; |
| 2625 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2626 | |
| 2627 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2628 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2629 | ------------------------------------------------------------------------*/ |
| 2630 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2631 | { |
| 2632 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2633 | "WDI API call before module is initialized - Fail request"); |
| 2634 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2635 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2636 | } |
| 2637 | |
| 2638 | /*------------------------------------------------------------------------ |
| 2639 | Fill in Event data and post to the Main FSM |
| 2640 | ------------------------------------------------------------------------*/ |
| 2641 | wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2642 | wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams; |
| 2643 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams); |
| 2644 | wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2645 | wdiEventData.pUserData = pUserData; |
| 2646 | |
| 2647 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2648 | |
| 2649 | }/*WDI_RemoveSTABcastKeyReq*/ |
| 2650 | |
| 2651 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2652 | @brief WDI_SetMaxTxPowerReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2653 | MAC wants to set Max Tx Power to HW. Upon the |
| 2654 | call of this API the WLAN DAL will pack and send a HAL |
| 2655 | Remove STA Bcast Key request message to the lower RIVA |
| 2656 | sub-system if DAL is in state STARTED. |
| 2657 | |
| 2658 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2659 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2660 | |
| 2661 | WDI_SetSTABcastKeyReq must have been called. |
| 2662 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2663 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2664 | parameters as specified by the Device |
| 2665 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2666 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2667 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2668 | response of the remove STA Bcast key operation received |
| 2669 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2671 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2672 | callback |
| 2673 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2674 | @see WDI_SetMaxTxPowerReq |
| 2675 | @return Result of the function call |
| 2676 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2677 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2678 | WDI_SetMaxTxPowerReq |
| 2679 | ( |
| 2680 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams, |
| 2681 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb, |
| 2682 | void* pUserData |
| 2683 | ) |
| 2684 | { |
| 2685 | WDI_EventInfoType wdiEventData; |
| 2686 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2687 | |
| 2688 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2689 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2690 | ------------------------------------------------------------------------*/ |
| 2691 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2692 | { |
| 2693 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2694 | "WDI API call before module is initialized - Fail request"); |
| 2695 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2696 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2697 | } |
| 2698 | |
| 2699 | /*------------------------------------------------------------------------ |
| 2700 | Fill in Event data and post to the Main FSM |
| 2701 | ------------------------------------------------------------------------*/ |
| 2702 | wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2703 | wdiEventData.pEventData = pwdiSetMaxTxPowerParams; |
| 2704 | wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams); |
| 2705 | wdiEventData.pCBfnc = wdiReqStatusCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2706 | wdiEventData.pUserData = pUserData; |
| 2707 | |
| 2708 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2709 | } |
| 2710 | |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 2711 | /** |
| 2712 | @brief WDI_SetTxPowerReq will be called when the upper |
| 2713 | MAC wants to set Tx Power to HW. |
| 2714 | In state BUSY this request will be queued. Request won't |
| 2715 | be allowed in any other state. |
| 2716 | |
| 2717 | |
| 2718 | @param pwdiSetTxPowerParams: set TS Power parameters |
| 2719 | BSSID and target TX Power with dbm included |
| 2720 | |
| 2721 | wdiReqStatusCb: callback for passing back the response |
| 2722 | |
| 2723 | pUserData: user data will be passed back with the |
| 2724 | callback |
| 2725 | |
| 2726 | @return Result of the function call |
| 2727 | */ |
| 2728 | WDI_Status |
| 2729 | WDI_SetTxPowerReq |
| 2730 | ( |
| 2731 | WDI_SetTxPowerParamsType* pwdiSetTxPowerParams, |
| 2732 | WDA_SetTxPowerRspCb wdiReqStatusCb, |
| 2733 | void* pUserData |
| 2734 | ) |
| 2735 | { |
| 2736 | WDI_EventInfoType wdiEventData; |
| 2737 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2738 | |
| 2739 | /*------------------------------------------------------------------------ |
| 2740 | Sanity Check |
| 2741 | ------------------------------------------------------------------------*/ |
| 2742 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2743 | { |
| 2744 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2745 | "WDI API call before module is initialized - Fail request"); |
| 2746 | |
| 2747 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2748 | } |
| 2749 | |
| 2750 | /*------------------------------------------------------------------------ |
| 2751 | Fill in Event data and post to the Main FSM |
| 2752 | ------------------------------------------------------------------------*/ |
| 2753 | wdiEventData.wdiRequest = WDI_SET_TX_POWER_REQ; |
| 2754 | wdiEventData.pEventData = pwdiSetTxPowerParams; |
| 2755 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPowerParams); |
| 2756 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2757 | wdiEventData.pUserData = pUserData; |
| 2758 | |
| 2759 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2760 | } |
| 2761 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2762 | #ifdef FEATURE_WLAN_CCX |
| 2763 | WDI_Status |
| 2764 | WDI_TSMStatsReq |
| 2765 | ( |
| 2766 | WDI_TSMStatsReqParamsType* pwdiTsmReqParams, |
| 2767 | WDI_TsmRspCb wdiReqStatusCb, |
| 2768 | void* pUserData |
| 2769 | ) |
| 2770 | { |
| 2771 | WDI_EventInfoType wdiEventData; |
| 2772 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2773 | /*------------------------------------------------------------------------ |
| 2774 | Sanity Check |
| 2775 | ------------------------------------------------------------------------*/ |
| 2776 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2777 | { |
| 2778 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2779 | "WDI API call before module is initialized - Fail request"); |
| 2780 | |
| 2781 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2782 | } |
| 2783 | |
| 2784 | /*------------------------------------------------------------------------ |
| 2785 | Fill in Event data and post to the Main FSM |
| 2786 | ------------------------------------------------------------------------*/ |
| 2787 | wdiEventData.wdiRequest = WDI_TSM_STATS_REQ; |
| 2788 | wdiEventData.pEventData = pwdiTsmReqParams; |
| 2789 | wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams); |
| 2790 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2791 | wdiEventData.pUserData = pUserData; |
| 2792 | |
| 2793 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2794 | |
| 2795 | } |
| 2796 | #endif |
| 2797 | |
| 2798 | /*======================================================================== |
| 2799 | |
| 2800 | QoS and BA APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2801 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2802 | ==========================================================================*/ |
| 2803 | |
| 2804 | /** |
| 2805 | @brief WDI_AddTSReq will be called when the upper MAC to inform |
| 2806 | the device of a successful add TSpec negotiation. HW |
| 2807 | needs to receive the TSpec Info from the UMAC in order |
| 2808 | to configure properly the QoS data traffic. Upon the |
| 2809 | call of this API the WLAN DAL will pack and send a HAL |
| 2810 | Add TS request message to the lower RIVA sub-system if |
| 2811 | DAL is in state STARTED. |
| 2812 | |
| 2813 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2814 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2815 | |
| 2816 | WDI_PostAssocReq must have been called. |
| 2817 | |
| 2818 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 2819 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2820 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2821 | wdiAddTsRspCb: callback for passing back the response of |
| 2822 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2823 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2824 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2825 | callback |
| 2826 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2827 | @see WDI_PostAssocReq |
| 2828 | @return Result of the function call |
| 2829 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2830 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2831 | WDI_AddTSReq |
| 2832 | ( |
| 2833 | WDI_AddTSReqParamsType* pwdiAddTsReqParams, |
| 2834 | WDI_AddTsRspCb wdiAddTsRspCb, |
| 2835 | void* pUserData |
| 2836 | ) |
| 2837 | { |
| 2838 | WDI_EventInfoType wdiEventData; |
| 2839 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2840 | |
| 2841 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2842 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2843 | ------------------------------------------------------------------------*/ |
| 2844 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2845 | { |
| 2846 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2847 | "WDI API call before module is initialized - Fail request"); |
| 2848 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2849 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2850 | } |
| 2851 | |
| 2852 | /*------------------------------------------------------------------------ |
| 2853 | Fill in Event data and post to the Main FSM |
| 2854 | ------------------------------------------------------------------------*/ |
| 2855 | wdiEventData.wdiRequest = WDI_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2856 | wdiEventData.pEventData = pwdiAddTsReqParams; |
| 2857 | wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams); |
| 2858 | wdiEventData.pCBfnc = wdiAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2859 | wdiEventData.pUserData = pUserData; |
| 2860 | |
| 2861 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2862 | |
| 2863 | }/*WDI_AddTSReq*/ |
| 2864 | |
| 2865 | |
| 2866 | |
| 2867 | /** |
| 2868 | @brief WDI_DelTSReq will be called when the upper MAC has ended |
| 2869 | admission on a specific AC. This is to inform HW that |
| 2870 | QoS traffic parameters must be rest. Upon the call of |
| 2871 | this API the WLAN DAL will pack and send a HAL Del TS |
| 2872 | request message to the lower RIVA sub-system if DAL is |
| 2873 | in state STARTED. |
| 2874 | |
| 2875 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2876 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2877 | |
| 2878 | WDI_AddTSReq must have been called. |
| 2879 | |
| 2880 | @param wdiDelTsReqParams: the del TS parameters as specified by |
| 2881 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2882 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2883 | wdiDelTsRspCb: callback for passing back the response of |
| 2884 | the del TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2885 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2886 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2887 | callback |
| 2888 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2889 | @see WDI_AddTSReq |
| 2890 | @return Result of the function call |
| 2891 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2892 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2893 | WDI_DelTSReq |
| 2894 | ( |
| 2895 | WDI_DelTSReqParamsType* pwdiDelTsReqParams, |
| 2896 | WDI_DelTsRspCb wdiDelTsRspCb, |
| 2897 | void* pUserData |
| 2898 | ) |
| 2899 | { |
| 2900 | WDI_EventInfoType wdiEventData; |
| 2901 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2902 | |
| 2903 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2904 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2905 | ------------------------------------------------------------------------*/ |
| 2906 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2907 | { |
| 2908 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2909 | "WDI API call before module is initialized - Fail request"); |
| 2910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2911 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2912 | } |
| 2913 | |
| 2914 | /*------------------------------------------------------------------------ |
| 2915 | Fill in Event data and post to the Main FSM |
| 2916 | ------------------------------------------------------------------------*/ |
| 2917 | wdiEventData.wdiRequest = WDI_DEL_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2918 | wdiEventData.pEventData = pwdiDelTsReqParams; |
| 2919 | wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams); |
| 2920 | wdiEventData.pCBfnc = wdiDelTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2921 | wdiEventData.pUserData = pUserData; |
| 2922 | |
| 2923 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2924 | |
| 2925 | }/*WDI_DelTSReq*/ |
| 2926 | |
| 2927 | |
| 2928 | |
| 2929 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2930 | @brief WDI_UpdateEDCAParams will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2931 | wishes to update the EDCA parameters used by HW for QoS |
| 2932 | data traffic. Upon the call of this API the WLAN DAL |
| 2933 | will pack and send a HAL Update EDCA Params request |
| 2934 | message to the lower RIVA sub-system if DAL is in state |
| 2935 | STARTED. |
| 2936 | |
| 2937 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2938 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2939 | |
| 2940 | WDI_PostAssocReq must have been called. |
| 2941 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2942 | @param wdiUpdateEDCAParams: the start parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2943 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2945 | wdiUpdateEDCAParamsRspCb: callback for passing back the |
| 2946 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2948 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2949 | callback |
| 2950 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2951 | @see WDI_PostAssocReq |
| 2952 | @return Result of the function call |
| 2953 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2954 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2955 | WDI_UpdateEDCAParams |
| 2956 | ( |
| 2957 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams, |
| 2958 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb, |
| 2959 | void* pUserData |
| 2960 | ) |
| 2961 | { |
| 2962 | WDI_EventInfoType wdiEventData; |
| 2963 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2964 | |
| 2965 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2966 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2967 | ------------------------------------------------------------------------*/ |
| 2968 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2969 | { |
| 2970 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2971 | "WDI API call before module is initialized - Fail request"); |
| 2972 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2973 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2974 | } |
| 2975 | |
| 2976 | /*------------------------------------------------------------------------ |
| 2977 | Fill in Event data and post to the Main FSM |
| 2978 | ------------------------------------------------------------------------*/ |
| 2979 | wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2980 | wdiEventData.pEventData = pwdiUpdateEDCAParams; |
| 2981 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams); |
| 2982 | wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2983 | wdiEventData.pUserData = pUserData; |
| 2984 | |
| 2985 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2986 | |
| 2987 | }/*WDI_UpdateEDCAParams*/ |
| 2988 | |
| 2989 | |
| 2990 | /** |
| 2991 | @brief WDI_AddBASessionReq will be called when the upper MAC has setup |
| 2992 | successfully a BA session and needs to notify the HW for |
| 2993 | the appropriate settings to take place. Upon the call of |
| 2994 | this API the WLAN DAL will pack and send a HAL Add BA |
| 2995 | request message to the lower RIVA sub-system if DAL is |
| 2996 | in state STARTED. |
| 2997 | |
| 2998 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2999 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3000 | |
| 3001 | WDI_PostAssocReq must have been called. |
| 3002 | |
| 3003 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 3004 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3005 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3006 | wdiAddBARspCb: callback for passing back the response of |
| 3007 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3008 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3009 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3010 | callback |
| 3011 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3012 | @see WDI_PostAssocReq |
| 3013 | @return Result of the function call |
| 3014 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3015 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3016 | WDI_AddBASessionReq |
| 3017 | ( |
| 3018 | WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams, |
| 3019 | WDI_AddBASessionRspCb wdiAddBASessionRspCb, |
| 3020 | void* pUserData |
| 3021 | ) |
| 3022 | { |
| 3023 | WDI_EventInfoType wdiEventData; |
| 3024 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3025 | |
| 3026 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3027 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3028 | ------------------------------------------------------------------------*/ |
| 3029 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3030 | { |
| 3031 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3032 | "WDI API call before module is initialized - Fail request"); |
| 3033 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3034 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3035 | } |
| 3036 | |
| 3037 | /*------------------------------------------------------------------------ |
| 3038 | Fill in Event data and post to the Main FSM |
| 3039 | ------------------------------------------------------------------------*/ |
| 3040 | wdiEventData.wdiRequest = WDI_ADD_BA_SESSION_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3041 | wdiEventData.pEventData = pwdiAddBASessionReqParams; |
| 3042 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams); |
| 3043 | wdiEventData.pCBfnc = wdiAddBASessionRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3044 | wdiEventData.pUserData = pUserData; |
| 3045 | |
| 3046 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3047 | |
| 3048 | }/*WDI_AddBASessionReq*/ |
| 3049 | |
| 3050 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3051 | @brief WDI_DelBAReq will be called when the upper MAC wants to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3052 | inform HW that it has deleted a previously created BA |
| 3053 | session. Upon the call of this API the WLAN DAL will |
| 3054 | pack and send a HAL Del BA request message to the lower |
| 3055 | RIVA sub-system if DAL is in state STARTED. |
| 3056 | |
| 3057 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3058 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3059 | |
| 3060 | WDI_AddBAReq must have been called. |
| 3061 | |
| 3062 | @param wdiDelBAReqParams: the del BA parameters as specified by |
| 3063 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3064 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3065 | wdiDelBARspCb: callback for passing back the response of |
| 3066 | the del BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3067 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3068 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3069 | callback |
| 3070 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3071 | @see WDI_AddBAReq |
| 3072 | @return Result of the function call |
| 3073 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3074 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3075 | WDI_DelBAReq |
| 3076 | ( |
| 3077 | WDI_DelBAReqParamsType* pwdiDelBAReqParams, |
| 3078 | WDI_DelBARspCb wdiDelBARspCb, |
| 3079 | void* pUserData |
| 3080 | ) |
| 3081 | { |
| 3082 | WDI_EventInfoType wdiEventData; |
| 3083 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3084 | |
| 3085 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3086 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3087 | ------------------------------------------------------------------------*/ |
| 3088 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3089 | { |
| 3090 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3091 | "WDI API call before module is initialized - Fail request"); |
| 3092 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3093 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3094 | } |
| 3095 | |
| 3096 | /*------------------------------------------------------------------------ |
| 3097 | Fill in Event data and post to the Main FSM |
| 3098 | ------------------------------------------------------------------------*/ |
| 3099 | wdiEventData.wdiRequest = WDI_DEL_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3100 | wdiEventData.pEventData = pwdiDelBAReqParams; |
| 3101 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams); |
| 3102 | wdiEventData.pCBfnc = wdiDelBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3103 | wdiEventData.pUserData = pUserData; |
| 3104 | |
| 3105 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3106 | |
| 3107 | }/*WDI_DelBAReq*/ |
| 3108 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3109 | /*======================================================================== |
| 3110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3111 | Power Save APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3112 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3113 | ==========================================================================*/ |
| 3114 | |
| 3115 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3116 | @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3117 | wants to set the power save related configurations of |
| 3118 | the WLAN Device. Upon the call of this API the WLAN DAL |
| 3119 | will pack and send a HAL Update CFG request message to |
| 3120 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3121 | |
| 3122 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3123 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3124 | |
| 3125 | WDI_Start must have been called. |
| 3126 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3127 | @param pwdiPowerSaveCfg: the power save cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3128 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3130 | wdiSetPwrSaveCfgCb: callback for passing back the |
| 3131 | response of the set power save cfg operation received |
| 3132 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3134 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3135 | callback |
| 3136 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3137 | @see WDI_Start |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3138 | @return Result of the function call |
| 3139 | */ |
| 3140 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3141 | WDI_SetPwrSaveCfgReq |
| 3142 | ( |
| 3143 | WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg, |
| 3144 | WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb, |
| 3145 | void* pUserData |
| 3146 | ) |
| 3147 | { |
| 3148 | WDI_EventInfoType wdiEventData; |
| 3149 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3150 | |
| 3151 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3152 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3153 | ------------------------------------------------------------------------*/ |
| 3154 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3155 | { |
| 3156 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3157 | "WDI API call before module is initialized - Fail request"); |
| 3158 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3159 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3160 | } |
| 3161 | |
| 3162 | /*------------------------------------------------------------------------ |
| 3163 | Fill in Event data and post to the Main FSM |
| 3164 | ------------------------------------------------------------------------*/ |
| 3165 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3166 | wdiEventData.pEventData = pwdiPowerSaveCfg; |
| 3167 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg); |
| 3168 | wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3169 | wdiEventData.pUserData = pUserData; |
| 3170 | |
| 3171 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3172 | |
| 3173 | }/*WDI_SetPwrSaveCfgReq*/ |
| 3174 | |
| 3175 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3176 | @brief WDI_EnterImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3177 | request the device to get into IMPS power state. Upon |
| 3178 | the call of this API the WLAN DAL will send a HAL Enter |
| 3179 | IMPS request message to the lower RIVA sub-system if DAL |
| 3180 | is in state STARTED. |
| 3181 | |
| 3182 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3183 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3184 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3185 | |
| 3186 | @param wdiEnterImpsRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3187 | response of the Enter IMPS operation received from the |
| 3188 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3190 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3191 | callback |
| 3192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3193 | @see WDI_Start |
| 3194 | @return Result of the function call |
| 3195 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3196 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3197 | WDI_EnterImpsReq |
| 3198 | ( |
| 3199 | WDI_EnterImpsRspCb wdiEnterImpsRspCb, |
| 3200 | void* pUserData |
| 3201 | ) |
| 3202 | { |
| 3203 | WDI_EventInfoType wdiEventData; |
| 3204 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3205 | |
| 3206 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3207 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3208 | ------------------------------------------------------------------------*/ |
| 3209 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3210 | { |
| 3211 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3212 | "WDI API call before module is initialized - Fail request"); |
| 3213 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3214 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3215 | } |
| 3216 | |
| 3217 | /*------------------------------------------------------------------------ |
| 3218 | Fill in Event data and post to the Main FSM |
| 3219 | ------------------------------------------------------------------------*/ |
| 3220 | wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3221 | wdiEventData.pEventData = NULL; |
| 3222 | wdiEventData.uEventDataSize = 0; |
| 3223 | wdiEventData.pCBfnc = wdiEnterImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3224 | wdiEventData.pUserData = pUserData; |
| 3225 | |
| 3226 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3227 | |
| 3228 | }/*WDI_EnterImpsReq*/ |
| 3229 | |
| 3230 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3231 | @brief WDI_ExitImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3232 | request the device to get out of IMPS power state. Upon |
| 3233 | the call of this API the WLAN DAL will send a HAL Exit |
| 3234 | IMPS request message to the lower RIVA sub-system if DAL |
| 3235 | is in state STARTED. |
| 3236 | |
| 3237 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3238 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3240 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3241 | |
| 3242 | @param wdiExitImpsRspCb: callback for passing back the response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3243 | of the Exit IMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3244 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3245 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3246 | callback |
| 3247 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3248 | @see WDI_Start |
| 3249 | @return Result of the function call |
| 3250 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3251 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3252 | WDI_ExitImpsReq |
| 3253 | ( |
| 3254 | WDI_ExitImpsRspCb wdiExitImpsRspCb, |
| 3255 | void* pUserData |
| 3256 | ) |
| 3257 | { |
| 3258 | WDI_EventInfoType wdiEventData; |
| 3259 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3260 | |
| 3261 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3262 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3263 | ------------------------------------------------------------------------*/ |
| 3264 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3265 | { |
| 3266 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3267 | "WDI API call before module is initialized - Fail request"); |
| 3268 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3269 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3270 | } |
| 3271 | |
| 3272 | /*------------------------------------------------------------------------ |
| 3273 | Fill in Event data and post to the Main FSM |
| 3274 | ------------------------------------------------------------------------*/ |
| 3275 | wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3276 | wdiEventData.pEventData = NULL; |
| 3277 | wdiEventData.uEventDataSize = 0; |
| 3278 | wdiEventData.pCBfnc = wdiExitImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3279 | wdiEventData.pUserData = pUserData; |
| 3280 | |
| 3281 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3282 | |
| 3283 | }/*WDI_ExitImpsReq*/ |
| 3284 | |
| 3285 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3286 | @brief WDI_EnterBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3287 | request the device to get into BMPS power state. Upon |
| 3288 | the call of this API the WLAN DAL will pack and send a |
| 3289 | HAL Enter BMPS request message to the lower RIVA |
| 3290 | sub-system if DAL is in state STARTED. |
| 3291 | |
| 3292 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3293 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3294 | |
| 3295 | WDI_PostAssocReq must have been called. |
| 3296 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3297 | @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3298 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3300 | wdiEnterBmpsRspCb: callback for passing back the |
| 3301 | response of the Enter BMPS operation received from the |
| 3302 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3303 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3304 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3305 | callback |
| 3306 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3307 | @see WDI_PostAssocReq |
| 3308 | @return Result of the function call |
| 3309 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3310 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3311 | WDI_EnterBmpsReq |
| 3312 | ( |
| 3313 | WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams, |
| 3314 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb, |
| 3315 | void* pUserData |
| 3316 | ) |
| 3317 | { |
| 3318 | WDI_EventInfoType wdiEventData; |
| 3319 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3320 | |
| 3321 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3322 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3323 | ------------------------------------------------------------------------*/ |
| 3324 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3325 | { |
| 3326 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3327 | "WDI API call before module is initialized - Fail request"); |
| 3328 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3329 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3330 | } |
| 3331 | |
| 3332 | /*------------------------------------------------------------------------ |
| 3333 | Fill in Event data and post to the Main FSM |
| 3334 | ------------------------------------------------------------------------*/ |
| 3335 | wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3336 | wdiEventData.pEventData = pwdiEnterBmpsReqParams; |
| 3337 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams); |
| 3338 | wdiEventData.pCBfnc = wdiEnterBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3339 | wdiEventData.pUserData = pUserData; |
| 3340 | |
| 3341 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3342 | |
| 3343 | }/*WDI_EnterBmpsReq*/ |
| 3344 | |
| 3345 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3346 | @brief WDI_ExitBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3347 | request the device to get out of BMPS power state. Upon |
| 3348 | the call of this API the WLAN DAL will pack and send a |
| 3349 | HAL Exit BMPS request message to the lower RIVA |
| 3350 | sub-system if DAL is in state STARTED. |
| 3351 | |
| 3352 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3353 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3354 | |
| 3355 | WDI_PostAssocReq must have been called. |
| 3356 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3357 | @param pwdiExitBmpsReqParams: the Exit BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3358 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3359 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3360 | wdiExitBmpsRspCb: callback for passing back the response |
| 3361 | of the Exit BMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3362 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3363 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3364 | callback |
| 3365 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3366 | @see WDI_PostAssocReq |
| 3367 | @return Result of the function call |
| 3368 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3369 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3370 | WDI_ExitBmpsReq |
| 3371 | ( |
| 3372 | WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams, |
| 3373 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb, |
| 3374 | void* pUserData |
| 3375 | ) |
| 3376 | { |
| 3377 | WDI_EventInfoType wdiEventData; |
| 3378 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3379 | |
| 3380 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3381 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3382 | ------------------------------------------------------------------------*/ |
| 3383 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3384 | { |
| 3385 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3386 | "WDI API call before module is initialized - Fail request"); |
| 3387 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3388 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3389 | } |
| 3390 | |
| 3391 | /*------------------------------------------------------------------------ |
| 3392 | Fill in Event data and post to the Main FSM |
| 3393 | ------------------------------------------------------------------------*/ |
| 3394 | wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3395 | wdiEventData.pEventData = pwdiExitBmpsReqParams; |
| 3396 | wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams); |
| 3397 | wdiEventData.pCBfnc = wdiExitBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3398 | wdiEventData.pUserData = pUserData; |
| 3399 | |
| 3400 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3401 | |
| 3402 | }/*WDI_ExitBmpsReq*/ |
| 3403 | |
| 3404 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3405 | @brief WDI_EnterUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3406 | request the device to get into UAPSD power state. Upon |
| 3407 | the call of this API the WLAN DAL will pack and send a |
| 3408 | HAL Enter UAPSD request message to the lower RIVA |
| 3409 | sub-system if DAL is in state STARTED. |
| 3410 | |
| 3411 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3412 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3413 | |
| 3414 | WDI_PostAssocReq must have been called. |
| 3415 | WDI_SetUapsdAcParamsReq must have been called. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3416 | |
| 3417 | @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3418 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3419 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3420 | wdiEnterUapsdRspCb: callback for passing back the |
| 3421 | response of the Enter UAPSD operation received from the |
| 3422 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3424 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3425 | callback |
| 3426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3427 | @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq |
| 3428 | @return Result of the function call |
| 3429 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3430 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3431 | WDI_EnterUapsdReq |
| 3432 | ( |
| 3433 | WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams, |
| 3434 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb, |
| 3435 | void* pUserData |
| 3436 | ) |
| 3437 | { |
| 3438 | WDI_EventInfoType wdiEventData; |
| 3439 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3440 | |
| 3441 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3442 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3443 | ------------------------------------------------------------------------*/ |
| 3444 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3445 | { |
| 3446 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3447 | "WDI API call before module is initialized - Fail request"); |
| 3448 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3449 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3450 | } |
| 3451 | |
| 3452 | /*------------------------------------------------------------------------ |
| 3453 | Fill in Event data and post to the Main FSM |
| 3454 | ------------------------------------------------------------------------*/ |
| 3455 | wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3456 | wdiEventData.pEventData = pwdiEnterUapsdReqParams; |
| 3457 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams); |
| 3458 | wdiEventData.pCBfnc = wdiEnterUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3459 | wdiEventData.pUserData = pUserData; |
| 3460 | |
| 3461 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3462 | |
| 3463 | }/*WDI_EnterUapsdReq*/ |
| 3464 | |
| 3465 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3466 | @brief WDI_ExitUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3467 | request the device to get out of UAPSD power state. Upon |
| 3468 | the call of this API the WLAN DAL will send a HAL Exit |
| 3469 | UAPSD request message to the lower RIVA sub-system if |
| 3470 | DAL is in state STARTED. |
| 3471 | |
| 3472 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3473 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3474 | |
| 3475 | WDI_PostAssocReq must have been called. |
| 3476 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3477 | @param wdiExitUapsdRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3478 | response of the Exit UAPSD operation received from the |
| 3479 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3480 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3481 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3482 | callback |
| 3483 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3484 | @see WDI_PostAssocReq |
| 3485 | @return Result of the function call |
| 3486 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3487 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3488 | WDI_ExitUapsdReq |
| 3489 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3490 | WDI_ExitUapsdReqParamsType *pwdiExitUapsdReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3491 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb, |
| 3492 | void* pUserData |
| 3493 | ) |
| 3494 | { |
| 3495 | WDI_EventInfoType wdiEventData; |
| 3496 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3497 | |
| 3498 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3499 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3500 | ------------------------------------------------------------------------*/ |
| 3501 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3502 | { |
| 3503 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3504 | "WDI API call before module is initialized - Fail request"); |
| 3505 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3506 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3507 | } |
| 3508 | |
| 3509 | /*------------------------------------------------------------------------ |
| 3510 | Fill in Event data and post to the Main FSM |
| 3511 | ------------------------------------------------------------------------*/ |
| 3512 | wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 3513 | wdiEventData.pEventData = pwdiExitUapsdReqParams; |
| 3514 | wdiEventData.uEventDataSize = sizeof(*pwdiExitUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3515 | wdiEventData.pCBfnc = wdiExitUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3516 | wdiEventData.pUserData = pUserData; |
| 3517 | |
| 3518 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3519 | |
| 3520 | }/*WDI_ExitUapsdReq*/ |
| 3521 | |
| 3522 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3523 | @brief WDI_UpdateUapsdParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3524 | MAC wants to set the UAPSD related configurations |
| 3525 | of an associated STA (while acting as an AP) to the WLAN |
| 3526 | Device. Upon the call of this API the WLAN DAL will pack |
| 3527 | and send a HAL Update UAPSD params request message to |
| 3528 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3529 | |
| 3530 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3531 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | |
| 3533 | WDI_ConfigBSSReq must have been called. |
| 3534 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3535 | @param pwdiUpdateUapsdReqParams: the UAPSD parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3536 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3537 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3538 | wdiUpdateUapsdParamsCb: callback for passing back the |
| 3539 | response of the update UAPSD params operation received |
| 3540 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3542 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3543 | callback |
| 3544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3545 | @see WDI_ConfigBSSReq |
| 3546 | @return Result of the function call |
| 3547 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3548 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3549 | WDI_UpdateUapsdParamsReq |
| 3550 | ( |
| 3551 | WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams, |
| 3552 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb, |
| 3553 | void* pUserData |
| 3554 | ) |
| 3555 | { |
| 3556 | WDI_EventInfoType wdiEventData; |
| 3557 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3558 | |
| 3559 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3560 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3561 | ------------------------------------------------------------------------*/ |
| 3562 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3563 | { |
| 3564 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3565 | "WDI API call before module is initialized - Fail request"); |
| 3566 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3567 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3568 | } |
| 3569 | |
| 3570 | /*------------------------------------------------------------------------ |
| 3571 | Fill in Event data and post to the Main FSM |
| 3572 | ------------------------------------------------------------------------*/ |
| 3573 | wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3574 | wdiEventData.pEventData = pwdiUpdateUapsdReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3575 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3576 | wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3577 | wdiEventData.pUserData = pUserData; |
| 3578 | |
| 3579 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3580 | |
| 3581 | }/*WDI_UpdateUapsdParamsReq*/ |
| 3582 | |
| 3583 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3584 | @brief WDI_SetUapsdAcParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3585 | MAC wants to set the UAPSD related configurations before |
| 3586 | requesting for enter UAPSD power state to the WLAN |
| 3587 | Device. Upon the call of this API the WLAN DAL will pack |
| 3588 | and send a HAL Set UAPSD params request message to |
| 3589 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3590 | |
| 3591 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3592 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3593 | |
| 3594 | WDI_PostAssocReq must have been called. |
| 3595 | |
| 3596 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3597 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3598 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3599 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3600 | response of the set UAPSD params operation received from |
| 3601 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3602 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3603 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3604 | callback |
| 3605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3606 | @see WDI_PostAssocReq |
| 3607 | @return Result of the function call |
| 3608 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3609 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3610 | WDI_SetUapsdAcParamsReq |
| 3611 | ( |
| 3612 | WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo, |
| 3613 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb, |
| 3614 | void* pUserData |
| 3615 | ) |
| 3616 | { |
| 3617 | WDI_EventInfoType wdiEventData; |
| 3618 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3619 | |
| 3620 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3621 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3622 | ------------------------------------------------------------------------*/ |
| 3623 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3624 | { |
| 3625 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3626 | "WDI API call before module is initialized - Fail request"); |
| 3627 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3628 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3629 | } |
| 3630 | |
| 3631 | /*------------------------------------------------------------------------ |
| 3632 | Fill in Event data and post to the Main FSM |
| 3633 | ------------------------------------------------------------------------*/ |
| 3634 | wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3635 | wdiEventData.pEventData = pwdiUapsdInfo; |
| 3636 | wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo); |
| 3637 | wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3638 | wdiEventData.pUserData = pUserData; |
| 3639 | |
| 3640 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3641 | |
| 3642 | }/*WDI_SetUapsdAcParamsReq*/ |
| 3643 | |
| 3644 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3645 | @brief WDI_ConfigureRxpFilterReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3646 | MAC wants to set/reset the RXP filters for received pkts |
| 3647 | (MC, BC etc.). Upon the call of this API the WLAN DAL will pack |
| 3648 | and send a HAL configure RXP filter request message to |
| 3649 | the lower RIVA sub-system. |
| 3650 | |
| 3651 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3652 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3653 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3654 | |
| 3655 | @param pwdiConfigureRxpFilterReqParams: the RXP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3656 | filter as specified by the Device |
| 3657 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3659 | wdiConfigureRxpFilterCb: callback for passing back the |
| 3660 | response of the configure RXP filter operation received |
| 3661 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3662 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3663 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3664 | callback |
| 3665 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3666 | @return Result of the function call |
| 3667 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3668 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3669 | WDI_ConfigureRxpFilterReq |
| 3670 | ( |
| 3671 | WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams, |
| 3672 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb, |
| 3673 | void* pUserData |
| 3674 | ) |
| 3675 | { |
| 3676 | WDI_EventInfoType wdiEventData; |
| 3677 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3678 | |
| 3679 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3680 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3681 | ------------------------------------------------------------------------*/ |
| 3682 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3683 | { |
| 3684 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3685 | "WDI API call before module is initialized - Fail request"); |
| 3686 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3687 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3688 | } |
| 3689 | |
| 3690 | /*------------------------------------------------------------------------ |
| 3691 | Fill in Event data and post to the Main FSM |
| 3692 | ------------------------------------------------------------------------*/ |
| 3693 | wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3694 | wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams; |
| 3695 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams); |
| 3696 | wdiEventData.pCBfnc = wdiConfigureRxpFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3697 | wdiEventData.pUserData = pUserData; |
| 3698 | |
| 3699 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3700 | }/*WDI_ConfigureRxpFilterReq*/ |
| 3701 | |
| 3702 | /** |
| 3703 | @brief WDI_SetBeaconFilterReq will be called when the upper MAC |
| 3704 | wants to set the beacon filters while in power save. |
| 3705 | Upon the call of this API the WLAN DAL will pack and |
| 3706 | send a Beacon filter request message to the |
| 3707 | lower RIVA sub-system. |
| 3708 | |
| 3709 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3710 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3711 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3712 | |
| 3713 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3714 | filter as specified by the Device |
| 3715 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3716 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3717 | wdiBeaconFilterCb: callback for passing back the |
| 3718 | response of the set beacon filter operation received |
| 3719 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3720 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3721 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3722 | callback |
| 3723 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3724 | @return Result of the function call |
| 3725 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3726 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3727 | WDI_SetBeaconFilterReq |
| 3728 | ( |
| 3729 | WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3730 | WDI_SetBeaconFilterCb wdiBeaconFilterCb, |
| 3731 | void* pUserData |
| 3732 | ) |
| 3733 | { |
| 3734 | WDI_EventInfoType wdiEventData; |
| 3735 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3736 | |
| 3737 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3738 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3739 | ------------------------------------------------------------------------*/ |
| 3740 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3741 | { |
| 3742 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3743 | "WDI API call before module is initialized - Fail request"); |
| 3744 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3745 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3746 | } |
| 3747 | |
| 3748 | /*------------------------------------------------------------------------ |
| 3749 | Fill in Event data and post to the Main FSM |
| 3750 | ------------------------------------------------------------------------*/ |
| 3751 | wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3752 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3753 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3754 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3755 | wdiEventData.pUserData = pUserData; |
| 3756 | |
| 3757 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3758 | }/*WDI_SetBeaconFilterReq*/ |
| 3759 | |
| 3760 | /** |
| 3761 | @brief WDI_RemBeaconFilterReq will be called when the upper MAC |
| 3762 | wants to remove the beacon filter for particular IE |
| 3763 | while in power save. Upon the call of this API the WLAN |
| 3764 | DAL will pack and send a remove Beacon filter request |
| 3765 | message to the lower RIVA sub-system. |
| 3766 | |
| 3767 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3768 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3769 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3770 | |
| 3771 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3772 | filter as specified by the Device |
| 3773 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3774 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3775 | wdiBeaconFilterCb: callback for passing back the |
| 3776 | response of the remove beacon filter operation received |
| 3777 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3778 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3779 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3780 | callback |
| 3781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3782 | @return Result of the function call |
| 3783 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3784 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3785 | WDI_RemBeaconFilterReq |
| 3786 | ( |
| 3787 | WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3788 | WDI_RemBeaconFilterCb wdiBeaconFilterCb, |
| 3789 | void* pUserData |
| 3790 | ) |
| 3791 | { |
| 3792 | WDI_EventInfoType wdiEventData; |
| 3793 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3794 | |
| 3795 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3796 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3797 | ------------------------------------------------------------------------*/ |
| 3798 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3799 | { |
| 3800 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3801 | "WDI API call before module is initialized - Fail request"); |
| 3802 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3803 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3804 | } |
| 3805 | |
| 3806 | /*------------------------------------------------------------------------ |
| 3807 | Fill in Event data and post to the Main FSM |
| 3808 | ------------------------------------------------------------------------*/ |
| 3809 | wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3810 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3811 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3812 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3813 | wdiEventData.pUserData = pUserData; |
| 3814 | |
| 3815 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3816 | }/*WDI_RemBeaconFilterReq*/ |
| 3817 | |
| 3818 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3819 | @brief WDI_SetRSSIThresholdsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3820 | MAC wants to set the RSSI thresholds related |
| 3821 | configurations while in power save. Upon the call of |
| 3822 | this API the WLAN DAL will pack and send a HAL Set RSSI |
| 3823 | thresholds request message to the lower RIVA |
| 3824 | sub-system if DAL is in state STARTED. |
| 3825 | |
| 3826 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3827 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3828 | |
| 3829 | WDI_PostAssocReq must have been called. |
| 3830 | |
| 3831 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3832 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3833 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3834 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3835 | response of the set UAPSD params operation received from |
| 3836 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3837 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3838 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3839 | callback |
| 3840 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3841 | @see WDI_PostAssocReq |
| 3842 | @return Result of the function call |
| 3843 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3844 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3845 | WDI_SetRSSIThresholdsReq |
| 3846 | ( |
| 3847 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams, |
| 3848 | WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb, |
| 3849 | void* pUserData |
| 3850 | ) |
| 3851 | { |
| 3852 | WDI_EventInfoType wdiEventData; |
| 3853 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3854 | |
| 3855 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3856 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3857 | ------------------------------------------------------------------------*/ |
| 3858 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3859 | { |
| 3860 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3861 | "WDI API call before module is initialized - Fail request"); |
| 3862 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3863 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3864 | } |
| 3865 | |
| 3866 | /*------------------------------------------------------------------------ |
| 3867 | Fill in Event data and post to the Main FSM |
| 3868 | ------------------------------------------------------------------------*/ |
| 3869 | wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3870 | wdiEventData.pEventData = pwdiRSSIThresholdsParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3871 | wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3872 | wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3873 | wdiEventData.pUserData = pUserData; |
| 3874 | |
| 3875 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3876 | }/* WDI_SetRSSIThresholdsReq*/ |
| 3877 | |
| 3878 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3879 | @brief WDI_HostOffloadReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3880 | wants to set the filter to minimize unnecessary host |
| 3881 | wakeup due to broadcast traffic while in power save. |
| 3882 | Upon the call of this API the WLAN DAL will pack and |
| 3883 | send a HAL host offload request message to the |
| 3884 | lower RIVA sub-system if DAL is in state STARTED. |
| 3885 | |
| 3886 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3887 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3888 | |
| 3889 | WDI_PostAssocReq must have been called. |
| 3890 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3891 | @param pwdiHostOffloadParams: the host offload as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3892 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3893 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3894 | wdiHostOffloadCb: callback for passing back the response |
| 3895 | of the host offload operation received from the |
| 3896 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3897 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3898 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3899 | callback |
| 3900 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3901 | @see WDI_PostAssocReq |
| 3902 | @return Result of the function call |
| 3903 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3904 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3905 | WDI_HostOffloadReq |
| 3906 | ( |
| 3907 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams, |
| 3908 | WDI_HostOffloadCb wdiHostOffloadCb, |
| 3909 | void* pUserData |
| 3910 | ) |
| 3911 | { |
| 3912 | WDI_EventInfoType wdiEventData; |
| 3913 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3914 | |
| 3915 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3916 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3917 | ------------------------------------------------------------------------*/ |
| 3918 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3919 | { |
| 3920 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3921 | "WDI API call before module is initialized - Fail request"); |
| 3922 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3923 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3924 | } |
| 3925 | |
| 3926 | /*------------------------------------------------------------------------ |
| 3927 | Fill in Event data and post to the Main FSM |
| 3928 | ------------------------------------------------------------------------*/ |
| 3929 | wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3930 | wdiEventData.pEventData = pwdiHostOffloadParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 3931 | wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3932 | wdiEventData.pCBfnc = wdiHostOffloadCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3933 | wdiEventData.pUserData = pUserData; |
| 3934 | |
| 3935 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3936 | }/*WDI_HostOffloadReq*/ |
| 3937 | |
| 3938 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3939 | @brief WDI_KeepAliveReq will be called when the upper MAC |
| 3940 | wants to set the filter to send NULL or unsolicited ARP responses |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3941 | and minimize unnecessary host wakeups due to while in power save. |
| 3942 | Upon the call of this API the WLAN DAL will pack and |
| 3943 | send a HAL Keep Alive request message to the |
| 3944 | lower RIVA sub-system if DAL is in state STARTED. |
| 3945 | |
| 3946 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3947 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | |
| 3949 | WDI_PostAssocReq must have been called. |
| 3950 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3951 | @param pwdiKeepAliveParams: the Keep Alive as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3952 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3953 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3954 | wdiKeepAliveCb: callback for passing back the response |
| 3955 | of the Keep Alive operation received from the |
| 3956 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3957 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3958 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3959 | callback |
| 3960 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3961 | @see WDI_PostAssocReq |
| 3962 | @return Result of the function call |
| 3963 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3964 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3965 | WDI_KeepAliveReq |
| 3966 | ( |
| 3967 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams, |
| 3968 | WDI_KeepAliveCb wdiKeepAliveCb, |
| 3969 | void* pUserData |
| 3970 | ) |
| 3971 | { |
| 3972 | WDI_EventInfoType wdiEventData; |
| 3973 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3974 | |
| 3975 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3976 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3977 | ------------------------------------------------------------------------*/ |
| 3978 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3979 | { |
| 3980 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3981 | "WDI_KeepAliveReq: WDI API call before module " |
| 3982 | "is initialized - Fail request"); |
| 3983 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3984 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3985 | } |
| 3986 | |
| 3987 | /*------------------------------------------------------------------------ |
| 3988 | Fill in Event data and post to the Main FSM |
| 3989 | ------------------------------------------------------------------------*/ |
| 3990 | wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3991 | wdiEventData.pEventData = pwdiKeepAliveParams; |
| 3992 | wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams); |
| 3993 | wdiEventData.pCBfnc = wdiKeepAliveCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3994 | wdiEventData.pUserData = pUserData; |
| 3995 | |
| 3996 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3997 | }/*WDI_KeepAliveReq*/ |
| 3998 | |
| 3999 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4000 | @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4001 | wants to set the Wowl Bcast ptrn to minimize unnecessary |
| 4002 | host wakeup due to broadcast traffic while in power |
| 4003 | save. Upon the call of this API the WLAN DAL will pack |
| 4004 | and send a HAL Wowl Bcast ptrn request message to the |
| 4005 | lower RIVA sub-system if DAL is in state STARTED. |
| 4006 | |
| 4007 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4008 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4009 | |
| 4010 | WDI_PostAssocReq must have been called. |
| 4011 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4012 | @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4013 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4014 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4015 | wdiWowlAddBcPtrnCb: callback for passing back the |
| 4016 | response of the add Wowl bcast ptrn operation received |
| 4017 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4018 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4019 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4020 | callback |
| 4021 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4022 | @see WDI_PostAssocReq |
| 4023 | @return Result of the function call |
| 4024 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4025 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4026 | WDI_WowlAddBcPtrnReq |
| 4027 | ( |
| 4028 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams, |
| 4029 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb, |
| 4030 | void* pUserData |
| 4031 | ) |
| 4032 | { |
| 4033 | WDI_EventInfoType wdiEventData; |
| 4034 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4035 | |
| 4036 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4037 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4038 | ------------------------------------------------------------------------*/ |
| 4039 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4040 | { |
| 4041 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4042 | "WDI API call before module is initialized - Fail request"); |
| 4043 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4044 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4045 | } |
| 4046 | |
| 4047 | /*------------------------------------------------------------------------ |
| 4048 | Fill in Event data and post to the Main FSM |
| 4049 | ------------------------------------------------------------------------*/ |
| 4050 | wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4051 | wdiEventData.pEventData = pwdiWowlAddBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4052 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4053 | wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4054 | wdiEventData.pUserData = pUserData; |
| 4055 | |
| 4056 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4057 | }/*WDI_WowlAddBcPtrnReq*/ |
| 4058 | |
| 4059 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4060 | @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4061 | wants to clear the Wowl Bcast ptrn. Upon the call of |
| 4062 | this API the WLAN DAL will pack and send a HAL delete |
| 4063 | Wowl Bcast ptrn request message to the lower RIVA |
| 4064 | sub-system if DAL is in state STARTED. |
| 4065 | |
| 4066 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4067 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4068 | |
| 4069 | WDI_WowlAddBcPtrnReq must have been called. |
| 4070 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4071 | @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4072 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4073 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4074 | wdiWowlDelBcPtrnCb: callback for passing back the |
| 4075 | response of the del Wowl bcast ptrn operation received |
| 4076 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4077 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4078 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4079 | callback |
| 4080 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4081 | @see WDI_WowlAddBcPtrnReq |
| 4082 | @return Result of the function call |
| 4083 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4084 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4085 | WDI_WowlDelBcPtrnReq |
| 4086 | ( |
| 4087 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams, |
| 4088 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb, |
| 4089 | void* pUserData |
| 4090 | ) |
| 4091 | { |
| 4092 | WDI_EventInfoType wdiEventData; |
| 4093 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4094 | |
| 4095 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4096 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4097 | ------------------------------------------------------------------------*/ |
| 4098 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4099 | { |
| 4100 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4101 | "WDI API call before module is initialized - Fail request"); |
| 4102 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4103 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4104 | } |
| 4105 | |
| 4106 | /*------------------------------------------------------------------------ |
| 4107 | Fill in Event data and post to the Main FSM |
| 4108 | ------------------------------------------------------------------------*/ |
| 4109 | wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4110 | wdiEventData.pEventData = pwdiWowlDelBcPtrnParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4111 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4112 | wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4113 | wdiEventData.pUserData = pUserData; |
| 4114 | |
| 4115 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4116 | }/*WDI_WowlDelBcPtrnReq*/ |
| 4117 | |
| 4118 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4119 | @brief WDI_WowlEnterReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4120 | wants to enter the Wowl state to minimize unnecessary |
| 4121 | host wakeup while in power save. Upon the call of this |
| 4122 | API the WLAN DAL will pack and send a HAL Wowl enter |
| 4123 | request message to the lower RIVA sub-system if DAL is |
| 4124 | in state STARTED. |
| 4125 | |
| 4126 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4127 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4128 | |
| 4129 | WDI_PostAssocReq must have been called. |
| 4130 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4131 | @param pwdiWowlEnterReqParams: the Wowl enter info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4132 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | wdiWowlEnterReqCb: callback for passing back the |
| 4135 | response of the enter Wowl operation received from the |
| 4136 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4137 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4138 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4139 | callback |
| 4140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4141 | @see WDI_PostAssocReq |
| 4142 | @return Result of the function call |
| 4143 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4144 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4145 | WDI_WowlEnterReq |
| 4146 | ( |
| 4147 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams, |
| 4148 | WDI_WowlEnterReqCb wdiWowlEnterCb, |
| 4149 | void* pUserData |
| 4150 | ) |
| 4151 | { |
| 4152 | WDI_EventInfoType wdiEventData; |
| 4153 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4154 | |
| 4155 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4156 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4157 | ------------------------------------------------------------------------*/ |
| 4158 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4159 | { |
| 4160 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4161 | "WDI API call before module is initialized - Fail request"); |
| 4162 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4163 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4164 | } |
| 4165 | |
| 4166 | /*------------------------------------------------------------------------ |
| 4167 | Fill in Event data and post to the Main FSM |
| 4168 | ------------------------------------------------------------------------*/ |
| 4169 | wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4170 | wdiEventData.pEventData = pwdiWowlEnterParams; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 4171 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4172 | wdiEventData.pCBfnc = wdiWowlEnterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4173 | wdiEventData.pUserData = pUserData; |
| 4174 | |
| 4175 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4176 | }/*WDI_WowlEnterReq*/ |
| 4177 | |
| 4178 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4179 | @brief WDI_WowlExitReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4180 | wants to exit the Wowl state. Upon the call of this API |
| 4181 | the WLAN DAL will pack and send a HAL Wowl exit request |
| 4182 | message to the lower RIVA sub-system if DAL is in state |
| 4183 | STARTED. |
| 4184 | |
| 4185 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4186 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4187 | |
| 4188 | WDI_WowlEnterReq must have been called. |
| 4189 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4190 | @param pwdiWowlExitReqParams: the Wowl exit info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4191 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4193 | wdiWowlExitReqCb: callback for passing back the response |
| 4194 | of the exit Wowl operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4196 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4197 | callback |
| 4198 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4199 | @see WDI_WowlEnterReq |
| 4200 | @return Result of the function call |
| 4201 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4202 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4203 | WDI_WowlExitReq |
| 4204 | ( |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4205 | WDI_WowlExitReqParamsType* pwdiWowlExitParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4206 | WDI_WowlExitReqCb wdiWowlExitCb, |
| 4207 | void* pUserData |
| 4208 | ) |
| 4209 | { |
| 4210 | WDI_EventInfoType wdiEventData; |
| 4211 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4212 | |
| 4213 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4214 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4215 | ------------------------------------------------------------------------*/ |
| 4216 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4217 | { |
| 4218 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4219 | "WDI API call before module is initialized - Fail request"); |
| 4220 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4221 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4222 | } |
| 4223 | |
| 4224 | /*------------------------------------------------------------------------ |
| 4225 | Fill in Event data and post to the Main FSM |
| 4226 | ------------------------------------------------------------------------*/ |
| 4227 | wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4228 | wdiEventData.pEventData = pwdiWowlExitParams; |
| 4229 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlExitParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4230 | wdiEventData.pCBfnc = wdiWowlExitCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4231 | wdiEventData.pUserData = pUserData; |
| 4232 | |
| 4233 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4234 | }/*WDI_WowlExitReq*/ |
| 4235 | |
| 4236 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4237 | @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4238 | the upper MAC wants to dynamically adjusts the listen |
| 4239 | interval based on the WLAN/MSM activity. Upon the call |
| 4240 | of this API the WLAN DAL will pack and send a HAL |
| 4241 | configure Apps Cpu Wakeup State request message to the |
| 4242 | lower RIVA sub-system. |
| 4243 | |
| 4244 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4245 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4246 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4247 | |
| 4248 | @param pwdiConfigureAppsCpuWakeupStateReqParams: the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4249 | Apps Cpu Wakeup State as specified by the |
| 4250 | Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4251 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4252 | wdiConfigureAppsCpuWakeupStateCb: callback for passing |
| 4253 | back the response of the configure Apps Cpu Wakeup State |
| 4254 | operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4256 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4257 | callback |
| 4258 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4259 | @return Result of the function call |
| 4260 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4261 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4262 | WDI_ConfigureAppsCpuWakeupStateReq |
| 4263 | ( |
| 4264 | WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams, |
| 4265 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb, |
| 4266 | void* pUserData |
| 4267 | ) |
| 4268 | { |
| 4269 | WDI_EventInfoType wdiEventData; |
| 4270 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4271 | |
| 4272 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4273 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4274 | ------------------------------------------------------------------------*/ |
| 4275 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4276 | { |
| 4277 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4278 | "WDI API call before module is initialized - Fail request"); |
| 4279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4280 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4281 | } |
| 4282 | |
| 4283 | /*------------------------------------------------------------------------ |
| 4284 | Fill in Event data and post to the Main FSM |
| 4285 | ------------------------------------------------------------------------*/ |
| 4286 | wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4287 | wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams; |
| 4288 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams); |
| 4289 | wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4290 | wdiEventData.pUserData = pUserData; |
| 4291 | |
| 4292 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4293 | }/*WDI_ConfigureAppsCpuWakeupStateReq*/ |
| 4294 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4295 | @brief WDI_FlushAcReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4296 | to to perform a flush operation on a given AC. Upon the |
| 4297 | call of this API the WLAN DAL will pack and send a HAL |
| 4298 | Flush AC request message to the lower RIVA sub-system if |
| 4299 | DAL is in state STARTED. |
| 4300 | |
| 4301 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4302 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4303 | |
| 4304 | WDI_AddBAReq must have been called. |
| 4305 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4306 | @param pwdiFlushAcReqParams: the Flush AC parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4307 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4308 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4309 | wdiFlushAcRspCb: callback for passing back the response |
| 4310 | of the Flush AC operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4311 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4312 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4313 | callback |
| 4314 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4315 | @see WDI_AddBAReq |
| 4316 | @return Result of the function call |
| 4317 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4318 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4319 | WDI_FlushAcReq |
| 4320 | ( |
| 4321 | WDI_FlushAcReqParamsType* pwdiFlushAcReqParams, |
| 4322 | WDI_FlushAcRspCb wdiFlushAcRspCb, |
| 4323 | void* pUserData |
| 4324 | ) |
| 4325 | { |
| 4326 | WDI_EventInfoType wdiEventData; |
| 4327 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4328 | |
| 4329 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4330 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4331 | ------------------------------------------------------------------------*/ |
| 4332 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4333 | { |
| 4334 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4335 | "WDI API call before module is initialized - Fail request"); |
| 4336 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4337 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4338 | } |
| 4339 | |
| 4340 | /*------------------------------------------------------------------------ |
| 4341 | Fill in Event data and post to the Main FSM |
| 4342 | ------------------------------------------------------------------------*/ |
| 4343 | wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4344 | wdiEventData.pEventData = pwdiFlushAcReqParams; |
| 4345 | wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams); |
| 4346 | wdiEventData.pCBfnc = wdiFlushAcRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4347 | wdiEventData.pUserData = pUserData; |
| 4348 | |
| 4349 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4350 | |
| 4351 | }/*WDI_FlushAcReq*/ |
| 4352 | |
| 4353 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4354 | @brief WDI_BtAmpEventReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4355 | wants to notify the lower mac on a BT AMP event. This is |
| 4356 | to inform BTC-SLM that some BT AMP event occurred. Upon |
| 4357 | the call of this API the WLAN DAL will pack and send a |
| 4358 | HAL BT AMP event request message to the lower RIVA |
| 4359 | sub-system if DAL is in state STARTED. |
| 4360 | |
| 4361 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4362 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4363 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4364 | |
| 4365 | @param wdiBtAmpEventReqParams: the BT AMP event parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4366 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4367 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4368 | wdiBtAmpEventRspCb: callback for passing back the |
| 4369 | response of the BT AMP event operation received from the |
| 4370 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4371 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4372 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4373 | callback |
| 4374 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4375 | @return Result of the function call |
| 4376 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4377 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4378 | WDI_BtAmpEventReq |
| 4379 | ( |
| 4380 | WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams, |
| 4381 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb, |
| 4382 | void* pUserData |
| 4383 | ) |
| 4384 | { |
| 4385 | WDI_EventInfoType wdiEventData; |
| 4386 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4387 | |
| 4388 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4389 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4390 | ------------------------------------------------------------------------*/ |
| 4391 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4392 | { |
| 4393 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4394 | "WDI API call before module is initialized - Fail request"); |
| 4395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4396 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4397 | } |
| 4398 | |
| 4399 | /*------------------------------------------------------------------------ |
| 4400 | Fill in Event data and post to the Main FSM |
| 4401 | ------------------------------------------------------------------------*/ |
| 4402 | wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4403 | wdiEventData.pEventData = pwdiBtAmpEventReqParams; |
| 4404 | wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams); |
| 4405 | wdiEventData.pCBfnc = wdiBtAmpEventRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4406 | wdiEventData.pUserData = pUserData; |
| 4407 | |
| 4408 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4409 | |
| 4410 | }/*WDI_BtAmpEventReq*/ |
| 4411 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4412 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 4413 | /** |
| 4414 | @brief WDI_Start Oem Data Req will be called when the upper MAC |
| 4415 | wants to notify the lower mac on a oem data Req event.Upon |
| 4416 | the call of this API the WLAN DAL will pack and send a |
| 4417 | HAL OEM Data Req event request message to the lower RIVA |
| 4418 | sub-system if DAL is in state STARTED. |
| 4419 | |
| 4420 | In state BUSY this request will be queued. Request won't |
| 4421 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4422 | |
| 4423 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4424 | |
| 4425 | @param pwdiOemDataReqParams: the Oem Data Req as |
| 4426 | specified by the Device Interface |
| 4427 | |
| 4428 | wdiStartOemDataRspCb: callback for passing back the |
| 4429 | response of the Oem Data Req received from the |
| 4430 | device |
| 4431 | |
| 4432 | pUserData: user data will be passed back with the |
| 4433 | callback |
| 4434 | |
| 4435 | @return Result of the function call |
| 4436 | */ |
| 4437 | WDI_Status |
| 4438 | WDI_StartOemDataReq |
| 4439 | ( |
| 4440 | WDI_oemDataReqParamsType* pwdiOemDataReqParams, |
| 4441 | WDI_oemDataRspCb wdiOemDataRspCb, |
| 4442 | void* pUserData |
| 4443 | ) |
| 4444 | { |
| 4445 | WDI_EventInfoType wdiEventData; |
| 4446 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4447 | |
| 4448 | /*------------------------------------------------------------------------ |
| 4449 | Sanity Check |
| 4450 | ------------------------------------------------------------------------*/ |
| 4451 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4452 | { |
| 4453 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4454 | "WDI API call before module is initialized - Fail request"); |
| 4455 | |
| 4456 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4457 | } |
| 4458 | |
| 4459 | /*------------------------------------------------------------------------ |
| 4460 | Fill in Event data and post to the Main FSM |
| 4461 | ------------------------------------------------------------------------*/ |
| 4462 | wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ; |
| 4463 | wdiEventData.pEventData = pwdiOemDataReqParams; |
| 4464 | wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams); |
| 4465 | wdiEventData.pCBfnc = wdiOemDataRspCb; |
| 4466 | wdiEventData.pUserData = pUserData; |
| 4467 | |
| 4468 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4469 | |
| 4470 | |
| 4471 | } |
| 4472 | |
| 4473 | #endif |
| 4474 | |
| 4475 | |
| 4476 | /*======================================================================== |
| 4477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4478 | CONTROL APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4480 | ==========================================================================*/ |
| 4481 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4482 | @brief WDI_SwitchChReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4483 | the WLAN HW to change the current channel of operation. |
| 4484 | Upon the call of this API the WLAN DAL will pack and |
| 4485 | send a HAL Start request message to the lower RIVA |
| 4486 | sub-system if DAL is in state STARTED. |
| 4487 | |
| 4488 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4489 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4490 | |
| 4491 | WDI_Start must have been called. |
| 4492 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4493 | @param wdiSwitchChReqParams: the switch ch parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4494 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4495 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4496 | wdiSwitchChRspCb: callback for passing back the response |
| 4497 | of the switch ch operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4498 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4499 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4500 | callback |
| 4501 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4502 | @see WDI_Start |
| 4503 | @return Result of the function call |
| 4504 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4505 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4506 | WDI_SwitchChReq |
| 4507 | ( |
| 4508 | WDI_SwitchChReqParamsType* pwdiSwitchChReqParams, |
| 4509 | WDI_SwitchChRspCb wdiSwitchChRspCb, |
| 4510 | void* pUserData |
| 4511 | ) |
| 4512 | { |
| 4513 | WDI_EventInfoType wdiEventData; |
| 4514 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4515 | |
| 4516 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4517 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4518 | ------------------------------------------------------------------------*/ |
| 4519 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4520 | { |
| 4521 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4522 | "WDI API call before module is initialized - Fail request"); |
| 4523 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4524 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4525 | } |
| 4526 | |
| 4527 | /*------------------------------------------------------------------------ |
| 4528 | Fill in Event data and post to the Main FSM |
| 4529 | ------------------------------------------------------------------------*/ |
| 4530 | wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4531 | wdiEventData.pEventData = pwdiSwitchChReqParams; |
| 4532 | wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams); |
| 4533 | wdiEventData.pCBfnc = wdiSwitchChRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4534 | wdiEventData.pUserData = pUserData; |
| 4535 | |
| 4536 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4537 | |
| 4538 | }/*WDI_SwitchChReq*/ |
| 4539 | |
| 4540 | |
| 4541 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4542 | @brief WDI_ConfigSTAReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4543 | wishes to add or update a STA in HW. Upon the call of |
| 4544 | this API the WLAN DAL will pack and send a HAL Start |
| 4545 | message request message to the lower RIVA sub-system if |
| 4546 | DAL is in state STARTED. |
| 4547 | |
| 4548 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4549 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | |
| 4551 | WDI_Start must have been called. |
| 4552 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4553 | @param wdiConfigSTAReqParams: the config STA parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4554 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4555 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4556 | wdiConfigSTARspCb: callback for passing back the |
| 4557 | response of the config STA operation received from the |
| 4558 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4560 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4561 | callback |
| 4562 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4563 | @see WDI_Start |
| 4564 | @return Result of the function call |
| 4565 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4566 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4567 | WDI_ConfigSTAReq |
| 4568 | ( |
| 4569 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams, |
| 4570 | WDI_ConfigSTARspCb wdiConfigSTARspCb, |
| 4571 | void* pUserData |
| 4572 | ) |
| 4573 | { |
| 4574 | WDI_EventInfoType wdiEventData; |
| 4575 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4576 | |
| 4577 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4578 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4579 | ------------------------------------------------------------------------*/ |
| 4580 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4581 | { |
| 4582 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4583 | "WDI API call before module is initialized - Fail request"); |
| 4584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4585 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4586 | } |
| 4587 | |
| 4588 | /*------------------------------------------------------------------------ |
| 4589 | Fill in Event data and post to the Main FSM |
| 4590 | ------------------------------------------------------------------------*/ |
| 4591 | wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4592 | wdiEventData.pEventData = pwdiConfigSTAReqParams; |
| 4593 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams); |
| 4594 | wdiEventData.pCBfnc = wdiConfigSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4595 | wdiEventData.pUserData = pUserData; |
| 4596 | |
| 4597 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4598 | |
| 4599 | }/*WDI_ConfigSTAReq*/ |
| 4600 | |
| 4601 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4602 | @brief WDI_SetLinkStateReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4603 | wants to change the state of an ongoing link. Upon the |
| 4604 | call of this API the WLAN DAL will pack and send a HAL |
| 4605 | Start message request message to the lower RIVA |
| 4606 | sub-system if DAL is in state STARTED. |
| 4607 | |
| 4608 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4609 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4610 | |
| 4611 | WDI_JoinStartReq must have been called. |
| 4612 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4613 | @param wdiSetLinkStateReqParams: the set link state parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4614 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4615 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4616 | wdiSetLinkStateRspCb: callback for passing back the |
| 4617 | response of the set link state operation received from |
| 4618 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4619 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4620 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4621 | callback |
| 4622 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4623 | @see WDI_JoinStartReq |
| 4624 | @return Result of the function call |
| 4625 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4626 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4627 | WDI_SetLinkStateReq |
| 4628 | ( |
| 4629 | WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams, |
| 4630 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb, |
| 4631 | void* pUserData |
| 4632 | ) |
| 4633 | { |
| 4634 | WDI_EventInfoType wdiEventData; |
| 4635 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4636 | |
| 4637 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4638 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4639 | ------------------------------------------------------------------------*/ |
| 4640 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4641 | { |
| 4642 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4643 | "WDI API call before module is initialized - Fail request"); |
| 4644 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4645 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4646 | } |
| 4647 | |
| 4648 | /*------------------------------------------------------------------------ |
| 4649 | Fill in Event data and post to the Main FSM |
| 4650 | ------------------------------------------------------------------------*/ |
| 4651 | wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4652 | wdiEventData.pEventData = pwdiSetLinkStateReqParams; |
| 4653 | wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams); |
| 4654 | wdiEventData.pCBfnc = wdiSetLinkStateRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4655 | wdiEventData.pUserData = pUserData; |
| 4656 | |
| 4657 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4658 | |
| 4659 | }/*WDI_SetLinkStateReq*/ |
| 4660 | |
| 4661 | |
| 4662 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4663 | @brief WDI_GetStatsReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4664 | to get statistics (MIB counters) from the device. Upon |
| 4665 | the call of this API the WLAN DAL will pack and send a |
| 4666 | HAL Start request message to the lower RIVA sub-system |
| 4667 | if DAL is in state STARTED. |
| 4668 | |
| 4669 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4670 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4671 | |
| 4672 | WDI_Start must have been called. |
| 4673 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4674 | @param wdiGetStatsReqParams: the stats parameters to get as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4675 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4677 | wdiGetStatsRspCb: callback for passing back the response |
| 4678 | of the get stats operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4679 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4680 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4681 | callback |
| 4682 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4683 | @see WDI_Start |
| 4684 | @return Result of the function call |
| 4685 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4686 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4687 | WDI_GetStatsReq |
| 4688 | ( |
| 4689 | WDI_GetStatsReqParamsType* pwdiGetStatsReqParams, |
| 4690 | WDI_GetStatsRspCb wdiGetStatsRspCb, |
| 4691 | void* pUserData |
| 4692 | ) |
| 4693 | { |
| 4694 | WDI_EventInfoType wdiEventData; |
| 4695 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4696 | |
| 4697 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4698 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4699 | ------------------------------------------------------------------------*/ |
| 4700 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4701 | { |
| 4702 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4703 | "WDI API call before module is initialized - Fail request"); |
| 4704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4705 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4706 | } |
| 4707 | |
| 4708 | /*------------------------------------------------------------------------ |
| 4709 | Fill in Event data and post to the Main FSM |
| 4710 | ------------------------------------------------------------------------*/ |
| 4711 | wdiEventData.wdiRequest = WDI_GET_STATS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4712 | wdiEventData.pEventData = pwdiGetStatsReqParams; |
| 4713 | wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams); |
| 4714 | wdiEventData.pCBfnc = wdiGetStatsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4715 | wdiEventData.pUserData = pUserData; |
| 4716 | |
| 4717 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4718 | |
| 4719 | }/*WDI_GetStatsReq*/ |
| 4720 | |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4721 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 4722 | /** |
| 4723 | @brief WDI_GetRoamRssiReq will be called when the upper MAC wants |
| 4724 | to get roam rssi from the device. Upon |
| 4725 | the call of this API the WLAN DAL will pack and send a |
| 4726 | HAL Start request message to the lower RIVA sub-system |
| 4727 | if DAL is in state STARTED. |
| 4728 | |
| 4729 | In state BUSY this request will be queued. Request won't |
| 4730 | be allowed in any other state. |
| 4731 | |
| 4732 | WDI_Start must have been called. |
| 4733 | |
| 4734 | @param wdiGetRoamRssiReqParams: the stats parameters to get as |
| 4735 | specified by the Device Interface |
| 4736 | |
| 4737 | wdiGetRoamRssiRspCb: callback for passing back the response |
| 4738 | of the get stats operation received from the device |
| 4739 | |
| 4740 | pUserData: user data will be passed back with the |
| 4741 | callback |
| 4742 | |
| 4743 | @see WDI_Start |
| 4744 | @return Result of the function call |
| 4745 | */ |
| 4746 | WDI_Status |
| 4747 | WDI_GetRoamRssiReq |
| 4748 | ( |
| 4749 | WDI_GetRoamRssiReqParamsType* pwdiGetRoamRssiReqParams, |
| 4750 | WDI_GetRoamRssiRspCb wdiGetRoamRssiRspCb, |
| 4751 | void* pUserData |
| 4752 | ) |
| 4753 | { |
| 4754 | WDI_EventInfoType wdiEventData; |
| 4755 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4756 | |
| 4757 | /*------------------------------------------------------------------------ |
| 4758 | Sanity Check |
| 4759 | ------------------------------------------------------------------------*/ |
| 4760 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4761 | { |
| 4762 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4763 | "WDI API call before module is initialized - Fail request"); |
| 4764 | |
| 4765 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4766 | } |
| 4767 | /*------------------------------------------------------------------------ |
| 4768 | Fill in Event data and post to the Main FSM |
| 4769 | ------------------------------------------------------------------------*/ |
| 4770 | wdiEventData.wdiRequest = WDI_GET_ROAM_RSSI_REQ; |
| 4771 | wdiEventData.pEventData = pwdiGetRoamRssiReqParams; |
| 4772 | wdiEventData.uEventDataSize = sizeof(*pwdiGetRoamRssiReqParams); |
| 4773 | wdiEventData.pCBfnc = wdiGetRoamRssiRspCb; |
| 4774 | wdiEventData.pUserData = pUserData; |
| 4775 | |
| 4776 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4777 | |
| 4778 | }/*WDI_GetRoamRssiReq*/ |
| 4779 | #endif |
| 4780 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4781 | |
| 4782 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4783 | @brief WDI_UpdateCfgReq will be called when the upper MAC when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4784 | it wishes to change the configuration of the WLAN |
| 4785 | Device. Upon the call of this API the WLAN DAL will pack |
| 4786 | and send a HAL Update CFG request message to the lower |
| 4787 | RIVA sub-system if DAL is in state STARTED. |
| 4788 | |
| 4789 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4790 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4791 | |
| 4792 | WDI_Start must have been called. |
| 4793 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4794 | @param wdiUpdateCfgReqParams: the update cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4795 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4797 | wdiUpdateCfgsRspCb: callback for passing back the |
| 4798 | response of the update cfg operation received from the |
| 4799 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4801 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4802 | callback |
| 4803 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4804 | @see WDI_Start |
| 4805 | @return Result of the function call |
| 4806 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4807 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4808 | WDI_UpdateCfgReq |
| 4809 | ( |
| 4810 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams, |
| 4811 | WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb, |
| 4812 | void* pUserData |
| 4813 | ) |
| 4814 | { |
| 4815 | WDI_EventInfoType wdiEventData; |
| 4816 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4817 | |
| 4818 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4819 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4820 | ------------------------------------------------------------------------*/ |
| 4821 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4822 | { |
| 4823 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4824 | "WDI API call before module is initialized - Fail request"); |
| 4825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4826 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4827 | } |
| 4828 | |
| 4829 | /*------------------------------------------------------------------------ |
| 4830 | Fill in Event data and post to the Main FSM |
| 4831 | ------------------------------------------------------------------------*/ |
| 4832 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4833 | wdiEventData.pEventData = pwdiUpdateCfgReqParams; |
| 4834 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams); |
| 4835 | wdiEventData.pCBfnc = wdiUpdateCfgsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4836 | wdiEventData.pUserData = pUserData; |
| 4837 | |
| 4838 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4839 | |
| 4840 | }/*WDI_UpdateCfgReq*/ |
| 4841 | |
| 4842 | |
| 4843 | |
| 4844 | /** |
| 4845 | @brief WDI_AddBAReq will be called when the upper MAC has setup |
| 4846 | successfully a BA session and needs to notify the HW for |
| 4847 | the appropriate settings to take place. Upon the call of |
| 4848 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4849 | request message to the lower RIVA sub-system if DAL is |
| 4850 | in state STARTED. |
| 4851 | |
| 4852 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4853 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4854 | |
| 4855 | WDI_PostAssocReq must have been called. |
| 4856 | |
| 4857 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4858 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4859 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4860 | wdiAddBARspCb: callback for passing back the response of |
| 4861 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4862 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4863 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4864 | callback |
| 4865 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4866 | @see WDI_PostAssocReq |
| 4867 | @return Result of the function call |
| 4868 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4869 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4870 | WDI_AddBAReq |
| 4871 | ( |
| 4872 | WDI_AddBAReqParamsType* pwdiAddBAReqParams, |
| 4873 | WDI_AddBARspCb wdiAddBARspCb, |
| 4874 | void* pUserData |
| 4875 | ) |
| 4876 | { |
| 4877 | WDI_EventInfoType wdiEventData; |
| 4878 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4879 | |
| 4880 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4881 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4882 | ------------------------------------------------------------------------*/ |
| 4883 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4884 | { |
| 4885 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4886 | "WDI API call before module is initialized - Fail request"); |
| 4887 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4888 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4889 | } |
| 4890 | |
| 4891 | /*------------------------------------------------------------------------ |
| 4892 | Fill in Event data and post to the Main FSM |
| 4893 | ------------------------------------------------------------------------*/ |
| 4894 | wdiEventData.wdiRequest = WDI_ADD_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4895 | wdiEventData.pEventData = pwdiAddBAReqParams; |
| 4896 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams); |
| 4897 | wdiEventData.pCBfnc = wdiAddBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4898 | wdiEventData.pUserData = pUserData; |
| 4899 | |
| 4900 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4901 | |
| 4902 | }/*WDI_AddBAReq*/ |
| 4903 | |
| 4904 | |
| 4905 | /** |
| 4906 | @brief WDI_TriggerBAReq will be called when the upper MAC has setup |
| 4907 | successfully a BA session and needs to notify the HW for |
| 4908 | the appropriate settings to take place. Upon the call of |
| 4909 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4910 | request message to the lower RIVA sub-system if DAL is |
| 4911 | in state STARTED. |
| 4912 | |
| 4913 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4914 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4915 | |
| 4916 | WDI_PostAssocReq must have been called. |
| 4917 | |
| 4918 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4919 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4920 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4921 | wdiAddBARspCb: callback for passing back the response of |
| 4922 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4923 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4924 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4925 | callback |
| 4926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4927 | @see WDI_PostAssocReq |
| 4928 | @return Result of the function call |
| 4929 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4930 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4931 | WDI_TriggerBAReq |
| 4932 | ( |
| 4933 | WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams, |
| 4934 | WDI_TriggerBARspCb wdiTriggerBARspCb, |
| 4935 | void* pUserData |
| 4936 | ) |
| 4937 | { |
| 4938 | WDI_EventInfoType wdiEventData; |
| 4939 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4940 | |
| 4941 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4942 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4943 | ------------------------------------------------------------------------*/ |
| 4944 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4945 | { |
| 4946 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4947 | "WDI API call before module is initialized - Fail request"); |
| 4948 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4949 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4950 | } |
| 4951 | |
| 4952 | /*------------------------------------------------------------------------ |
| 4953 | Fill in Event data and post to the Main FSM |
| 4954 | ------------------------------------------------------------------------*/ |
| 4955 | wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4956 | wdiEventData.pEventData = pwdiTriggerBAReqParams; |
| 4957 | wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams); |
| 4958 | wdiEventData.pCBfnc = wdiTriggerBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4959 | wdiEventData.pUserData = pUserData; |
| 4960 | |
| 4961 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4962 | |
| 4963 | }/*WDI_AddBAReq*/ |
| 4964 | |
| 4965 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4966 | @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4967 | wishes to update any of the Beacon parameters used by HW. |
| 4968 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request |
| 4969 | message to the lower RIVA sub-system if DAL is in state |
| 4970 | STARTED. |
| 4971 | |
| 4972 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4973 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4974 | |
| 4975 | WDI_PostAssocReq must have been called. |
| 4976 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4977 | @param wdiUpdateBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4978 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4979 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4980 | wdiUpdateBeaconParamsRspCb: callback for passing back the |
| 4981 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4983 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4984 | callback |
| 4985 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4986 | @see WDI_PostAssocReq |
| 4987 | @return Result of the function call |
| 4988 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4989 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4990 | WDI_UpdateBeaconParamsReq |
| 4991 | ( |
| 4992 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams, |
| 4993 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb, |
| 4994 | void* pUserData |
| 4995 | ) |
| 4996 | { |
| 4997 | WDI_EventInfoType wdiEventData; |
| 4998 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4999 | |
| 5000 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5001 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5002 | ------------------------------------------------------------------------*/ |
| 5003 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5004 | { |
| 5005 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5006 | "WDI API call before module is initialized - Fail request"); |
| 5007 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5008 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5009 | } |
| 5010 | |
| 5011 | /*------------------------------------------------------------------------ |
| 5012 | Fill in Event data and post to the Main FSM |
| 5013 | ------------------------------------------------------------------------*/ |
| 5014 | wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5015 | wdiEventData.pEventData = pwdiUpdateBeaconParams; |
| 5016 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams); |
| 5017 | wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5018 | wdiEventData.pUserData = pUserData; |
| 5019 | |
| 5020 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5021 | |
| 5022 | }/*WDI_UpdateBeaconParamsReq*/ |
| 5023 | |
| 5024 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5025 | @brief WDI_SendBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5026 | wishes to update the Beacon template used by HW. |
| 5027 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request |
| 5028 | message to the lower RIVA sub-system if DAL is in state |
| 5029 | STARTED. |
| 5030 | |
| 5031 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5032 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5033 | |
| 5034 | WDI_PostAssocReq must have been called. |
| 5035 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5036 | @param wdiSendBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5037 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5038 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5039 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5040 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5042 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5043 | callback |
| 5044 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5045 | @see WDI_PostAssocReq |
| 5046 | @return Result of the function call |
| 5047 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5048 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5049 | WDI_SendBeaconParamsReq |
| 5050 | ( |
| 5051 | WDI_SendBeaconParamsType* pwdiSendBeaconParams, |
| 5052 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb, |
| 5053 | void* pUserData |
| 5054 | ) |
| 5055 | { |
| 5056 | WDI_EventInfoType wdiEventData; |
| 5057 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5058 | |
| 5059 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5060 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5061 | ------------------------------------------------------------------------*/ |
| 5062 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5063 | { |
| 5064 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5065 | "WDI API call before module is initialized - Fail request"); |
| 5066 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5067 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5068 | } |
| 5069 | |
| 5070 | /*------------------------------------------------------------------------ |
| 5071 | Fill in Event data and post to the Main FSM |
| 5072 | ------------------------------------------------------------------------*/ |
| 5073 | wdiEventData.wdiRequest = WDI_SND_BCON_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5074 | wdiEventData.pEventData = pwdiSendBeaconParams; |
| 5075 | wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams); |
| 5076 | wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5077 | wdiEventData.pUserData = pUserData; |
| 5078 | |
| 5079 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5080 | |
| 5081 | }/*WDI_SendBeaconParamsReq*/ |
| 5082 | |
| 5083 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5084 | @brief WDI_UpdateProbeRspTemplateReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5085 | upper MAC wants to update the probe response template to |
| 5086 | be transmitted as Soft AP |
| 5087 | Upon the call of this API the WLAN DAL will |
| 5088 | pack and send the probe rsp template message to the |
| 5089 | lower RIVA sub-system if DAL is in state STARTED. |
| 5090 | |
| 5091 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5092 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5093 | |
| 5094 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5095 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5096 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5097 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5098 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5099 | response of the Send Beacon Params operation received |
| 5100 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5101 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5102 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5103 | callback |
| 5104 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5105 | @see WDI_AddBAReq |
| 5106 | @return Result of the function call |
| 5107 | */ |
| 5108 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5109 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5110 | WDI_UpdateProbeRspTemplateReq |
| 5111 | ( |
| 5112 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams, |
| 5113 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb, |
| 5114 | void* pUserData |
| 5115 | ) |
| 5116 | { |
| 5117 | WDI_EventInfoType wdiEventData; |
| 5118 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5119 | |
| 5120 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5121 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5122 | ------------------------------------------------------------------------*/ |
| 5123 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5124 | { |
| 5125 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5126 | "WDI API call before module is initialized - Fail request"); |
| 5127 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5128 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5129 | } |
| 5130 | |
| 5131 | /*------------------------------------------------------------------------ |
| 5132 | Fill in Event data and post to the Main FSM |
| 5133 | ------------------------------------------------------------------------*/ |
| 5134 | wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5135 | wdiEventData.pEventData = pwdiUpdateProbeRspParams; |
| 5136 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams); |
| 5137 | wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5138 | wdiEventData.pUserData = pUserData; |
| 5139 | |
| 5140 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5141 | |
| 5142 | }/*WDI_UpdateProbeRspTemplateReq*/ |
| 5143 | |
| 5144 | /** |
| 5145 | @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob |
| 5146 | to the NV memory. |
| 5147 | |
| 5148 | |
| 5149 | @param wdiNvDownloadReqParams: the NV Download parameters as specified by |
| 5150 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5152 | wdiNvDownloadRspCb: callback for passing back the response of |
| 5153 | the NV Download operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5154 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5155 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5156 | callback |
| 5157 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5158 | @see WDI_PostAssocReq |
| 5159 | @return Result of the function call |
| 5160 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5161 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5162 | WDI_NvDownloadReq |
| 5163 | ( |
| 5164 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams, |
| 5165 | WDI_NvDownloadRspCb wdiNvDownloadRspCb, |
| 5166 | void* pUserData |
| 5167 | ) |
| 5168 | { |
| 5169 | WDI_EventInfoType wdiEventData; |
| 5170 | |
| 5171 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5172 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5173 | ------------------------------------------------------------------------*/ |
| 5174 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5175 | { |
| 5176 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5177 | "WDI API call before module is initialized - Fail request"); |
| 5178 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5179 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5180 | } |
| 5181 | |
| 5182 | /*------------------------------------------------------------------------ |
| 5183 | Fill in Event data and post to the Main FSM |
| 5184 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5185 | wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ; |
| 5186 | wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams; |
| 5187 | wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams); |
| 5188 | wdiEventData.pCBfnc = wdiNvDownloadRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5189 | wdiEventData.pUserData = pUserData; |
| 5190 | |
| 5191 | return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData); |
| 5192 | |
| 5193 | }/*WDI_NVDownloadReq*/ |
| 5194 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5195 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5196 | @brief WDI_SetP2PGONOAReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5197 | upper MAC wants to send Notice of Absence |
| 5198 | Upon the call of this API the WLAN DAL will |
| 5199 | pack and send the probe rsp template message to the |
| 5200 | lower RIVA sub-system if DAL is in state STARTED. |
| 5201 | |
| 5202 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5203 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5204 | |
| 5205 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5206 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5207 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5208 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5209 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5210 | response of the Send Beacon Params operation received |
| 5211 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5212 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5213 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5214 | callback |
| 5215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5216 | @see WDI_AddBAReq |
| 5217 | @return Result of the function call |
| 5218 | */ |
| 5219 | WDI_Status |
| 5220 | WDI_SetP2PGONOAReq |
| 5221 | ( |
| 5222 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams, |
| 5223 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb, |
| 5224 | void* pUserData |
| 5225 | ) |
| 5226 | { |
| 5227 | WDI_EventInfoType wdiEventData; |
| 5228 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5229 | |
| 5230 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5231 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5232 | ------------------------------------------------------------------------*/ |
| 5233 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5234 | { |
| 5235 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5236 | "WDI API call before module is initialized - Fail request"); |
| 5237 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5238 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5239 | } |
| 5240 | |
| 5241 | /*------------------------------------------------------------------------ |
| 5242 | Fill in Event data and post to the Main FSM |
| 5243 | ------------------------------------------------------------------------*/ |
| 5244 | wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5245 | wdiEventData.pEventData = pwdiP2PGONOAReqParams; |
| 5246 | wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams); |
| 5247 | wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5248 | wdiEventData.pUserData = pUserData; |
| 5249 | |
| 5250 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5251 | |
| 5252 | }/*WDI_SetP2PGONOAReq*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5253 | |
| 5254 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5255 | @brief WDI_AddSTASelfReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5256 | UMAC wanted to add STA self while opening any new session |
| 5257 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5258 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5259 | |
| 5260 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5261 | @param pwdiAddSTASelfParams: the add sta self parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5262 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5263 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5264 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5265 | callback |
| 5266 | |
| 5267 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5268 | @return Result of the function call |
| 5269 | */ |
| 5270 | WDI_Status |
| 5271 | WDI_AddSTASelfReq |
| 5272 | ( |
| 5273 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams, |
| 5274 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb, |
| 5275 | void* pUserData |
| 5276 | ) |
| 5277 | { |
| 5278 | WDI_EventInfoType wdiEventData; |
| 5279 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5280 | |
| 5281 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5282 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5283 | ------------------------------------------------------------------------*/ |
| 5284 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5285 | { |
| 5286 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5287 | "WDI API call before module is initialized - Fail request"); |
| 5288 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5289 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5290 | } |
| 5291 | |
| 5292 | /*------------------------------------------------------------------------ |
| 5293 | Fill in Event data and post to the Main FSM |
| 5294 | ------------------------------------------------------------------------*/ |
| 5295 | wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5296 | wdiEventData.pEventData = pwdiAddSTASelfReqParams; |
| 5297 | wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams); |
| 5298 | wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5299 | wdiEventData.pUserData = pUserData; |
| 5300 | |
| 5301 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5302 | |
| 5303 | }/*WDI_AddSTASelfReq*/ |
| 5304 | |
| 5305 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5306 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5307 | /** |
| 5308 | @brief WDI_AggrAddTSReq will be called when the upper MAC to inform |
| 5309 | the device of a successful add TSpec negotiation. HW |
| 5310 | needs to receive the TSpec Info from the UMAC in order |
| 5311 | to configure properly the QoS data traffic. Upon the |
| 5312 | call of this API the WLAN DAL will pack and send a HAL |
| 5313 | Add TS request message to the lower RIVA sub-system if |
| 5314 | DAL is in state STARTED. |
| 5315 | |
| 5316 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5317 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5318 | |
| 5319 | WDI_PostAssocReq must have been called. |
| 5320 | |
| 5321 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 5322 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5323 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5324 | wdiAddTsRspCb: callback for passing back the response of |
| 5325 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5326 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5327 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5328 | callback |
| 5329 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5330 | @see WDI_PostAssocReq |
| 5331 | @return Result of the function call |
| 5332 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5333 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5334 | WDI_AggrAddTSReq |
| 5335 | ( |
| 5336 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams, |
| 5337 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb, |
| 5338 | void* pUserData |
| 5339 | ) |
| 5340 | { |
| 5341 | WDI_EventInfoType wdiEventData; |
| 5342 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5343 | |
| 5344 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5345 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5346 | ------------------------------------------------------------------------*/ |
| 5347 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5348 | { |
| 5349 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5350 | "WDI API call before module is initialized - Fail request"); |
| 5351 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5352 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5353 | } |
| 5354 | |
| 5355 | /*------------------------------------------------------------------------ |
| 5356 | Fill in Event data and post to the Main FSM |
| 5357 | ------------------------------------------------------------------------*/ |
| 5358 | wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5359 | wdiEventData.pEventData = pwdiAggrAddTsReqParams; |
| 5360 | wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams); |
| 5361 | wdiEventData.pCBfnc = wdiAggrAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5362 | wdiEventData.pUserData = pUserData; |
| 5363 | |
| 5364 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5365 | |
| 5366 | }/*WDI_AggrAddTSReq*/ |
| 5367 | |
| 5368 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 5369 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5370 | /** |
| 5371 | @brief WDI_FTMCommandReq |
| 5372 | Post FTM Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5373 | |
| 5374 | @param ftmCommandReq: FTM Command Body |
| 5375 | @param ftmCommandRspCb: FTM Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5376 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5377 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5378 | @see |
| 5379 | @return Result of the function call |
| 5380 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5381 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5382 | WDI_FTMCommandReq |
| 5383 | ( |
| 5384 | WDI_FTMCommandReqType *ftmCommandReq, |
| 5385 | WDI_FTMCommandRspCb ftmCommandRspCb, |
| 5386 | void *pUserData |
| 5387 | ) |
| 5388 | { |
| 5389 | WDI_EventInfoType wdiEventData; |
| 5390 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5391 | |
| 5392 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5393 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5394 | ------------------------------------------------------------------------*/ |
| 5395 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5396 | { |
| 5397 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5398 | "WDI API call before module is initialized - Fail request"); |
| 5399 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5400 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5401 | } |
| 5402 | |
| 5403 | /*------------------------------------------------------------------------ |
| 5404 | Fill in Event data and post to the Main FSM |
| 5405 | ------------------------------------------------------------------------*/ |
| 5406 | wdiEventData.wdiRequest = WDI_FTM_CMD_REQ; |
| 5407 | wdiEventData.pEventData = (void *)ftmCommandReq; |
| 5408 | wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32); |
| 5409 | wdiEventData.pCBfnc = ftmCommandRspCb; |
| 5410 | wdiEventData.pUserData = pUserData; |
| 5411 | |
| 5412 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5413 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5414 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5415 | @brief WDI_HostResumeReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5416 | |
| 5417 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5418 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5419 | |
| 5420 | |
| 5421 | @param pwdiResumeReqParams: as specified by |
| 5422 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5424 | wdiResumeReqRspCb: callback for passing back the response of |
| 5425 | the Resume Req received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5426 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5427 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5428 | callback |
| 5429 | |
| 5430 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5431 | @return Result of the function call |
| 5432 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5433 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5434 | WDI_HostResumeReq |
| 5435 | ( |
| 5436 | WDI_ResumeParamsType* pwdiResumeReqParams, |
| 5437 | WDI_HostResumeEventRspCb wdiResumeReqRspCb, |
| 5438 | void* pUserData |
| 5439 | ) |
| 5440 | { |
| 5441 | WDI_EventInfoType wdiEventData; |
| 5442 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5443 | |
| 5444 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5445 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5446 | ------------------------------------------------------------------------*/ |
| 5447 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5448 | { |
| 5449 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5450 | "WDI API call before module is initialized - Fail request"); |
| 5451 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5452 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5453 | } |
| 5454 | |
| 5455 | /*------------------------------------------------------------------------ |
| 5456 | Fill in Event data and post to the Main FSM |
| 5457 | ------------------------------------------------------------------------*/ |
| 5458 | wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5459 | wdiEventData.pEventData = pwdiResumeReqParams; |
| 5460 | wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams); |
| 5461 | wdiEventData.pCBfnc = wdiResumeReqRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5462 | wdiEventData.pUserData = pUserData; |
| 5463 | |
| 5464 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5465 | |
| 5466 | }/*WDI_HostResumeReq*/ |
| 5467 | |
| 5468 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5469 | @brief WDI_DelSTASelfReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5470 | |
| 5471 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5472 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5473 | |
| 5474 | |
| 5475 | @param pwdiDelStaSelfReqParams: as specified by |
| 5476 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5478 | wdiDelStaSelfRspCb: callback for passing back the response of |
| 5479 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5480 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5481 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5482 | callback |
| 5483 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5484 | @see WDI_PostAssocReq |
| 5485 | @return Result of the function call |
| 5486 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5487 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5488 | WDI_DelSTASelfReq |
| 5489 | ( |
| 5490 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams, |
| 5491 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb, |
| 5492 | void* pUserData |
| 5493 | ) |
| 5494 | { |
| 5495 | WDI_EventInfoType wdiEventData; |
| 5496 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5497 | |
| 5498 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5499 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5500 | ------------------------------------------------------------------------*/ |
| 5501 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5502 | { |
| 5503 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5504 | "WDI API call before module is initialized - Fail request"); |
| 5505 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5506 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5507 | } |
| 5508 | |
| 5509 | /*------------------------------------------------------------------------ |
| 5510 | Fill in Event data and post to the Main FSM |
| 5511 | ------------------------------------------------------------------------*/ |
| 5512 | wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5513 | wdiEventData.pEventData = pwdiDelStaSelfReqParams; |
| 5514 | wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams); |
| 5515 | wdiEventData.pCBfnc = wdiDelStaSelfRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5516 | wdiEventData.pUserData = pUserData; |
| 5517 | |
| 5518 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5519 | |
| 5520 | }/*WDI_AggrAddTSReq*/ |
| 5521 | |
| 5522 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5523 | @brief WDI_SetTxPerTrackingReq will be called when the upper MAC |
| 5524 | wants to set the Tx Per Tracking configurations. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5525 | Upon the call of this API the WLAN DAL will pack |
| 5526 | and send a HAL Set Tx Per Tracking request message to the |
| 5527 | lower RIVA sub-system if DAL is in state STARTED. |
| 5528 | |
| 5529 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5530 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5531 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5532 | @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5533 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5535 | pwdiSetTxPerTrackingRspCb: callback for passing back the |
| 5536 | response of the set Tx PER Tracking configurations operation received |
| 5537 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5538 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5539 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5540 | callback |
| 5541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5542 | @return Result of the function call |
| 5543 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5544 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5545 | WDI_SetTxPerTrackingReq |
| 5546 | ( |
| 5547 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams, |
| 5548 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb, |
| 5549 | void* pUserData |
| 5550 | ) |
| 5551 | { |
| 5552 | WDI_EventInfoType wdiEventData; |
| 5553 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5554 | |
| 5555 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5556 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5557 | ------------------------------------------------------------------------*/ |
| 5558 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5559 | { |
| 5560 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5561 | "WDI API call before module is initialized - Fail request"); |
| 5562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5563 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5564 | } |
| 5565 | |
| 5566 | /*------------------------------------------------------------------------ |
| 5567 | Fill in Event data and post to the Main FSM |
| 5568 | ------------------------------------------------------------------------*/ |
| 5569 | wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5570 | wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5571 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5572 | wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5573 | wdiEventData.pUserData = pUserData; |
| 5574 | |
| 5575 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5576 | |
| 5577 | }/*WDI_SetTxPerTrackingReq*/ |
| 5578 | |
| 5579 | /** |
| 5580 | @brief WDI_SetTmLevelReq |
| 5581 | If HW Thermal condition changed, driver should react based on new |
| 5582 | HW thermal condition. |
| 5583 | |
| 5584 | @param pwdiSetTmLevelReq: New thermal condition information |
| 5585 | |
| 5586 | pwdiSetTmLevelRspCb: callback |
| 5587 | |
| 5588 | usrData: user data will be passed back with the |
| 5589 | callback |
| 5590 | |
| 5591 | @return Result of the function call |
| 5592 | */ |
| 5593 | WDI_Status |
| 5594 | WDI_SetTmLevelReq |
| 5595 | ( |
| 5596 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq, |
| 5597 | WDI_SetTmLevelCb pwdiSetTmLevelRspCb, |
| 5598 | void *usrData |
| 5599 | ) |
| 5600 | { |
| 5601 | WDI_EventInfoType wdiEventData; |
| 5602 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5603 | |
| 5604 | /*------------------------------------------------------------------------ |
| 5605 | Sanity Check |
| 5606 | ------------------------------------------------------------------------*/ |
| 5607 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5608 | { |
| 5609 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5610 | "WDI API call before module is initialized - Fail request"); |
| 5611 | |
| 5612 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5613 | } |
| 5614 | |
| 5615 | /*------------------------------------------------------------------------ |
| 5616 | Fill in Event data and post to the Main FSM |
| 5617 | ------------------------------------------------------------------------*/ |
| 5618 | wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ; |
| 5619 | wdiEventData.pEventData = pwdiSetTmLevelReq; |
| 5620 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq); |
| 5621 | wdiEventData.pCBfnc = pwdiSetTmLevelRspCb; |
| 5622 | wdiEventData.pUserData = usrData; |
| 5623 | |
| 5624 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5625 | } |
| 5626 | |
| 5627 | /** |
| 5628 | @brief WDI_HostSuspendInd |
| 5629 | |
| 5630 | Suspend Indication from the upper layer will be sent |
| 5631 | down to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5632 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5633 | @param WDI_SuspendResumeIndParamsType |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5634 | |
| 5635 | @see |
| 5636 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5637 | @return Status of the request |
| 5638 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5639 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5640 | WDI_HostSuspendInd |
| 5641 | ( |
| 5642 | WDI_SuspendParamsType* pwdiSuspendIndParams |
| 5643 | ) |
| 5644 | { |
| 5645 | |
| 5646 | WDI_EventInfoType wdiEventData; |
| 5647 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5648 | |
| 5649 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5650 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5651 | ------------------------------------------------------------------------*/ |
| 5652 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5653 | { |
| 5654 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5655 | "WDI API call before module is initialized - Fail request"); |
| 5656 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5657 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5658 | } |
| 5659 | |
| 5660 | /*------------------------------------------------------------------------ |
| 5661 | Fill in Event data and post to the Main FSM |
| 5662 | ------------------------------------------------------------------------*/ |
| 5663 | wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5664 | wdiEventData.pEventData = pwdiSuspendIndParams; |
| 5665 | wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams); |
| 5666 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5667 | wdiEventData.pUserData = NULL; |
| 5668 | |
| 5669 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5670 | |
| 5671 | }/*WDI_HostSuspendInd*/ |
| 5672 | |
| 5673 | /** |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 5674 | @brief WDI_TrafficStatsInd |
| 5675 | Traffic Stats from the upper layer will be sent |
| 5676 | down to HAL |
| 5677 | |
| 5678 | @param WDI_TrafficStatsIndType |
| 5679 | |
| 5680 | @see |
| 5681 | |
| 5682 | @return Status of the request |
| 5683 | */ |
| 5684 | WDI_Status |
| 5685 | WDI_TrafficStatsInd |
| 5686 | ( |
| 5687 | WDI_TrafficStatsIndType *pWdiTrafficStatsIndParams |
| 5688 | ) |
| 5689 | { |
| 5690 | |
| 5691 | WDI_EventInfoType wdiEventData; |
| 5692 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5693 | |
| 5694 | /*------------------------------------------------------------------------ |
| 5695 | Sanity Check |
| 5696 | ------------------------------------------------------------------------*/ |
| 5697 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5698 | { |
| 5699 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5700 | "WDI API call before module is initialized - Fail request"); |
| 5701 | |
| 5702 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5703 | } |
| 5704 | |
| 5705 | /*------------------------------------------------------------------------ |
| 5706 | Fill in Event data and post to the Main FSM |
| 5707 | ------------------------------------------------------------------------*/ |
| 5708 | wdiEventData.wdiRequest = WDI_TRAFFIC_STATS_IND; |
| 5709 | wdiEventData.pEventData = pWdiTrafficStatsIndParams; |
| 5710 | wdiEventData.uEventDataSize = sizeof(*pWdiTrafficStatsIndParams); |
| 5711 | wdiEventData.pCBfnc = NULL; |
| 5712 | wdiEventData.pUserData = NULL; |
| 5713 | |
| 5714 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5715 | |
| 5716 | }/*WDI_TrafficStatsInd*/ |
| 5717 | |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 5718 | #ifdef WLAN_FEATURE_11W |
| 5719 | /** |
| 5720 | @brief WDI_ExcludeUnencryptedInd |
| 5721 | Register with HAL to receive/drop unencrypted frames |
| 5722 | |
| 5723 | @param WDI_ExcludeUnencryptIndType |
| 5724 | |
| 5725 | @see |
| 5726 | |
| 5727 | @return Status of the request |
| 5728 | */ |
| 5729 | WDI_Status |
| 5730 | WDI_ExcludeUnencryptedInd |
| 5731 | ( |
| 5732 | WDI_ExcludeUnencryptIndType *pWdiExcUnencParams |
| 5733 | ) |
| 5734 | { |
| 5735 | |
| 5736 | WDI_EventInfoType wdiEventData; |
| 5737 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5738 | |
| 5739 | /*------------------------------------------------------------------------ |
| 5740 | Sanity Check |
| 5741 | ------------------------------------------------------------------------*/ |
| 5742 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5743 | { |
| 5744 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5745 | "WDI API call before module is initialized - Fail request"); |
| 5746 | |
| 5747 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5748 | } |
| 5749 | |
| 5750 | /*------------------------------------------------------------------------ |
| 5751 | Fill in Event data and post to the Main FSM |
| 5752 | ------------------------------------------------------------------------*/ |
| 5753 | wdiEventData.wdiRequest = WDI_EXCLUDE_UNENCRYPTED_IND; |
| 5754 | wdiEventData.pEventData = pWdiExcUnencParams; |
| 5755 | wdiEventData.uEventDataSize = sizeof(*pWdiExcUnencParams); |
| 5756 | wdiEventData.pCBfnc = NULL; |
| 5757 | wdiEventData.pUserData = NULL; |
| 5758 | |
| 5759 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5760 | |
| 5761 | }/*WDI_TrafficStatsInd*/ |
| 5762 | #endif |
| 5763 | |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 5764 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5765 | @brief WDI_HALDumpCmdReq |
| 5766 | Post HAL DUMP Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5767 | |
| 5768 | @param halDumpCmdReqParams: Hal Dump Command Body |
| 5769 | @param halDumpCmdRspCb: HAL DUMP Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5770 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5771 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5772 | @see |
| 5773 | @return Result of the function call |
| 5774 | */ |
| 5775 | WDI_Status WDI_HALDumpCmdReq |
| 5776 | ( |
| 5777 | WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams, |
| 5778 | WDI_HALDumpCmdRspCb halDumpCmdRspCb, |
| 5779 | void *pUserData |
| 5780 | ) |
| 5781 | { |
| 5782 | WDI_EventInfoType wdiEventData; |
| 5783 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5784 | |
| 5785 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5786 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5787 | ------------------------------------------------------------------------*/ |
| 5788 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5789 | { |
| 5790 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5791 | "WDI API call before module is initialized - Fail request"); |
| 5792 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5793 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5794 | } |
| 5795 | |
| 5796 | /*------------------------------------------------------------------------ |
| 5797 | Fill in Event data and post to the Main FSM |
| 5798 | ------------------------------------------------------------------------*/ |
| 5799 | wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ; |
| 5800 | wdiEventData.pEventData = (void *)halDumpCmdReqParams; |
| 5801 | wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType); |
| 5802 | wdiEventData.pCBfnc = halDumpCmdRspCb; |
| 5803 | wdiEventData.pUserData = pUserData; |
| 5804 | |
| 5805 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5806 | } |
| 5807 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5808 | /*============================================================================ |
| 5809 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5810 | DAL Control Path Main FSM Function Implementation |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5811 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5812 | ============================================================================*/ |
| 5813 | |
| 5814 | /** |
| 5815 | @brief Main FSM Start function for all states except BUSY |
| 5816 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5817 | |
| 5818 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5819 | wdiEV: event posted to the main DAL FSM |
| 5820 | pEventData: pointer to the event information |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5821 | structure |
| 5822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5823 | @see |
| 5824 | @return Result of the function call |
| 5825 | */ |
| 5826 | WDI_Status |
| 5827 | WDI_PostMainEvent |
| 5828 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5829 | WDI_ControlBlockType* pWDICtx, |
| 5830 | WDI_MainEventType wdiEV, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5831 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5832 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5833 | ) |
| 5834 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5835 | WDI_Status wdiStatus; |
| 5836 | WDI_MainFuncType pfnWDIMainEvHdlr; |
| 5837 | WDI_MainStateType wdiOldState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5838 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5839 | |
| 5840 | /*------------------------------------------------------------------------- |
| 5841 | Sanity check |
| 5842 | -------------------------------------------------------------------------*/ |
| 5843 | if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) || |
| 5844 | ( wdiEV >= WDI_MAX_EVENT )) |
| 5845 | { |
| 5846 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5847 | "Invalid state or event in Post Main Ev function ST: %d EV: %d", |
| 5848 | pWDICtx->uGlobalState, wdiEV); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5849 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5850 | } |
| 5851 | |
| 5852 | /*Access to the global state must be locked */ |
| 5853 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5854 | |
| 5855 | /*Fetch event handler for state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5856 | pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5857 | |
| 5858 | wdiOldState = pWDICtx->uGlobalState; |
| 5859 | |
| 5860 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5861 | --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a |
| 5862 | response comes from CCPU for the request sent by host: |
| 5863 | 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] | 5864 | 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] | 5865 | --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] | 5866 | CCPU: |
| 5867 | don't change the state */ |
| 5868 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5869 | { |
| 5870 | /*Transition to BUSY State - the request is now being processed by the FSM, |
| 5871 | if the request fails we shall transition back to the old state, if not |
| 5872 | the request will manage its own state transition*/ |
| 5873 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
| 5874 | } |
| 5875 | /* If the state function associated with the EV is NULL it means that this |
| 5876 | event is not allowed in this state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5877 | if ( NULL != pfnWDIMainEvHdlr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5878 | { |
| 5879 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5880 | "Posting event %d in state: %d to the Main FSM", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5881 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5882 | wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5883 | } |
| 5884 | else |
| 5885 | { |
| 5886 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5887 | "Unexpected event %d in state: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5888 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5889 | wdiStatus = WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5890 | } |
| 5891 | |
| 5892 | /* If a request handles itself well it will end up in a success or in a |
| 5893 | pending |
| 5894 | Success - means that the request was processed and the proper state |
| 5895 | transition already occurred or will occur when the resp is received |
| 5896 | - NO other state transition or dequeueing is required |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5897 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5898 | Pending - means the request could not be processed at this moment in time |
| 5899 | because the FSM was already busy so no state transition or dequeueing |
| 5900 | is necessary anymore |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5901 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5902 | Success for synchronous case means that the transition may occur and |
| 5903 | processing of pending requests may continue - so it should go through |
| 5904 | and restores the state and continue processing queued requests*/ |
| 5905 | if (( WDI_STATUS_SUCCESS != wdiStatus )&& |
| 5906 | ( WDI_STATUS_PENDING != wdiStatus )) |
| 5907 | { |
| 5908 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5909 | { |
| 5910 | /*The request has failed or could not be processed - transition back to |
| 5911 | the old state - check to see if anything was queued and try to execute |
| 5912 | The dequeue logic should post a message to a thread and return - no |
| 5913 | actual processing can occur */ |
| 5914 | WDI_STATE_TRANSITION( pWDICtx, wdiOldState); |
| 5915 | } |
| 5916 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5917 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5918 | } |
| 5919 | |
| 5920 | /* we have completed processing the event */ |
| 5921 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5922 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5923 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5924 | |
| 5925 | }/*WDI_PostMainEvent*/ |
| 5926 | |
| 5927 | |
| 5928 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5929 | INIT State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5930 | --------------------------------------------------------------------------*/ |
| 5931 | /** |
| 5932 | @brief Main FSM Start function for all states except BUSY |
| 5933 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5934 | |
| 5935 | @param pWDICtx: pointer to the WLAN DAL context |
| 5936 | pEventData: pointer to the event information structure |
| 5937 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5938 | @see |
| 5939 | @return Result of the function call |
| 5940 | */ |
| 5941 | WDI_Status |
| 5942 | WDI_MainStart |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5943 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5944 | WDI_ControlBlockType* pWDICtx, |
| 5945 | WDI_EventInfoType* pEventData |
| 5946 | ) |
| 5947 | { |
| 5948 | |
| 5949 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5950 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5951 | ----------------------------------------------------------------------*/ |
| 5952 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5953 | { |
| 5954 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5955 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5956 | pWDICtx, pEventData); |
| 5957 | return WDI_STATUS_E_FAILURE; |
| 5958 | } |
| 5959 | |
| 5960 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5961 | |
| 5962 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5963 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5964 | ----------------------------------------------------------------------*/ |
| 5965 | if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened ) |
| 5966 | { |
| 5967 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 5968 | "Control Transport not yet Open - queueing the request"); |
| 5969 | |
| 5970 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5971 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5972 | |
| 5973 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5974 | return WDI_STATUS_PENDING; |
| 5975 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5976 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5977 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5978 | |
| 5979 | /*Return Success*/ |
| 5980 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5981 | |
| 5982 | }/*WDI_MainStart*/ |
| 5983 | |
| 5984 | /** |
| 5985 | @brief Main FSM Response function for state INIT |
| 5986 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5987 | |
| 5988 | @param pWDICtx: pointer to the WLAN DAL context |
| 5989 | pEventData: pointer to the event information structure |
| 5990 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5991 | @see |
| 5992 | @return Result of the function call |
| 5993 | */ |
| 5994 | WDI_Status |
| 5995 | WDI_MainRspInit |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5996 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5997 | WDI_ControlBlockType* pWDICtx, |
| 5998 | WDI_EventInfoType* pEventData |
| 5999 | ) |
| 6000 | { |
| 6001 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6002 | Not expecting a response from the device before it is started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6003 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6004 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6005 | |
| 6006 | /*Return Success*/ |
| 6007 | return WDI_STATUS_E_NOT_ALLOWED; |
| 6008 | }/* WDI_MainRspInit */ |
| 6009 | |
| 6010 | /** |
| 6011 | @brief Main FSM Close function for all states except BUSY |
| 6012 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6013 | |
| 6014 | @param pWDICtx: pointer to the WLAN DAL context |
| 6015 | pEventData: pointer to the event information structure |
| 6016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6017 | @see |
| 6018 | @return Result of the function call |
| 6019 | */ |
| 6020 | WDI_Status |
| 6021 | WDI_MainClose |
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 | WDI_ControlBlockType* pWDICtx, |
| 6024 | WDI_EventInfoType* pEventData |
| 6025 | ) |
| 6026 | { |
| 6027 | |
| 6028 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6029 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6030 | ----------------------------------------------------------------------*/ |
| 6031 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6032 | { |
| 6033 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6034 | "Invalid parameters on Main Close %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6035 | pWDICtx, pEventData); |
| 6036 | return WDI_STATUS_E_FAILURE; |
| 6037 | } |
| 6038 | |
| 6039 | /*Return Success*/ |
| 6040 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6041 | |
| 6042 | }/*WDI_MainClose*/ |
| 6043 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6044 | STARTED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6045 | --------------------------------------------------------------------------*/ |
| 6046 | /** |
| 6047 | @brief Main FSM Start function for state STARTED |
| 6048 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6049 | |
| 6050 | @param pWDICtx: pointer to the WLAN DAL context |
| 6051 | pEventData: pointer to the event information structure |
| 6052 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6053 | @see |
| 6054 | @return Result of the function call |
| 6055 | */ |
| 6056 | WDI_Status |
| 6057 | WDI_MainStartStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6058 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6059 | WDI_ControlBlockType* pWDICtx, |
| 6060 | WDI_EventInfoType* pEventData |
| 6061 | ) |
| 6062 | { |
| 6063 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 6064 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6065 | |
| 6066 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6067 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6068 | ----------------------------------------------------------------------*/ |
| 6069 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6070 | { |
| 6071 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6072 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6073 | pWDICtx, pEventData); |
| 6074 | return WDI_STATUS_E_FAILURE; |
| 6075 | } |
| 6076 | |
| 6077 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6078 | Nothing to do transport was already started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6079 | ----------------------------------------------------------------------*/ |
| 6080 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6081 | "Received start while transport was already started - nothing to do"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6082 | |
| 6083 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6084 | |
| 6085 | /*Transition back to started because the post function transitioned us to |
| 6086 | busy*/ |
| 6087 | WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST); |
| 6088 | |
| 6089 | /*Check to see if any request is pending*/ |
| 6090 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6091 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6092 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6093 | |
| 6094 | /*Tell UMAC Success*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6095 | wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc; |
| 6096 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6097 | /*Notify UMAC*/ |
| 6098 | wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData); |
| 6099 | |
| 6100 | /*Return Success*/ |
| 6101 | return WDI_STATUS_SUCCESS; |
| 6102 | |
| 6103 | }/*WDI_MainStartStarted*/ |
| 6104 | |
| 6105 | /** |
| 6106 | @brief Main FSM Stop function for state STARTED |
| 6107 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6108 | |
| 6109 | @param pWDICtx: pointer to the WLAN DAL context |
| 6110 | pEventData: pointer to the event information structure |
| 6111 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6112 | @see |
| 6113 | @return Result of the function call |
| 6114 | */ |
| 6115 | WDI_Status |
| 6116 | WDI_MainStopStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6117 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6118 | WDI_ControlBlockType* pWDICtx, |
| 6119 | WDI_EventInfoType* pEventData |
| 6120 | ) |
| 6121 | { |
| 6122 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6123 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6124 | ----------------------------------------------------------------------*/ |
| 6125 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6126 | { |
| 6127 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6128 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6129 | pWDICtx, pEventData); |
| 6130 | return WDI_STATUS_E_FAILURE; |
| 6131 | } |
| 6132 | |
| 6133 | /*State at this point is BUSY - because we enter this state before posting |
| 6134 | an event to the FSM in order to prevent potential race conditions*/ |
| 6135 | |
| 6136 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 6137 | "Processing stop request in FSM"); |
| 6138 | |
| 6139 | /*Return Success*/ |
| 6140 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6141 | |
| 6142 | }/*WDI_MainStopStarted*/ |
| 6143 | /** |
| 6144 | @brief Main FSM Request function for state started |
| 6145 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6146 | |
| 6147 | @param pWDICtx: pointer to the WLAN DAL context |
| 6148 | pEventData: pointer to the event information structure |
| 6149 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6150 | @see |
| 6151 | @return Result of the function call |
| 6152 | */ |
| 6153 | WDI_Status |
| 6154 | WDI_MainReqStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6155 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6156 | WDI_ControlBlockType* pWDICtx, |
| 6157 | WDI_EventInfoType* pEventData |
| 6158 | ) |
| 6159 | { |
| 6160 | |
| 6161 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6162 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6163 | ----------------------------------------------------------------------*/ |
| 6164 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6165 | { |
| 6166 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6167 | "Invalid parameters on Main Req Started %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6168 | pWDICtx, pEventData); |
| 6169 | return WDI_STATUS_E_FAILURE; |
| 6170 | } |
| 6171 | |
| 6172 | /*State at this point is BUSY - because we enter this state before posting |
| 6173 | an event to the FSM in order to prevent potential race conditions*/ |
| 6174 | |
| 6175 | /*Return Success*/ |
| 6176 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6177 | |
| 6178 | }/*WDI_MainReqStarted*/ |
| 6179 | |
| 6180 | /** |
| 6181 | @brief Main FSM Response function for all states except INIT |
| 6182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6183 | |
| 6184 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6185 | pEventData: pointer to the event information structure |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6186 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6187 | @see |
| 6188 | @return Result of the function call |
| 6189 | */ |
| 6190 | WDI_Status |
| 6191 | WDI_MainRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6192 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6193 | WDI_ControlBlockType* pWDICtx, |
| 6194 | WDI_EventInfoType* pEventData |
| 6195 | ) |
| 6196 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6197 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6198 | wpt_boolean expectedResponse; |
| 6199 | |
| 6200 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6201 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6202 | ----------------------------------------------------------------------*/ |
| 6203 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6204 | { |
| 6205 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6206 | "Invalid parameters on Main Response %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6207 | pWDICtx, pEventData); |
| 6208 | return WDI_STATUS_E_FAILURE; |
| 6209 | } |
| 6210 | |
| 6211 | if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 6212 | { |
| 6213 | /* we received an expected response */ |
| 6214 | expectedResponse = eWLAN_PAL_TRUE; |
| 6215 | |
| 6216 | /*We expect that we will transition to started after this processing*/ |
| 6217 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 6218 | |
| 6219 | /* we are no longer expecting a response */ |
| 6220 | pWDICtx->wdiExpectedResponse = WDI_MAX_RESP; |
| 6221 | } |
| 6222 | else |
| 6223 | { |
| 6224 | /* we received an indication or unexpected response */ |
| 6225 | expectedResponse = eWLAN_PAL_FALSE; |
| 6226 | /* for indications no need to update state from what it is right |
| 6227 | now, unless it explicitly does it in the indication handler (say |
| 6228 | for device failure ind) */ |
| 6229 | pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState; |
| 6230 | } |
| 6231 | |
| 6232 | /*Process the response and indication */ |
| 6233 | wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData ); |
| 6234 | |
| 6235 | /*Lock the CB as we are about to do a state transition*/ |
| 6236 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6237 | |
| 6238 | /*Transition to the expected state after the response processing |
| 6239 | - this should always be started state with the following exceptions: |
| 6240 | 1. processing of a failed start response |
| 6241 | 2. device failure detected while processing response |
| 6242 | 3. stop response received*/ |
| 6243 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6244 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6245 | /*Dequeue request that may have been queued while we were waiting for the |
| 6246 | response */ |
| 6247 | if ( expectedResponse ) |
| 6248 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6249 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6250 | } |
| 6251 | |
| 6252 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6253 | |
| 6254 | /*Return Success - always */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6255 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6256 | |
| 6257 | }/*WDI_MainRsp*/ |
| 6258 | |
| 6259 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6260 | STOPPED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6261 | --------------------------------------------------------------------------*/ |
| 6262 | /** |
| 6263 | @brief Main FSM Stop function for state STOPPED |
| 6264 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6265 | |
| 6266 | @param pWDICtx: pointer to the WLAN DAL context |
| 6267 | pEventData: pointer to the event information structure |
| 6268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6269 | @see |
| 6270 | @return Result of the function call |
| 6271 | */ |
| 6272 | WDI_Status |
| 6273 | WDI_MainStopStopped |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6274 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6275 | WDI_ControlBlockType* pWDICtx, |
| 6276 | WDI_EventInfoType* pEventData |
| 6277 | ) |
| 6278 | { |
| 6279 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6280 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6281 | ----------------------------------------------------------------------*/ |
| 6282 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6283 | { |
| 6284 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6285 | "Invalid parameters on Main Stop Stopped %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6286 | pWDICtx, pEventData); |
| 6287 | return WDI_STATUS_E_FAILURE; |
| 6288 | } |
| 6289 | |
| 6290 | /*We should normally not get a STOP request if we are already stopped |
| 6291 | since we should normally be stopped by the UMAC. However in some |
| 6292 | error situations we put ourselves in the stopped state without the |
| 6293 | UMAC knowing, so when we get a STOP request in this state we still |
| 6294 | process it since we need to clean up the underlying state */ |
| 6295 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6296 | "Processing stop request while stopped in FSM"); |
| 6297 | |
| 6298 | /*Return Success*/ |
| 6299 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6300 | |
| 6301 | }/*WDI_MainStopStopped*/ |
| 6302 | |
| 6303 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6304 | BUSY State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6305 | --------------------------------------------------------------------------*/ |
| 6306 | /** |
| 6307 | @brief Main FSM Start function for state BUSY |
| 6308 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6309 | |
| 6310 | @param pWDICtx: pointer to the WLAN DAL context |
| 6311 | pEventData: pointer to the event information structure |
| 6312 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6313 | @see |
| 6314 | @return Result of the function call |
| 6315 | */ |
| 6316 | WDI_Status |
| 6317 | WDI_MainStartBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6318 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6319 | WDI_ControlBlockType* pWDICtx, |
| 6320 | WDI_EventInfoType* pEventData |
| 6321 | ) |
| 6322 | { |
| 6323 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6324 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6325 | ----------------------------------------------------------------------*/ |
| 6326 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6327 | { |
| 6328 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6329 | "Invalid parameters on Main Start in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6330 | pWDICtx, pEventData); |
| 6331 | return WDI_STATUS_E_FAILURE; |
| 6332 | } |
| 6333 | |
| 6334 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6335 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6336 | ----------------------------------------------------------------------*/ |
| 6337 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6338 | "WDI Busy state - queue start request"); |
| 6339 | |
| 6340 | /*Queue the start request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6341 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6342 | |
| 6343 | /*Return Success*/ |
| 6344 | return WDI_STATUS_PENDING; |
| 6345 | }/*WDI_MainStartBusy*/ |
| 6346 | |
| 6347 | /** |
| 6348 | @brief Main FSM Stop function for state BUSY |
| 6349 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6350 | |
| 6351 | @param pWDICtx: pointer to the WLAN DAL context |
| 6352 | pEventData: pointer to the event information structure |
| 6353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6354 | @see |
| 6355 | @return Result of the function call |
| 6356 | */ |
| 6357 | WDI_Status |
| 6358 | WDI_MainStopBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6359 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6360 | WDI_ControlBlockType* pWDICtx, |
| 6361 | WDI_EventInfoType* pEventData |
| 6362 | ) |
| 6363 | { |
| 6364 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6365 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6366 | ----------------------------------------------------------------------*/ |
| 6367 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6368 | { |
| 6369 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6370 | "Invalid parameters on Main Stop in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6371 | pWDICtx, pEventData); |
| 6372 | return WDI_STATUS_E_FAILURE; |
| 6373 | } |
| 6374 | |
| 6375 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6376 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6377 | ----------------------------------------------------------------------*/ |
| 6378 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6379 | "WDI Busy state - queue stop request"); |
| 6380 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6381 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6382 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6384 | }/*WDI_MainStopBusy*/ |
| 6385 | |
| 6386 | /** |
| 6387 | @brief Main FSM Request function for state BUSY |
| 6388 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6389 | |
| 6390 | @param pWDICtx: pointer to the WLAN DAL context |
| 6391 | pEventData: pointer to the event information structure |
| 6392 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6393 | @see |
| 6394 | @return Result of the function call |
| 6395 | */ |
| 6396 | WDI_Status |
| 6397 | WDI_MainReqBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6398 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6399 | WDI_ControlBlockType* pWDICtx, |
| 6400 | WDI_EventInfoType* pEventData |
| 6401 | ) |
| 6402 | { |
| 6403 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6404 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6405 | ----------------------------------------------------------------------*/ |
| 6406 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6407 | { |
| 6408 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6409 | "Invalid parameters on Main Request in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6410 | pWDICtx, pEventData); |
| 6411 | return WDI_STATUS_E_FAILURE; |
| 6412 | } |
| 6413 | |
| 6414 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6415 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6416 | ----------------------------------------------------------------------*/ |
| 6417 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6418 | "WDI Busy state - queue request %d because waiting for response %d", |
| 6419 | pEventData->wdiRequest, pWDICtx->wdiExpectedResponse); |
| 6420 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6421 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6422 | return WDI_STATUS_PENDING; |
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_MainReqBusy*/ |
| 6425 | /** |
| 6426 | @brief Main FSM Close function for state BUSY |
| 6427 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6428 | |
| 6429 | @param pWDICtx: pointer to the WLAN DAL context |
| 6430 | pEventData: pointer to the event information structure |
| 6431 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6432 | @see |
| 6433 | @return Result of the function call |
| 6434 | */ |
| 6435 | WDI_Status |
| 6436 | WDI_MainCloseBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6437 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6438 | WDI_ControlBlockType* pWDICtx, |
| 6439 | WDI_EventInfoType* pEventData |
| 6440 | ) |
| 6441 | { |
| 6442 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6443 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6444 | ----------------------------------------------------------------------*/ |
| 6445 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6446 | { |
| 6447 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6448 | "Invalid parameters on Main Close in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6449 | pWDICtx, pEventData); |
| 6450 | return WDI_STATUS_E_FAILURE; |
| 6451 | } |
| 6452 | |
| 6453 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6454 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6455 | ----------------------------------------------------------------------*/ |
| 6456 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6457 | "WDI Busy state - queue close request"); |
| 6458 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6459 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6460 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6461 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6462 | }/*WDI_MainCloseBusy*/ |
| 6463 | |
| 6464 | /** |
| 6465 | @brief Main FSM Shutdown function for INIT & STARTED states |
| 6466 | |
| 6467 | |
| 6468 | @param pWDICtx: pointer to the WLAN DAL context |
| 6469 | pEventData: pointer to the event information structure |
| 6470 | |
| 6471 | @see |
| 6472 | @return Result of the function call |
| 6473 | */ |
| 6474 | WDI_Status |
| 6475 | WDI_MainShutdown |
| 6476 | ( |
| 6477 | WDI_ControlBlockType* pWDICtx, |
| 6478 | WDI_EventInfoType* pEventData |
| 6479 | ) |
| 6480 | { |
| 6481 | /*-------------------------------------------------------------------- |
| 6482 | Sanity Check |
| 6483 | ----------------------------------------------------------------------*/ |
| 6484 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6485 | { |
| 6486 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6487 | "Invalid parameters on Main Start %x %x", |
| 6488 | pWDICtx, pEventData); |
| 6489 | return WDI_STATUS_E_FAILURE; |
| 6490 | } |
| 6491 | |
| 6492 | /*State at this point is BUSY - because we enter this state before posting |
| 6493 | an event to the FSM in order to prevent potential race conditions*/ |
| 6494 | |
| 6495 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6496 | "Processing shutdown request in FSM"); |
| 6497 | |
| 6498 | /*Return Success*/ |
| 6499 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6500 | |
| 6501 | }/*WDI_MainShutdown*/ |
| 6502 | |
| 6503 | /** |
| 6504 | @brief Main FSM Shutdown function for BUSY state |
| 6505 | |
| 6506 | |
| 6507 | @param pWDICtx: pointer to the WLAN DAL context |
| 6508 | pEventData: pointer to the event information structure |
| 6509 | |
| 6510 | @see |
| 6511 | @return Result of the function call |
| 6512 | */ |
| 6513 | WDI_Status |
| 6514 | WDI_MainShutdownBusy |
| 6515 | ( |
| 6516 | WDI_ControlBlockType* pWDICtx, |
| 6517 | WDI_EventInfoType* pEventData |
| 6518 | ) |
| 6519 | { |
| 6520 | /*-------------------------------------------------------------------- |
| 6521 | Sanity Check |
| 6522 | ----------------------------------------------------------------------*/ |
| 6523 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6524 | { |
| 6525 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6526 | "Invalid parameters on Main Start %x %x", |
| 6527 | pWDICtx, pEventData); |
| 6528 | return WDI_STATUS_E_FAILURE; |
| 6529 | } |
| 6530 | |
| 6531 | /* If you are waiting for a HAL response at this stage, you are not |
| 6532 | * going to get it. Riva is already shutdown/crashed. |
| 6533 | */ |
| 6534 | wpalTimerStop(&gWDICb.wptResponseTimer); |
| 6535 | |
| 6536 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6537 | "Processing shutdown request in FSM: Busy state "); |
| 6538 | |
| 6539 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6540 | |
| 6541 | }/*WDI_MainShutdownBusy*/ |
| 6542 | |
| 6543 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6544 | /*======================================================================= |
| 6545 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6546 | WLAN DAL Control Path Main Processing Functions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6547 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6548 | *=======================================================================*/ |
| 6549 | |
| 6550 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6551 | Main DAL Control Path Request Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6552 | ========================================================================*/ |
| 6553 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6554 | @brief Process Start Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6555 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6556 | |
| 6557 | @param pWDICtx: pointer to the WLAN DAL context |
| 6558 | pEventData: pointer to the event information structure |
| 6559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6560 | @see |
| 6561 | @return Result of the function call |
| 6562 | */ |
| 6563 | WDI_Status |
| 6564 | WDI_ProcessStartReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6565 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6566 | WDI_ControlBlockType* pWDICtx, |
| 6567 | WDI_EventInfoType* pEventData |
| 6568 | ) |
| 6569 | { |
| 6570 | WDI_StartReqParamsType* pwdiStartParams = NULL; |
| 6571 | WDI_StartRspCb wdiStartRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6572 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6573 | wpt_uint16 usDataOffset = 0; |
| 6574 | wpt_uint16 usSendSize = 0; |
| 6575 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6576 | tHalMacStartReqMsg halStartReq; |
| 6577 | wpt_uint16 usLen = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6578 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6579 | |
| 6580 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6581 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6582 | -------------------------------------------------------------------------*/ |
| 6583 | if (( NULL == pEventData ) || |
| 6584 | ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) || |
| 6585 | ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc))) |
| 6586 | { |
| 6587 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6588 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6589 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6590 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6591 | } |
| 6592 | |
| 6593 | /*----------------------------------------------------------------------- |
| 6594 | Get message buffer |
| 6595 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6596 | usLen = sizeof(halStartReq.startReqParams) + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6597 | pwdiStartParams->usConfigBufferLen; |
| 6598 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6599 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6600 | usLen, |
| 6601 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6602 | ( usSendSize < (usDataOffset + usLen ))) |
| 6603 | { |
| 6604 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6605 | "Unable to get send buffer in start req %x %x %x", |
| 6606 | pEventData, pwdiStartParams, wdiStartRspCb); |
| 6607 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6608 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6609 | } |
| 6610 | |
| 6611 | /*----------------------------------------------------------------------- |
| 6612 | Fill in the message |
| 6613 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6614 | halStartReq.startReqParams.driverType = |
| 6615 | WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6616 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6617 | halStartReq.startReqParams.uConfigBufferLen = |
| 6618 | pwdiStartParams->usConfigBufferLen; |
| 6619 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6620 | &halStartReq.startReqParams, |
| 6621 | sizeof(halStartReq.startReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6622 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6623 | usDataOffset += sizeof(halStartReq.startReqParams); |
| 6624 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6625 | pwdiStartParams->pConfigBuffer, |
| 6626 | pwdiStartParams->usConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6627 | |
| 6628 | pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6629 | pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6630 | |
| 6631 | /*Save Low Level Ind CB and associated user data - it will be used further |
| 6632 | on when an indication is coming from the lower MAC*/ |
| 6633 | pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6634 | pWDICtx->pIndUserData = pwdiStartParams->pIndUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6635 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6636 | pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6637 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6638 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6639 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6640 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6641 | wdiStartRspCb, pEventData->pUserData, WDI_START_RESP); |
| 6642 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6643 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6644 | }/*WDI_ProcessStartReq*/ |
| 6645 | |
| 6646 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6647 | @brief Process Stop Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6648 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6649 | |
| 6650 | @param pWDICtx: pointer to the WLAN DAL context |
| 6651 | pEventData: pointer to the event information structure |
| 6652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6653 | @see |
| 6654 | @return Result of the function call |
| 6655 | */ |
| 6656 | WDI_Status |
| 6657 | WDI_ProcessStopReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6658 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6659 | WDI_ControlBlockType* pWDICtx, |
| 6660 | WDI_EventInfoType* pEventData |
| 6661 | ) |
| 6662 | { |
| 6663 | WDI_StopReqParamsType* pwdiStopParams = NULL; |
| 6664 | WDI_StopRspCb wdiStopRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6665 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6666 | wpt_uint16 usDataOffset = 0; |
| 6667 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6668 | wpt_status status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6669 | tHalMacStopReqMsg halStopReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6670 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6671 | |
| 6672 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6673 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6674 | -------------------------------------------------------------------------*/ |
| 6675 | if (( NULL == pEventData ) || |
| 6676 | ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) || |
| 6677 | ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc))) |
| 6678 | { |
| 6679 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6680 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6681 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6682 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6683 | } |
| 6684 | |
| 6685 | /*----------------------------------------------------------------------- |
| 6686 | Get message buffer |
| 6687 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6688 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6689 | sizeof(halStopReq.stopReqParams), |
| 6690 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6691 | ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) ))) |
| 6692 | { |
| 6693 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6694 | "Unable to get send buffer in stop req %x %x %x", |
| 6695 | pEventData, pwdiStopParams, wdiStopRspCb); |
| 6696 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6697 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6698 | } |
| 6699 | |
| 6700 | /*----------------------------------------------------------------------- |
| 6701 | Fill in the message |
| 6702 | -----------------------------------------------------------------------*/ |
| 6703 | halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON( |
| 6704 | pwdiStopParams->wdiStopReason); |
| 6705 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6706 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6707 | &halStopReq.stopReqParams, |
| 6708 | sizeof(halStopReq.stopReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6709 | |
| 6710 | pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6711 | pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6712 | |
| 6713 | /*! TO DO: stop the data services */ |
| 6714 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6715 | { |
| 6716 | /*Stop the STA Table !UT- check this logic again |
| 6717 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 6718 | WDI_STATableStop(pWDICtx); |
| 6719 | |
| 6720 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6721 | status = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 6722 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6723 | { |
| 6724 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6725 | "WDI Init failed to reset power state event"); |
| 6726 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6727 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6728 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6729 | } |
| 6730 | /* Stop Transport Driver, DXE */ |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 6731 | status = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb); |
| 6732 | if( eWLAN_PAL_STATUS_SUCCESS != status ) |
| 6733 | { |
| 6734 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6735 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Power Down state\n", status); |
| 6736 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6737 | goto fail; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 6738 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6739 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6740 | * 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] | 6741 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6742 | status = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 6743 | WDI_SET_POWER_STATE_TIMEOUT); |
| 6744 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6745 | { |
| 6746 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6747 | "WDI Init failed to wait on an event"); |
| 6748 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6749 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6750 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6751 | } |
| 6752 | } |
| 6753 | |
| 6754 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6755 | Send Stop Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6756 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6757 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6758 | wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP); |
| 6759 | |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 6760 | fail: |
| 6761 | // Release the message buffer so we don't leak |
| 6762 | wpalMemoryFree(pSendBuffer); |
| 6763 | |
| 6764 | failRequest: |
| 6765 | //WDA should have failure check to avoid the memory leak |
| 6766 | return WDI_STATUS_E_FAILURE; |
| 6767 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6768 | }/*WDI_ProcessStopReq*/ |
| 6769 | |
| 6770 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6771 | @brief Process Close Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6772 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6773 | |
| 6774 | @param pWDICtx: pointer to the WLAN DAL context |
| 6775 | pEventData: pointer to the event information structure |
| 6776 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6777 | @see |
| 6778 | @return Result of the function call |
| 6779 | */ |
| 6780 | WDI_Status |
| 6781 | WDI_ProcessCloseReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6782 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6783 | WDI_ControlBlockType* pWDICtx, |
| 6784 | WDI_EventInfoType* pEventData |
| 6785 | ) |
| 6786 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6787 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6788 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6789 | |
| 6790 | /*Lock control block for cleanup*/ |
| 6791 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6793 | /*Clear all pending request*/ |
| 6794 | WDI_ClearPendingRequests(pWDICtx); |
| 6795 | |
| 6796 | /* Close Control transport*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6797 | WCTS_CloseTransport(pWDICtx->wctsHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6798 | |
| 6799 | /* Close Data transport*/ |
| 6800 | /* FTM mode does not open Data Path */ |
| 6801 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6802 | { |
| 6803 | WDTS_Close(pWDICtx); |
| 6804 | } |
| 6805 | |
| 6806 | /*Close the STA Table !UT- check this logic again*/ |
| 6807 | WDI_STATableClose(pWDICtx); |
| 6808 | |
| 6809 | /*close the PAL */ |
| 6810 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 6811 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 6812 | { |
| 6813 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6814 | "Failed to wpal Close %d", wptStatus); |
| 6815 | WDI_ASSERT(0); |
| 6816 | } |
| 6817 | |
| 6818 | /*Transition back to init state*/ |
| 6819 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 6820 | |
| 6821 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6822 | |
| 6823 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6824 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6826 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6827 | }/*WDI_ProcessCloseReq*/ |
| 6828 | |
| 6829 | |
| 6830 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6831 | SCANING REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6832 | ===========================================================================*/ |
| 6833 | |
| 6834 | /** |
| 6835 | @brief Process Init Scan Request function (called when Main FSM |
| 6836 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6837 | |
| 6838 | @param pWDICtx: pointer to the WLAN DAL context |
| 6839 | pEventData: pointer to the event information structure |
| 6840 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6841 | @see |
| 6842 | @return Result of the function call |
| 6843 | */ |
| 6844 | WDI_Status |
| 6845 | WDI_ProcessInitScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6846 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6847 | WDI_ControlBlockType* pWDICtx, |
| 6848 | WDI_EventInfoType* pEventData |
| 6849 | ) |
| 6850 | { |
| 6851 | WDI_InitScanReqParamsType* pwdiInitScanParams = NULL; |
| 6852 | WDI_InitScanRspCb wdiInitScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6853 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6854 | wpt_uint16 usDataOffset = 0; |
| 6855 | wpt_uint16 usSendSize = 0; |
| 6856 | wpt_uint8 i = 0; |
| 6857 | |
| 6858 | tHalInitScanReqMsg halInitScanReqMsg; |
| 6859 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6860 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6861 | * It shold be removed once host and riva changes are in sync*/ |
| 6862 | tHalInitScanConReqMsg halInitScanConReqMsg; |
| 6863 | |
| 6864 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6865 | |
| 6866 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6867 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6868 | -------------------------------------------------------------------------*/ |
| 6869 | if (( NULL == pEventData ) || |
| 6870 | ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) || |
| 6871 | ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc))) |
| 6872 | { |
| 6873 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6874 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6875 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6876 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6877 | } |
| 6878 | |
| 6879 | #if 0 |
| 6880 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6881 | /*----------------------------------------------------------------------- |
| 6882 | Check to see if SCAN is already in progress - if so reject the req |
| 6883 | We only allow one scan at a time |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6884 | ! TO DO: - revisit this constraint |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6885 | -----------------------------------------------------------------------*/ |
| 6886 | if ( pWDICtx->bScanInProgress ) |
| 6887 | { |
| 6888 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6889 | "Scan is already in progress - subsequent scan is not allowed" |
| 6890 | " until the first scan completes"); |
| 6891 | |
| 6892 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6893 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6894 | } |
| 6895 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6896 | pWDICtx->bScanInProgress = eWLAN_PAL_TRUE; |
| 6897 | pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6898 | |
| 6899 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6900 | #endif |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 6901 | if ((pwdiInitScanParams->wdiReqInfo.bUseNOA) && (!WDI_getFwWlanFeatCaps(P2P_GO_NOA_DECOUPLE_INIT_SCAN))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6902 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6903 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6904 | * It shold be removed once host and riva changes are in sync*/ |
| 6905 | /*----------------------------------------------------------------------- |
| 6906 | Get message buffer |
| 6907 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6908 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6909 | sizeof(halInitScanConReqMsg.initScanParams), |
| 6910 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6911 | ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) ))) |
| 6912 | { |
| 6913 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6914 | "Unable to get send buffer in init scan req %x %x %x", |
| 6915 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6916 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6917 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6918 | } |
| 6919 | |
| 6920 | |
| 6921 | /*----------------------------------------------------------------------- |
| 6922 | Fill in the message |
| 6923 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6924 | halInitScanConReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6925 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6926 | |
| 6927 | wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid, |
| 6928 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6929 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6930 | halInitScanConReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6931 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6932 | halInitScanConReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6933 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6934 | halInitScanConReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6935 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6936 | |
| 6937 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr, |
| 6938 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6939 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6940 | halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA; |
| 6941 | halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6942 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6943 | halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6944 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6945 | |
| 6946 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6947 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6948 | halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6949 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6950 | } |
| 6951 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6952 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6953 | &halInitScanConReqMsg.initScanParams, |
| 6954 | sizeof(halInitScanConReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6955 | } |
| 6956 | else |
| 6957 | { |
| 6958 | /*----------------------------------------------------------------------- |
| 6959 | Get message buffer |
| 6960 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6961 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6962 | sizeof(halInitScanReqMsg.initScanParams), |
| 6963 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6964 | ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) ))) |
| 6965 | { |
| 6966 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6967 | "Unable to get send buffer in init scan req %x %x %x", |
| 6968 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6969 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6970 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6971 | } |
| 6972 | |
| 6973 | |
| 6974 | /*----------------------------------------------------------------------- |
| 6975 | Fill in the message |
| 6976 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6977 | halInitScanReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6978 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6979 | |
| 6980 | wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid, |
| 6981 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6982 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6983 | halInitScanReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6984 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6985 | halInitScanReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6986 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6987 | halInitScanReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6988 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6989 | |
| 6990 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr, |
| 6991 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6992 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6993 | halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6994 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6995 | |
| 6996 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6997 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6998 | halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6999 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 7000 | } |
| 7001 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7002 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7003 | &halInitScanReqMsg.initScanParams, |
| 7004 | sizeof(halInitScanReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7005 | } |
| 7006 | |
| 7007 | pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7008 | pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7009 | |
| 7010 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7011 | Send Init Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7012 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7013 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7014 | wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP); |
| 7015 | |
| 7016 | }/*WDI_ProcessInitScanReq*/ |
| 7017 | |
| 7018 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7019 | @brief Process Start Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7020 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7021 | |
| 7022 | @param pWDICtx: pointer to the WLAN DAL context |
| 7023 | pEventData: pointer to the event information structure |
| 7024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7025 | @see |
| 7026 | @return Result of the function call |
| 7027 | */ |
| 7028 | WDI_Status |
| 7029 | WDI_ProcessStartScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7030 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7031 | WDI_ControlBlockType* pWDICtx, |
| 7032 | WDI_EventInfoType* pEventData |
| 7033 | ) |
| 7034 | { |
| 7035 | WDI_StartScanReqParamsType* pwdiStartScanParams = NULL; |
| 7036 | WDI_StartScanRspCb wdiStartScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7037 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7038 | wpt_uint16 usDataOffset = 0; |
| 7039 | wpt_uint16 usSendSize = 0; |
| 7040 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7041 | tHalStartScanReqMsg halStartScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7042 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7043 | |
| 7044 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7045 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7046 | -------------------------------------------------------------------------*/ |
| 7047 | if (( NULL == pEventData ) || |
| 7048 | ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) || |
| 7049 | ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc))) |
| 7050 | { |
| 7051 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7052 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7053 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7054 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7055 | } |
| 7056 | |
| 7057 | #if 0 |
| 7058 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7059 | /*----------------------------------------------------------------------- |
| 7060 | Check to see if SCAN is already in progress - start scan is only |
| 7061 | 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] | 7062 | is either init or end |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7063 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7064 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7065 | (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) && |
| 7066 | ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState ))) |
| 7067 | { |
| 7068 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7069 | "Scan start not allowed in this state %d %d", |
| 7070 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7071 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7072 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7073 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7074 | } |
| 7075 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7076 | pWDICtx->uScanState = WDI_SCAN_STARTED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7077 | |
| 7078 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7079 | #endif |
| 7080 | |
| 7081 | /*----------------------------------------------------------------------- |
| 7082 | Get message buffer |
| 7083 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7084 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7085 | sizeof(halStartScanReqMsg.startScanParams), |
| 7086 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7087 | ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) ))) |
| 7088 | { |
| 7089 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7090 | "Unable to get send buffer in start scan req %x %x %x", |
| 7091 | pEventData, pwdiStartScanParams, wdiStartScanRspCb); |
| 7092 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7093 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7094 | } |
| 7095 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7096 | halStartScanReqMsg.startScanParams.scanChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7097 | pwdiStartScanParams->ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7098 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7099 | &halStartScanReqMsg.startScanParams, |
| 7100 | sizeof(halStartScanReqMsg.startScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7101 | |
| 7102 | pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7103 | pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7104 | |
| 7105 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7106 | Send Start Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7107 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7108 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7109 | wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP); |
| 7110 | }/*WDI_ProcessStartScanReq*/ |
| 7111 | |
| 7112 | |
| 7113 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7114 | @brief Process End Scan Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7115 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7116 | |
| 7117 | @param pWDICtx: pointer to the WLAN DAL context |
| 7118 | pEventData: pointer to the event information structure |
| 7119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7120 | @see |
| 7121 | @return Result of the function call |
| 7122 | */ |
| 7123 | WDI_Status |
| 7124 | WDI_ProcessEndScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7125 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7126 | WDI_ControlBlockType* pWDICtx, |
| 7127 | WDI_EventInfoType* pEventData |
| 7128 | ) |
| 7129 | { |
| 7130 | WDI_EndScanReqParamsType* pwdiEndScanParams = NULL; |
| 7131 | WDI_EndScanRspCb wdiEndScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7132 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7133 | wpt_uint16 usDataOffset = 0; |
| 7134 | wpt_uint16 usSendSize = 0; |
| 7135 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7136 | tHalEndScanReqMsg halEndScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7137 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7138 | |
| 7139 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7140 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7141 | -------------------------------------------------------------------------*/ |
| 7142 | if (( NULL == pEventData ) || |
| 7143 | ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) || |
| 7144 | ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc))) |
| 7145 | { |
| 7146 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7147 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7148 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7149 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7150 | } |
| 7151 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7152 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 7153 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7154 | * forwarded to HAL and result in hang*/ |
| 7155 | #if 0 |
| 7156 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7157 | /*----------------------------------------------------------------------- |
| 7158 | Check to see if SCAN is already in progress - end scan is only |
| 7159 | allowed when a scan is ongoing and the state of the scan procedure |
| 7160 | is started |
| 7161 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7162 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7163 | ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState )) |
| 7164 | { |
| 7165 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7166 | "End start not allowed in this state %d %d", |
| 7167 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7168 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7169 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7170 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7171 | } |
| 7172 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7173 | pWDICtx->uScanState = WDI_SCAN_ENDED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7174 | |
| 7175 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7176 | #endif |
| 7177 | |
| 7178 | /*----------------------------------------------------------------------- |
| 7179 | Get message buffer |
| 7180 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7181 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7182 | sizeof(halEndScanReqMsg.endScanParams), |
| 7183 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7184 | ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) ))) |
| 7185 | { |
| 7186 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7187 | "Unable to get send buffer in start scan req %x %x %x", |
| 7188 | pEventData, pwdiEndScanParams, wdiEndScanRspCb); |
| 7189 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7190 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7191 | } |
| 7192 | |
| 7193 | halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel; |
| 7194 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7195 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7196 | &halEndScanReqMsg.endScanParams, |
| 7197 | sizeof(halEndScanReqMsg.endScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7198 | |
| 7199 | pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7200 | pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7201 | |
| 7202 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7203 | Send End Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7204 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7205 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7206 | wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP); |
| 7207 | }/*WDI_ProcessEndScanReq*/ |
| 7208 | |
| 7209 | |
| 7210 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7211 | @brief Process Finish Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7212 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7213 | |
| 7214 | @param pWDICtx: pointer to the WLAN DAL context |
| 7215 | pEventData: pointer to the event information structure |
| 7216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7217 | @see |
| 7218 | @return Result of the function call |
| 7219 | */ |
| 7220 | WDI_Status |
| 7221 | WDI_ProcessFinishScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7222 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7223 | WDI_ControlBlockType* pWDICtx, |
| 7224 | WDI_EventInfoType* pEventData |
| 7225 | ) |
| 7226 | { |
| 7227 | WDI_FinishScanReqParamsType* pwdiFinishScanParams; |
| 7228 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7229 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7230 | wpt_uint16 usDataOffset = 0; |
| 7231 | wpt_uint16 usSendSize = 0; |
| 7232 | wpt_uint8 i = 0; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 7233 | wpt_status wptStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7234 | tHalFinishScanReqMsg halFinishScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7235 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7236 | |
| 7237 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7238 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7239 | -------------------------------------------------------------------------*/ |
| 7240 | if (( NULL == pEventData ) || |
| 7241 | ( NULL == pEventData->pEventData) || |
| 7242 | ( NULL == pEventData->pCBfnc)) |
| 7243 | { |
| 7244 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7245 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7246 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7247 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7248 | } |
| 7249 | |
| 7250 | pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData; |
| 7251 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7252 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 7253 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7254 | * forwarded to HAL and result in hang*/ |
| 7255 | #if 0 |
| 7256 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7257 | /*----------------------------------------------------------------------- |
| 7258 | Check to see if SCAN is already in progress |
| 7259 | Finish scan gets invoked any scan states. ie. abort scan |
| 7260 | It should be allowed in any states. |
| 7261 | -----------------------------------------------------------------------*/ |
| 7262 | if ( !pWDICtx->bScanInProgress ) |
| 7263 | { |
| 7264 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7265 | "Finish start not allowed in this state %d", |
| 7266 | pWDICtx->bScanInProgress ); |
| 7267 | |
| 7268 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 7269 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7270 | } |
| 7271 | |
| 7272 | /*----------------------------------------------------------------------- |
| 7273 | 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] | 7274 | back all subsequent requests will be blocked at BUSY state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7275 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7276 | pWDICtx->uScanState = WDI_SCAN_FINISHED_ST; |
| 7277 | pWDICtx->bScanInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7278 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7279 | #endif |
| 7280 | |
| 7281 | if ( pWDICtx->bInBmps ) |
| 7282 | { |
| 7283 | // notify DTS that we are entering BMPS |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 7284 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL); |
| 7285 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 7286 | { |
| 7287 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 7288 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering BMPS\n", wptStatus); |
| 7289 | WDI_ASSERT(0); |
| 7290 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7291 | } |
| 7292 | |
| 7293 | /*----------------------------------------------------------------------- |
| 7294 | Get message buffer |
| 7295 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7296 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7297 | sizeof(halFinishScanReqMsg.finishScanParams), |
| 7298 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7299 | ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) ))) |
| 7300 | { |
| 7301 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7302 | "Unable to get send buffer in start scan req %x %x %x", |
| 7303 | pEventData, pwdiFinishScanParams, wdiFinishScanRspCb); |
| 7304 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7305 | return WDI_STATUS_E_FAILURE; |
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 | halFinishScanReqMsg.finishScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7309 | WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode); |
| 7310 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7311 | halFinishScanReqMsg.finishScanParams.currentOperChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7312 | pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel; |
| 7313 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7314 | halFinishScanReqMsg.finishScanParams.cbState = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7315 | WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState); |
| 7316 | |
| 7317 | wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid, |
| 7318 | pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7319 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7320 | halFinishScanReqMsg.finishScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7321 | pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7322 | halFinishScanReqMsg.finishScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7323 | pwdiFinishScanParams->wdiReqInfo.ucFrameType ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7324 | halFinishScanReqMsg.finishScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7325 | pwdiFinishScanParams->wdiReqInfo.ucFrameLength ; |
| 7326 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7327 | halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7328 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ; |
| 7329 | |
| 7330 | for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7331 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7332 | halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7333 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ; |
| 7334 | } |
| 7335 | |
| 7336 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr, |
| 7337 | &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7338 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7339 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7340 | &halFinishScanReqMsg.finishScanParams, |
| 7341 | sizeof(halFinishScanReqMsg.finishScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7342 | |
| 7343 | pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7344 | pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7345 | |
| 7346 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7347 | Send Finish Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7348 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7349 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7350 | wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP); |
| 7351 | }/*WDI_ProcessFinishScanReq*/ |
| 7352 | |
| 7353 | |
| 7354 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7355 | ASSOCIATION REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7356 | ==========================================================================*/ |
| 7357 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7358 | @brief Process BSS Join for a given Session |
| 7359 | |
| 7360 | @param pWDICtx: pointer to the WLAN DAL context |
| 7361 | pEventData: pointer to the event information structure |
| 7362 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7363 | @see |
| 7364 | @return Result of the function call |
| 7365 | */ |
| 7366 | WDI_Status |
| 7367 | WDI_ProcessBSSSessionJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7368 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7369 | WDI_ControlBlockType* pWDICtx, |
| 7370 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 7371 | WDI_JoinRspCb wdiJoinRspCb, |
| 7372 | void* pUserData |
| 7373 | ) |
| 7374 | { |
| 7375 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7376 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7377 | wpt_uint16 usDataOffset = 0; |
| 7378 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7379 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
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 | tHalJoinReqMsg halJoinReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7382 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7383 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7384 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7386 | /*------------------------------------------------------------------------ |
| 7387 | Check to see if we have any session with this BSSID already stored, we |
| 7388 | should not |
| 7389 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7390 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7391 | pwdiJoinParams->wdiReqInfo.macBSSID, |
| 7392 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7393 | |
| 7394 | if ( NULL != pBSSSes ) |
| 7395 | { |
| 7396 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7397 | "Association for this BSSID: " MAC_ADDRESS_STR " is already in place", |
| 7398 | MAC_ADDR_ARRAY(pwdiJoinParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7399 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7400 | /*reset the bAssociationInProgress otherwise the next |
| 7401 | *join request will be queued*/ |
| 7402 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7403 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7404 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7405 | } |
| 7406 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7407 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7408 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7409 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7410 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7411 | if ( NULL == pBSSSes ) |
| 7412 | { |
| 7413 | |
| 7414 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7415 | "DAL has no free sessions - cannot run another join"); |
| 7416 | |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 7417 | /*reset the bAssociationInProgress otherwise the next |
| 7418 | *join request will be queued*/ |
| 7419 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7420 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7421 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7422 | } |
| 7423 | |
| 7424 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7425 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7426 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7427 | WDI_MAC_ADDR_LEN); |
| 7428 | |
| 7429 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7430 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7431 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7432 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7433 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7434 | |
| 7435 | /*----------------------------------------------------------------------- |
| 7436 | Get message buffer |
| 7437 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7438 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7439 | sizeof(halJoinReqMsg.joinReqParams), |
| 7440 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7441 | ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) ))) |
| 7442 | { |
| 7443 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7444 | "Unable to get send buffer in join req %x %x %x", |
| 7445 | pUserData, pwdiJoinParams, wdiJoinRspCb); |
| 7446 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7447 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7448 | } |
| 7449 | |
| 7450 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7451 | pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7452 | |
| 7453 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7454 | pwdiJoinParams->wdiReqInfo.macSTASelf, |
| 7455 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7456 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7457 | halJoinReqMsg.joinReqParams.ucChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7458 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel; |
| 7459 | |
| 7460 | halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState; |
| 7461 | |
Madan Mohan Koyyalamudi | 83b1282 | 2012-11-02 12:43:10 -0700 | [diff] [blame] | 7462 | #ifdef WLAN_FEATURE_VOWIFI |
| 7463 | halJoinReqMsg.joinReqParams.maxTxPower = |
| 7464 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.cMaxTxPower; |
| 7465 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7466 | halJoinReqMsg.joinReqParams.ucLocalPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7467 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint; |
| 7468 | #endif |
| 7469 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7470 | halJoinReqMsg.joinReqParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7471 | WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo. |
| 7472 | wdiSecondaryChannelOffset); |
| 7473 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7474 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7475 | &halJoinReqMsg.joinReqParams, |
| 7476 | sizeof(halJoinReqMsg.joinReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7477 | |
| 7478 | pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7479 | pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7480 | |
| 7481 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7482 | Send Join Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7483 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7484 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7485 | wdiJoinRspCb, pUserData, WDI_JOIN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7486 | |
| 7487 | }/*WDI_ProcessBSSSessionJoinReq*/ |
| 7488 | |
| 7489 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7490 | @brief Process Join Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7491 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7492 | |
| 7493 | @param pWDICtx: pointer to the WLAN DAL context |
| 7494 | pEventData: pointer to the event information structure |
| 7495 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7496 | @see |
| 7497 | @return Result of the function call |
| 7498 | */ |
| 7499 | WDI_Status |
| 7500 | WDI_ProcessJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7501 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7502 | WDI_ControlBlockType* pWDICtx, |
| 7503 | WDI_EventInfoType* pEventData |
| 7504 | ) |
| 7505 | { |
| 7506 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7507 | WDI_JoinReqParamsType* pwdiJoinParams = NULL; |
| 7508 | WDI_JoinRspCb wdiJoinRspCb = NULL; |
| 7509 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7510 | |
| 7511 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7512 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7513 | -------------------------------------------------------------------------*/ |
| 7514 | if (( NULL == pEventData ) || |
| 7515 | ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) || |
| 7516 | ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc))) |
| 7517 | { |
| 7518 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7519 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7520 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7521 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7522 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7523 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7524 | /*------------------------------------------------------------------------- |
| 7525 | 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] | 7526 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7527 | -------------------------------------------------------------------------*/ |
| 7528 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7529 | |
| 7530 | if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress ) |
| 7531 | { |
| 7532 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7533 | "Association is currently in progress, queueing new join req"); |
| 7534 | |
| 7535 | /*Association is in progress - queue current one*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7536 | wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7537 | pwdiJoinParams->wdiReqInfo.macBSSID); |
| 7538 | |
| 7539 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7540 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7541 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7542 | } |
| 7543 | |
| 7544 | /*Starting a new association */ |
| 7545 | pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE; |
| 7546 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7547 | |
| 7548 | /*Process the Join Request*/ |
| 7549 | return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams, |
| 7550 | wdiJoinRspCb,pEventData->pUserData); |
| 7551 | |
| 7552 | }/*WDI_ProcessJoinReq*/ |
| 7553 | |
| 7554 | |
| 7555 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7556 | @brief Process Config BSS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7557 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7558 | |
| 7559 | @param pWDICtx: pointer to the WLAN DAL context |
| 7560 | pEventData: pointer to the event information structure |
| 7561 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7562 | @see |
| 7563 | @return Result of the function call |
| 7564 | */ |
| 7565 | WDI_Status |
| 7566 | WDI_ProcessConfigBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7567 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7568 | WDI_ControlBlockType* pWDICtx, |
| 7569 | WDI_EventInfoType* pEventData |
| 7570 | ) |
| 7571 | { |
| 7572 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams; |
| 7573 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7574 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7575 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7576 | wpt_uint16 uMsgSize = 0; |
| 7577 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7578 | wpt_uint16 usDataOffset = 0; |
| 7579 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7580 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7581 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7582 | tConfigBssReqMsg halConfigBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7583 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7584 | |
| 7585 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7586 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7587 | -------------------------------------------------------------------------*/ |
| 7588 | if (( NULL == pEventData ) || |
| 7589 | ( NULL == pEventData->pEventData ) || |
| 7590 | ( NULL == pEventData->pCBfnc )) |
| 7591 | { |
| 7592 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7593 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7594 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7595 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7596 | } |
| 7597 | |
| 7598 | pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData; |
| 7599 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc; |
| 7600 | /*------------------------------------------------------------------------- |
| 7601 | 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] | 7602 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7603 | -------------------------------------------------------------------------*/ |
| 7604 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7605 | |
| 7606 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7607 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7608 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7609 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7610 | pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
| 7611 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7612 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7613 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7614 | { |
| 7615 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 7616 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7617 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7618 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7619 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7620 | if ( NULL == pBSSSes ) |
| 7621 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7622 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7623 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7624 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7626 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7627 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7628 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7630 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7631 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7632 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7633 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7634 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7635 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7636 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7637 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7638 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7639 | /* 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] | 7640 | * Request in case of IBSS*/ |
| 7641 | if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) || |
| 7642 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) || |
| 7643 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) || |
| 7644 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE)) |
| 7645 | { |
| 7646 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7647 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7648 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7649 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7650 | if ( NULL == pBSSSes ) |
| 7651 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7652 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7653 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7654 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7655 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7656 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7657 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7658 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7660 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7661 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7662 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7663 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7664 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7665 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7666 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7667 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7668 | } |
| 7669 | else |
| 7670 | { |
| 7671 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7672 | "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d", |
| 7673 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7674 | pwdiConfigBSSParams->wdiReqInfo.wdiBSSType); |
| 7675 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7676 | /* for IBSS testing */ |
| 7677 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7678 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7679 | } |
| 7680 | #endif |
| 7681 | } |
| 7682 | |
| 7683 | /*------------------------------------------------------------------------ |
| 7684 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7685 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7686 | ------------------------------------------------------------------------*/ |
| 7687 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7688 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7689 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7690 | "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d", |
| 7691 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7692 | ucCurrentBSSSesIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7693 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7694 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7695 | |
| 7696 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7697 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7698 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7699 | } |
| 7700 | |
| 7701 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7702 | wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq, |
| 7703 | pwdiConfigBSSParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7704 | sizeof(pWDICtx->wdiCachedConfigBssReq)); |
| 7705 | |
| 7706 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7707 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7708 | /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */ |
| 7709 | #ifdef WLAN_FEATURE_11AC |
| 7710 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7711 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7712 | else |
| 7713 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 7714 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7715 | |
| 7716 | /*----------------------------------------------------------------------- |
| 7717 | Get message buffer |
| 7718 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7719 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7720 | uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7721 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7722 | { |
| 7723 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7724 | "Unable to get send buffer in config bss req %x %x %x", |
| 7725 | pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb); |
| 7726 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7727 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7728 | } |
| 7729 | |
| 7730 | /*Copy the BSS request */ |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 7731 | #ifdef WLAN_FEATURE_11AC |
| 7732 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 7733 | WDI_CopyWDIConfigBSSToHALConfigBSS( (tConfigBssParams*)&halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7734 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7735 | else |
| 7736 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7737 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7738 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7739 | |
| 7740 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 7741 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7742 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7743 | |
| 7744 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7745 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx; |
| 7746 | |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 7747 | #ifdef WLAN_FEATURE_11AC |
| 7748 | if (WDI_getFwWlanFeatCaps(DOT11AC)){ |
| 7749 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7750 | &halConfigBssReqMsg.uBssParams.configBssParams_V1, |
| 7751 | uMsgSize); |
| 7752 | }else |
| 7753 | #endif |
Tushnim Bhattacharyya | 95341d3 | 2013-03-20 20:15:03 -0700 | [diff] [blame] | 7754 | { |
| 7755 | if ( uMsgSize <= sizeof(tConfigBssParams) ) |
| 7756 | { |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 7757 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Tushnim Bhattacharyya | 95341d3 | 2013-03-20 20:15:03 -0700 | [diff] [blame] | 7758 | &halConfigBssReqMsg.uBssParams.configBssParams, |
| 7759 | uMsgSize); |
| 7760 | } |
| 7761 | else |
| 7762 | { |
| 7763 | return WDI_STATUS_E_FAILURE; |
| 7764 | } |
| 7765 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7766 | |
| 7767 | pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7768 | pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7769 | |
| 7770 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7771 | Send Config BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7772 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7773 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7774 | wdiConfigBSSRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7775 | WDI_CONFIG_BSS_RESP); |
| 7776 | |
| 7777 | }/*WDI_ProcessConfigBSSReq*/ |
| 7778 | |
| 7779 | |
| 7780 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7781 | @brief Process Del BSS Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7782 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7783 | |
| 7784 | @param pWDICtx: pointer to the WLAN DAL context |
| 7785 | pEventData: pointer to the event information structure |
| 7786 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7787 | @see |
| 7788 | @return Result of the function call |
| 7789 | */ |
| 7790 | WDI_Status |
| 7791 | WDI_ProcessDelBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7792 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7793 | WDI_ControlBlockType* pWDICtx, |
| 7794 | WDI_EventInfoType* pEventData |
| 7795 | ) |
| 7796 | { |
| 7797 | WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL; |
| 7798 | WDI_DelBSSRspCb wdiDelBSSRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7799 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7800 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7801 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7802 | wpt_uint16 usDataOffset = 0; |
| 7803 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7804 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7805 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7806 | tDeleteBssReqMsg halBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7807 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7808 | |
| 7809 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7810 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7811 | -------------------------------------------------------------------------*/ |
| 7812 | if (( NULL == pEventData ) || |
| 7813 | ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) || |
| 7814 | ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc))) |
| 7815 | { |
| 7816 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7817 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7818 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7819 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7820 | } |
| 7821 | |
| 7822 | /*------------------------------------------------------------------------- |
| 7823 | 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] | 7824 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7825 | -------------------------------------------------------------------------*/ |
| 7826 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7827 | |
| 7828 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7829 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7830 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7831 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 7832 | pwdiDelBSSParams->ucBssIdx, |
| 7833 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7834 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7835 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7836 | { |
| 7837 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7838 | "%s: BSS does not yet exist. ucBssIdx %d", |
| 7839 | __func__, pwdiDelBSSParams->ucBssIdx); |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7840 | |
| 7841 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7842 | |
| 7843 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7844 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7845 | |
| 7846 | /*------------------------------------------------------------------------ |
| 7847 | Check if this BSS is being currently processed or queued, |
| 7848 | if queued - queue the new request as well |
| 7849 | ------------------------------------------------------------------------*/ |
| 7850 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7851 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7852 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7853 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 7854 | __func__, pwdiDelBSSParams->ucBssIdx); |
| 7855 | |
| 7856 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 7857 | |
| 7858 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7859 | |
| 7860 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7861 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 7862 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7863 | /*----------------------------------------------------------------------- |
| 7864 | If we receive a Del BSS request for an association that is already in |
| 7865 | progress, it indicates that the assoc has failed => we no longer have |
| 7866 | an association in progress => we must check for pending associations |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7867 | 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] | 7868 | -----------------------------------------------------------------------*/ |
| 7869 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
| 7870 | { |
| 7871 | /*We can switch to false here because even if a subsequent Join comes in |
| 7872 | it will only be processed when DAL transitions out of BUSY state which |
| 7873 | happens when the Del BSS request comes */ |
| 7874 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7875 | |
| 7876 | /*Former association is complete - prepare next pending assoc for |
| 7877 | processing */ |
| 7878 | WDI_DequeueAssocRequest(pWDICtx); |
| 7879 | } |
| 7880 | |
| 7881 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7882 | /*----------------------------------------------------------------------- |
| 7883 | Get message buffer |
| 7884 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7885 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7886 | sizeof(halBssReqMsg.deleteBssParams), |
| 7887 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7888 | ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) ))) |
| 7889 | { |
| 7890 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7891 | "Unable to get send buffer in start req %x %x %x", |
| 7892 | pEventData, pwdiDelBSSParams, wdiDelBSSRspCb); |
| 7893 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7894 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7895 | } |
| 7896 | |
| 7897 | /*Fill in the message request structure*/ |
| 7898 | |
| 7899 | /*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] | 7900 | halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7901 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7902 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7903 | &halBssReqMsg.deleteBssParams, |
| 7904 | sizeof(halBssReqMsg.deleteBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7905 | |
| 7906 | pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7907 | pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7908 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7909 | |
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 | Send Del BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7912 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7913 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7914 | wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP); |
| 7915 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7917 | }/*WDI_ProcessDelBSSReq*/ |
| 7918 | |
| 7919 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7920 | @brief Process Post Assoc Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7921 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7922 | |
| 7923 | @param pWDICtx: pointer to the WLAN DAL context |
| 7924 | pEventData: pointer to the event information structure |
| 7925 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7926 | @see |
| 7927 | @return Result of the function call |
| 7928 | */ |
| 7929 | WDI_Status |
| 7930 | WDI_ProcessPostAssocReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7931 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7932 | WDI_ControlBlockType* pWDICtx, |
| 7933 | WDI_EventInfoType* pEventData |
| 7934 | ) |
| 7935 | { |
| 7936 | WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL; |
| 7937 | WDI_PostAssocRspCb wdiPostAssocRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7938 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7939 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7940 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7941 | wpt_uint16 usDataOffset = 0; |
| 7942 | wpt_uint16 usSendSize = 0; |
| 7943 | wpt_uint16 uMsgSize = 0; |
| 7944 | wpt_uint16 uOffset = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7945 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7946 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7947 | tPostAssocReqMsg halPostAssocReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7948 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7949 | |
| 7950 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7951 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7952 | -------------------------------------------------------------------------*/ |
| 7953 | if (( NULL == pEventData ) || |
| 7954 | ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) || |
| 7955 | ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc))) |
| 7956 | { |
| 7957 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7958 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7959 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7960 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7961 | } |
| 7962 | |
| 7963 | /*------------------------------------------------------------------------- |
| 7964 | 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] | 7965 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7966 | -------------------------------------------------------------------------*/ |
| 7967 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7968 | |
| 7969 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7970 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7971 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7972 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7973 | pwdiPostAssocParams->wdiBSSParams.macBSSID, |
| 7974 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7975 | |
| 7976 | if ( NULL == pBSSSes ) |
| 7977 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7978 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7979 | "%s: Association sequence for this BSS does not yet exist - " |
| 7980 | "operation not allowed. macBSSID " MAC_ADDRESS_STR, |
| 7981 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7982 | |
| 7983 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7984 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7985 | } |
| 7986 | |
| 7987 | /*------------------------------------------------------------------------ |
| 7988 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7989 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7990 | ------------------------------------------------------------------------*/ |
| 7991 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7992 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7994 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7995 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7996 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7997 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7998 | |
| 7999 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8000 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8001 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8002 | } |
| 8003 | |
| 8004 | /*----------------------------------------------------------------------- |
| 8005 | If Post Assoc was not yet received - the current association must |
| 8006 | be in progress |
| 8007 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8008 | if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8009 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 8010 | { |
| 8011 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8012 | "Association sequence for this BSS association no longer in " |
| 8013 | "progress - not allowed"); |
| 8014 | |
| 8015 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8016 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8017 | } |
| 8018 | |
| 8019 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8020 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8021 | -----------------------------------------------------------------------*/ |
| 8022 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 8023 | { |
| 8024 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8025 | "Post Assoc not allowed before JOIN - failing request"); |
| 8026 | |
| 8027 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8028 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8029 | } |
| 8030 | |
| 8031 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8032 | |
| 8033 | uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) + |
| 8034 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ; |
| 8035 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8036 | Fill message for tx over the bus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8037 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8038 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8039 | uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8040 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 8041 | { |
| 8042 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8043 | "Unable to get send buffer in start req %x %x %x", |
| 8044 | pEventData, pwdiPostAssocParams, wdiPostAssocRspCb); |
| 8045 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8046 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8047 | } |
| 8048 | |
| 8049 | /*Copy the STA parameters */ |
| 8050 | WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 8051 | &pwdiPostAssocParams->wdiSTAParams ); |
| 8052 | |
| 8053 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8054 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8055 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 8056 | pwdiPostAssocParams->wdiSTAParams.macSTA, |
| 8057 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx )) |
| 8058 | { |
| 8059 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8060 | "This station does not exist in the WDI Station Table %d"); |
| 8061 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 8062 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8063 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8064 | } |
| 8065 | |
| 8066 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8067 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8068 | pBSSSes->ucBSSIdx; |
| 8069 | |
| 8070 | /*Copy the BSS parameters */ |
| 8071 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 8072 | &pwdiPostAssocParams->wdiBSSParams); |
| 8073 | |
| 8074 | /* Need to fill in the STA index of the peer */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8075 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8076 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 8077 | pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8078 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8079 | { |
| 8080 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8081 | "This station does not exist in the WDI Station Table %d"); |
| 8082 | wpalMutexRelease(&pWDICtx->wptMutex); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 8083 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8084 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8085 | } |
| 8086 | |
| 8087 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8088 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8089 | pBSSSes->ucBSSIdx; |
| 8090 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8091 | |
| 8092 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8093 | &halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 8094 | sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8095 | |
| 8096 | uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams); |
| 8097 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8098 | wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset, |
| 8099 | &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 8100 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams)); |
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 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8103 | pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8104 | pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8106 | |
| 8107 | wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8108 | pwdiPostAssocParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8109 | sizeof(pWDICtx->wdiCachedPostAssocReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8110 | |
| 8111 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8112 | Send Post Assoc Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8113 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8114 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8115 | wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP); |
| 8116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8117 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8118 | }/*WDI_ProcessPostAssocReq*/ |
| 8119 | |
| 8120 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8121 | @brief Process Del STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8122 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8123 | |
| 8124 | @param pWDICtx: pointer to the WLAN DAL context |
| 8125 | pEventData: pointer to the event information structure |
| 8126 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8127 | @see |
| 8128 | @return Result of the function call |
| 8129 | */ |
| 8130 | WDI_Status |
| 8131 | WDI_ProcessDelSTAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8132 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8133 | WDI_ControlBlockType* pWDICtx, |
| 8134 | WDI_EventInfoType* pEventData |
| 8135 | ) |
| 8136 | { |
| 8137 | WDI_DelSTAReqParamsType* pwdiDelSTAParams; |
| 8138 | WDI_DelSTARspCb wdiDelSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8139 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8140 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8141 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8142 | wpt_uint16 usDataOffset = 0; |
| 8143 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8144 | wpt_macAddr macBSSID; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8145 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 8146 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8147 | tDeleteStaReqMsg halDelStaReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8148 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8149 | |
| 8150 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8151 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8152 | -------------------------------------------------------------------------*/ |
| 8153 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8154 | ( NULL == pEventData->pCBfnc )) |
| 8155 | { |
| 8156 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8157 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8158 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8159 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8160 | } |
| 8161 | |
| 8162 | pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData; |
| 8163 | wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc; |
| 8164 | /*------------------------------------------------------------------------- |
| 8165 | 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] | 8166 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8167 | -------------------------------------------------------------------------*/ |
| 8168 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8169 | |
| 8170 | /*------------------------------------------------------------------------ |
| 8171 | Find the BSS for which the request is made and identify WDI session |
| 8172 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8173 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8174 | pwdiDelSTAParams->ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8175 | &macBSSID)) |
| 8176 | { |
| 8177 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8178 | "This station does not exist in the WDI Station Table %d"); |
| 8179 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8180 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8181 | } |
| 8182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8183 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8184 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8185 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8186 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8187 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8188 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8189 | |
| 8190 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8191 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8192 | } |
| 8193 | |
| 8194 | /*------------------------------------------------------------------------ |
| 8195 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8196 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8197 | ------------------------------------------------------------------------*/ |
| 8198 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8199 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8200 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8201 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8202 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8203 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8204 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8205 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8206 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8207 | } |
| 8208 | |
| 8209 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8210 | /*----------------------------------------------------------------------- |
| 8211 | Get message buffer |
| 8212 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8213 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8214 | sizeof(halDelStaReqMsg.delStaParams), |
| 8215 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8216 | ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) ))) |
| 8217 | { |
| 8218 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8219 | "Unable to get send buffer in start req %x %x %x", |
| 8220 | pEventData, pwdiDelSTAParams, wdiDelSTARspCb); |
| 8221 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8222 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8223 | } |
| 8224 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8225 | halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx; |
| 8226 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8227 | &halDelStaReqMsg.delStaParams, |
| 8228 | sizeof(halDelStaReqMsg.delStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8229 | |
| 8230 | pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8231 | pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8232 | |
| 8233 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8234 | Send Del STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8235 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8236 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8237 | wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP); |
| 8238 | |
| 8239 | }/*WDI_ProcessDelSTAReq*/ |
| 8240 | |
| 8241 | |
| 8242 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8243 | SECURITY REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8244 | ==========================================================================*/ |
| 8245 | /** |
| 8246 | @brief Process Set BSS Key Request function (called when Main FSM |
| 8247 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8248 | |
| 8249 | @param pWDICtx: pointer to the WLAN DAL context |
| 8250 | pEventData: pointer to the event information structure |
| 8251 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8252 | @see |
| 8253 | @return Result of the function call |
| 8254 | */ |
| 8255 | WDI_Status |
| 8256 | WDI_ProcessSetBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8257 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8258 | WDI_ControlBlockType* pWDICtx, |
| 8259 | WDI_EventInfoType* pEventData |
| 8260 | ) |
| 8261 | { |
| 8262 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams; |
| 8263 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8264 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8265 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8266 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8267 | wpt_uint16 usDataOffset = 0; |
| 8268 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8269 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8270 | tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}}; |
| 8271 | wpt_uint8 keyIndex = 0; |
| 8272 | |
| 8273 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8274 | |
| 8275 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8276 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8277 | -------------------------------------------------------------------------*/ |
| 8278 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8279 | ( NULL == pEventData->pCBfnc )) |
| 8280 | { |
| 8281 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8282 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8283 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8284 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8285 | } |
| 8286 | |
| 8287 | pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData; |
| 8288 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc; |
| 8289 | /*------------------------------------------------------------------------- |
| 8290 | 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] | 8291 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8292 | -------------------------------------------------------------------------*/ |
| 8293 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8294 | |
| 8295 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8296 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8297 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8298 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8299 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx, |
| 8300 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8301 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8302 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8303 | { |
| 8304 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8305 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8306 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8307 | |
| 8308 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8309 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8310 | } |
| 8311 | |
| 8312 | /*------------------------------------------------------------------------ |
| 8313 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8314 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8315 | ------------------------------------------------------------------------*/ |
| 8316 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8317 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8318 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8319 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8320 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8321 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8322 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8323 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8324 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8325 | } |
| 8326 | |
| 8327 | |
| 8328 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8329 | /*----------------------------------------------------------------------- |
| 8330 | Get message buffer |
| 8331 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8332 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8333 | sizeof(halSetBssKeyReqMsg.setBssKeyParams), |
| 8334 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8335 | ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) ))) |
| 8336 | { |
| 8337 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8338 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8339 | pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb); |
| 8340 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8341 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8342 | } |
| 8343 | |
| 8344 | /*----------------------------------------------------------------------- |
| 8345 | Copy the Key parameters into the HAL message |
| 8346 | -----------------------------------------------------------------------*/ |
| 8347 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8348 | halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8349 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8350 | halSetBssKeyReqMsg.setBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8351 | WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType); |
| 8352 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8353 | halSetBssKeyReqMsg.setBssKeyParams.numKeys = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8354 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys; |
| 8355 | |
| 8356 | for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ; |
| 8357 | keyIndex++) |
| 8358 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8359 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8360 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId; |
| 8361 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast = |
| 8362 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast; |
| 8363 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection = |
| 8364 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection; |
| 8365 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8366 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8367 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8368 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8369 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8370 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8371 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength; |
| 8372 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8373 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8374 | WDI_MAX_KEY_LENGTH); |
| 8375 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8376 | |
| 8377 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8378 | &halSetBssKeyReqMsg.setBssKeyParams, |
| 8379 | sizeof(halSetBssKeyReqMsg.setBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8380 | |
| 8381 | pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8382 | pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8383 | |
| 8384 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8385 | Send Set BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8386 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8387 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8388 | wdiSetBSSKeyRspCb, pEventData->pUserData, |
| 8389 | WDI_SET_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8390 | |
| 8391 | }/*WDI_ProcessSetBssKeyReq*/ |
| 8392 | |
| 8393 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8394 | @brief Process Remove BSS Key Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8395 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8396 | |
| 8397 | @param pWDICtx: pointer to the WLAN DAL context |
| 8398 | pEventData: pointer to the event information structure |
| 8399 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8400 | @see |
| 8401 | @return Result of the function call |
| 8402 | */ |
| 8403 | WDI_Status |
| 8404 | WDI_ProcessRemoveBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8405 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8406 | WDI_ControlBlockType* pWDICtx, |
| 8407 | WDI_EventInfoType* pEventData |
| 8408 | ) |
| 8409 | { |
| 8410 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams; |
| 8411 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8412 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8413 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8414 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8415 | wpt_uint16 usDataOffset = 0; |
| 8416 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8417 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8418 | tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}}; |
| 8419 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8420 | |
| 8421 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8422 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8423 | -------------------------------------------------------------------------*/ |
| 8424 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8425 | ( NULL == pEventData->pCBfnc )) |
| 8426 | { |
| 8427 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8428 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8429 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8430 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8431 | } |
| 8432 | |
| 8433 | pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData; |
| 8434 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc; |
| 8435 | /*------------------------------------------------------------------------- |
| 8436 | 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] | 8437 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8438 | -------------------------------------------------------------------------*/ |
| 8439 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8440 | |
| 8441 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8442 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8443 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8444 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8445 | pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx, |
| 8446 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8447 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8448 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8449 | { |
| 8450 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8451 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8452 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8453 | |
| 8454 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8455 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8456 | } |
| 8457 | |
| 8458 | /*------------------------------------------------------------------------ |
| 8459 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8460 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8461 | ------------------------------------------------------------------------*/ |
| 8462 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8463 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8464 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8465 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8466 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8467 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8468 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8469 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8470 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8471 | } |
| 8472 | |
| 8473 | |
| 8474 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8475 | |
| 8476 | /*----------------------------------------------------------------------- |
| 8477 | Get message buffer |
| 8478 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8479 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8480 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams), |
| 8481 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8482 | ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) ))) |
| 8483 | { |
| 8484 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8485 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8486 | pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb); |
| 8487 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8488 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8489 | } |
| 8490 | /*----------------------------------------------------------------------- |
| 8491 | Copy the Key parameters into the HAL message |
| 8492 | -----------------------------------------------------------------------*/ |
| 8493 | halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
| 8494 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8495 | halRemoveBssKeyReqMsg.removeBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8496 | WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType); |
| 8497 | |
| 8498 | halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId; |
| 8499 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8500 | halRemoveBssKeyReqMsg.removeBssKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8501 | WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType); |
| 8502 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8503 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8504 | &halRemoveBssKeyReqMsg.removeBssKeyParams, |
| 8505 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8506 | |
| 8507 | pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8508 | pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8509 | |
| 8510 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8511 | Send Remove BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8512 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8513 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8514 | wdiRemoveBSSKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8515 | WDI_RMV_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8516 | }/*WDI_ProcessRemoveBssKeyReq*/ |
| 8517 | |
| 8518 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8519 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8520 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8521 | |
| 8522 | @param pWDICtx: pointer to the WLAN DAL context |
| 8523 | pEventData: pointer to the event information structure |
| 8524 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8525 | @see |
| 8526 | @return Result of the function call |
| 8527 | */ |
| 8528 | WDI_Status |
| 8529 | WDI_ProcessSetStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8530 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8531 | WDI_ControlBlockType* pWDICtx, |
| 8532 | WDI_EventInfoType* pEventData |
| 8533 | ) |
| 8534 | { |
| 8535 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8536 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8537 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8538 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8539 | wpt_uint16 usDataOffset = 0; |
| 8540 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8541 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8542 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8543 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8544 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8545 | wpt_uint8 keyIndex = 0; |
| 8546 | |
| 8547 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8548 | |
| 8549 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8550 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8551 | -------------------------------------------------------------------------*/ |
| 8552 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8553 | ( NULL == pEventData->pCBfnc )) |
| 8554 | { |
| 8555 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8556 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8557 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8558 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8559 | } |
| 8560 | |
| 8561 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8562 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8563 | /*------------------------------------------------------------------------- |
| 8564 | 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] | 8565 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8566 | -------------------------------------------------------------------------*/ |
| 8567 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8568 | |
| 8569 | /*------------------------------------------------------------------------ |
| 8570 | Find the BSS for which the request is made and identify WDI session |
| 8571 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8572 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8573 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8574 | &macBSSID)) |
| 8575 | { |
| 8576 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8577 | "This station does not exist in the WDI Station Table %d"); |
| 8578 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8579 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8580 | } |
| 8581 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8582 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8583 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8584 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8585 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8586 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8587 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8588 | |
| 8589 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8590 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8591 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8593 | /*------------------------------------------------------------------------ |
| 8594 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8595 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8596 | ------------------------------------------------------------------------*/ |
| 8597 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8598 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8599 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8600 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8601 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8602 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8603 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8604 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8605 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8606 | } |
| 8607 | |
| 8608 | |
| 8609 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8610 | /*----------------------------------------------------------------------- |
| 8611 | Get message buffer |
| 8612 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8613 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8614 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8615 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8616 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8617 | { |
| 8618 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8619 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8620 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8621 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8622 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8623 | } |
| 8624 | /*----------------------------------------------------------------------- |
| 8625 | Copy the STA Key parameters into the HAL message |
| 8626 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8627 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8628 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8629 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8630 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8631 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8632 | |
| 8633 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8634 | |
| 8635 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8636 | |
| 8637 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8638 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8639 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8640 | keyIndex++) |
| 8641 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8642 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8643 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8644 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8645 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8646 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8647 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8648 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8649 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8650 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8651 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8652 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8653 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8654 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8655 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8656 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8657 | WDI_MAX_KEY_LENGTH); |
| 8658 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8659 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8660 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8661 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8662 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8663 | |
| 8664 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8665 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8666 | |
| 8667 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8668 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8669 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8670 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8671 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8672 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8673 | |
| 8674 | }/*WDI_ProcessSetSTAKeyReq*/ |
| 8675 | |
| 8676 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8677 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8678 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8679 | |
| 8680 | @param pWDICtx: pointer to the WLAN DAL context |
| 8681 | pEventData: pointer to the event information structure |
| 8682 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8683 | @see |
| 8684 | @return Result of the function call |
| 8685 | */ |
| 8686 | WDI_Status |
| 8687 | WDI_ProcessRemoveStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8688 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8689 | WDI_ControlBlockType* pWDICtx, |
| 8690 | WDI_EventInfoType* pEventData |
| 8691 | ) |
| 8692 | { |
| 8693 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams; |
| 8694 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8695 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8696 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8697 | wpt_uint16 usDataOffset = 0; |
| 8698 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8699 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8700 | wpt_macAddr macBSSID; |
| 8701 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8702 | tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}}; |
| 8703 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8704 | |
| 8705 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8706 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8707 | -------------------------------------------------------------------------*/ |
| 8708 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8709 | ( NULL == pEventData->pCBfnc )) |
| 8710 | { |
| 8711 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8712 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8713 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8714 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8715 | } |
| 8716 | |
| 8717 | pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8718 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8719 | /*------------------------------------------------------------------------- |
| 8720 | 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] | 8721 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8722 | -------------------------------------------------------------------------*/ |
| 8723 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8724 | |
| 8725 | /*------------------------------------------------------------------------ |
| 8726 | Find the BSS for which the request is made and identify WDI session |
| 8727 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8728 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8729 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8730 | &macBSSID)) |
| 8731 | { |
| 8732 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8733 | "This station does not exist in the WDI Station Table %d"); |
| 8734 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8735 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8736 | } |
| 8737 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8738 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8739 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8740 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8741 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8742 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8743 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8744 | |
| 8745 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8746 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8747 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8749 | /*------------------------------------------------------------------------ |
| 8750 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8751 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8752 | ------------------------------------------------------------------------*/ |
| 8753 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8754 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8755 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8756 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8757 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8758 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8759 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8760 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8761 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8762 | } |
| 8763 | |
| 8764 | |
| 8765 | |
| 8766 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8767 | /*----------------------------------------------------------------------- |
| 8768 | Get message buffer |
| 8769 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8770 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8771 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams), |
| 8772 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8773 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) ))) |
| 8774 | { |
| 8775 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8776 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8777 | pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb); |
| 8778 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8779 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8780 | } |
| 8781 | |
| 8782 | /*----------------------------------------------------------------------- |
| 8783 | Copy the Key parameters into the HAL message |
| 8784 | -----------------------------------------------------------------------*/ |
| 8785 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8786 | halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8787 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8788 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8789 | halRemoveStaKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8790 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8792 | halRemoveStaKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8793 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId; |
| 8794 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8795 | halRemoveStaKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8796 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast; |
| 8797 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8798 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8799 | &halRemoveStaKeyReqMsg.removeStaKeyParams, |
| 8800 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8801 | |
| 8802 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8803 | pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8804 | |
| 8805 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8806 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8807 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8808 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8809 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8810 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8811 | |
| 8812 | }/*WDI_ProcessRemoveSTAKeyReq*/ |
| 8813 | |
| 8814 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8815 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8816 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8817 | |
| 8818 | @param pWDICtx: pointer to the WLAN DAL context |
| 8819 | pEventData: pointer to the event information structure |
| 8820 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8821 | @see |
| 8822 | @return Result of the function call |
| 8823 | */ |
| 8824 | WDI_Status |
| 8825 | WDI_ProcessSetStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8826 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8827 | WDI_ControlBlockType* pWDICtx, |
| 8828 | WDI_EventInfoType* pEventData |
| 8829 | ) |
| 8830 | { |
| 8831 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8832 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8833 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8834 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8835 | wpt_uint16 usDataOffset = 0; |
| 8836 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8837 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8838 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8839 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8840 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8841 | wpt_uint8 keyIndex = 0; |
| 8842 | |
| 8843 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8844 | |
| 8845 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8846 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8847 | -------------------------------------------------------------------------*/ |
| 8848 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8849 | ( NULL == pEventData->pCBfnc )) |
| 8850 | { |
| 8851 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8852 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8853 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8854 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8855 | } |
| 8856 | |
| 8857 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8858 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8859 | /*------------------------------------------------------------------------- |
| 8860 | 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] | 8861 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8862 | -------------------------------------------------------------------------*/ |
| 8863 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8864 | |
| 8865 | /*------------------------------------------------------------------------ |
| 8866 | Find the BSS for which the request is made and identify WDI session |
| 8867 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8868 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8869 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8870 | &macBSSID)) |
| 8871 | { |
| 8872 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8873 | "This station does not exist in the WDI Station Table %d"); |
| 8874 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8875 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8876 | } |
| 8877 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8878 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8879 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8880 | { |
| 8881 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8882 | "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8883 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8884 | |
| 8885 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8886 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8887 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8888 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8889 | /*------------------------------------------------------------------------ |
| 8890 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8891 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8892 | ------------------------------------------------------------------------*/ |
| 8893 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8894 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8895 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8896 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8897 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8898 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8899 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8900 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8901 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8902 | } |
| 8903 | |
| 8904 | |
| 8905 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8906 | /*----------------------------------------------------------------------- |
| 8907 | Get message buffer |
| 8908 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8909 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8910 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8911 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8912 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8913 | { |
| 8914 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8915 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8916 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8917 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8918 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8919 | } |
| 8920 | /*----------------------------------------------------------------------- |
| 8921 | Copy the STA Key parameters into the HAL message |
| 8922 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8923 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8924 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8925 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8926 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8927 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8928 | |
| 8929 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8930 | |
| 8931 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8932 | |
| 8933 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8934 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8935 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8936 | keyIndex++) |
| 8937 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8938 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8939 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8940 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8941 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8942 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8943 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8944 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8945 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8946 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8947 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8948 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8949 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8950 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8951 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8952 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8953 | WDI_MAX_KEY_LENGTH); |
| 8954 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8955 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8956 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8957 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8958 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8959 | |
| 8960 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8961 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8962 | |
| 8963 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8964 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8965 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8966 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8967 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8968 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8969 | |
| 8970 | }/*WDI_ProcessSetSTABcastKeyReq*/ |
| 8971 | |
| 8972 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8973 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8974 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8975 | |
| 8976 | @param pWDICtx: pointer to the WLAN DAL context |
| 8977 | pEventData: pointer to the event information structure |
| 8978 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8979 | @see |
| 8980 | @return Result of the function call |
| 8981 | */ |
| 8982 | WDI_Status |
| 8983 | WDI_ProcessRemoveStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8984 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8985 | WDI_ControlBlockType* pWDICtx, |
| 8986 | WDI_EventInfoType* pEventData |
| 8987 | ) |
| 8988 | { |
| 8989 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams; |
| 8990 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8991 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8992 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8993 | wpt_uint16 usDataOffset = 0; |
| 8994 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8995 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8996 | wpt_macAddr macBSSID; |
| 8997 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8998 | tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}}; |
| 8999 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9000 | |
| 9001 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9002 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9003 | -------------------------------------------------------------------------*/ |
| 9004 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9005 | ( NULL == pEventData->pCBfnc )) |
| 9006 | { |
| 9007 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9008 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9009 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9010 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9011 | } |
| 9012 | |
| 9013 | pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 9014 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 9015 | /*------------------------------------------------------------------------- |
| 9016 | 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] | 9017 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9018 | -------------------------------------------------------------------------*/ |
| 9019 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9020 | |
| 9021 | /*------------------------------------------------------------------------ |
| 9022 | Find the BSS for which the request is made and identify WDI session |
| 9023 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9024 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9025 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9026 | &macBSSID)) |
| 9027 | { |
| 9028 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9029 | "This station does not exist in the WDI Station Table %d"); |
| 9030 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9031 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9032 | } |
| 9033 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9034 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 9035 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9036 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9037 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9038 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9039 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9040 | |
| 9041 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9042 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9043 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9044 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9045 | /*------------------------------------------------------------------------ |
| 9046 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9047 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9048 | ------------------------------------------------------------------------*/ |
| 9049 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9050 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9051 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9052 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9053 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9054 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9055 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9056 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9057 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9058 | } |
| 9059 | |
| 9060 | |
| 9061 | |
| 9062 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9063 | /*----------------------------------------------------------------------- |
| 9064 | Get message buffer |
| 9065 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9066 | 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] | 9067 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams), |
| 9068 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9069 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) ))) |
| 9070 | { |
| 9071 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9072 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9073 | pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb); |
| 9074 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9075 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9076 | } |
| 9077 | |
| 9078 | /*----------------------------------------------------------------------- |
| 9079 | Copy the Key parameters into the HAL message |
| 9080 | -----------------------------------------------------------------------*/ |
| 9081 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9082 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9083 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx; |
| 9084 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9085 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9086 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType); |
| 9087 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9088 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9089 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId; |
| 9090 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9091 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9092 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast; |
| 9093 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9094 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9095 | &halRemoveStaBcastKeyReqMsg.removeStaKeyParams, |
| 9096 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9097 | |
| 9098 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9099 | pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9100 | |
| 9101 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9102 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9103 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9104 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9105 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9106 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9107 | |
| 9108 | }/*WDI_ProcessRemoveSTABcastKeyReq*/ |
| 9109 | |
| 9110 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9111 | QOS and BA PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9112 | ==========================================================================*/ |
| 9113 | /** |
| 9114 | @brief Process Add TSpec Request function (called when Main FSM |
| 9115 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9116 | |
| 9117 | @param pWDICtx: pointer to the WLAN DAL context |
| 9118 | pEventData: pointer to the event information structure |
| 9119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9120 | @see |
| 9121 | @return Result of the function call |
| 9122 | */ |
| 9123 | WDI_Status |
| 9124 | WDI_ProcessAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9125 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9126 | WDI_ControlBlockType* pWDICtx, |
| 9127 | WDI_EventInfoType* pEventData |
| 9128 | ) |
| 9129 | { |
| 9130 | WDI_AddTSReqParamsType* pwdiAddTSParams; |
| 9131 | WDI_AddTsRspCb wdiAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9132 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9133 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9134 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9135 | wpt_uint16 usDataOffset = 0; |
| 9136 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9137 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9138 | wpt_macAddr macBSSID; |
| 9139 | tAddTsParams halAddTsParams = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9141 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9142 | |
| 9143 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9144 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9145 | -------------------------------------------------------------------------*/ |
| 9146 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9147 | ( NULL == pEventData->pCBfnc )) |
| 9148 | { |
| 9149 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9150 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9151 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9152 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9153 | } |
| 9154 | |
| 9155 | pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData; |
| 9156 | wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc; |
| 9157 | /*------------------------------------------------------------------------- |
| 9158 | 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] | 9159 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9160 | -------------------------------------------------------------------------*/ |
| 9161 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9162 | |
| 9163 | /*------------------------------------------------------------------------ |
| 9164 | Find the BSS for which the request is made and identify WDI session |
| 9165 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9166 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9167 | pwdiAddTSParams->wdiTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9168 | &macBSSID)) |
| 9169 | { |
| 9170 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9171 | "This station does not exist in the WDI Station Table %d"); |
| 9172 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9173 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9174 | } |
| 9175 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9176 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 9177 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9178 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9179 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9180 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9181 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9182 | |
| 9183 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9184 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9185 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9186 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9187 | /*------------------------------------------------------------------------ |
| 9188 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9189 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9190 | ------------------------------------------------------------------------*/ |
| 9191 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9192 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9193 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9194 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9195 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9196 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9197 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9198 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9199 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9200 | } |
| 9201 | |
| 9202 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9203 | /*----------------------------------------------------------------------- |
| 9204 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9205 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9206 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9207 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ, |
| 9208 | sizeof(halAddTsParams), |
| 9209 | &pSendBuffer, &usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9210 | &usSendSize))|| |
| 9211 | ( usSendSize < (usDataOffset + sizeof(halAddTsParams) ))) |
| 9212 | { |
| 9213 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9214 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9215 | pEventData, pwdiAddTSParams, wdiAddTSRspCb); |
| 9216 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9217 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9218 | } |
| 9219 | |
| 9220 | halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx; |
| 9221 | halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx; |
| 9222 | |
| 9223 | //TSPEC IE |
| 9224 | halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType; |
| 9225 | halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9226 | halAddTsParams.tspec.nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9227 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9228 | halAddTsParams.tspec.maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9229 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9230 | halAddTsParams.tspec.minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9231 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9232 | halAddTsParams.tspec.maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9233 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9234 | halAddTsParams.tspec.inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9235 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9236 | halAddTsParams.tspec.suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9237 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9238 | halAddTsParams.tspec.svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9239 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9240 | halAddTsParams.tspec.minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9241 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9242 | halAddTsParams.tspec.meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9243 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9244 | halAddTsParams.tspec.peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9245 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9246 | halAddTsParams.tspec.maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9247 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9248 | halAddTsParams.tspec.delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9249 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9250 | halAddTsParams.tspec.minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9251 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9252 | halAddTsParams.tspec.surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9253 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9254 | halAddTsParams.tspec.mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9255 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime; |
| 9256 | |
| 9257 | //TSPEC IE : TS INFO : TRAFFIC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9258 | halAddTsParams.tspec.tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9259 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9260 | halAddTsParams.tspec.tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9261 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9262 | halAddTsParams.tspec.tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9263 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9264 | halAddTsParams.tspec.tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9265 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9266 | halAddTsParams.tspec.tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9267 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9268 | halAddTsParams.tspec.tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9269 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9270 | halAddTsParams.tspec.tsinfo.traffic.trafficType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9271 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType; |
| 9272 | |
| 9273 | //TSPEC IE : TS INFO : SCHEDULE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9274 | halAddTsParams.tspec.tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9275 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9276 | halAddTsParams.tspec.tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9277 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule; |
| 9278 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9279 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9280 | &halAddTsParams, |
| 9281 | sizeof(halAddTsParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9282 | |
| 9283 | pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9284 | pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9285 | |
| 9286 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9287 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9288 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9289 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9290 | wdiAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9291 | WDI_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9292 | }/*WDI_ProcessAddTSpecReq*/ |
| 9293 | |
| 9294 | |
| 9295 | /** |
| 9296 | @brief Process Del TSpec Request function (called when Main FSM |
| 9297 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9298 | |
| 9299 | @param pWDICtx: pointer to the WLAN DAL context |
| 9300 | pEventData: pointer to the event information structure |
| 9301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9302 | @see |
| 9303 | @return Result of the function call |
| 9304 | */ |
| 9305 | WDI_Status |
| 9306 | WDI_ProcessDelTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9307 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9308 | WDI_ControlBlockType* pWDICtx, |
| 9309 | WDI_EventInfoType* pEventData |
| 9310 | ) |
| 9311 | { |
| 9312 | WDI_DelTSReqParamsType* pwdiDelTSParams; |
| 9313 | WDI_DelTsRspCb wdiDelTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9314 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9315 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9316 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9317 | wpt_uint16 usDataOffset = 0; |
| 9318 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9319 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9320 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9321 | |
| 9322 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9323 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9324 | -------------------------------------------------------------------------*/ |
| 9325 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9326 | ( NULL == pEventData->pCBfnc )) |
| 9327 | { |
| 9328 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9329 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9330 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9331 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9332 | } |
| 9333 | |
| 9334 | pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData; |
| 9335 | wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc; |
| 9336 | |
| 9337 | /*------------------------------------------------------------------------- |
| 9338 | 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] | 9339 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9340 | -------------------------------------------------------------------------*/ |
| 9341 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9342 | |
| 9343 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9344 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9345 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9346 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 9347 | pwdiDelTSParams->wdiDelTSInfo.macBSSID, |
| 9348 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9349 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9350 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9351 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9352 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9353 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9354 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
| 9355 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9356 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9357 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9358 | } |
| 9359 | |
| 9360 | /*------------------------------------------------------------------------ |
| 9361 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9362 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9363 | ------------------------------------------------------------------------*/ |
| 9364 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9365 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9366 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9367 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9368 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9369 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9370 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9371 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9372 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9373 | } |
| 9374 | |
| 9375 | |
| 9376 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9377 | /*----------------------------------------------------------------------- |
| 9378 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9379 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9380 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9381 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9382 | sizeof(pwdiDelTSParams->wdiDelTSInfo), |
| 9383 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9384 | ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) ))) |
| 9385 | { |
| 9386 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9387 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9388 | pEventData, pwdiDelTSParams, wdiDelTSRspCb); |
| 9389 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9390 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9391 | } |
| 9392 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9393 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9394 | &pwdiDelTSParams->wdiDelTSInfo, |
| 9395 | sizeof(pwdiDelTSParams->wdiDelTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9396 | |
| 9397 | pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9398 | pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9399 | |
| 9400 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9401 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9402 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9403 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9404 | wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9405 | }/*WDI_ProcessDelTSpecReq*/ |
| 9406 | |
| 9407 | /** |
| 9408 | @brief Process Update EDCA Params Request function (called when |
| 9409 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9410 | |
| 9411 | @param pWDICtx: pointer to the WLAN DAL context |
| 9412 | pEventData: pointer to the event information structure |
| 9413 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9414 | @see |
| 9415 | @return Result of the function call |
| 9416 | */ |
| 9417 | WDI_Status |
| 9418 | WDI_ProcessUpdateEDCAParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9419 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9420 | WDI_ControlBlockType* pWDICtx, |
| 9421 | WDI_EventInfoType* pEventData |
| 9422 | ) |
| 9423 | { |
| 9424 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams; |
| 9425 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9426 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9427 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9428 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9429 | wpt_uint16 usDataOffset = 0; |
| 9430 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9431 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9432 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9433 | |
| 9434 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9435 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9436 | -------------------------------------------------------------------------*/ |
| 9437 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9438 | ( NULL == pEventData->pCBfnc )) |
| 9439 | { |
| 9440 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9441 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9442 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9443 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9444 | } |
| 9445 | |
| 9446 | pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData; |
| 9447 | wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc; |
| 9448 | /*------------------------------------------------------------------------- |
| 9449 | 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] | 9450 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9451 | -------------------------------------------------------------------------*/ |
| 9452 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9453 | |
| 9454 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9455 | Find the BSS for which the request is made |
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 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 9458 | pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx, |
| 9459 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9460 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9461 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9462 | { |
| 9463 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9464 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 9465 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9466 | |
| 9467 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9468 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9469 | } |
| 9470 | |
| 9471 | /*------------------------------------------------------------------------ |
| 9472 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9473 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9474 | ------------------------------------------------------------------------*/ |
| 9475 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9476 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9477 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9478 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 9479 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9480 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9481 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9482 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9483 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9484 | } |
| 9485 | |
| 9486 | |
| 9487 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9488 | /*----------------------------------------------------------------------- |
| 9489 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9490 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9491 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9492 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9493 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo), |
| 9494 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9495 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) ))) |
| 9496 | { |
| 9497 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9498 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9499 | pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb); |
| 9500 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9501 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9502 | } |
| 9503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9504 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9505 | &pwdiUpdateEDCAParams->wdiEDCAInfo, |
| 9506 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9507 | |
| 9508 | pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9509 | pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9510 | |
| 9511 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9512 | Send Update EDCA Params Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9513 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9514 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9515 | wdiUpdateEDCARspCb, pEventData->pUserData, |
| 9516 | WDI_UPD_EDCA_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9517 | }/*WDI_ProcessUpdateEDCAParamsReq*/ |
| 9518 | |
| 9519 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9520 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9521 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9522 | |
| 9523 | @param pWDICtx: pointer to the WLAN DAL context |
| 9524 | pEventData: pointer to the event information structure |
| 9525 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9526 | @see |
| 9527 | @return Result of the function call |
| 9528 | */ |
| 9529 | WDI_Status |
| 9530 | WDI_ProcessAddBASessionReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9531 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9532 | WDI_ControlBlockType* pWDICtx, |
| 9533 | WDI_EventInfoType* pEventData |
| 9534 | ) |
| 9535 | { |
| 9536 | WDI_AddBASessionReqParamsType* pwdiAddBASessionParams; |
| 9537 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9538 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9539 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9540 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9541 | wpt_uint16 usDataOffset = 0; |
| 9542 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9543 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9544 | wpt_macAddr macBSSID; |
| 9545 | |
| 9546 | tAddBASessionReqMsg halAddBASessionReq; |
| 9547 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9548 | |
| 9549 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9550 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9551 | -------------------------------------------------------------------------*/ |
| 9552 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9553 | ( NULL == pEventData->pCBfnc )) |
| 9554 | { |
| 9555 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9556 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9557 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9558 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9559 | } |
| 9560 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9561 | pwdiAddBASessionParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9562 | (WDI_AddBASessionReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9563 | wdiAddBASessionRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9564 | (WDI_AddBASessionRspCb)pEventData->pCBfnc; |
| 9565 | /*------------------------------------------------------------------------- |
| 9566 | 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] | 9567 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9568 | -------------------------------------------------------------------------*/ |
| 9569 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9570 | |
| 9571 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9572 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9573 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9574 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9575 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9576 | &macBSSID)) |
| 9577 | { |
| 9578 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9579 | "This station does not exist in the WDI Station Table %d"); |
| 9580 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9581 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9582 | } |
| 9583 | |
| 9584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9585 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9586 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9587 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9588 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9590 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9591 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 9592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9593 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9594 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9595 | } |
| 9596 | |
| 9597 | /*------------------------------------------------------------------------ |
| 9598 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9599 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9600 | ------------------------------------------------------------------------*/ |
| 9601 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9602 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9603 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9604 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9605 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9606 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9607 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9608 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9609 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9610 | } |
| 9611 | |
| 9612 | |
| 9613 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9614 | /*----------------------------------------------------------------------- |
| 9615 | Get message buffer |
| 9616 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9617 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9618 | WDI_ADD_BA_SESSION_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9619 | sizeof(halAddBASessionReq.addBASessionParams), |
| 9620 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9621 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9622 | (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) ))) |
| 9623 | { |
| 9624 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9625 | "Unable to get send buffer in Add BA session req %x %x %x", |
| 9626 | pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb); |
| 9627 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9628 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9629 | } |
| 9630 | |
| 9631 | halAddBASessionReq.addBASessionParams.staIdx = |
| 9632 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx; |
| 9633 | wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr, |
| 9634 | pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr, |
| 9635 | WDI_MAC_ADDR_LEN); |
| 9636 | halAddBASessionReq.addBASessionParams.baTID = |
| 9637 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID; |
| 9638 | halAddBASessionReq.addBASessionParams.baPolicy = |
| 9639 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy; |
| 9640 | halAddBASessionReq.addBASessionParams.baBufferSize = |
| 9641 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize; |
| 9642 | halAddBASessionReq.addBASessionParams.baTimeout = |
| 9643 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout; |
| 9644 | halAddBASessionReq.addBASessionParams.baSSN = |
| 9645 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN; |
| 9646 | halAddBASessionReq.addBASessionParams.baDirection = |
| 9647 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection; |
| 9648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9649 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9650 | &halAddBASessionReq.addBASessionParams, |
| 9651 | sizeof(halAddBASessionReq.addBASessionParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9652 | |
| 9653 | pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9654 | pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9655 | |
| 9656 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9657 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9658 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9659 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9660 | wdiAddBASessionRspCb, pEventData->pUserData, |
| 9661 | WDI_ADD_BA_SESSION_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9662 | }/*WDI_ProcessAddBASessionReq*/ |
| 9663 | |
| 9664 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9665 | @brief Process Del BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9666 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9667 | |
| 9668 | @param pWDICtx: pointer to the WLAN DAL context |
| 9669 | pEventData: pointer to the event information structure |
| 9670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9671 | @see |
| 9672 | @return Result of the function call |
| 9673 | */ |
| 9674 | WDI_Status |
| 9675 | WDI_ProcessDelBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9676 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9677 | WDI_ControlBlockType* pWDICtx, |
| 9678 | WDI_EventInfoType* pEventData |
| 9679 | ) |
| 9680 | { |
| 9681 | WDI_DelBAReqParamsType* pwdiDelBAParams; |
| 9682 | WDI_DelBARspCb wdiDelBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9683 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9684 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9685 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9686 | wpt_uint16 usDataOffset = 0; |
| 9687 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9688 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9689 | wpt_macAddr macBSSID; |
| 9690 | tDelBAParams halDelBAparam; |
| 9691 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9692 | |
| 9693 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9694 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9695 | -------------------------------------------------------------------------*/ |
| 9696 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9697 | ( NULL == pEventData->pCBfnc )) |
| 9698 | { |
| 9699 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9700 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9701 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9702 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9703 | } |
| 9704 | |
| 9705 | pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData; |
| 9706 | wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc; |
| 9707 | /*------------------------------------------------------------------------- |
| 9708 | 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] | 9709 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9710 | -------------------------------------------------------------------------*/ |
| 9711 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9712 | |
| 9713 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9714 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9715 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9716 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9717 | pwdiDelBAParams->wdiBAInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9718 | &macBSSID)) |
| 9719 | { |
| 9720 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9721 | "This station does not exist in the WDI Station Table %d"); |
| 9722 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9723 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9724 | } |
| 9725 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9726 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9727 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9728 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9729 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9730 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9731 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9732 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9733 | |
| 9734 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9735 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9736 | } |
| 9737 | |
| 9738 | /*------------------------------------------------------------------------ |
| 9739 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9740 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9741 | ------------------------------------------------------------------------*/ |
| 9742 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9743 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9744 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9745 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9746 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9747 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9748 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9749 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9750 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9751 | } |
| 9752 | |
| 9753 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9754 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9755 | sizeof(halDelBAparam), |
| 9756 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9757 | ( usSendSize < (usDataOffset + sizeof(halDelBAparam) ))) |
| 9758 | { |
| 9759 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9760 | "Unable to get send buffer for DEL BA req %x %x %x", |
| 9761 | pEventData, pwdiDelBAParams, wdiDelBARspCb); |
| 9762 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9763 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9764 | } |
| 9765 | |
| 9766 | halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx; |
| 9767 | halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID; |
| 9768 | halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection; |
| 9769 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9770 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9771 | &halDelBAparam, |
| 9772 | sizeof(halDelBAparam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9773 | |
| 9774 | pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9775 | pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9776 | |
| 9777 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9778 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9779 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9780 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9781 | wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9782 | }/*WDI_ProcessDelBAReq*/ |
| 9783 | |
| 9784 | #ifdef FEATURE_WLAN_CCX |
| 9785 | |
| 9786 | WDI_Status |
| 9787 | WDI_ProcessTSMStatsReq |
| 9788 | ( |
| 9789 | WDI_ControlBlockType* pWDICtx, |
| 9790 | WDI_EventInfoType* pEventData |
| 9791 | ) |
| 9792 | { |
| 9793 | WDI_TSMStatsReqParamsType* pwdiTSMParams; |
| 9794 | WDI_TsmRspCb wdiTSMRspCb; |
| 9795 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 9796 | WDI_BSSSessionType* pBSSSes = NULL; |
| 9797 | wpt_uint8* pSendBuffer = NULL; |
| 9798 | wpt_uint16 usDataOffset = 0; |
| 9799 | wpt_uint16 usSendSize = 0; |
| 9800 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 9801 | tTsmStatsParams halTsmStatsReqParams = {0}; |
| 9802 | |
| 9803 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9804 | |
| 9805 | /*------------------------------------------------------------------------- |
| 9806 | Sanity check |
| 9807 | -------------------------------------------------------------------------*/ |
| 9808 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9809 | ( NULL == pEventData->pCBfnc )) |
| 9810 | { |
| 9811 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9812 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9813 | WDI_ASSERT(0); |
| 9814 | return WDI_STATUS_E_FAILURE; |
| 9815 | } |
| 9816 | |
| 9817 | pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData; |
| 9818 | wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc; |
| 9819 | /*------------------------------------------------------------------------- |
| 9820 | Check to see if we are in the middle of an association, if so queue, if |
| 9821 | not it means it is free to process request |
| 9822 | -------------------------------------------------------------------------*/ |
| 9823 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9824 | |
| 9825 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes); |
| 9826 | if ( NULL == pBSSSes ) |
| 9827 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9828 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9829 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9830 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9831 | |
| 9832 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9833 | return WDI_STATUS_E_NOT_ALLOWED; |
| 9834 | } |
| 9835 | |
| 9836 | /*------------------------------------------------------------------------ |
| 9837 | Check if this BSS is being currently processed or queued, |
| 9838 | if queued - queue the new request as well |
| 9839 | ------------------------------------------------------------------------*/ |
| 9840 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9841 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9842 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9843 | "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9844 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9845 | |
| 9846 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 9847 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9848 | return wdiStatus; |
| 9849 | } |
| 9850 | |
| 9851 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9852 | /*----------------------------------------------------------------------- |
| 9853 | Get message buffer |
| 9854 | ! TO DO : proper conversion into the HAL Message Request Format |
| 9855 | -----------------------------------------------------------------------*/ |
| 9856 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ, |
| 9857 | sizeof(halTsmStatsReqParams), |
| 9858 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9859 | ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) ))) |
| 9860 | { |
| 9861 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9862 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9863 | pEventData, pwdiTSMParams, wdiTSMRspCb); |
| 9864 | WDI_ASSERT(0); |
| 9865 | return WDI_STATUS_E_FAILURE; |
| 9866 | } |
| 9867 | |
| 9868 | halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid; |
| 9869 | wpalMemoryCopy(halTsmStatsReqParams.bssId, |
| 9870 | pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, |
| 9871 | WDI_MAC_ADDR_LEN); |
| 9872 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9873 | &halTsmStatsReqParams, |
| 9874 | sizeof(halTsmStatsReqParams)); |
| 9875 | |
| 9876 | pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB; |
| 9877 | pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData; |
| 9878 | |
| 9879 | /*------------------------------------------------------------------------- |
| 9880 | Send TSM Stats Request to HAL |
| 9881 | -------------------------------------------------------------------------*/ |
| 9882 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9883 | wdiTSMRspCb, pEventData->pUserData, |
| 9884 | WDI_TSM_STATS_RESP); |
| 9885 | }/*WDI_ProcessTSMStatsReq*/ |
| 9886 | |
| 9887 | #endif |
| 9888 | |
| 9889 | |
| 9890 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9891 | @brief Process Flush AC Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9892 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9893 | |
| 9894 | @param pWDICtx: pointer to the WLAN DAL context |
| 9895 | pEventData: pointer to the event information structure |
| 9896 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9897 | @see |
| 9898 | @return Result of the function call |
| 9899 | */ |
| 9900 | WDI_Status |
| 9901 | WDI_ProcessFlushAcReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9902 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9903 | WDI_ControlBlockType* pWDICtx, |
| 9904 | WDI_EventInfoType* pEventData |
| 9905 | ) |
| 9906 | { |
| 9907 | WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL; |
| 9908 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9909 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9910 | wpt_uint16 usDataOffset = 0; |
| 9911 | wpt_uint16 usSendSize = 0; |
| 9912 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9913 | |
| 9914 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9915 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9916 | -------------------------------------------------------------------------*/ |
| 9917 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9918 | ( NULL == pEventData->pCBfnc )) |
| 9919 | { |
| 9920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9921 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9922 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9923 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9924 | } |
| 9925 | |
| 9926 | pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData; |
| 9927 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc; |
| 9928 | /*----------------------------------------------------------------------- |
| 9929 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9930 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9931 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9932 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9933 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo), |
| 9934 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9935 | ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) ))) |
| 9936 | { |
| 9937 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9938 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9939 | pEventData, pwdiFlushAcParams, wdiFlushAcRspCb); |
| 9940 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9941 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9942 | } |
| 9943 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9944 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9945 | &pwdiFlushAcParams->wdiFlushAcInfo, |
| 9946 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9947 | |
| 9948 | pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9949 | pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9950 | |
| 9951 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9952 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9953 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9954 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9955 | wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9956 | }/*WDI_ProcessFlushAcReq*/ |
| 9957 | |
| 9958 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9959 | @brief Process BT AMP event Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9960 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9961 | |
| 9962 | @param pWDICtx: pointer to the WLAN DAL context |
| 9963 | pEventData: pointer to the event information structure |
| 9964 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9965 | @see |
| 9966 | @return Result of the function call |
| 9967 | */ |
| 9968 | WDI_Status |
| 9969 | WDI_ProcessBtAmpEventReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9970 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9971 | WDI_ControlBlockType* pWDICtx, |
| 9972 | WDI_EventInfoType* pEventData |
| 9973 | ) |
| 9974 | { |
| 9975 | WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL; |
| 9976 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9977 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9978 | wpt_uint16 usDataOffset = 0; |
| 9979 | wpt_uint16 usSendSize = 0; |
| 9980 | |
| 9981 | tBtAmpEventMsg haltBtAmpEventMsg; |
| 9982 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9983 | |
| 9984 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9985 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9986 | -------------------------------------------------------------------------*/ |
| 9987 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9988 | ( NULL == pEventData->pCBfnc )) |
| 9989 | { |
| 9990 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 9991 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9992 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9993 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9994 | } |
| 9995 | |
| 9996 | pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData; |
| 9997 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc; |
| 9998 | /*----------------------------------------------------------------------- |
| 9999 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10000 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10001 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10002 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10003 | sizeof(haltBtAmpEventMsg.btAmpEventParams), |
| 10004 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10005 | ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) ))) |
| 10006 | { |
| 10007 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10008 | "Unable to get send buffer in BT AMP event req %x %x %x", |
| 10009 | pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb); |
| 10010 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10011 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10012 | } |
| 10013 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10014 | haltBtAmpEventMsg.btAmpEventParams.btAmpEventType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10015 | pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10016 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10017 | &haltBtAmpEventMsg.btAmpEventParams, |
| 10018 | sizeof(haltBtAmpEventMsg.btAmpEventParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10019 | |
| 10020 | pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10021 | pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10022 | |
| 10023 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10024 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10025 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10026 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10027 | wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10028 | }/*WDI_ProcessBtAmpEventReq*/ |
| 10029 | |
| 10030 | /** |
| 10031 | @brief Process Add STA self Request function (called when Main FSM |
| 10032 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10033 | |
| 10034 | @param pWDICtx: pointer to the WLAN DAL context |
| 10035 | pEventData: pointer to the event information structure |
| 10036 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10037 | @see |
| 10038 | @return Result of the function call |
| 10039 | */ |
| 10040 | WDI_Status |
| 10041 | WDI_ProcessAddSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10042 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10043 | WDI_ControlBlockType* pWDICtx, |
| 10044 | WDI_EventInfoType* pEventData |
| 10045 | ) |
| 10046 | { |
| 10047 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams; |
| 10048 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10049 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10050 | wpt_uint16 usDataOffset = 0; |
| 10051 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10052 | tAddStaSelfParams halAddSTASelfParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10053 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10054 | |
| 10055 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10056 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10057 | -------------------------------------------------------------------------*/ |
| 10058 | if (( NULL == pEventData ) || |
| 10059 | ( NULL == pEventData->pEventData) || |
| 10060 | ( NULL == pEventData->pCBfnc)) |
| 10061 | { |
| 10062 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10063 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10064 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10065 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10066 | } |
| 10067 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10068 | pwdiAddSTASelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10069 | (WDI_AddSTASelfReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10070 | wdiAddSTASelfReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10071 | (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc; |
| 10072 | /*----------------------------------------------------------------------- |
| 10073 | Get message buffer |
| 10074 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10075 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10076 | WDI_ADD_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10077 | sizeof(tAddStaSelfParams), |
| 10078 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10079 | ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) ))) |
| 10080 | { |
| 10081 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10082 | "Unable to get send buffer in ADD STA SELF REQ %x %x %x", |
| 10083 | pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb); |
| 10084 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10085 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10086 | } |
| 10087 | |
| 10088 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10089 | wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10090 | sizeof(pWDICtx->wdiCacheAddSTASelfReq)); |
| 10091 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10092 | wpalMemoryCopy(halAddSTASelfParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10093 | pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ; |
| 10094 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10095 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams, |
| 10096 | sizeof(tAddStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10097 | |
| 10098 | pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10099 | pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10100 | |
| 10101 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10102 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10103 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10104 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10105 | wdiAddSTASelfReqRspCb, pEventData->pUserData, |
| 10106 | WDI_ADD_STA_SELF_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10107 | }/*WDI_ProcessAddSTASelfReq*/ |
| 10108 | |
| 10109 | |
| 10110 | |
| 10111 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10112 | @brief Process Del Sta Self Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10113 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10114 | |
| 10115 | @param pWDICtx: pointer to the WLAN DAL context |
| 10116 | pEventData: pointer to the event information structure |
| 10117 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10118 | @see |
| 10119 | @return Result of the function call |
| 10120 | */ |
| 10121 | WDI_Status |
| 10122 | WDI_ProcessDelSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10123 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10124 | WDI_ControlBlockType* pWDICtx, |
| 10125 | WDI_EventInfoType* pEventData |
| 10126 | ) |
| 10127 | { |
| 10128 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams; |
| 10129 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10130 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10131 | wpt_uint16 usDataOffset = 0; |
| 10132 | wpt_uint16 usSendSize = 0; |
| 10133 | tDelStaSelfParams halSetDelSelfSTAParams; |
| 10134 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10135 | |
| 10136 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10137 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10138 | -------------------------------------------------------------------------*/ |
| 10139 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10140 | ( NULL == pEventData->pCBfnc )) |
| 10141 | { |
| 10142 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10143 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10144 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10145 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10146 | } |
| 10147 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10148 | pwdiDelStaSelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10149 | (WDI_DelSTASelfReqParamsType*)pEventData->pEventData; |
| 10150 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc; |
| 10151 | |
| 10152 | /*----------------------------------------------------------------------- |
| 10153 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10154 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10155 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10156 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10157 | sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo), |
| 10158 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10159 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10160 | (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) ))) |
| 10161 | { |
| 10162 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10163 | "Unable to get send buffer in Del Sta Self req %x %x %x", |
| 10164 | pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb); |
| 10165 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10166 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10167 | } |
| 10168 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10169 | wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10170 | pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ; |
| 10171 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10172 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams, |
| 10173 | sizeof(tDelStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10174 | |
| 10175 | pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10176 | pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10177 | |
| 10178 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10179 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10180 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10181 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10182 | wdiDelStaSelfRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10183 | WDI_DEL_STA_SELF_RESP); |
| 10184 | |
| 10185 | } |
| 10186 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10187 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 10188 | /** |
| 10189 | @brief Process Start Oem Data Request function (called when Main |
| 10190 | FSM allows it) |
| 10191 | |
| 10192 | @param pWDICtx: pointer to the WLAN DAL context |
| 10193 | pEventData: pointer to the event information structure |
| 10194 | |
| 10195 | @see |
| 10196 | @return Result of the function call |
| 10197 | */ |
| 10198 | WDI_Status |
| 10199 | WDI_ProcessStartOemDataReq |
| 10200 | ( |
| 10201 | WDI_ControlBlockType* pWDICtx, |
| 10202 | WDI_EventInfoType* pEventData |
| 10203 | ) |
| 10204 | { |
| 10205 | WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL; |
| 10206 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 10207 | wpt_uint8* pSendBuffer = NULL; |
| 10208 | wpt_uint16 usDataOffset = 0; |
| 10209 | wpt_uint16 usSendSize = 0; |
| 10210 | wpt_uint16 reqLen; |
| 10211 | tStartOemDataReqParams* halStartOemDataReqParams; |
| 10212 | |
| 10213 | /*------------------------------------------------------------------------- |
| 10214 | Sanity check |
| 10215 | -------------------------------------------------------------------------*/ |
| 10216 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10217 | ( NULL == pEventData->pCBfnc )) |
| 10218 | { |
| 10219 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10220 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10221 | WDI_ASSERT(0); |
| 10222 | return WDI_STATUS_E_FAILURE; |
| 10223 | } |
| 10224 | |
| 10225 | pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData; |
| 10226 | wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc; |
| 10227 | |
| 10228 | /*----------------------------------------------------------------------- |
| 10229 | Get message buffer |
| 10230 | -----------------------------------------------------------------------*/ |
| 10231 | |
| 10232 | reqLen = sizeof(tStartOemDataReqParams); |
| 10233 | |
| 10234 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10235 | WDI_START_OEM_DATA_REQ, reqLen, |
| 10236 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10237 | (usSendSize < (usDataOffset + reqLen))) |
| 10238 | { |
| 10239 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10240 | "Unable to get send buffer in Start Oem Data req %x %x %x", |
| 10241 | pEventData, pwdiOemDataReqParams, wdiOemDataRspCb); |
| 10242 | WDI_ASSERT(0); |
| 10243 | return WDI_STATUS_E_FAILURE; |
| 10244 | } |
| 10245 | |
| 10246 | //copying WDI OEM DATA REQ PARAMS to shared memory |
| 10247 | halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset ); |
| 10248 | |
| 10249 | wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr)); |
| 10250 | wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE); |
| 10251 | |
| 10252 | pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB; |
| 10253 | pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData; |
| 10254 | |
| 10255 | /*------------------------------------------------------------------------- |
| 10256 | Send Start Request to HAL |
| 10257 | -------------------------------------------------------------------------*/ |
| 10258 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10259 | wdiOemDataRspCb, pEventData->pUserData, |
| 10260 | WDI_START_OEM_DATA_RESP); |
| 10261 | }/*WDI_ProcessStartOemDataReq*/ |
| 10262 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10263 | |
| 10264 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10265 | @brief Process Host Resume Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10266 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10267 | |
| 10268 | @param pWDICtx: pointer to the WLAN DAL context |
| 10269 | pEventData: pointer to the event information structure |
| 10270 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10271 | @see |
| 10272 | @return Result of the function call |
| 10273 | */ |
| 10274 | WDI_Status |
| 10275 | WDI_ProcessHostResumeReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10276 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10277 | WDI_ControlBlockType* pWDICtx, |
| 10278 | WDI_EventInfoType* pEventData |
| 10279 | ) |
| 10280 | { |
| 10281 | WDI_ResumeParamsType* pwdiHostResumeParams = NULL; |
| 10282 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10283 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10284 | wpt_uint16 usDataOffset = 0; |
| 10285 | wpt_uint16 usSendSize = 0; |
| 10286 | tHalWlanHostResumeReqParam halResumeReqParams; |
| 10287 | |
| 10288 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10289 | |
| 10290 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10291 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10292 | -------------------------------------------------------------------------*/ |
| 10293 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10294 | ( NULL == pEventData->pCBfnc )) |
| 10295 | { |
| 10296 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10297 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10298 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10299 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10300 | } |
| 10301 | |
| 10302 | pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData; |
| 10303 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc; |
| 10304 | |
| 10305 | /*----------------------------------------------------------------------- |
| 10306 | Get message buffer |
| 10307 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10308 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10309 | WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams), |
| 10310 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10311 | (usSendSize < (usDataOffset + sizeof(halResumeReqParams)))) |
| 10312 | { |
| 10313 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10314 | "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] | 10315 | pEventData, pwdiHostResumeParams, wdiHostResumeRspCb); |
| 10316 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10317 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10318 | } |
| 10319 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10320 | halResumeReqParams.configuredMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10321 | pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10322 | |
| 10323 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10324 | &halResumeReqParams, |
| 10325 | sizeof(halResumeReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10326 | |
| 10327 | pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10328 | pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10329 | |
| 10330 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10331 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10332 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10333 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10334 | wdiHostResumeRspCb, pEventData->pUserData, |
| 10335 | WDI_HOST_RESUME_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10336 | }/*WDI_ProcessHostResumeReq*/ |
| 10337 | |
| 10338 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10339 | @brief Process set Tx Per Tracking Parameters Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10340 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10341 | |
| 10342 | @param pWDICtx: pointer to the WLAN DAL context |
| 10343 | pEventData: pointer to the event information structure |
| 10344 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10345 | @see |
| 10346 | @return Result of the function call |
| 10347 | */ |
| 10348 | WDI_Status |
| 10349 | WDI_ProcessSetTxPerTrackingReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10350 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10351 | WDI_ControlBlockType* pWDICtx, |
| 10352 | WDI_EventInfoType* pEventData |
| 10353 | ) |
| 10354 | { |
| 10355 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL; |
| 10356 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10357 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10358 | wpt_uint16 usDataOffset = 0; |
| 10359 | wpt_uint16 usSendSize = 0; |
| 10360 | tHalTxPerTrackingReqParam halTxPerTrackingReqParam; |
| 10361 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10362 | |
| 10363 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10364 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10365 | -------------------------------------------------------------------------*/ |
| 10366 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10367 | ( NULL == pEventData->pCBfnc )) |
| 10368 | { |
| 10369 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10370 | "%s: Invalid parameters ",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10371 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10372 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10373 | } |
| 10374 | |
| 10375 | pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData; |
| 10376 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10377 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10378 | /*----------------------------------------------------------------------- |
| 10379 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10380 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10381 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10382 | 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] | 10383 | sizeof(halTxPerTrackingReqParam), |
| 10384 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10385 | ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) ))) |
| 10386 | { |
| 10387 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10388 | "Unable to get send buffer in set tx per tracking req %x %x %x", |
| 10389 | pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb); |
| 10390 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10391 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10392 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10393 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10394 | halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable; |
| 10395 | halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod; |
| 10396 | halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio; |
| 10397 | halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10398 | |
| 10399 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10400 | &halTxPerTrackingReqParam, |
| 10401 | sizeof(halTxPerTrackingReqParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10402 | |
| 10403 | pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10404 | pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10405 | |
| 10406 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10407 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10408 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10409 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10410 | pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10411 | }/*WDI_ProcessSetTxPerTrackingReq*/ |
| 10412 | |
| 10413 | /*========================================================================= |
| 10414 | Indications |
| 10415 | =========================================================================*/ |
| 10416 | |
| 10417 | /** |
| 10418 | @brief Process Suspend Indications function (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10419 | |
| 10420 | @param pWDICtx: pointer to the WLAN DAL context |
| 10421 | pEventData: pointer to the event information structure |
| 10422 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10423 | @see |
| 10424 | @return Result of the function call |
| 10425 | */ |
| 10426 | WDI_Status |
| 10427 | WDI_ProcessHostSuspendInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10428 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10429 | WDI_ControlBlockType* pWDICtx, |
| 10430 | WDI_EventInfoType* pEventData |
| 10431 | ) |
| 10432 | { |
| 10433 | WDI_SuspendParamsType *pSuspendIndParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10434 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10435 | wpt_uint16 usDataOffset = 0; |
| 10436 | wpt_uint16 usSendSize = 0; |
| 10437 | WDI_Status wdiStatus; |
| 10438 | tHalWlanHostSuspendIndParam halWlanSuspendIndparams; |
| 10439 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10440 | |
| 10441 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10442 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10443 | -------------------------------------------------------------------------*/ |
| 10444 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10445 | { |
| 10446 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10447 | "%s: Invalid parameters in Suspend ind",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10448 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10449 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10450 | } |
| 10451 | |
| 10452 | pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData; |
| 10453 | |
| 10454 | /*----------------------------------------------------------------------- |
| 10455 | Get message buffer |
| 10456 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10457 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10458 | WDI_HOST_SUSPEND_IND, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10459 | sizeof(halWlanSuspendIndparams), |
| 10460 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10461 | (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams)))) |
| 10462 | { |
| 10463 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10464 | "Unable to get send buffer in Suspend Ind "); |
| 10465 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10466 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10467 | } |
| 10468 | |
| 10469 | halWlanSuspendIndparams.configuredMcstBcstFilterSetting = |
| 10470 | pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting; |
| 10471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10472 | halWlanSuspendIndparams.activeSessionCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10473 | WDI_GetActiveSessionsCount(pWDICtx); |
| 10474 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10475 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams, |
| 10476 | sizeof(tHalWlanHostSuspendIndParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10477 | |
| 10478 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10479 | Send Suspend Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10480 | -------------------------------------------------------------------------*/ |
| 10481 | pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10482 | pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10483 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10484 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10485 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10486 | }/*WDI_ProcessHostSuspendInd*/ |
| 10487 | |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 10488 | |
| 10489 | |
| 10490 | /** |
| 10491 | @brief Process Traffic Stats Indications function (called when Main FSM allows it) |
| 10492 | |
| 10493 | @param pWDICtx: pointer to the WLAN DAL context |
| 10494 | pEventData: pointer to the event information structure |
| 10495 | |
| 10496 | @see |
| 10497 | @return Result of the function call |
| 10498 | */ |
| 10499 | WDI_Status |
| 10500 | WDI_ProcessTrafficStatsInd |
| 10501 | ( |
| 10502 | WDI_ControlBlockType* pWDICtx, |
| 10503 | WDI_EventInfoType* pEventData |
| 10504 | ) |
| 10505 | { |
| 10506 | WDI_TrafficStatsIndType* pTrafficStatsIndParams; |
| 10507 | wpt_uint8* pSendBuffer = NULL; |
| 10508 | wpt_uint16 usDataOffset = 0; |
| 10509 | wpt_uint16 usSendSize = 0; |
| 10510 | WDI_Status wdiStatus; |
| 10511 | tStatsClassBIndParams* pStatsClassBIndParams; |
| 10512 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10513 | |
| 10514 | /*------------------------------------------------------------------------- |
| 10515 | Sanity check |
| 10516 | -------------------------------------------------------------------------*/ |
| 10517 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10518 | { |
| 10519 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10520 | "%s: Invalid parameters in Traffic Stats ind",__func__); |
| 10521 | WDI_ASSERT(0); |
| 10522 | return WDI_STATUS_E_FAILURE; |
| 10523 | } |
| 10524 | |
| 10525 | pTrafficStatsIndParams = (WDI_TrafficStatsIndType *)pEventData->pEventData; |
| 10526 | |
| 10527 | if(pTrafficStatsIndParams->length != sizeof(tStaStatsClassB)*(HAL_NUM_STA)) |
| 10528 | { |
| 10529 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10530 | "%s: Invalid parameters in Traffic Stats ind",__func__); |
| 10531 | WDI_ASSERT(0); |
| 10532 | return WDI_STATUS_E_FAILURE; |
| 10533 | } |
| 10534 | |
| 10535 | /*----------------------------------------------------------------------- |
| 10536 | Get message buffer |
| 10537 | -----------------------------------------------------------------------*/ |
| 10538 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10539 | WDI_TRAFFIC_STATS_IND, |
| 10540 | sizeof(tStatsClassBIndParams), |
| 10541 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10542 | (usSendSize < (usDataOffset + sizeof(tStatsClassBIndParams)))) |
| 10543 | { |
| 10544 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 10545 | "Unable to get send buffer in Traffic Stats Ind "); |
| 10546 | WDI_ASSERT(0); |
| 10547 | return WDI_STATUS_E_FAILURE; |
| 10548 | } |
| 10549 | |
| 10550 | pStatsClassBIndParams = (tStatsClassBIndParams*)(pSendBuffer+usDataOffset); |
| 10551 | |
| 10552 | pStatsClassBIndParams->duration = pTrafficStatsIndParams->duration; |
| 10553 | |
| 10554 | wpalMemoryCopy(pStatsClassBIndParams->staStatsClassB, |
| 10555 | pTrafficStatsIndParams->pTrafficStats, |
| 10556 | pTrafficStatsIndParams->length); |
| 10557 | |
| 10558 | /*------------------------------------------------------------------------- |
| 10559 | Send Suspend Request to HAL |
| 10560 | -------------------------------------------------------------------------*/ |
| 10561 | pWDICtx->wdiReqStatusCB = pTrafficStatsIndParams->wdiReqStatusCB; |
| 10562 | pWDICtx->pReqStatusUserData = pTrafficStatsIndParams->pUserData; |
| 10563 | |
| 10564 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
| 10565 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10566 | }/*WDI_ProcessTrafficStatsInd*/ |
| 10567 | |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 10568 | #ifdef WLAN_FEATURE_11W |
| 10569 | /** |
| 10570 | @brief Process Exclude Unencrypted Indications function (called |
| 10571 | when Main FSM allows it) |
| 10572 | |
| 10573 | @param pWDICtx: pointer to the WLAN DAL context |
| 10574 | pEventData: pointer to the event information structure |
| 10575 | |
| 10576 | @see |
| 10577 | @return Result of the function call |
| 10578 | */ |
| 10579 | WDI_Status |
| 10580 | WDI_ProcessExcludeUnencryptInd |
| 10581 | ( |
| 10582 | WDI_ControlBlockType* pWDICtx, |
| 10583 | WDI_EventInfoType* pEventData |
| 10584 | ) |
| 10585 | { |
| 10586 | WDI_ExcludeUnencryptIndType* pWDIExcUnencIndParams; |
| 10587 | wpt_uint8* pSendBuffer = NULL; |
| 10588 | wpt_uint16 usDataOffset = 0; |
| 10589 | wpt_uint16 usSendSize = 0; |
| 10590 | WDI_Status wdiStatus; |
| 10591 | tHalWlanExcludeUnEncryptedIndParam* pHalExcUnencIndParams; |
| 10592 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10593 | |
| 10594 | /*------------------------------------------------------------------------- |
| 10595 | Sanity check |
| 10596 | -------------------------------------------------------------------------*/ |
| 10597 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10598 | { |
| 10599 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10600 | "%s: Invalid parameters in Exclude Unencrypted ind",__func__); |
| 10601 | WDI_ASSERT(0); |
| 10602 | return WDI_STATUS_E_FAILURE; |
| 10603 | } |
| 10604 | |
| 10605 | pWDIExcUnencIndParams = (WDI_ExcludeUnencryptIndType *)pEventData->pEventData; |
| 10606 | |
| 10607 | /*----------------------------------------------------------------------- |
| 10608 | Get message buffer |
| 10609 | -----------------------------------------------------------------------*/ |
| 10610 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10611 | WDI_EXCLUDE_UNENCRYPTED_IND, |
| 10612 | sizeof(tHalWlanExcludeUnEncryptedIndParam), |
| 10613 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10614 | (usSendSize < (usDataOffset + sizeof(tHalWlanExcludeUnEncryptedIndParam)))) |
| 10615 | { |
| 10616 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 10617 | "Unable to get send buffer in Exclude Unencrypted Ind "); |
| 10618 | WDI_ASSERT(0); |
| 10619 | return WDI_STATUS_E_FAILURE; |
| 10620 | } |
| 10621 | |
| 10622 | pHalExcUnencIndParams = (tHalWlanExcludeUnEncryptedIndParam*)(pSendBuffer+usDataOffset); |
| 10623 | |
| 10624 | pHalExcUnencIndParams->bDot11ExcludeUnencrypted = pWDIExcUnencIndParams->bExcludeUnencrypt; |
| 10625 | |
| 10626 | wpalMemoryCopy(pHalExcUnencIndParams->bssId, |
| 10627 | pWDIExcUnencIndParams->bssid, WDI_MAC_ADDR_LEN); |
| 10628 | |
| 10629 | /*------------------------------------------------------------------------- |
| 10630 | Send Suspend Request to HAL |
| 10631 | -------------------------------------------------------------------------*/ |
| 10632 | pWDICtx->wdiReqStatusCB = pWDIExcUnencIndParams->wdiReqStatusCB; |
| 10633 | pWDICtx->pReqStatusUserData = pWDIExcUnencIndParams->pUserData; |
| 10634 | |
| 10635 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
| 10636 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10637 | }/*WDI_ProcessExcludeUnencryptInd*/ |
| 10638 | #endif |
| 10639 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10640 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10641 | MISC CONTROL PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10642 | ==========================================================================*/ |
| 10643 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10644 | @brief Process Channel Switch Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10645 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10646 | |
| 10647 | @param pWDICtx: pointer to the WLAN DAL context |
| 10648 | pEventData: pointer to the event information structure |
| 10649 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10650 | @see |
| 10651 | @return Result of the function call |
| 10652 | */ |
| 10653 | WDI_Status |
| 10654 | WDI_ProcessChannelSwitchReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10655 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10656 | WDI_ControlBlockType* pWDICtx, |
| 10657 | WDI_EventInfoType* pEventData |
| 10658 | ) |
| 10659 | { |
| 10660 | WDI_SwitchChReqParamsType* pwdiSwitchChParams; |
| 10661 | WDI_SwitchChRspCb wdiSwitchChRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10662 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10663 | wpt_uint16 usDataOffset = 0; |
| 10664 | wpt_uint16 usSendSize = 0; |
| 10665 | tSwitchChannelReqMsg halSwitchChannelReq = {{0}}; |
| 10666 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10667 | |
| 10668 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10669 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10670 | -------------------------------------------------------------------------*/ |
| 10671 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10672 | ( NULL == pEventData->pCBfnc )) |
| 10673 | { |
| 10674 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10675 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10676 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10677 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10678 | } |
| 10679 | |
| 10680 | pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData; |
| 10681 | wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc; |
| 10682 | /*----------------------------------------------------------------------- |
| 10683 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10684 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10685 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10686 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10687 | sizeof(halSwitchChannelReq.switchChannelParams), |
| 10688 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10689 | ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) ))) |
| 10690 | { |
| 10691 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10692 | "Unable to get send buffer in channel switch req %x %x %x", |
| 10693 | pEventData, pwdiSwitchChParams, wdiSwitchChRspCb); |
| 10694 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10695 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10696 | } |
| 10697 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10698 | halSwitchChannelReq.switchChannelParams.channelNumber = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10699 | pwdiSwitchChParams->wdiChInfo.ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10700 | #ifndef WLAN_FEATURE_VOWIFI |
| 10701 | halSwitchChannelReq.switchChannelParams.localPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10702 | pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint; |
| 10703 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10704 | halSwitchChannelReq.switchChannelParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10705 | pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset; |
| 10706 | |
| 10707 | #ifdef WLAN_FEATURE_VOWIFI |
| 10708 | halSwitchChannelReq.switchChannelParams.maxTxPower |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10709 | = pwdiSwitchChParams->wdiChInfo.cMaxTxPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10710 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr, |
| 10711 | pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr, |
| 10712 | WDI_MAC_ADDR_LEN); |
| 10713 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId, |
| 10714 | pwdiSwitchChParams->wdiChInfo.macBSSId, |
| 10715 | WDI_MAC_ADDR_LEN); |
| 10716 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10717 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10718 | &halSwitchChannelReq.switchChannelParams, |
| 10719 | sizeof(halSwitchChannelReq.switchChannelParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10720 | |
| 10721 | pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10722 | pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10723 | |
| 10724 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10725 | Send Switch Channel Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10726 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10727 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10728 | wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10729 | }/*WDI_ProcessChannelSwitchReq*/ |
| 10730 | |
| 10731 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10732 | @brief Process Config STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10733 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10734 | |
| 10735 | @param pWDICtx: pointer to the WLAN DAL context |
| 10736 | pEventData: pointer to the event information structure |
| 10737 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10738 | @see |
| 10739 | @return Result of the function call |
| 10740 | */ |
| 10741 | WDI_Status |
| 10742 | WDI_ProcessConfigStaReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10743 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10744 | WDI_ControlBlockType* pWDICtx, |
| 10745 | WDI_EventInfoType* pEventData |
| 10746 | ) |
| 10747 | { |
| 10748 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams; |
| 10749 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10750 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10751 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10752 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10753 | wpt_uint16 usDataOffset = 0; |
| 10754 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10755 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
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 | tConfigStaReqMsg halConfigStaReqMsg; |
| 10758 | wpt_uint16 uMsgSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10759 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10760 | |
| 10761 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10762 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10763 | -------------------------------------------------------------------------*/ |
| 10764 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10765 | ( NULL == pEventData->pCBfnc )) |
| 10766 | { |
| 10767 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10768 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10769 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10770 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10771 | } |
| 10772 | |
| 10773 | pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData; |
| 10774 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc; |
| 10775 | /*------------------------------------------------------------------------- |
| 10776 | 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] | 10777 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10778 | -------------------------------------------------------------------------*/ |
| 10779 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10780 | |
| 10781 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10782 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10783 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10784 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10785 | pwdiConfigSTAParams->wdiReqInfo.macBSSID, |
| 10786 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10787 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10788 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10789 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10790 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10791 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10792 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10793 | |
| 10794 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10795 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10796 | } |
| 10797 | |
| 10798 | /*------------------------------------------------------------------------ |
| 10799 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10800 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10801 | ------------------------------------------------------------------------*/ |
| 10802 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10803 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10804 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10805 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10806 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10807 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10808 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10809 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10810 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10811 | } |
| 10812 | |
| 10813 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10814 | |
| 10815 | /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */ |
| 10816 | #ifdef WLAN_FEATURE_11AC |
| 10817 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10818 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10819 | else |
| 10820 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 10821 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10822 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10823 | /*----------------------------------------------------------------------- |
| 10824 | Get message buffer |
| 10825 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10826 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ, |
| 10827 | uMsgSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10828 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10829 | ( usSendSize < (usDataOffset + uMsgSize ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10830 | { |
| 10831 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10832 | "Unable to get send buffer in config sta req %x %x %x", |
| 10833 | pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb); |
| 10834 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10835 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10836 | } |
| 10837 | |
| 10838 | /*Copy the station context*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10839 | WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10840 | &pwdiConfigSTAParams->wdiReqInfo); |
| 10841 | |
| 10842 | if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF) |
| 10843 | { |
| 10844 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10845 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10846 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 10847 | pwdiConfigSTAParams->wdiReqInfo.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10848 | (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10849 | { |
| 10850 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10851 | "This station does not exist in the WDI Station Table %d"); |
| 10852 | wpalMutexRelease(&pWDICtx->wptMutex); |
Madan Mohan Koyyalamudi | f244d8f | 2012-11-29 11:21:05 -0800 | [diff] [blame] | 10853 | wpalMemoryFree(pSendBuffer); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10854 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10855 | } |
| 10856 | } |
| 10857 | else |
| 10858 | { |
| 10859 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 10860 | yet received it from HAL */ |
Gopichand Nakkala | 79aacf0 | 2013-03-27 21:09:23 -0700 | [diff] [blame^] | 10861 | halConfigStaReqMsg.uStaParams.configStaParams.staIdx = pwdiConfigSTAParams->wdiReqInfo.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10862 | } |
| 10863 | |
| 10864 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10865 | halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx; |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10866 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10867 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10868 | &halConfigStaReqMsg.uStaParams, |
Madan Mohan Koyyalamudi | 0e4acab | 2012-11-02 12:46:40 -0700 | [diff] [blame] | 10869 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10870 | |
| 10871 | pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10872 | pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10873 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10874 | wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq, |
| 10875 | pwdiConfigSTAParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10876 | sizeof(pWDICtx->wdiCachedConfigStaReq)); |
| 10877 | |
| 10878 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10879 | Send Config STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10880 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10881 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10882 | wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10883 | }/*WDI_ProcessConfigStaReq*/ |
| 10884 | |
| 10885 | |
| 10886 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10887 | @brief Process Set Link State Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10888 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10889 | |
| 10890 | @param pWDICtx: pointer to the WLAN DAL context |
| 10891 | pEventData: pointer to the event information structure |
| 10892 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10893 | @see |
| 10894 | @return Result of the function call |
| 10895 | */ |
| 10896 | WDI_Status |
| 10897 | WDI_ProcessSetLinkStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10898 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10899 | WDI_ControlBlockType* pWDICtx, |
| 10900 | WDI_EventInfoType* pEventData |
| 10901 | ) |
| 10902 | { |
| 10903 | WDI_SetLinkReqParamsType* pwdiSetLinkParams; |
| 10904 | WDI_SetLinkStateRspCb wdiSetLinkRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10905 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10906 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10907 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10908 | wpt_uint16 usDataOffset = 0; |
| 10909 | wpt_uint16 usSendSize = 0; |
| 10910 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10911 | tLinkStateParams halLinkStateReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10912 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10913 | |
| 10914 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10915 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10916 | -------------------------------------------------------------------------*/ |
| 10917 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10918 | ( NULL == pEventData->pCBfnc )) |
| 10919 | { |
| 10920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 10921 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10922 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10923 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10924 | } |
| 10925 | |
| 10926 | pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData; |
| 10927 | wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc; |
| 10928 | /*------------------------------------------------------------------------- |
| 10929 | 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] | 10930 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10931 | -------------------------------------------------------------------------*/ |
| 10932 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10933 | |
| 10934 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10935 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10936 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10937 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10938 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, |
| 10939 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10940 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10941 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10942 | { |
Madan Mohan Koyyalamudi | 891e949 | 2012-10-21 12:19:31 -0700 | [diff] [blame] | 10943 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10944 | "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR, |
| 10945 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10946 | } |
| 10947 | else |
| 10948 | { |
| 10949 | /*------------------------------------------------------------------------ |
| 10950 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10951 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10952 | ------------------------------------------------------------------------*/ |
| 10953 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10954 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10955 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10956 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10957 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
| 10958 | |
| 10959 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10960 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10961 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10962 | } |
| 10963 | } |
| 10964 | /* If the link is set to enter IDLE - the Session allocated for this BSS |
| 10965 | will be deleted on the Set Link State response coming from HAL |
| 10966 | - cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10967 | wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10968 | sizeof(pWDICtx->wdiCacheSetLinkStReq)); |
| 10969 | |
| 10970 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10971 | /*----------------------------------------------------------------------- |
| 10972 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10973 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10974 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10975 | |
| 10976 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10977 | sizeof(halLinkStateReqMsg), |
| 10978 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10979 | ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) ))) |
| 10980 | { |
| 10981 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10982 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10983 | pEventData, pwdiSetLinkParams, wdiSetLinkRspCb); |
| 10984 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10985 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10986 | } |
| 10987 | |
| 10988 | wpalMemoryCopy(halLinkStateReqMsg.bssid, |
| 10989 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 10990 | |
| 10991 | wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr, |
| 10992 | pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN); |
| 10993 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10994 | halLinkStateReqMsg.state = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10995 | WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState); |
| 10996 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10997 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10998 | &halLinkStateReqMsg, |
| 10999 | sizeof(halLinkStateReqMsg)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11000 | |
| 11001 | pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11002 | pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11003 | |
| 11004 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11005 | Send Set Link State Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11006 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11007 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11008 | wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11009 | }/*WDI_ProcessSetLinkStateReq*/ |
| 11010 | |
| 11011 | |
| 11012 | /** |
| 11013 | @brief Process Get Stats Request function (called when Main FSM |
| 11014 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11015 | |
| 11016 | @param pWDICtx: pointer to the WLAN DAL context |
| 11017 | pEventData: pointer to the event information structure |
| 11018 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11019 | @see |
| 11020 | @return Result of the function call |
| 11021 | */ |
| 11022 | WDI_Status |
| 11023 | WDI_ProcessGetStatsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11024 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11025 | WDI_ControlBlockType* pWDICtx, |
| 11026 | WDI_EventInfoType* pEventData |
| 11027 | ) |
| 11028 | { |
| 11029 | WDI_GetStatsReqParamsType* pwdiGetStatsParams; |
| 11030 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11031 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11032 | wpt_uint16 usDataOffset = 0; |
| 11033 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11034 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11035 | WDI_BSSSessionType* pBSSSes = NULL; |
| 11036 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11037 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11038 | tHalStatsReqMsg halStatsReqMsg; |
| 11039 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11040 | |
| 11041 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11042 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11043 | -------------------------------------------------------------------------*/ |
| 11044 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 11045 | ( NULL == pEventData->pCBfnc ) ) |
| 11046 | { |
| 11047 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11048 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11049 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11050 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11051 | } |
| 11052 | |
| 11053 | pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData; |
| 11054 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 11055 | |
| 11056 | /*------------------------------------------------------------------------- |
| 11057 | 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] | 11058 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11059 | -------------------------------------------------------------------------*/ |
| 11060 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11061 | |
| 11062 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11063 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11064 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11065 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11066 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11067 | &macBSSID)) |
| 11068 | { |
| 11069 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11070 | "This station does not exist in the WDI Station Table %d"); |
| 11071 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11072 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11073 | } |
| 11074 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11075 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11076 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11077 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11078 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11079 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11080 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11081 | |
| 11082 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11083 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11084 | } |
| 11085 | |
| 11086 | /*------------------------------------------------------------------------ |
| 11087 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11088 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11089 | ------------------------------------------------------------------------*/ |
| 11090 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11091 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11092 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11093 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11094 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11095 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11096 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11097 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11098 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11099 | } |
| 11100 | |
| 11101 | |
| 11102 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11103 | |
| 11104 | /*----------------------------------------------------------------------- |
| 11105 | Get message buffer |
| 11106 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11107 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11108 | sizeof(halStatsReqMsg.statsReqParams), |
| 11109 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11110 | ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) ))) |
| 11111 | { |
| 11112 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11113 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11114 | pEventData, pwdiGetStatsParams, wdiGetStatsRspCb); |
| 11115 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11116 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11117 | } |
| 11118 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11119 | halStatsReqMsg.statsReqParams.staId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11120 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11121 | halStatsReqMsg.statsReqParams.statsMask = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11122 | pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11123 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11124 | &halStatsReqMsg.statsReqParams, |
| 11125 | sizeof(halStatsReqMsg.statsReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11126 | |
| 11127 | pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11128 | pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11129 | |
| 11130 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11131 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11132 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11133 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11134 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11135 | }/*WDI_ProcessGetStatsReq*/ |
| 11136 | |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 11137 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 11138 | /** |
| 11139 | @brief Process Get Roam Rssi Request function (called when Main FSM |
| 11140 | allows it) |
| 11141 | |
| 11142 | @param pWDICtx: pointer to the WLAN DAL context |
| 11143 | pEventData: pointer to the event information structure |
| 11144 | |
| 11145 | @see |
| 11146 | @return Result of the function call |
| 11147 | */ |
| 11148 | WDI_Status |
| 11149 | WDI_ProcessGetRoamRssiReq |
| 11150 | ( |
| 11151 | WDI_ControlBlockType* pWDICtx, |
| 11152 | WDI_EventInfoType* pEventData |
| 11153 | ) |
| 11154 | { |
| 11155 | WDI_GetRoamRssiReqParamsType* pwdiGetRoamRssiParams; |
| 11156 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 11157 | wpt_uint8* pSendBuffer = NULL; |
| 11158 | wpt_uint16 usDataOffset = 0; |
| 11159 | wpt_uint16 usSendSize = 0; |
| 11160 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 11161 | WDI_BSSSessionType* pBSSSes = NULL; |
| 11162 | wpt_macAddr macBSSID; |
| 11163 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 11164 | tHalGetRoamRssiReqMsg halRssiRoamReqMsg; |
| 11165 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11166 | /*------------------------------------------------------------------------- |
| 11167 | Sanity check |
| 11168 | -------------------------------------------------------------------------*/ |
| 11169 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 11170 | ( NULL == pEventData->pCBfnc ) ) |
| 11171 | { |
| 11172 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11173 | "%s: Invalid parameters", __func__); |
| 11174 | WDI_ASSERT(0); |
| 11175 | return WDI_STATUS_E_FAILURE; |
| 11176 | } |
| 11177 | |
| 11178 | pwdiGetRoamRssiParams = (WDI_GetRoamRssiReqParamsType*)pEventData->pEventData; |
| 11179 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 11180 | |
| 11181 | /*------------------------------------------------------------------------- |
| 11182 | Check to see if we are in the middle of an association, if so queue, if |
| 11183 | not it means it is free to process request |
| 11184 | -------------------------------------------------------------------------*/ |
| 11185 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11186 | |
| 11187 | /*------------------------------------------------------------------------ |
| 11188 | Find the BSS for which the request is made |
| 11189 | ------------------------------------------------------------------------*/ |
| 11190 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11191 | pwdiGetRoamRssiParams->wdiGetRoamRssiParamsInfo.ucSTAIdx, |
| 11192 | &macBSSID)) |
| 11193 | { |
| 11194 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11195 | "This station does not exist in the WDI Station Table %d"); |
| 11196 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11197 | return WDI_STATUS_E_FAILURE; |
| 11198 | } |
| 11199 | |
| 11200 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11201 | if ( NULL == pBSSSes ) |
| 11202 | { |
| 11203 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11204 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11205 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 11206 | |
| 11207 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11208 | return WDI_STATUS_E_NOT_ALLOWED; |
| 11209 | } |
| 11210 | |
| 11211 | /*------------------------------------------------------------------------ |
| 11212 | Check if this BSS is being currently processed or queued, |
| 11213 | if queued - queue the new request as well |
| 11214 | ------------------------------------------------------------------------*/ |
| 11215 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11216 | { |
| 11217 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11218 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11219 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 11220 | |
| 11221 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 11222 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11223 | return wdiStatus; |
| 11224 | } |
| 11225 | |
| 11226 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11227 | |
| 11228 | /*----------------------------------------------------------------------- |
| 11229 | Get message buffer |
| 11230 | -----------------------------------------------------------------------*/ |
| 11231 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_ROAM_RSSI_REQ, |
| 11232 | sizeof(halRssiRoamReqMsg.roamRssiReqParams), |
| 11233 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11234 | ( usSendSize < (usDataOffset + sizeof(halRssiRoamReqMsg.roamRssiReqParams) ))) |
| 11235 | { |
| 11236 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11237 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11238 | pEventData, pwdiGetRoamRssiParams, wdiGetStatsRspCb); |
| 11239 | WDI_ASSERT(0); |
| 11240 | return WDI_STATUS_E_FAILURE; |
| 11241 | } |
| 11242 | |
| 11243 | halRssiRoamReqMsg.roamRssiReqParams.staId = |
| 11244 | pwdiGetRoamRssiParams->wdiGetRoamRssiParamsInfo.ucSTAIdx; |
| 11245 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11246 | &halRssiRoamReqMsg.roamRssiReqParams, |
| 11247 | sizeof(halRssiRoamReqMsg.roamRssiReqParams)); |
| 11248 | |
| 11249 | pWDICtx->wdiReqStatusCB = pwdiGetRoamRssiParams->wdiReqStatusCB; |
| 11250 | pWDICtx->pReqStatusUserData = pwdiGetRoamRssiParams->pUserData; |
| 11251 | |
| 11252 | /*------------------------------------------------------------------------- |
| 11253 | Send Get STA Request to HAL |
| 11254 | -------------------------------------------------------------------------*/ |
| 11255 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11256 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_ROAM_RSSI_RESP); |
| 11257 | }/*WDI_ProcessGetRoamRssiReq*/ |
| 11258 | #endif |
| 11259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11260 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11261 | @brief Process Update Cfg Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11262 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11263 | |
| 11264 | @param pWDICtx: pointer to the WLAN DAL context |
| 11265 | pEventData: pointer to the event information structure |
| 11266 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11267 | @see |
| 11268 | @return Result of the function call |
| 11269 | */ |
| 11270 | WDI_Status |
| 11271 | WDI_ProcessUpdateCfgReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11272 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11273 | WDI_ControlBlockType* pWDICtx, |
| 11274 | WDI_EventInfoType* pEventData |
| 11275 | ) |
| 11276 | { |
| 11277 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL; |
| 11278 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL; |
| 11279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11280 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11281 | wpt_uint16 usDataOffset = 0; |
| 11282 | wpt_uint16 usSendSize = 0; |
| 11283 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11284 | |
| 11285 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11286 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11287 | -------------------------------------------------------------------------*/ |
| 11288 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 11289 | ( NULL == pEventData->pCBfnc)) |
| 11290 | { |
| 11291 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11292 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11293 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11294 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11295 | } |
| 11296 | |
| 11297 | pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData; |
| 11298 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc; |
| 11299 | |
| 11300 | /*----------------------------------------------------------------------- |
| 11301 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11302 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11303 | -----------------------------------------------------------------------*/ |
| 11304 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11305 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11306 | pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32), |
| 11307 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11308 | ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen))) |
| 11309 | { |
| 11310 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11311 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11312 | pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb); |
| 11313 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11314 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11315 | } |
| 11316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11317 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11318 | &pwdiUpdateCfgParams->uConfigBufferLen, |
| 11319 | sizeof(wpt_uint32)); |
| 11320 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32), |
| 11321 | pwdiUpdateCfgParams->pConfigBuffer, |
| 11322 | pwdiUpdateCfgParams->uConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11323 | |
| 11324 | pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11325 | pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11326 | |
| 11327 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11328 | Send Update Cfg Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11329 | -------------------------------------------------------------------------*/ |
| 11330 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11331 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11332 | wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11333 | |
| 11334 | }/*WDI_ProcessUpdateCfgReq*/ |
| 11335 | |
| 11336 | |
| 11337 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11338 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11339 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11340 | |
| 11341 | @param pWDICtx: pointer to the WLAN DAL context |
| 11342 | pEventData: pointer to the event information structure |
| 11343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11344 | @see |
| 11345 | @return Result of the function call |
| 11346 | */ |
| 11347 | WDI_Status |
| 11348 | WDI_ProcessAddBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11349 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11350 | WDI_ControlBlockType* pWDICtx, |
| 11351 | WDI_EventInfoType* pEventData |
| 11352 | ) |
| 11353 | { |
| 11354 | WDI_AddBAReqParamsType* pwdiAddBAParams; |
| 11355 | WDI_AddBARspCb wdiAddBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11356 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11357 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11358 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11359 | wpt_uint16 usDataOffset = 0; |
| 11360 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11361 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11362 | wpt_macAddr macBSSID; |
| 11363 | |
| 11364 | tAddBAReqMsg halAddBAReq; |
| 11365 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11366 | |
| 11367 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11368 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11369 | -------------------------------------------------------------------------*/ |
| 11370 | if (( NULL == pEventData ) || |
| 11371 | ( NULL == pEventData->pEventData) || |
| 11372 | ( NULL == pEventData->pCBfnc )) |
| 11373 | { |
| 11374 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11375 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11376 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11377 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11378 | } |
| 11379 | |
| 11380 | pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData; |
| 11381 | wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc; |
| 11382 | |
| 11383 | /*------------------------------------------------------------------------- |
| 11384 | 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] | 11385 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11386 | -------------------------------------------------------------------------*/ |
| 11387 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11388 | |
| 11389 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11390 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11391 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11392 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11393 | pwdiAddBAParams->wdiBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11394 | &macBSSID)) |
| 11395 | { |
| 11396 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11397 | "This station does not exist in the WDI Station Table %d"); |
| 11398 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11399 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11400 | } |
| 11401 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11402 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11403 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11404 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11405 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11406 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11407 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11408 | |
| 11409 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11410 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11411 | } |
| 11412 | |
| 11413 | /*------------------------------------------------------------------------ |
| 11414 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11415 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11416 | ------------------------------------------------------------------------*/ |
| 11417 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11418 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11419 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11420 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11421 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11422 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11423 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11424 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11425 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11426 | } |
| 11427 | |
| 11428 | |
| 11429 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11430 | /*----------------------------------------------------------------------- |
| 11431 | Get message buffer |
| 11432 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11433 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11434 | sizeof(halAddBAReq.addBAParams), |
| 11435 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11436 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11437 | (usDataOffset + sizeof(halAddBAReq.addBAParams) ))) |
| 11438 | { |
| 11439 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11440 | "Unable to get send buffer in Add BA req %x %x %x", |
| 11441 | pEventData, pwdiAddBAParams, wdiAddBARspCb); |
| 11442 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11443 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11444 | } |
| 11445 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11446 | halAddBAReq.addBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11447 | pwdiAddBAParams->wdiBAInfoType.ucBaSessionID; |
| 11448 | halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize; |
| 11449 | #ifdef FEATURE_ON_CHIP_REORDERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11450 | halAddBAReq.addBAParams.isReorderingDoneOnChip = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11451 | pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip; |
| 11452 | #endif |
| 11453 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11454 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11455 | &halAddBAReq.addBAParams, |
| 11456 | sizeof(halAddBAReq.addBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11457 | |
| 11458 | pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11459 | pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11460 | |
| 11461 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11462 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11463 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11464 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11465 | wdiAddBARspCb, pEventData->pUserData, |
| 11466 | WDI_ADD_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11467 | }/*WDI_ProcessAddBAReq*/ |
| 11468 | |
| 11469 | |
| 11470 | |
| 11471 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11472 | @brief Process Trigger BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11473 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11474 | |
| 11475 | @param pWDICtx: pointer to the WLAN DAL context |
| 11476 | pEventData: pointer to the event information structure |
| 11477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11478 | @see |
| 11479 | @return Result of the function call |
| 11480 | */ |
| 11481 | WDI_Status |
| 11482 | WDI_ProcessTriggerBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11483 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11484 | WDI_ControlBlockType* pWDICtx, |
| 11485 | WDI_EventInfoType* pEventData |
| 11486 | ) |
| 11487 | { |
| 11488 | WDI_TriggerBAReqParamsType* pwdiTriggerBAParams; |
| 11489 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11490 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11491 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11492 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11493 | wpt_uint16 usDataOffset = 0; |
| 11494 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11495 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11496 | wpt_uint16 index; |
| 11497 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11498 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11499 | tTriggerBAReqMsg halTriggerBAReq; |
| 11500 | tTriggerBaReqCandidate* halTriggerBACandidate; |
| 11501 | WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate; |
| 11502 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11503 | |
| 11504 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11505 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11506 | -------------------------------------------------------------------------*/ |
| 11507 | if (( NULL == pEventData ) || |
| 11508 | ( NULL == pEventData->pEventData ) || |
| 11509 | ( NULL == pEventData->pCBfnc )) |
| 11510 | { |
| 11511 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11512 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11513 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11514 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11515 | } |
| 11516 | |
| 11517 | pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData; |
| 11518 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc; |
| 11519 | /*------------------------------------------------------------------------- |
| 11520 | 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] | 11521 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11522 | -------------------------------------------------------------------------*/ |
| 11523 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 11524 | |
| 11525 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11526 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11527 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11528 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 11529 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11530 | &macBSSID)) |
| 11531 | { |
| 11532 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11533 | "This station does not exist in the WDI Station Table %d"); |
| 11534 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11535 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11536 | } |
| 11537 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11538 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 11539 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11540 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11541 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11542 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 11543 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11544 | |
| 11545 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11546 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11547 | } |
| 11548 | |
| 11549 | /*------------------------------------------------------------------------ |
| 11550 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11551 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11552 | ------------------------------------------------------------------------*/ |
| 11553 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 11554 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11555 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11556 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 11557 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11558 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11559 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11560 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11561 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11562 | } |
| 11563 | |
| 11564 | |
| 11565 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11566 | /*----------------------------------------------------------------------- |
| 11567 | Get message buffer |
| 11568 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11569 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11570 | WDI_TRIGGER_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11571 | sizeof(halTriggerBAReq.triggerBAParams) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11572 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11573 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt), |
| 11574 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11575 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11576 | (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11577 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11578 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) ))) |
| 11579 | { |
| 11580 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11581 | "Unable to get send buffer in Trigger BA req %x %x %x", |
| 11582 | pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb); |
| 11583 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11584 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11585 | } |
| 11586 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11587 | halTriggerBAReq.triggerBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11588 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11589 | halTriggerBAReq.triggerBAParams.baCandidateCnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11590 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt; |
| 11591 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11592 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11593 | &halTriggerBAReq.triggerBAParams, |
| 11594 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11595 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11596 | wdiTriggerBACandidate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11597 | (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1); |
| 11598 | halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+ |
| 11599 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11600 | |
| 11601 | for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11602 | index++) |
| 11603 | { |
| 11604 | halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx; |
| 11605 | halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap; |
| 11606 | halTriggerBACandidate++; |
| 11607 | wdiTriggerBACandidate++; |
| 11608 | } |
| 11609 | |
| 11610 | pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11611 | pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11612 | |
| 11613 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11614 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11615 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11616 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11617 | wdiTriggerBARspCb, pEventData->pUserData, |
| 11618 | WDI_TRIGGER_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11619 | }/*WDI_ProcessTriggerBAReq*/ |
| 11620 | |
| 11621 | |
| 11622 | |
| 11623 | /** |
| 11624 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11625 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11626 | |
| 11627 | @param pWDICtx: pointer to the WLAN DAL context |
| 11628 | pEventData: pointer to the event information structure |
| 11629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11630 | @see |
| 11631 | @return Result of the function call |
| 11632 | */ |
| 11633 | WDI_Status |
| 11634 | WDI_ProcessUpdateBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11635 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11636 | WDI_ControlBlockType* pWDICtx, |
| 11637 | WDI_EventInfoType* pEventData |
| 11638 | ) |
| 11639 | { |
| 11640 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams; |
| 11641 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11642 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11643 | wpt_uint16 usDataOffset = 0; |
| 11644 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11645 | tUpdateBeaconParams halUpdateBeaconParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11646 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11647 | |
| 11648 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11649 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11650 | -------------------------------------------------------------------------*/ |
| 11651 | if (( NULL == pEventData ) || |
| 11652 | ( NULL == pEventData->pEventData) || |
| 11653 | ( NULL == pEventData->pCBfnc)) |
| 11654 | { |
| 11655 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11656 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11657 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11658 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11659 | } |
| 11660 | |
| 11661 | pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData; |
| 11662 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc; |
| 11663 | /*----------------------------------------------------------------------- |
| 11664 | Get message buffer |
| 11665 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11666 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11667 | sizeof(halUpdateBeaconParams), |
| 11668 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11669 | ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) ))) |
| 11670 | { |
| 11671 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11672 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11673 | pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb); |
| 11674 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11675 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11676 | } |
| 11677 | |
| 11678 | /*BSS Index of the BSS*/ |
| 11679 | halUpdateBeaconParams.bssIdx = |
| 11680 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx; |
| 11681 | /*shortPreamble mode. HAL should update all the STA rates when it |
| 11682 | receives this message*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11683 | halUpdateBeaconParams.fShortPreamble = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11684 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble; |
| 11685 | /* short Slot time.*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11686 | halUpdateBeaconParams.fShortSlotTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11687 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime; |
| 11688 | /* Beacon Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11689 | halUpdateBeaconParams.beaconInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11690 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval; |
| 11691 | |
| 11692 | /*Protection related */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11693 | halUpdateBeaconParams.llaCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11694 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11695 | halUpdateBeaconParams.llbCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11696 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11697 | halUpdateBeaconParams.llgCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11698 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11699 | halUpdateBeaconParams.ht20MhzCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11700 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11701 | halUpdateBeaconParams.llnNonGFCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11702 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11703 | halUpdateBeaconParams.fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11704 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport; |
| 11705 | halUpdateBeaconParams.fRIFSMode = |
| 11706 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11707 | halUpdateBeaconParams.paramChangeBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11708 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap; |
| 11709 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11710 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams, |
| 11711 | sizeof(halUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11712 | |
| 11713 | pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11714 | pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11715 | |
| 11716 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11717 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11718 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11719 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11720 | wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11721 | }/*WDI_ProcessUpdateBeaconParamsReq*/ |
| 11722 | |
| 11723 | |
| 11724 | |
| 11725 | /** |
| 11726 | @brief Process Send Beacon template Request function (called when Main FSM |
| 11727 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11728 | |
| 11729 | @param pWDICtx: pointer to the WLAN DAL context |
| 11730 | pEventData: pointer to the event information structure |
| 11731 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11732 | @see |
| 11733 | @return Result of the function call |
| 11734 | */ |
| 11735 | WDI_Status |
| 11736 | WDI_ProcessSendBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11737 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11738 | WDI_ControlBlockType* pWDICtx, |
| 11739 | WDI_EventInfoType* pEventData |
| 11740 | ) |
| 11741 | { |
| 11742 | WDI_SendBeaconParamsType* pwdiSendBeaconParams; |
| 11743 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11744 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11745 | wpt_uint16 usDataOffset = 0; |
| 11746 | wpt_uint16 usSendSize = 0; |
| 11747 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11748 | |
| 11749 | tSendBeaconReqMsg halSendBeaconReq; |
| 11750 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11751 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11752 | -------------------------------------------------------------------------*/ |
| 11753 | if (( NULL == pEventData ) || |
| 11754 | ( NULL == pEventData->pEventData ) || |
| 11755 | ( NULL == pEventData->pCBfnc )) |
| 11756 | { |
| 11757 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11758 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11759 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11760 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11761 | } |
| 11762 | |
| 11763 | pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData; |
| 11764 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc; |
| 11765 | /*----------------------------------------------------------------------- |
| 11766 | Get message buffer |
| 11767 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11768 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11769 | sizeof(halSendBeaconReq.sendBeaconParam), |
| 11770 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11771 | ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) ))) |
| 11772 | { |
| 11773 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11774 | "Unable to get send buffer in send beacon req %x %x %x", |
| 11775 | pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb); |
| 11776 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11777 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11778 | } |
| 11779 | |
| 11780 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId, |
| 11781 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID, |
| 11782 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11783 | halSendBeaconReq.sendBeaconParam.beaconLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11784 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength; |
| 11785 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon, |
| 11786 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon, |
| 11787 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11788 | halSendBeaconReq.sendBeaconParam.timIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11789 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset; |
Gopichand Nakkala | 1ec80b6 | 2013-03-22 11:15:19 +0530 | [diff] [blame] | 11790 | /* usP2PIeOffset should be atleast greater than timIeOffset */ |
| 11791 | if ((pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset != 0 ) && |
| 11792 | (pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset < |
| 11793 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset)) |
| 11794 | { |
| 11795 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11796 | "Invalid usP2PIeOffset %hu", |
| 11797 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset); |
| 11798 | WDI_ASSERT(0); |
| 11799 | return WDI_STATUS_E_FAILURE; |
| 11800 | } |
| 11801 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11802 | halSendBeaconReq.sendBeaconParam.p2pIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11803 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11804 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11805 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11806 | &halSendBeaconReq.sendBeaconParam, |
| 11807 | sizeof(halSendBeaconReq.sendBeaconParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11808 | |
| 11809 | pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11810 | pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11811 | |
| 11812 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11813 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11814 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11815 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11816 | wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11817 | }/*WDI_ProcessSendBeaconParamsReq*/ |
| 11818 | |
| 11819 | /** |
| 11820 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11821 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11822 | |
| 11823 | @param pWDICtx: pointer to the WLAN DAL context |
| 11824 | pEventData: pointer to the event information structure |
| 11825 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11826 | @see |
| 11827 | @return Result of the function call |
| 11828 | */ |
| 11829 | WDI_Status |
| 11830 | WDI_ProcessUpdateProbeRspTemplateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11831 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11832 | WDI_ControlBlockType* pWDICtx, |
| 11833 | WDI_EventInfoType* pEventData |
| 11834 | ) |
| 11835 | { |
| 11836 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams; |
| 11837 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11838 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11839 | wpt_uint16 usDataOffset = 0; |
| 11840 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11841 | tSendProbeRespReqParams halUpdateProbeRspTmplParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11842 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11843 | |
| 11844 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11845 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11846 | -------------------------------------------------------------------------*/ |
| 11847 | if (( NULL == pEventData ) || |
| 11848 | ( NULL == pEventData->pEventData) || |
| 11849 | ( NULL == pEventData->pCBfnc)) |
| 11850 | { |
| 11851 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11852 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11853 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11854 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11855 | } |
| 11856 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11857 | pwdiUpdateProbeRespTmplParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11858 | (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11859 | wdiUpdateProbeRespTmplRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11860 | (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc; |
| 11861 | /*----------------------------------------------------------------------- |
| 11862 | Get message buffer |
| 11863 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11864 | 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] | 11865 | sizeof(halUpdateProbeRspTmplParams), |
| 11866 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11867 | ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) ))) |
| 11868 | { |
| 11869 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11870 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11871 | pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb); |
| 11872 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11873 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11874 | } |
| 11875 | |
| 11876 | wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11877 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11878 | WDI_MAC_ADDR_LEN); |
| 11879 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11880 | halUpdateProbeRspTmplParams.probeRespTemplateLen = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11881 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen; |
| 11882 | |
| 11883 | wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate, |
| 11884 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11885 | BEACON_TEMPLATE_SIZE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11886 | |
| 11887 | |
| 11888 | wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap, |
| 11889 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap, |
| 11890 | WDI_PROBE_REQ_BITMAP_IE_LEN); |
| 11891 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11892 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11893 | &halUpdateProbeRspTmplParams, |
| 11894 | sizeof(halUpdateProbeRspTmplParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11895 | |
| 11896 | pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11897 | pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11898 | |
| 11899 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11900 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11901 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11902 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11903 | wdiUpdateProbeRespTmplRspCb, pEventData->pUserData, |
| 11904 | WDI_UPD_PROBE_RSP_TEMPLATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11905 | }/*WDI_ProcessUpdateProbeRspTemplateReq*/ |
| 11906 | |
| 11907 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11908 | @brief Process NV blob download function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11909 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11910 | |
| 11911 | @param pWDICtx: pointer to the WLAN DAL context |
| 11912 | pEventData: pointer to the event information structure |
| 11913 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11914 | @see |
| 11915 | @return Result of the function call |
| 11916 | */ |
| 11917 | WDI_Status |
| 11918 | WDI_ProcessNvDownloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11919 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11920 | WDI_ControlBlockType* pWDICtx, |
| 11921 | WDI_EventInfoType* pEventData |
| 11922 | ) |
| 11923 | { |
| 11924 | |
| 11925 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL; |
| 11926 | WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL; |
| 11927 | |
| 11928 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11929 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11930 | -------------------------------------------------------------------------*/ |
| 11931 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11932 | ( NULL == (pwdiNvDownloadReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11933 | (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11934 | ( NULL == (wdiNvDownloadRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11935 | (WDI_NvDownloadRspCb)pEventData->pCBfnc))) |
| 11936 | { |
| 11937 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11938 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11939 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11940 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11941 | } |
| 11942 | |
| 11943 | /*Intialize the Nv Blob Info */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11944 | pWDICtx->wdiNvBlobInfo.usTotalFragment = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11945 | TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize); |
| 11946 | |
| 11947 | /*cache the wdi nv request message here if the the first fragment |
| 11948 | * To issue the request to HAL for the next fragment */ |
| 11949 | if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
| 11950 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11951 | wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq, |
| 11952 | pwdiNvDownloadReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11953 | sizeof(pWDICtx->wdiCachedNvDownloadReq)); |
| 11954 | |
| 11955 | pWDICtx->pfncRspCB = pEventData->pCBfnc; |
| 11956 | pWDICtx->pRspCBUserData = pEventData->pUserData; |
| 11957 | } |
| 11958 | |
| 11959 | return WDI_SendNvBlobReq(pWDICtx,pEventData); |
| 11960 | } |
| 11961 | |
| 11962 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11963 | @brief Process Set Max Tx Power Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11964 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11965 | |
| 11966 | @param pWDICtx: pointer to the WLAN DAL context |
| 11967 | pEventData: pointer to the event information structure |
| 11968 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11969 | @see |
| 11970 | @return Result of the function call |
| 11971 | */ |
| 11972 | WDI_Status WDI_ProcessSetMaxTxPowerReq |
| 11973 | ( |
| 11974 | WDI_ControlBlockType* pWDICtx, |
| 11975 | WDI_EventInfoType* pEventData |
| 11976 | ) |
| 11977 | { |
| 11978 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL; |
| 11979 | WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11980 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11981 | wpt_uint16 usDataOffset = 0; |
| 11982 | wpt_uint16 usSendSize = 0; |
| 11983 | tSetMaxTxPwrReq halSetMaxTxPower; |
| 11984 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11985 | |
| 11986 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11987 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11988 | -------------------------------------------------------------------------*/ |
| 11989 | if (( NULL == pEventData ) || |
| 11990 | ( NULL == pEventData->pEventData ) || |
| 11991 | ( NULL == pEventData->pCBfnc )) |
| 11992 | { |
| 11993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 11994 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11995 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11996 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11997 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11998 | pwdiSetMaxTxPowerParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11999 | (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12000 | wdiSetMaxTxPowerRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12001 | (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc; |
| 12002 | |
| 12003 | /*----------------------------------------------------------------------- |
| 12004 | Get message buffer |
| 12005 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12006 | 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] | 12007 | sizeof(halSetMaxTxPower.setMaxTxPwrParams), |
| 12008 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12009 | ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12010 | ))) |
| 12011 | { |
| 12012 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12013 | "Unable to get Set Max Tx Power req %x %x %x", |
| 12014 | pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb); |
| 12015 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12016 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12017 | } |
| 12018 | |
| 12019 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId, |
| 12020 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId, |
| 12021 | WDI_MAC_ADDR_LEN); |
| 12022 | |
| 12023 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr, |
| 12024 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr, |
| 12025 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12026 | halSetMaxTxPower.setMaxTxPwrParams.power = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12027 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12028 | |
| 12029 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12030 | &halSetMaxTxPower.setMaxTxPwrParams, |
| 12031 | sizeof(halSetMaxTxPower.setMaxTxPwrParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12032 | |
| 12033 | pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12034 | pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12035 | |
| 12036 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12037 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12038 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12039 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12040 | wdiSetMaxTxPowerRspCb, pEventData->pUserData, |
| 12041 | WDI_SET_MAX_TX_POWER_RESP); |
| 12042 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12043 | } |
| 12044 | |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 12045 | /** |
| 12046 | @brief Process Set Tx Power Request function (called when Main |
| 12047 | FSM allows it) |
| 12048 | |
| 12049 | @param pWDICtx: pointer to the WLAN DAL context |
| 12050 | pEventData: pointer to the event information structure |
| 12051 | |
| 12052 | @see |
| 12053 | @return Result of the function call |
| 12054 | */ |
| 12055 | WDI_Status WDI_ProcessSetTxPowerReq |
| 12056 | ( |
| 12057 | WDI_ControlBlockType* pWDICtx, |
| 12058 | WDI_EventInfoType* pEventData |
| 12059 | ) |
| 12060 | { |
| 12061 | WDI_SetTxPowerParamsType* pwdiSetTxPowerParams = NULL; |
| 12062 | WDA_SetTxPowerRspCb wdiSetTxPowerRspCb; |
| 12063 | wpt_uint8* pSendBuffer = NULL; |
| 12064 | wpt_uint16 usDataOffset = 0; |
| 12065 | wpt_uint16 usSendSize = 0; |
| 12066 | tSetTxPwrReqMsg *halSetTxPower = NULL;; |
| 12067 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12068 | |
| 12069 | /*------------------------------------------------------------------------- |
| 12070 | Sanity check |
| 12071 | -------------------------------------------------------------------------*/ |
| 12072 | if (( NULL == pEventData ) || |
| 12073 | ( NULL == pEventData->pEventData ) || |
| 12074 | ( NULL == pEventData->pCBfnc )) |
| 12075 | { |
| 12076 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12077 | "%s: Invalid parameters", __func__); |
| 12078 | WDI_ASSERT(0); |
| 12079 | return WDI_STATUS_E_FAILURE; |
| 12080 | } |
| 12081 | |
| 12082 | pwdiSetTxPowerParams = |
| 12083 | (WDI_SetTxPowerParamsType*)pEventData->pEventData; |
| 12084 | wdiSetTxPowerRspCb = |
| 12085 | (WDA_SetTxPowerRspCb)pEventData->pCBfnc; |
| 12086 | |
| 12087 | /*----------------------------------------------------------------------- |
| 12088 | Get message buffer |
| 12089 | -----------------------------------------------------------------------*/ |
| 12090 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TX_POWER_REQ, |
| 12091 | sizeof(tSetTxPwrReqParams), |
| 12092 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12093 | ( usSendSize < (usDataOffset + sizeof(tSetTxPwrReqParams) |
| 12094 | ))) |
| 12095 | { |
| 12096 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12097 | "Unable to get Set Max Tx Power req %x %x %x", |
| 12098 | pEventData, pwdiSetTxPowerParams, wdiSetTxPowerRspCb); |
| 12099 | WDI_ASSERT(0); |
| 12100 | return WDI_STATUS_E_FAILURE; |
| 12101 | } |
| 12102 | |
| 12103 | halSetTxPower = (tSetTxPwrReqMsg *)(pSendBuffer+usDataOffset); |
| 12104 | halSetTxPower->setTxPwrReqParams.txPower = |
| 12105 | pwdiSetTxPowerParams->wdiTxPowerInfo.ucPower; |
| 12106 | halSetTxPower->setTxPwrReqParams.bssIdx = |
| 12107 | pwdiSetTxPowerParams->wdiTxPowerInfo.bssIdx; |
| 12108 | |
| 12109 | pWDICtx->wdiReqStatusCB = pwdiSetTxPowerParams->wdiReqStatusCB; |
| 12110 | pWDICtx->pReqStatusUserData = pwdiSetTxPowerParams->pUserData; |
| 12111 | |
| 12112 | /*------------------------------------------------------------------------- |
| 12113 | Send Set Tx Power Request to HAL |
| 12114 | -------------------------------------------------------------------------*/ |
| 12115 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12116 | wdiSetTxPowerRspCb, pEventData->pUserData, |
| 12117 | WDI_SET_TX_POWER_RESP); |
| 12118 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12119 | |
| 12120 | /** |
| 12121 | @brief Process P2P Notice Of Absence Request function (called when Main FSM |
| 12122 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12123 | |
| 12124 | @param pWDICtx: pointer to the WLAN DAL context |
| 12125 | pEventData: pointer to the event information structure |
| 12126 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12127 | @see |
| 12128 | @return Result of the function call |
| 12129 | */ |
| 12130 | WDI_Status |
| 12131 | WDI_ProcessP2PGONOAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12132 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12133 | WDI_ControlBlockType* pWDICtx, |
| 12134 | WDI_EventInfoType* pEventData |
| 12135 | ) |
| 12136 | { |
| 12137 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams; |
| 12138 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12139 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12140 | wpt_uint16 usDataOffset = 0; |
| 12141 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12142 | tSetP2PGONOAParams halSetP2PGONOAParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12143 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12144 | |
| 12145 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12146 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12147 | -------------------------------------------------------------------------*/ |
| 12148 | if (( NULL == pEventData ) || |
| 12149 | ( NULL == pEventData->pEventData) || |
| 12150 | ( NULL == pEventData->pCBfnc)) |
| 12151 | { |
| 12152 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12153 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12154 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12155 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12156 | } |
| 12157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12158 | pwdiP2PGONOAReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12159 | (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12160 | wdiP2PGONOAReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12161 | (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc; |
| 12162 | /*----------------------------------------------------------------------- |
| 12163 | Get message buffer |
| 12164 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12165 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 12166 | WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12167 | sizeof(halSetP2PGONOAParams), |
| 12168 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12169 | ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) ))) |
| 12170 | { |
| 12171 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12172 | "Unable to get send buffer in set P2P GO NOA REQ %x %x %x", |
| 12173 | pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb); |
| 12174 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12175 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12176 | } |
| 12177 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12178 | halSetP2PGONOAParams.opp_ps = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12179 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12180 | halSetP2PGONOAParams.ctWindow = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12181 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow; |
| 12182 | halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12183 | halSetP2PGONOAParams.duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12184 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12185 | halSetP2PGONOAParams.interval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12186 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12187 | halSetP2PGONOAParams.single_noa_duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12188 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12189 | halSetP2PGONOAParams.psSelection = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12190 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection; |
| 12191 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12192 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12193 | &halSetP2PGONOAParams, |
| 12194 | sizeof(halSetP2PGONOAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12195 | |
| 12196 | pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12197 | pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12198 | |
| 12199 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12200 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12201 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12202 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12203 | wdiP2PGONOAReqRspCb, pEventData->pUserData, |
| 12204 | WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12205 | }/*WDI_ProcessP2PGONOAReq*/ |
| 12206 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12207 | |
| 12208 | |
| 12209 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12210 | @brief Function to handle the ack from DXE once the power |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12211 | state is set. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12212 | @param None |
| 12213 | |
| 12214 | @see |
| 12215 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12216 | */ |
| 12217 | void |
| 12218 | WDI_SetPowerStateCb |
| 12219 | ( |
| 12220 | wpt_status status, |
| 12221 | unsigned int dxePhyAddr, |
| 12222 | void *pContext |
| 12223 | ) |
| 12224 | { |
| 12225 | wpt_status wptStatus; |
| 12226 | WDI_ControlBlockType *pCB = NULL; |
| 12227 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 12228 | if(eWLAN_PAL_STATUS_E_FAILURE == status ) |
| 12229 | { |
| 12230 | //it shouldn't happen, put an error msg |
| 12231 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12232 | /* |
| 12233 | * Trigger the event to bring the Enter BMPS req function to come |
| 12234 | * out of wait |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12235 | */ |
| 12236 | if( NULL != pContext ) |
| 12237 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12238 | pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12239 | } |
| 12240 | else |
| 12241 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12242 | //put an error msg |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12243 | pCB = &gWDICb; |
| 12244 | } |
| 12245 | pCB->dxePhyAddr = dxePhyAddr; |
| 12246 | wptStatus = wpalEventSet(&pCB->setPowerStateEvent); |
| 12247 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 12248 | { |
| 12249 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12250 | "Failed to set an event"); |
| 12251 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12252 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12253 | } |
| 12254 | return; |
| 12255 | } |
| 12256 | |
| 12257 | |
| 12258 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12259 | @brief Process Enter IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12260 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12261 | |
| 12262 | @param pWDICtx: pointer to the WLAN DAL context |
| 12263 | pEventData: pointer to the event information structure |
| 12264 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12265 | @see |
| 12266 | @return Result of the function call |
| 12267 | */ |
| 12268 | WDI_Status |
| 12269 | WDI_ProcessEnterImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12270 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12271 | WDI_ControlBlockType* pWDICtx, |
| 12272 | WDI_EventInfoType* pEventData |
| 12273 | ) |
| 12274 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12275 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12276 | WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12277 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12278 | wpt_uint16 usDataOffset = 0; |
| 12279 | wpt_uint16 usSendSize = 0; |
| 12280 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12281 | |
| 12282 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12283 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12284 | -------------------------------------------------------------------------*/ |
| 12285 | if (( NULL == pEventData ) || |
| 12286 | ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc))) |
| 12287 | { |
| 12288 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12289 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12290 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12291 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12292 | } |
| 12293 | |
| 12294 | /*----------------------------------------------------------------------- |
| 12295 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12296 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12297 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12298 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12299 | 0, |
| 12300 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12301 | ( usSendSize < (usDataOffset ))) |
| 12302 | { |
| 12303 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12304 | "Unable to get send buffer in Enter IMPS req %x %x", |
| 12305 | pEventData, wdiEnterImpsRspCb); |
| 12306 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12307 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12308 | } |
| 12309 | |
| 12310 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12311 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 12312 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12313 | { |
| 12314 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12315 | "WDI Init failed to reset an event"); |
| 12316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12317 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12318 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12319 | } |
| 12320 | |
| 12321 | // notify DTS that we are entering IMPS |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12322 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb); |
| 12323 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) { |
| 12324 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 12325 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering IMPS\n", wptStatus); |
| 12326 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12327 | goto fail; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12328 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12329 | |
| 12330 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12331 | * 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] | 12332 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12333 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 12334 | WDI_SET_POWER_STATE_TIMEOUT); |
| 12335 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12336 | { |
| 12337 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12338 | "WDI Init failed to wait on an event"); |
| 12339 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12340 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12341 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12342 | } |
| 12343 | |
| 12344 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12345 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12346 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12347 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12348 | wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12349 | |
| 12350 | fail: |
| 12351 | // Release the message buffer so we don't leak |
| 12352 | wpalMemoryFree(pSendBuffer); |
| 12353 | |
| 12354 | failRequest: |
| 12355 | //WDA should have failure check to avoid the memory leak |
| 12356 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12357 | }/*WDI_ProcessEnterImpsReq*/ |
| 12358 | |
| 12359 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12360 | @brief Process Exit IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12361 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12362 | |
| 12363 | @param pWDICtx: pointer to the WLAN DAL context |
| 12364 | pEventData: pointer to the event information structure |
| 12365 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12366 | @see |
| 12367 | @return Result of the function call |
| 12368 | */ |
| 12369 | WDI_Status |
| 12370 | WDI_ProcessExitImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12371 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12372 | WDI_ControlBlockType* pWDICtx, |
| 12373 | WDI_EventInfoType* pEventData |
| 12374 | ) |
| 12375 | { |
| 12376 | WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12377 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12378 | wpt_uint16 usDataOffset = 0; |
| 12379 | wpt_uint16 usSendSize = 0; |
| 12380 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12381 | |
| 12382 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12383 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12384 | -------------------------------------------------------------------------*/ |
| 12385 | if (( NULL == pEventData ) || |
| 12386 | ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc))) |
| 12387 | { |
| 12388 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12389 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12390 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12391 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12392 | } |
| 12393 | |
| 12394 | /*----------------------------------------------------------------------- |
| 12395 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12396 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12397 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12398 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12399 | 0, |
| 12400 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12401 | ( usSendSize < (usDataOffset ))) |
| 12402 | { |
| 12403 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12404 | "Unable to get send buffer in Exit IMPS req %x %x", |
| 12405 | pEventData, wdiExitImpsRspCb); |
| 12406 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12407 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12408 | } |
| 12409 | |
| 12410 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12411 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12412 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12413 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12414 | wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12415 | }/*WDI_ProcessExitImpsReq*/ |
| 12416 | |
| 12417 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12418 | @brief Process Enter BMPS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12419 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12420 | |
| 12421 | @param pWDICtx: pointer to the WLAN DAL context |
| 12422 | pEventData: pointer to the event information structure |
| 12423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12424 | @see |
| 12425 | @return Result of the function call |
| 12426 | */ |
| 12427 | WDI_Status |
| 12428 | WDI_ProcessEnterBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12429 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12430 | WDI_ControlBlockType* pWDICtx, |
| 12431 | WDI_EventInfoType* pEventData |
| 12432 | ) |
| 12433 | { |
| 12434 | WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL; |
| 12435 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12436 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12437 | wpt_uint16 usDataOffset = 0; |
| 12438 | wpt_uint16 usSendSize = 0; |
| 12439 | tHalEnterBmpsReqParams enterBmpsReq; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12440 | wpt_status wptStatus; |
| 12441 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12442 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12443 | |
| 12444 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12445 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12446 | -------------------------------------------------------------------------*/ |
| 12447 | if (( NULL == pEventData ) || |
| 12448 | ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) || |
| 12449 | ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc))) |
| 12450 | { |
| 12451 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12452 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12453 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12454 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12455 | } |
| 12456 | |
| 12457 | /*----------------------------------------------------------------------- |
| 12458 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12459 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12460 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12461 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12462 | sizeof(enterBmpsReq), |
| 12463 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12464 | ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) ))) |
| 12465 | { |
| 12466 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12467 | "Unable to get send buffer in Enter BMPS req %x %x %x", |
| 12468 | pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb); |
| 12469 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12470 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12471 | } |
| 12472 | |
| 12473 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12474 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 12475 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12476 | { |
| 12477 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12478 | "WDI Init failed to reset an event"); |
| 12479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12480 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12481 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12482 | } |
| 12483 | |
| 12484 | // notify DTS that we are entering BMPS |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12485 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb); |
| 12486 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 12487 | { |
| 12488 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 12489 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that we are entering BMPS\n", wptStatus); |
| 12490 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12491 | goto fail; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 12492 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12493 | |
| 12494 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12495 | * 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] | 12496 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 12497 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 12498 | WDI_SET_POWER_STATE_TIMEOUT); |
| 12499 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12500 | { |
| 12501 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12502 | "WDI Init failed to wait on an event"); |
| 12503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12504 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12505 | goto fail; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12506 | } |
| 12507 | |
| 12508 | pWDICtx->bInBmps = eWLAN_PAL_TRUE; |
| 12509 | |
| 12510 | enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx; |
| 12511 | enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt; |
| 12512 | enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount; |
| 12513 | enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod; |
| 12514 | |
| 12515 | // For CCX and 11R Roaming |
| 12516 | enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod; |
| 12517 | enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage; |
| 12518 | enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable; |
| 12519 | |
| 12520 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12521 | &enterBmpsReq, |
| 12522 | sizeof(enterBmpsReq)); |
| 12523 | |
| 12524 | pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12525 | pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12526 | |
| 12527 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12528 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12529 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12530 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12531 | wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 12532 | |
| 12533 | fail: |
| 12534 | // Release the message buffer so we don't leak |
| 12535 | wpalMemoryFree(pSendBuffer); |
| 12536 | |
| 12537 | failRequest: |
| 12538 | //WDA should have failure check to avoid the memory leak |
| 12539 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12540 | }/*WDI_ProcessEnterBmpsReq*/ |
| 12541 | |
| 12542 | /** |
| 12543 | @brief Process Exit BMPS Request function (called when Main FSM |
| 12544 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12545 | |
| 12546 | @param pWDICtx: pointer to the WLAN DAL context |
| 12547 | pEventData: pointer to the event information structure |
| 12548 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12549 | @see |
| 12550 | @return Result of the function call |
| 12551 | */ |
| 12552 | WDI_Status |
| 12553 | WDI_ProcessExitBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12554 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12555 | WDI_ControlBlockType* pWDICtx, |
| 12556 | WDI_EventInfoType* pEventData |
| 12557 | ) |
| 12558 | { |
| 12559 | WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL; |
| 12560 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12561 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12562 | wpt_uint16 usDataOffset = 0; |
| 12563 | wpt_uint16 usSendSize = 0; |
| 12564 | tHalExitBmpsReqParams exitBmpsReq; |
| 12565 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12566 | |
| 12567 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12568 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12569 | -------------------------------------------------------------------------*/ |
| 12570 | if (( NULL == pEventData ) || |
| 12571 | ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) || |
| 12572 | ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc))) |
| 12573 | { |
| 12574 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12575 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12576 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12577 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12578 | } |
| 12579 | |
| 12580 | /*----------------------------------------------------------------------- |
| 12581 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12582 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12583 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12584 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12585 | sizeof(exitBmpsReq), |
| 12586 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12587 | ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) ))) |
| 12588 | { |
| 12589 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12590 | "Unable to get send buffer in Exit BMPS req %x %x %x", |
| 12591 | pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb); |
| 12592 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12593 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12594 | } |
| 12595 | exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull; |
| 12596 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12597 | exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx; |
| 12598 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12599 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12600 | &exitBmpsReq, |
| 12601 | sizeof(exitBmpsReq)); |
| 12602 | |
| 12603 | pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12604 | pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12605 | |
| 12606 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12607 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12608 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12609 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12610 | wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12611 | }/*WDI_ProcessExitBmpsReq*/ |
| 12612 | |
| 12613 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12614 | @brief Process Enter UAPSD Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12615 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12616 | |
| 12617 | @param pWDICtx: pointer to the WLAN DAL context |
| 12618 | pEventData: pointer to the event information structure |
| 12619 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12620 | @see |
| 12621 | @return Result of the function call |
| 12622 | */ |
| 12623 | WDI_Status |
| 12624 | WDI_ProcessEnterUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12625 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12626 | WDI_ControlBlockType* pWDICtx, |
| 12627 | WDI_EventInfoType* pEventData |
| 12628 | ) |
| 12629 | { |
| 12630 | WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL; |
| 12631 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12632 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12633 | wpt_uint16 usDataOffset = 0; |
| 12634 | wpt_uint16 usSendSize = 0; |
| 12635 | tUapsdReqParams enterUapsdReq; |
| 12636 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12637 | |
| 12638 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12639 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12640 | -------------------------------------------------------------------------*/ |
| 12641 | if (( NULL == pEventData ) || |
| 12642 | ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) || |
| 12643 | ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc))) |
| 12644 | { |
| 12645 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12646 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12647 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12648 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12649 | } |
| 12650 | |
| 12651 | /*----------------------------------------------------------------------- |
| 12652 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12653 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12654 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12655 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12656 | sizeof(enterUapsdReq), |
| 12657 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12658 | ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) ))) |
| 12659 | { |
| 12660 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12661 | "Unable to get send buffer in Enter UAPSD req %x %x %x", |
| 12662 | pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb); |
| 12663 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12664 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12665 | } |
| 12666 | |
| 12667 | enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled; |
| 12668 | enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled; |
| 12669 | enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled; |
| 12670 | enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled; |
| 12671 | enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled; |
| 12672 | enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled; |
| 12673 | enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled; |
| 12674 | enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12675 | enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12676 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12677 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12678 | &enterUapsdReq, |
| 12679 | sizeof(enterUapsdReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12680 | |
| 12681 | pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12682 | pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12683 | |
| 12684 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12685 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12686 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12687 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12688 | wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12689 | }/*WDI_ProcessEnterUapsdReq*/ |
| 12690 | |
| 12691 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12692 | @brief Process Exit UAPSD Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12693 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12694 | |
| 12695 | @param pWDICtx: pointer to the WLAN DAL context |
| 12696 | pEventData: pointer to the event information structure |
| 12697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12698 | @see |
| 12699 | @return Result of the function call |
| 12700 | */ |
| 12701 | WDI_Status |
| 12702 | WDI_ProcessExitUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12703 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12704 | WDI_ControlBlockType* pWDICtx, |
| 12705 | WDI_EventInfoType* pEventData |
| 12706 | ) |
| 12707 | { |
| 12708 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12709 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12710 | wpt_uint16 usDataOffset = 0; |
| 12711 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12712 | WDI_ExitUapsdReqParamsType *pExitUapsdparams; |
| 12713 | wpt_uint8 bssIdx = 0; |
| 12714 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12715 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12716 | |
| 12717 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12718 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12719 | -------------------------------------------------------------------------*/ |
| 12720 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12721 | ( NULL == (pExitUapsdparams = (WDI_ExitUapsdReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12722 | ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc))) |
| 12723 | { |
| 12724 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12725 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12726 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12727 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12728 | } |
| 12729 | |
| 12730 | /*----------------------------------------------------------------------- |
| 12731 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12732 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12733 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12734 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12735 | sizeof(wpt_uint8), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12736 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12737 | ( usSendSize < (usDataOffset + sizeof(wpt_uint8)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12738 | { |
| 12739 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12740 | "Unable to get send buffer in Exit UAPSD req %x %x", |
| 12741 | pEventData, wdiExitUapsdRspCb); |
| 12742 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12743 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12744 | } |
| 12745 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 12746 | bssIdx = pExitUapsdparams->wdiExitUapsdInfo.bssIdx; |
| 12747 | |
| 12748 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12749 | &bssIdx, |
| 12750 | sizeof(wpt_uint8)); |
| 12751 | |
| 12752 | pWDICtx->wdiReqStatusCB = pExitUapsdparams->wdiReqStatusCB; |
| 12753 | pWDICtx->pReqStatusUserData = pExitUapsdparams->pUserData; |
| 12754 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12755 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12756 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12757 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12758 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12759 | wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12760 | }/*WDI_ProcessExitUapsdReq*/ |
| 12761 | |
| 12762 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12763 | @brief Process Set UAPSD params Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12764 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12765 | |
| 12766 | @param pWDICtx: pointer to the WLAN DAL context |
| 12767 | pEventData: pointer to the event information structure |
| 12768 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12769 | @see |
| 12770 | @return Result of the function call |
| 12771 | */ |
| 12772 | WDI_Status |
| 12773 | WDI_ProcessSetUapsdAcParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12774 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12775 | WDI_ControlBlockType* pWDICtx, |
| 12776 | WDI_EventInfoType* pEventData |
| 12777 | ) |
| 12778 | { |
| 12779 | WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL; |
| 12780 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12781 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12782 | wpt_uint16 usDataOffset = 0; |
| 12783 | wpt_uint16 usSendSize = 0; |
| 12784 | tUapsdInfo uapsdAcParamsReq; |
| 12785 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12786 | |
| 12787 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12788 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12789 | -------------------------------------------------------------------------*/ |
| 12790 | if (( NULL == pEventData ) || |
| 12791 | ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) || |
| 12792 | ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc))) |
| 12793 | { |
| 12794 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12795 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12796 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12797 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12798 | } |
| 12799 | |
| 12800 | /*----------------------------------------------------------------------- |
| 12801 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12802 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12803 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12804 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12805 | sizeof(uapsdAcParamsReq), |
| 12806 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12807 | ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) ))) |
| 12808 | { |
| 12809 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12810 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12811 | pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb); |
| 12812 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12813 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12814 | } |
| 12815 | |
| 12816 | uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc; |
| 12817 | uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx; |
| 12818 | uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp; |
| 12819 | uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval; |
| 12820 | uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval; |
| 12821 | uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval; |
| 12822 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12823 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12824 | &uapsdAcParamsReq, |
| 12825 | sizeof(uapsdAcParamsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12826 | |
| 12827 | pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12828 | pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12829 | |
| 12830 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12831 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12832 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12833 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12834 | wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12835 | }/*WDI_ProcessSetUapsdAcParamsReq*/ |
| 12836 | |
| 12837 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12838 | @brief Process update UAPSD params Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12839 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12840 | |
| 12841 | @param pWDICtx: pointer to the WLAN DAL context |
| 12842 | pEventData: pointer to the event information structure |
| 12843 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12844 | @see |
| 12845 | @return Result of the function call |
| 12846 | */ |
| 12847 | WDI_Status |
| 12848 | WDI_ProcessUpdateUapsdParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12849 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12850 | WDI_ControlBlockType* pWDICtx, |
| 12851 | WDI_EventInfoType* pEventData |
| 12852 | ) |
| 12853 | { |
| 12854 | WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL; |
| 12855 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12856 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12857 | wpt_uint16 usDataOffset = 0; |
| 12858 | wpt_uint16 usSendSize = 0; |
| 12859 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12860 | |
| 12861 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12862 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12863 | -------------------------------------------------------------------------*/ |
| 12864 | if (( NULL == pEventData ) || |
| 12865 | ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) || |
| 12866 | ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc))) |
| 12867 | { |
| 12868 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12869 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12870 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12871 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12872 | } |
| 12873 | |
| 12874 | /*----------------------------------------------------------------------- |
| 12875 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12876 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12877 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12878 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12879 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo), |
| 12880 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12881 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) ))) |
| 12882 | { |
| 12883 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12884 | "Unable to get send buffer in Update UAPSD params req %x %x %x", |
| 12885 | pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb); |
| 12886 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12887 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12888 | } |
| 12889 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12890 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12891 | &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo, |
| 12892 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12893 | |
| 12894 | pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12895 | pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12896 | |
| 12897 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12898 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12899 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12900 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12901 | wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12902 | }/*WDI_ProcessUpdateUapsdParamsReq*/ |
| 12903 | |
| 12904 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12905 | @brief Process Configure RXP filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12906 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12907 | |
| 12908 | @param pWDICtx: pointer to the WLAN DAL context |
| 12909 | pEventData: pointer to the event information structure |
| 12910 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12911 | @see |
| 12912 | @return Result of the function call |
| 12913 | */ |
| 12914 | WDI_Status |
| 12915 | WDI_ProcessConfigureRxpFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12916 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12917 | WDI_ControlBlockType* pWDICtx, |
| 12918 | WDI_EventInfoType* pEventData |
| 12919 | ) |
| 12920 | { |
| 12921 | WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL; |
| 12922 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12923 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12924 | wpt_uint16 usDataOffset = 0; |
| 12925 | wpt_uint16 usSendSize = 0; |
| 12926 | tHalConfigureRxpFilterReqParams halRxpFilterParams; |
| 12927 | |
| 12928 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12929 | |
| 12930 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12931 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12932 | -------------------------------------------------------------------------*/ |
| 12933 | if (( NULL == pEventData ) || |
| 12934 | ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) || |
| 12935 | ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc))) |
| 12936 | { |
| 12937 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 12938 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12939 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12940 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12941 | } |
| 12942 | |
| 12943 | /*----------------------------------------------------------------------- |
| 12944 | Get message buffer |
| 12945 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12946 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12947 | sizeof(halRxpFilterParams), |
| 12948 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12949 | ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) ))) |
| 12950 | { |
| 12951 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12952 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12953 | pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb); |
| 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 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12958 | halRxpFilterParams.setMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12959 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12960 | halRxpFilterParams.setMcstBcstFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12961 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter; |
| 12962 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12963 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12964 | &halRxpFilterParams, |
| 12965 | sizeof(halRxpFilterParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12966 | |
| 12967 | pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12968 | pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12969 | |
| 12970 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12971 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12972 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12973 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12974 | wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12975 | }/*WDI_ProcessConfigureRxpFilterReq*/ |
| 12976 | |
| 12977 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12978 | @brief Process set beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12979 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12980 | |
| 12981 | @param pWDICtx: pointer to the WLAN DAL context |
| 12982 | pEventData: pointer to the event information structure |
| 12983 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12984 | @see |
| 12985 | @return Result of the function call |
| 12986 | */ |
| 12987 | WDI_Status |
| 12988 | WDI_ProcessSetBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12989 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12990 | WDI_ControlBlockType* pWDICtx, |
| 12991 | WDI_EventInfoType* pEventData |
| 12992 | ) |
| 12993 | { |
| 12994 | WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12995 | WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12996 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12997 | wpt_uint16 usDataOffset = 0; |
| 12998 | wpt_uint16 usSendSize = 0; |
| 12999 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13000 | |
| 13001 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13002 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13003 | -------------------------------------------------------------------------*/ |
| 13004 | if (( NULL == pEventData ) || |
| 13005 | ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 13006 | ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc))) |
| 13007 | { |
| 13008 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13009 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13010 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13011 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13012 | } |
| 13013 | |
| 13014 | /*----------------------------------------------------------------------- |
| 13015 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13016 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13017 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13018 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13019 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe), |
| 13020 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13021 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 13022 | { |
| 13023 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13024 | "Unable to get send buffer in Set beacon filter req %x %x %x", |
| 13025 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 13026 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13027 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13028 | } |
| 13029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13030 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13031 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 13032 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
| 13033 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 13034 | &pwdiBeaconFilterParams->aFilters[0], |
| 13035 | pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13036 | |
| 13037 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13038 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13039 | |
| 13040 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13041 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13042 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13043 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13044 | wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13045 | }/*WDI_ProcessSetBeaconFilterReq*/ |
| 13046 | |
| 13047 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13048 | @brief Process remove beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13049 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13050 | |
| 13051 | @param pWDICtx: pointer to the WLAN DAL context |
| 13052 | pEventData: pointer to the event information structure |
| 13053 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13054 | @see |
| 13055 | @return Result of the function call |
| 13056 | */ |
| 13057 | WDI_Status |
| 13058 | WDI_ProcessRemBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13059 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13060 | WDI_ControlBlockType* pWDICtx, |
| 13061 | WDI_EventInfoType* pEventData |
| 13062 | ) |
| 13063 | { |
| 13064 | WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 13065 | WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13066 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13067 | wpt_uint16 usDataOffset = 0; |
| 13068 | wpt_uint16 usSendSize = 0; |
| 13069 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13070 | |
| 13071 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13072 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13073 | -------------------------------------------------------------------------*/ |
| 13074 | if (( NULL == pEventData ) || |
| 13075 | ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 13076 | ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc))) |
| 13077 | { |
| 13078 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13079 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13080 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13081 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13082 | } |
| 13083 | |
| 13084 | /*----------------------------------------------------------------------- |
| 13085 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13086 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13087 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13088 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13089 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 13090 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13091 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 13092 | { |
| 13093 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13094 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 13095 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 13096 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13097 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13098 | } |
| 13099 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13100 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13101 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 13102 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13103 | |
| 13104 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13105 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13106 | |
| 13107 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13108 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13109 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13110 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13111 | wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13112 | } |
| 13113 | |
| 13114 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13115 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13116 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13117 | |
| 13118 | @param pWDICtx: pointer to the WLAN DAL context |
| 13119 | pEventData: pointer to the event information structure |
| 13120 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13121 | @see |
| 13122 | @return Result of the function call |
| 13123 | */ |
| 13124 | WDI_Status |
| 13125 | WDI_ProcessSetRSSIThresholdsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13126 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13127 | WDI_ControlBlockType* pWDICtx, |
| 13128 | WDI_EventInfoType* pEventData |
| 13129 | ) |
| 13130 | { |
| 13131 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL; |
| 13132 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13133 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13134 | wpt_uint16 usDataOffset = 0; |
| 13135 | wpt_uint16 usSendSize = 0; |
| 13136 | tHalRSSIThresholds rssiThresholdsReq; |
| 13137 | WDI_Status ret_status = 0; |
| 13138 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13139 | |
| 13140 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13141 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13142 | -------------------------------------------------------------------------*/ |
| 13143 | if (( NULL == pEventData ) || |
| 13144 | ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) || |
| 13145 | ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc))) |
| 13146 | { |
| 13147 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13148 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13149 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13150 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13151 | } |
| 13152 | |
| 13153 | /*----------------------------------------------------------------------- |
| 13154 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13155 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13156 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13157 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13158 | sizeof(rssiThresholdsReq), |
| 13159 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13160 | ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) ))) |
| 13161 | { |
| 13162 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13163 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 13164 | pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb); |
| 13165 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13166 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13167 | } |
| 13168 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13169 | rssiThresholdsReq.bReserved10 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13170 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13171 | rssiThresholdsReq.bRssiThres1NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13172 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13173 | rssiThresholdsReq.bRssiThres1PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13174 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13175 | rssiThresholdsReq.bRssiThres2NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13176 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13177 | rssiThresholdsReq.bRssiThres2PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13178 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13179 | rssiThresholdsReq.bRssiThres3NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13180 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13181 | rssiThresholdsReq.bRssiThres3PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13182 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13183 | rssiThresholdsReq.ucRssiThreshold1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13184 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13185 | rssiThresholdsReq.ucRssiThreshold2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13186 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13187 | rssiThresholdsReq.ucRssiThreshold3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13188 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3; |
| 13189 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13190 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13191 | &rssiThresholdsReq, |
| 13192 | sizeof(rssiThresholdsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13193 | |
| 13194 | pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13195 | pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13196 | |
| 13197 | /*------------------------------------------------------------------------- |
| 13198 | Send Set threshold req to HAL |
| 13199 | -------------------------------------------------------------------------*/ |
| 13200 | if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13201 | wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS) |
| 13202 | { |
| 13203 | // When we are in idle state WDI_STARTED_ST and we receive indication for threshold |
| 13204 | // req. Then as a result of processing the threshold cross ind, we trigger |
| 13205 | // a Set threshold req, then we need to indicate to WDI that it needs to |
| 13206 | // go to busy state as a result of the indication as we sent a req in the |
| 13207 | // same WDI context. |
| 13208 | // Hence expected state transition is to busy. |
| 13209 | pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST; |
| 13210 | } |
| 13211 | |
| 13212 | return ret_status; |
| 13213 | } |
| 13214 | |
| 13215 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13216 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13217 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13218 | |
| 13219 | @param pWDICtx: pointer to the WLAN DAL context |
| 13220 | pEventData: pointer to the event information structure |
| 13221 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13222 | @see |
| 13223 | @return Result of the function call |
| 13224 | */ |
| 13225 | WDI_Status |
| 13226 | WDI_ProcessHostOffloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13227 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13228 | WDI_ControlBlockType* pWDICtx, |
| 13229 | WDI_EventInfoType* pEventData |
| 13230 | ) |
| 13231 | { |
| 13232 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL; |
| 13233 | WDI_HostOffloadCb wdiHostOffloadCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13234 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13235 | wpt_uint16 usDataOffset = 0; |
| 13236 | wpt_uint16 usSendSize = 0; |
| 13237 | tHalHostOffloadReq hostOffloadParams; |
| 13238 | tHalNSOffloadParams nsOffloadParams; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13239 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13240 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13241 | |
| 13242 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13243 | |
| 13244 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13245 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13246 | -------------------------------------------------------------------------*/ |
| 13247 | if (( NULL == pEventData ) || |
| 13248 | ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) || |
| 13249 | ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc))) |
| 13250 | { |
| 13251 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13252 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13253 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13254 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13255 | } |
| 13256 | |
| 13257 | /*----------------------------------------------------------------------- |
| 13258 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13259 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13260 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13261 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13262 | sizeof(hostOffloadParams)+sizeof(nsOffloadParams), |
| 13263 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13264 | ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) ))) |
| 13265 | { |
| 13266 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13267 | "Unable to get send buffer in host offload req %x %x %x", |
| 13268 | pEventData, pwdiHostOffloadParams, wdiHostOffloadCb); |
| 13269 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13270 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13271 | } |
| 13272 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13273 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13274 | pwdiHostOffloadParams->wdiHostOffloadInfo.bssId, |
| 13275 | &pBSSSes); |
| 13276 | if ( NULL == pBSSSes ) |
| 13277 | { |
| 13278 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13279 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13280 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13281 | } |
| 13282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13283 | hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType; |
| 13284 | hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13285 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13286 | if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType ) |
| 13287 | { |
| 13288 | // ARP Offload |
| 13289 | wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr, |
| 13290 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr, |
| 13291 | 4); |
| 13292 | } |
| 13293 | else |
| 13294 | { |
| 13295 | // NS Offload |
| 13296 | wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr, |
| 13297 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 13298 | 16); |
| 13299 | |
| 13300 | #ifdef WLAN_NS_OFFLOAD |
| 13301 | // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams |
| 13302 | wpalMemoryCopy(nsOffloadParams.srcIPv6Addr, |
| 13303 | pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr, |
| 13304 | 16); |
| 13305 | wpalMemoryCopy(nsOffloadParams.selfIPv6Addr, |
| 13306 | pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr, |
| 13307 | 16); |
| 13308 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1, |
| 13309 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1, |
| 13310 | 16); |
| 13311 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2, |
| 13312 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2, |
| 13313 | 16); |
| 13314 | wpalMemoryCopy(nsOffloadParams.selfMacAddr, |
| 13315 | pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr, |
| 13316 | 6); |
| 13317 | nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid; |
| 13318 | nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid; |
| 13319 | nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13320 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13321 | #endif // WLAN_NS_OFFLOAD |
| 13322 | } |
| 13323 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13324 | nsOffloadParams.bssIdx = pBSSSes->ucBSSIdx; |
| 13325 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13326 | // copy hostOffloadParams into pSendBuffer |
| 13327 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13328 | &hostOffloadParams, |
| 13329 | sizeof(hostOffloadParams)); |
| 13330 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13331 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13332 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13333 | // copy nsOffloadParams into pSendBuffer |
| 13334 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13335 | &nsOffloadParams, |
| 13336 | sizeof(nsOffloadParams)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13337 | } |
| 13338 | else |
| 13339 | { |
| 13340 | #ifdef WLAN_NS_OFFLOAD |
| 13341 | if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType ) |
| 13342 | { |
| 13343 | // copy nsOffloadParams into pSendBuffer |
| 13344 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
| 13345 | &nsOffloadParams, |
| 13346 | sizeof(nsOffloadParams)); |
| 13347 | } |
| 13348 | #endif |
| 13349 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13350 | |
| 13351 | pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13352 | pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13353 | |
| 13354 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13355 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13356 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13357 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13358 | wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13359 | |
| 13360 | fail: |
| 13361 | // Release the message buffer so we don't leak |
| 13362 | wpalMemoryFree(pSendBuffer); |
| 13363 | |
| 13364 | failRequest: |
| 13365 | //WDA should have failure check to avoid the memory leak |
| 13366 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13367 | }/*WDI_ProcessHostOffloadReq*/ |
| 13368 | |
| 13369 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13370 | @brief Process Keep Alive Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13371 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13372 | |
| 13373 | @param pWDICtx: pointer to the WLAN DAL context |
| 13374 | pEventData: pointer to the event information structure |
| 13375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13376 | @see |
| 13377 | @return Result of the function call |
| 13378 | */ |
| 13379 | WDI_Status |
| 13380 | WDI_ProcessKeepAliveReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13381 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13382 | WDI_ControlBlockType* pWDICtx, |
| 13383 | WDI_EventInfoType* pEventData |
| 13384 | ) |
| 13385 | { |
| 13386 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL; |
| 13387 | WDI_KeepAliveCb wdiKeepAliveCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13388 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13389 | wpt_uint16 usDataOffset = 0; |
| 13390 | wpt_uint16 usSendSize = 0; |
| 13391 | tHalKeepAliveReq keepAliveReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13392 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13393 | WDI_BSSSessionType* pBSSSes = NULL; |
| 13394 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13395 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13396 | |
| 13397 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13398 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13399 | -------------------------------------------------------------------------*/ |
| 13400 | if (( NULL == pEventData ) || |
| 13401 | ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) || |
| 13402 | ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc))) |
| 13403 | { |
| 13404 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13405 | "Invalid parameters in Keep Alive req"); |
| 13406 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13407 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13408 | } |
| 13409 | |
| 13410 | /*----------------------------------------------------------------------- |
| 13411 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13412 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13413 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13414 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13415 | sizeof(keepAliveReq), |
| 13416 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13417 | ( usSendSize < (usDataOffset + sizeof(keepAliveReq) ))) |
| 13418 | { |
| 13419 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13420 | "Unable to get send buffer in keep alive req %x %x %x", |
| 13421 | pEventData, pwdiKeepAliveParams, wdiKeepAliveCb); |
| 13422 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13423 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13424 | } |
| 13425 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13426 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13427 | pwdiKeepAliveParams->wdiKeepAliveInfo.bssId, |
| 13428 | &pBSSSes); |
| 13429 | if ( NULL == pBSSSes ) |
| 13430 | { |
| 13431 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13432 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13433 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13434 | } |
| 13435 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13436 | keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType; |
| 13437 | keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod; |
| 13438 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13439 | keepAliveReq.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13440 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13441 | if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2) |
| 13442 | { |
| 13443 | wpalMemoryCopy(keepAliveReq.hostIpv4Addr, |
| 13444 | pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr, |
| 13445 | HAL_IPV4_ADDR_LEN); |
| 13446 | wpalMemoryCopy(keepAliveReq.destIpv4Addr, |
| 13447 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13448 | HAL_IPV4_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13449 | wpalMemoryCopy(keepAliveReq.destMacAddr, |
| 13450 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr, |
| 13451 | HAL_MAC_ADDR_LEN); |
| 13452 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13453 | |
| 13454 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13455 | &keepAliveReq, |
| 13456 | sizeof(keepAliveReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13457 | |
| 13458 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 13459 | "Process keep alive req %d",sizeof(keepAliveReq)); |
| 13460 | |
| 13461 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 13462 | "Process keep alive req time period %d",keepAliveReq.timePeriod); |
| 13463 | |
| 13464 | pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13465 | pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13466 | |
| 13467 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 13468 | "Sending keep alive req to HAL"); |
| 13469 | |
| 13470 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13471 | Send Get STA Request to HAL |
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 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13474 | wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13475 | |
| 13476 | fail: |
| 13477 | // Release the message buffer so we don't leak |
| 13478 | wpalMemoryFree(pSendBuffer); |
| 13479 | |
| 13480 | failRequest: |
| 13481 | //WDA should have failure check to avoid the memory leak |
| 13482 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13483 | }/*WDI_ProcessKeepAliveReq*/ |
| 13484 | |
| 13485 | |
| 13486 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13487 | @brief Process Wowl add bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13488 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13489 | |
| 13490 | @param pWDICtx: pointer to the WLAN DAL context |
| 13491 | pEventData: pointer to the event information structure |
| 13492 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13493 | @see |
| 13494 | @return Result of the function call |
| 13495 | */ |
| 13496 | WDI_Status |
| 13497 | WDI_ProcessWowlAddBcPtrnReq |
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 | WDI_ControlBlockType* pWDICtx, |
| 13500 | WDI_EventInfoType* pEventData |
| 13501 | ) |
| 13502 | { |
| 13503 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL; |
| 13504 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13505 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13506 | wpt_uint16 usDataOffset = 0; |
| 13507 | wpt_uint16 usSendSize = 0; |
| 13508 | tHalWowlAddBcastPtrn wowlAddBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13509 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13510 | WDI_BSSSessionType* pBSSSes = NULL; |
| 13511 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13512 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13513 | |
| 13514 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13515 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13516 | -------------------------------------------------------------------------*/ |
| 13517 | if (( NULL == pEventData ) || |
| 13518 | ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 13519 | ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc))) |
| 13520 | { |
| 13521 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13522 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13523 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13524 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13525 | } |
| 13526 | |
| 13527 | /*----------------------------------------------------------------------- |
| 13528 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13529 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13530 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13531 | 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] | 13532 | sizeof(wowlAddBcPtrnReq), |
| 13533 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13534 | ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) ))) |
| 13535 | { |
| 13536 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13537 | "Unable to get send buffer in Wowl add bc ptrn req %x %x %x", |
| 13538 | pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb); |
| 13539 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13540 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13541 | } |
| 13542 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13543 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13544 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.bssId, |
| 13545 | &pBSSSes); |
| 13546 | if ( NULL == pBSSSes ) |
| 13547 | { |
| 13548 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13549 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13550 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13551 | } |
| 13552 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13553 | wowlAddBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13554 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13555 | wowlAddBcPtrnReq.ucPatternByteOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13556 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13557 | wowlAddBcPtrnReq.ucPatternMaskSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13558 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13559 | wowlAddBcPtrnReq.ucPatternSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13560 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize; |
| 13561 | |
| 13562 | if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE) |
| 13563 | { |
| 13564 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 13565 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 13566 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize); |
| 13567 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 13568 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 13569 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize); |
| 13570 | } |
| 13571 | else |
| 13572 | { |
| 13573 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 13574 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 13575 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13576 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 13577 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 13578 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13579 | |
| 13580 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 13581 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 13582 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13583 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 13584 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 13585 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 13586 | } |
| 13587 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13588 | wowlAddBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 13589 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13590 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13591 | &wowlAddBcPtrnReq, |
| 13592 | sizeof(wowlAddBcPtrnReq)); |
| 13593 | |
| 13594 | pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13595 | pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13596 | |
| 13597 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13598 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13599 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13600 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13601 | wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13602 | fail: |
| 13603 | // Release the message buffer so we don't leak |
| 13604 | wpalMemoryFree(pSendBuffer); |
| 13605 | |
| 13606 | failRequest: |
| 13607 | //WDA should have failure check to avoid the memory leak |
| 13608 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13609 | }/*WDI_ProcessWowlAddBcPtrnReq*/ |
| 13610 | |
| 13611 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13612 | @brief Process Wowl delete bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13613 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13614 | |
| 13615 | @param pWDICtx: pointer to the WLAN DAL context |
| 13616 | pEventData: pointer to the event information structure |
| 13617 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13618 | @see |
| 13619 | @return Result of the function call |
| 13620 | */ |
| 13621 | WDI_Status |
| 13622 | WDI_ProcessWowlDelBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13623 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13624 | WDI_ControlBlockType* pWDICtx, |
| 13625 | WDI_EventInfoType* pEventData |
| 13626 | ) |
| 13627 | { |
| 13628 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL; |
| 13629 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13630 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13631 | wpt_uint16 usDataOffset = 0; |
| 13632 | wpt_uint16 usSendSize = 0; |
| 13633 | tHalWowlDelBcastPtrn wowlDelBcPtrnReq; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13634 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 13635 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13636 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13637 | |
| 13638 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13639 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13640 | -------------------------------------------------------------------------*/ |
| 13641 | if (( NULL == pEventData ) || |
| 13642 | ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 13643 | ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc))) |
| 13644 | { |
| 13645 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13646 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13647 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13648 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13649 | } |
| 13650 | |
| 13651 | /*----------------------------------------------------------------------- |
| 13652 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13653 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13654 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13655 | 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] | 13656 | sizeof(wowlDelBcPtrnReq), |
| 13657 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13658 | ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) ))) |
| 13659 | { |
| 13660 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13661 | "Unable to get send buffer in Wowl del bc ptrn req %x %x %x", |
| 13662 | pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb); |
| 13663 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13664 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13665 | } |
| 13666 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13667 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 13668 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.bssId, |
| 13669 | &pBSSSes); |
| 13670 | if ( NULL == pBSSSes ) |
| 13671 | { |
| 13672 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13673 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13674 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13675 | } |
| 13676 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13677 | wowlDelBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13678 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13679 | |
| 13680 | wowlDelBcPtrnReq.bssIdx = pBSSSes->ucBSSIdx; |
| 13681 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13682 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13683 | &wowlDelBcPtrnReq, |
| 13684 | sizeof(wowlDelBcPtrnReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13685 | |
| 13686 | pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13687 | pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13688 | |
| 13689 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13690 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13691 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13692 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13693 | wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 13694 | |
| 13695 | fail: |
| 13696 | // Release the message buffer so we don't leak |
| 13697 | wpalMemoryFree(pSendBuffer); |
| 13698 | |
| 13699 | failRequest: |
| 13700 | //WDA should have failure check to avoid the memory leak |
| 13701 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13702 | }/*WDI_ProcessWowlDelBcPtrnReq*/ |
| 13703 | |
| 13704 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13705 | @brief Process Wowl enter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13706 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13707 | |
| 13708 | @param pWDICtx: pointer to the WLAN DAL context |
| 13709 | pEventData: pointer to the event information structure |
| 13710 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13711 | @see |
| 13712 | @return Result of the function call |
| 13713 | */ |
| 13714 | WDI_Status |
| 13715 | WDI_ProcessWowlEnterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13716 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13717 | WDI_ControlBlockType* pWDICtx, |
| 13718 | WDI_EventInfoType* pEventData |
| 13719 | ) |
| 13720 | { |
| 13721 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL; |
| 13722 | WDI_WowlEnterReqCb wdiWowlEnterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13723 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13724 | wpt_uint16 usDataOffset = 0; |
| 13725 | wpt_uint16 usSendSize = 0; |
| 13726 | tHalWowlEnterParams wowlEnterReq; |
| 13727 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13728 | |
| 13729 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13730 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13731 | -------------------------------------------------------------------------*/ |
| 13732 | if (( NULL == pEventData ) || |
| 13733 | ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) || |
| 13734 | ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc))) |
| 13735 | { |
| 13736 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13737 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13738 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13739 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13740 | } |
| 13741 | |
| 13742 | /*----------------------------------------------------------------------- |
| 13743 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13744 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13745 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13746 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13747 | sizeof(wowlEnterReq), |
| 13748 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13749 | ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) ))) |
| 13750 | { |
| 13751 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13752 | "Unable to get send buffer in Wowl enter req %x %x %x", |
| 13753 | pEventData, pwdiWowlEnterParams, wdiWowlEnterCb); |
| 13754 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13755 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13756 | } |
| 13757 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13758 | wowlEnterReq.ucMagicPktEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13759 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13760 | wowlEnterReq.ucPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13761 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13762 | wowlEnterReq.ucUcastPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13763 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13764 | wowlEnterReq.ucWowChnlSwitchRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13765 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13766 | wowlEnterReq.ucWowDeauthRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13767 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13768 | wowlEnterReq.ucWowDisassocRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13769 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13770 | wowlEnterReq.ucWowMaxMissedBeacons = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13771 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13772 | wowlEnterReq.ucWowMaxSleepUsec = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13773 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec; |
| 13774 | |
| 13775 | #ifdef WLAN_WAKEUP_EVENTS |
| 13776 | wowlEnterReq.ucWoWEAPIDRequestEnable = |
| 13777 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable; |
| 13778 | |
| 13779 | wowlEnterReq.ucWoWEAPOL4WayEnable = |
| 13780 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable; |
| 13781 | |
| 13782 | wowlEnterReq.ucWowNetScanOffloadMatch = |
| 13783 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch; |
| 13784 | |
| 13785 | wowlEnterReq.ucWowGTKRekeyError = |
| 13786 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError; |
| 13787 | |
| 13788 | wowlEnterReq.ucWoWBSSConnLoss = |
| 13789 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss; |
| 13790 | #endif // WLAN_WAKEUP_EVENTS |
| 13791 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13792 | wowlEnterReq.bssIdx = pwdiWowlEnterParams->wdiWowlEnterInfo.bssIdx; |
| 13793 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13794 | wpalMemoryCopy(wowlEnterReq.magicPtrn, |
| 13795 | pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn, |
| 13796 | sizeof(tSirMacAddr)); |
| 13797 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13798 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13799 | &wowlEnterReq, |
| 13800 | sizeof(wowlEnterReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13801 | |
| 13802 | pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13803 | pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13804 | |
| 13805 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13806 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13807 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13808 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13809 | wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13810 | }/*WDI_ProcessWowlEnterReq*/ |
| 13811 | |
| 13812 | /** |
| 13813 | @brief Process Wowl exit Request function (called when Main FSM |
| 13814 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13815 | |
| 13816 | @param pWDICtx: pointer to the WLAN DAL context |
| 13817 | pEventData: pointer to the event information structure |
| 13818 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13819 | @see |
| 13820 | @return Result of the function call |
| 13821 | */ |
| 13822 | WDI_Status |
| 13823 | WDI_ProcessWowlExitReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13824 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13825 | WDI_ControlBlockType* pWDICtx, |
| 13826 | WDI_EventInfoType* pEventData |
| 13827 | ) |
| 13828 | { |
| 13829 | WDI_WowlExitReqCb wdiWowlExitCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13830 | WDI_WowlExitReqParamsType* pwdiWowlExitParams = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13831 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13832 | wpt_uint16 usDataOffset = 0; |
| 13833 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13834 | tHalWowlExitParams wowlExitparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13835 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13836 | |
| 13837 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13838 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13839 | -------------------------------------------------------------------------*/ |
| 13840 | if (( NULL == pEventData ) || |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13841 | ( NULL == (pwdiWowlExitParams = (WDI_WowlExitReqParamsType *)pEventData->pEventData)) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13842 | ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc))) |
| 13843 | { |
| 13844 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13845 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13846 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13847 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13848 | } |
| 13849 | |
| 13850 | /*----------------------------------------------------------------------- |
| 13851 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13852 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13853 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13854 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13855 | sizeof(wowlExitparams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13856 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13857 | ( usSendSize < (usDataOffset + sizeof(wowlExitparams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13858 | { |
| 13859 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13860 | "Unable to get send buffer in Wowl Exit req %x %x", |
| 13861 | pEventData, wdiWowlExitCb); |
| 13862 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13863 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13864 | } |
| 13865 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 13866 | wowlExitparams.bssIdx = pwdiWowlExitParams->wdiWowlExitInfo.bssIdx; |
| 13867 | |
| 13868 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13869 | &wowlExitparams, |
| 13870 | sizeof(wowlExitparams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13871 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13872 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13873 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13874 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13875 | wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13876 | }/*WDI_ProcessWowlExitReq*/ |
| 13877 | |
| 13878 | /** |
| 13879 | @brief Process Configure Apps Cpu Wakeup State Request function |
| 13880 | (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13881 | |
| 13882 | @param pWDICtx: pointer to the WLAN DAL context |
| 13883 | pEventData: pointer to the event information structure |
| 13884 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13885 | @see |
| 13886 | @return Result of the function call |
| 13887 | */ |
| 13888 | WDI_Status |
| 13889 | WDI_ProcessConfigureAppsCpuWakeupStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13890 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13891 | WDI_ControlBlockType* pWDICtx, |
| 13892 | WDI_EventInfoType* pEventData |
| 13893 | ) |
| 13894 | { |
| 13895 | WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL; |
| 13896 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13897 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13898 | wpt_uint16 usDataOffset = 0; |
| 13899 | wpt_uint16 usSendSize = 0; |
| 13900 | tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams; |
| 13901 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13902 | |
| 13903 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13904 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13905 | -------------------------------------------------------------------------*/ |
| 13906 | if (( NULL == pEventData ) || |
| 13907 | ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) || |
| 13908 | ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc))) |
| 13909 | { |
| 13910 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13911 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13912 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13913 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13914 | } |
| 13915 | |
| 13916 | /*----------------------------------------------------------------------- |
| 13917 | Get message buffer |
| 13918 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13919 | 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] | 13920 | sizeof(halCfgAppsCpuWakeupStateReqParams), |
| 13921 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13922 | ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) ))) |
| 13923 | { |
| 13924 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13925 | "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x", |
| 13926 | pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb); |
| 13927 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13928 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13929 | } |
| 13930 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13931 | halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13932 | pwdiAppsCpuWakeupStateParams->bIsAppsAwake; |
| 13933 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13934 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13935 | &halCfgAppsCpuWakeupStateReqParams, |
| 13936 | sizeof(halCfgAppsCpuWakeupStateReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13937 | |
| 13938 | pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13939 | pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13940 | |
| 13941 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13942 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13943 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13944 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13945 | wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData, |
| 13946 | WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13947 | }/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/ |
| 13948 | |
| 13949 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 13950 | /** |
| 13951 | @brief Process Aggregated Add TSpec Request function (called when Main FSM |
| 13952 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13953 | |
| 13954 | @param pWDICtx: pointer to the WLAN DAL context |
| 13955 | pEventData: pointer to the event information structure |
| 13956 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13957 | @see |
| 13958 | @return Result of the function call |
| 13959 | */ |
| 13960 | WDI_Status |
| 13961 | WDI_ProcessAggrAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13962 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13963 | WDI_ControlBlockType* pWDICtx, |
| 13964 | WDI_EventInfoType* pEventData |
| 13965 | ) |
| 13966 | { |
| 13967 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams; |
| 13968 | WDI_AggrAddTsRspCb wdiAggrAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13969 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13970 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13971 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13972 | wpt_uint16 usDataOffset = 0; |
| 13973 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13974 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13975 | wpt_macAddr macBSSID; |
| 13976 | tAggrAddTsReq halAggrAddTsReq; |
| 13977 | int i; |
| 13978 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13979 | |
| 13980 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13981 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13982 | -------------------------------------------------------------------------*/ |
| 13983 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 13984 | ( NULL == pEventData->pCBfnc )) |
| 13985 | { |
| 13986 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 13987 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13988 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13989 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13990 | } |
| 13991 | wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 ); |
| 13992 | pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData; |
| 13993 | wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc; |
| 13994 | /*------------------------------------------------------------------------- |
| 13995 | 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] | 13996 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13997 | -------------------------------------------------------------------------*/ |
| 13998 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13999 | |
| 14000 | /*------------------------------------------------------------------------ |
| 14001 | Find the BSS for which the request is made and identify WDI session |
| 14002 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14003 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 14004 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14005 | &macBSSID)) |
| 14006 | { |
| 14007 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14008 | "This station does not exist in the WDI Station Table %d"); |
| 14009 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14010 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14011 | } |
| 14012 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14013 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 14014 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14015 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14016 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14017 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 14018 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14019 | |
| 14020 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14021 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14022 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14023 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14024 | /*------------------------------------------------------------------------ |
| 14025 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14026 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14027 | ------------------------------------------------------------------------*/ |
| 14028 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 14029 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14030 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14031 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 14032 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14033 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14034 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14035 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14036 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14037 | } |
| 14038 | |
| 14039 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14040 | /*----------------------------------------------------------------------- |
| 14041 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14042 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14043 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14044 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14045 | sizeof(tAggrAddTsParams), |
| 14046 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 14047 | ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) ))) |
| 14048 | { |
| 14049 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14050 | "Unable to get send buffer in set bss key req %x %x %x", |
| 14051 | pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb); |
| 14052 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14053 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14054 | } |
| 14055 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14056 | halAggrAddTsReq.aggrAddTsParam.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14057 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14058 | halAggrAddTsReq.aggrAddTsParam.tspecIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14059 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx; |
| 14060 | |
| 14061 | for( i = 0; i < WLAN_HAL_MAX_AC; i++ ) |
| 14062 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14063 | halAggrAddTsReq.aggrAddTsParam.tspec[i].type = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14064 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14065 | halAggrAddTsReq.aggrAddTsParam.tspec[i].length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14066 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14067 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14068 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14069 | ackPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14070 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14071 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14072 | accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14073 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14074 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14075 | userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14076 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14077 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14078 | psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14079 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14080 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14081 | aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14082 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14083 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14084 | direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14085 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14086 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14087 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14088 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14089 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 14090 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14091 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14092 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14093 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14094 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14095 | |
| 14096 | |
| 14097 | halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14098 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14099 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14100 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14101 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14102 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14103 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14104 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14105 | halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14106 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14107 | halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14108 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14109 | halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14110 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14111 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14112 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14113 | halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14114 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14115 | halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14116 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14117 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14118 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14119 | halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14120 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14121 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14122 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14123 | halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14124 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14125 | halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14126 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime; |
| 14127 | } |
| 14128 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14129 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 14130 | &halAggrAddTsReq, |
| 14131 | sizeof(halAggrAddTsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14132 | |
| 14133 | pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14134 | pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14135 | |
| 14136 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14137 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14138 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14139 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14140 | wdiAggrAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14141 | WDI_AGGR_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14142 | }/*WDI_ProcessAggrAddTSpecReq*/ |
| 14143 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 14144 | |
| 14145 | /** |
| 14146 | @brief Process Shutdown Request function (called when Main FSM |
| 14147 | allows it) |
| 14148 | |
| 14149 | @param pWDICtx: pointer to the WLAN DAL context |
| 14150 | pEventData: pointer to the event information structure |
| 14151 | |
| 14152 | @see |
| 14153 | @return Result of the function call |
| 14154 | */ |
| 14155 | WDI_Status |
| 14156 | WDI_ProcessShutdownReq |
| 14157 | ( |
| 14158 | WDI_ControlBlockType* pWDICtx, |
| 14159 | WDI_EventInfoType* pEventData |
| 14160 | ) |
| 14161 | { |
| 14162 | wpt_status wptStatus; |
| 14163 | |
| 14164 | |
| 14165 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14166 | |
| 14167 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14168 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14169 | -------------------------------------------------------------------------*/ |
| 14170 | if ( NULL == pEventData ) |
| 14171 | { |
| 14172 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14173 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14174 | WDI_ASSERT(0); |
| 14175 | return WDI_STATUS_E_FAILURE; |
| 14176 | } |
| 14177 | |
| 14178 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14179 | |
| 14180 | |
| 14181 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 14182 | /*! TO DO: stop the data services */ |
| 14183 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 14184 | { |
| 14185 | /*Stop the STA Table !UT- check this logic again |
| 14186 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 14187 | WDI_STATableStop(pWDICtx); |
| 14188 | |
| 14189 | /* Stop Transport Driver, DXE */ |
| 14190 | WDTS_Stop(pWDICtx); |
| 14191 | } |
| 14192 | |
| 14193 | /*Clear all pending request*/ |
| 14194 | WDI_ClearPendingRequests(pWDICtx); |
| 14195 | /* Close Data transport*/ |
| 14196 | /* FTM mode does not open Data Path */ |
| 14197 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 14198 | { |
| 14199 | WDTS_Close(pWDICtx); |
| 14200 | } |
| 14201 | /*Close the STA Table !UT- check this logic again*/ |
| 14202 | WDI_STATableClose(pWDICtx); |
| 14203 | /*close the PAL */ |
| 14204 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 14205 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 14206 | { |
| 14207 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14208 | "Failed to wpal Close %d", wptStatus); |
| 14209 | WDI_ASSERT(0); |
| 14210 | } |
| 14211 | |
| 14212 | /*Transition back to init state*/ |
| 14213 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 14214 | |
| 14215 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14216 | |
| 14217 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14218 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14219 | |
| 14220 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14221 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14222 | }/*WDI_ProcessShutdownReq*/ |
| 14223 | |
| 14224 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14225 | Main DAL Control Path Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14226 | ========================================================================*/ |
| 14227 | |
| 14228 | /** |
| 14229 | @brief Process Start Response function (called when a response |
| 14230 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14231 | |
| 14232 | @param pWDICtx: pointer to the WLAN DAL context |
| 14233 | pEventData: pointer to the event information structure |
| 14234 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14235 | @see |
| 14236 | @return Result of the function call |
| 14237 | */ |
| 14238 | WDI_Status |
| 14239 | WDI_ProcessStartRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14240 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14241 | WDI_ControlBlockType* pWDICtx, |
| 14242 | WDI_EventInfoType* pEventData |
| 14243 | ) |
| 14244 | { |
| 14245 | WDI_StartRspParamsType wdiRspParams; |
| 14246 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 14247 | |
| 14248 | tHalMacStartRspParams* startRspParams; |
| 14249 | |
| 14250 | #ifndef HAL_SELF_STA_PER_BSS |
| 14251 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 14252 | #endif |
| 14253 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14254 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14255 | wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB; |
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 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14258 | -------------------------------------------------------------------------*/ |
| 14259 | if (( NULL == pEventData ) || |
| 14260 | ( NULL == pEventData->pEventData) || |
| 14261 | ( NULL == wdiStartRspCb )) |
| 14262 | { |
| 14263 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14264 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14265 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14266 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14267 | } |
| 14268 | |
| 14269 | /*------------------------------------------------------------------------- |
| 14270 | Extract response and send it to UMAC |
| 14271 | -------------------------------------------------------------------------*/ |
| 14272 | if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize ) |
| 14273 | { |
| 14274 | // not enough data was received |
| 14275 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 14276 | "Invalid response length in Start Resp Expect %x Rcvd %x", |
| 14277 | sizeof(tHalMacStartRspParams), pEventData->uEventDataSize); |
| 14278 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14279 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14280 | } |
| 14281 | |
| 14282 | /*------------------------------------------------------------------------- |
| 14283 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14284 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14285 | -------------------------------------------------------------------------*/ |
| 14286 | startRspParams = (tHalMacStartRspParams *) pEventData->pEventData; |
| 14287 | |
| 14288 | wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids; |
| 14289 | wdiRspParams.ucMaxStations = startRspParams->ucMaxStations; |
| 14290 | wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR; |
| 14291 | wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR; |
| 14292 | wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION; |
| 14293 | wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION; |
| 14294 | wdiRspParams.wlanReportedVersion.major = |
| 14295 | startRspParams->wcnssWlanVersion.major; |
| 14296 | wdiRspParams.wlanReportedVersion.minor = |
| 14297 | startRspParams->wcnssWlanVersion.minor; |
| 14298 | wdiRspParams.wlanReportedVersion.version = |
| 14299 | startRspParams->wcnssWlanVersion.version; |
| 14300 | wdiRspParams.wlanReportedVersion.revision = |
| 14301 | startRspParams->wcnssWlanVersion.revision; |
| 14302 | wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion, |
| 14303 | startRspParams->wcnssCrmVersionString, |
| 14304 | sizeof(wdiRspParams.wcnssSoftwareVersion)); |
| 14305 | wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion, |
| 14306 | startRspParams->wcnssWlanVersionString, |
| 14307 | sizeof(wdiRspParams.wcnssHardwareVersion)); |
| 14308 | wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status); |
| 14309 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 14310 | /*Save the HAL Version*/ |
| 14311 | pWDICtx->wlanVersion = wdiRspParams.wlanReportedVersion; |
| 14312 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14313 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14314 | if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus ) |
| 14315 | { |
| 14316 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 14317 | |
| 14318 | /*Cache the start response for further use*/ |
| 14319 | wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14320 | &wdiRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14321 | sizeof(pWDICtx->wdiCachedStartRspParams)); |
| 14322 | |
| 14323 | } |
| 14324 | else |
| 14325 | { |
| 14326 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14327 | "Failed to start device with status %s(%d)", |
| 14328 | WDI_getHALStatusMsgString(startRspParams->status), |
| 14329 | startRspParams->status); |
| 14330 | |
| 14331 | /*Set the expected state transition to stopped - because the start has |
| 14332 | failed*/ |
| 14333 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 14334 | |
| 14335 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14336 | |
| 14337 | /*Notify UMAC*/ |
| 14338 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14339 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14340 | WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus); |
| 14341 | |
| 14342 | /*Although the response is an error - it was processed by our function |
| 14343 | so as far as the caller is concerned this is a succesful reponse processing*/ |
| 14344 | return WDI_STATUS_SUCCESS; |
| 14345 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14346 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14347 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14348 | |
| 14349 | if(eDRIVER_TYPE_MFG == pWDICtx->driverMode) |
| 14350 | { |
| 14351 | /* FTM mode does not need to execute below */ |
| 14352 | /* Notify UMAC */ |
| 14353 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 14354 | return WDI_STATUS_SUCCESS; |
| 14355 | } |
| 14356 | |
| 14357 | /* START the Data transport */ |
| 14358 | WDTS_startTransport(pWDICtx); |
| 14359 | |
| 14360 | /*Start the STA Table !- check this logic again*/ |
| 14361 | WDI_STATableStart(pWDICtx); |
| 14362 | |
| 14363 | #ifndef HAL_SELF_STA_PER_BSS |
| 14364 | /* Store the Self STA Index */ |
| 14365 | pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx; |
| 14366 | |
| 14367 | pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId; |
| 14368 | wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta, |
| 14369 | WDI_MAC_ADDR_LEN); |
| 14370 | |
| 14371 | /* At this point add the self-STA */ |
| 14372 | |
| 14373 | /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */ |
| 14374 | /* !TO DO: wdiAddSTAParam.bcastDpuSignature */ |
| 14375 | /*! TO DO: wdiAddSTAParam.dpuSig */ |
| 14376 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 14377 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 14378 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 14379 | |
| 14380 | //all DPU indices are the same for self STA |
| 14381 | wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId; |
| 14382 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 14383 | wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14384 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta, |
| 14385 | WDI_MAC_ADDR_LEN); |
| 14386 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 14387 | wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx; |
| 14388 | |
| 14389 | /* Note: Since we don't get an explicit config STA request for self STA, we |
| 14390 | add the self STA upon receiving the Start response message. But the |
| 14391 | self STA entry in the table is deleted when WDI gets an explicit delete STA |
| 14392 | request */ |
| 14393 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 14394 | #endif |
| 14395 | |
| 14396 | /*Notify UMAC*/ |
| 14397 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 14398 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14399 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14400 | }/*WDI_ProcessStartRsp*/ |
| 14401 | |
| 14402 | |
| 14403 | /** |
| 14404 | @brief Process Stop Response function (called when a response |
| 14405 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14406 | |
| 14407 | @param pWDICtx: pointer to the WLAN DAL context |
| 14408 | pEventData: pointer to the event information structure |
| 14409 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14410 | @see |
| 14411 | @return Result of the function call |
| 14412 | */ |
| 14413 | WDI_Status |
| 14414 | WDI_ProcessStopRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14415 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14416 | WDI_ControlBlockType* pWDICtx, |
| 14417 | WDI_EventInfoType* pEventData |
| 14418 | ) |
| 14419 | { |
| 14420 | WDI_Status wdiStatus; |
| 14421 | WDI_StopRspCb wdiStopRspCb = NULL; |
| 14422 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14423 | tHalMacStopRspMsg halMacStopRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14424 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14425 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14426 | wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14427 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14428 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14429 | -------------------------------------------------------------------------*/ |
| 14430 | if (( NULL == pEventData ) || |
| 14431 | ( NULL == pEventData->pEventData) || |
| 14432 | ( NULL == wdiStopRspCb )) |
| 14433 | { |
| 14434 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14435 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14436 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14437 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14438 | } |
| 14439 | |
| 14440 | /*------------------------------------------------------------------------- |
| 14441 | Extract response and send it to UMAC |
| 14442 | -------------------------------------------------------------------------*/ |
| 14443 | if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize ) |
| 14444 | { |
| 14445 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14446 | "Invalid response length in Stop Resp %x %x", |
| 14447 | pEventData->uEventDataSize); |
| 14448 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14449 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14450 | } |
| 14451 | |
| 14452 | /*------------------------------------------------------------------------- |
| 14453 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14454 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14455 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14456 | wpalMemoryCopy( &halMacStopRspMsg.stopRspParams, |
| 14457 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14458 | sizeof(halMacStopRspMsg.stopRspParams)); |
| 14459 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14460 | wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14461 | |
| 14462 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14463 | |
| 14464 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14465 | Check to see if the stop went OK |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14466 | --------------------------------------------------------------------------*/ |
| 14467 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 14468 | { |
| 14469 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14470 | "Failed to stop the device with status %s (%d)", |
| 14471 | WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status), |
| 14472 | halMacStopRspMsg.stopRspParams.status); |
| 14473 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14474 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14475 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14476 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14477 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14478 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14480 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 14481 | |
| 14482 | /*Transition now as WDI may get preempted imediately after it sends |
| 14483 | up the Stop Response and it will not get to process the state transition |
| 14484 | from Main Rsp function*/ |
| 14485 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
| 14486 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14487 | |
| 14488 | /*! TO DO: - STOP the Data transport */ |
| 14489 | |
| 14490 | /*Notify UMAC*/ |
| 14491 | wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14492 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14493 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14494 | }/*WDI_ProcessStopRsp*/ |
| 14495 | |
| 14496 | /** |
| 14497 | @brief Process Close Rsp function (called when a response |
| 14498 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14499 | |
| 14500 | @param pWDICtx: pointer to the WLAN DAL context |
| 14501 | pEventData: pointer to the event information structure |
| 14502 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14503 | @see |
| 14504 | @return Result of the function call |
| 14505 | */ |
| 14506 | WDI_Status |
| 14507 | WDI_ProcessCloseRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14508 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14509 | WDI_ControlBlockType* pWDICtx, |
| 14510 | WDI_EventInfoType* pEventData |
| 14511 | ) |
| 14512 | { |
| 14513 | /*There is no close response comming from HAL - function just kept for |
| 14514 | simmetry */ |
| 14515 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14516 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14517 | }/*WDI_ProcessCloseRsp*/ |
| 14518 | |
| 14519 | |
| 14520 | /*============================================================================ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14521 | SCAN RESPONSE PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14522 | ============================================================================*/ |
| 14523 | |
| 14524 | /** |
| 14525 | @brief Process Init Scan Rsp function (called when a response |
| 14526 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14527 | |
| 14528 | @param pWDICtx: pointer to the WLAN DAL context |
| 14529 | pEventData: pointer to the event information structure |
| 14530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14531 | @see |
| 14532 | @return Result of the function call |
| 14533 | */ |
| 14534 | WDI_Status |
| 14535 | WDI_ProcessInitScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14536 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14537 | WDI_ControlBlockType* pWDICtx, |
| 14538 | WDI_EventInfoType* pEventData |
| 14539 | ) |
| 14540 | { |
| 14541 | WDI_Status wdiStatus; |
| 14542 | WDI_InitScanRspCb wdiInitScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14543 | tHalInitScanRspMsg halInitScanRspMsg; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 14544 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14545 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14546 | |
| 14547 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14548 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14549 | -------------------------------------------------------------------------*/ |
| 14550 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14551 | ( NULL == pEventData->pEventData)) |
| 14552 | { |
| 14553 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14554 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14555 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14556 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14557 | } |
| 14558 | |
| 14559 | wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB; |
| 14560 | if( NULL == wdiInitScanRspCb) |
| 14561 | { |
| 14562 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14563 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14564 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14565 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14566 | } |
| 14567 | |
| 14568 | /*------------------------------------------------------------------------- |
| 14569 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14570 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14571 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14572 | wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams, |
| 14573 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14574 | sizeof(halInitScanRspMsg.initScanRspParams)); |
| 14575 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14576 | wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14577 | |
| 14578 | if ( pWDICtx->bInBmps ) |
| 14579 | { |
| 14580 | // notify DTS that we are entering Full power |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 14581 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 14582 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) { |
| 14583 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 14584 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 14585 | WDI_ASSERT(0); |
| 14586 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14587 | } |
| 14588 | |
| 14589 | /*Notify UMAC*/ |
| 14590 | wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14591 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14592 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14593 | }/*WDI_ProcessInitScanRsp*/ |
| 14594 | |
| 14595 | |
| 14596 | /** |
| 14597 | @brief Process Start Scan Rsp function (called when a response |
| 14598 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14599 | |
| 14600 | @param pWDICtx: pointer to the WLAN DAL context |
| 14601 | pEventData: pointer to the event information structure |
| 14602 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14603 | @see |
| 14604 | @return Result of the function call |
| 14605 | */ |
| 14606 | WDI_Status |
| 14607 | WDI_ProcessStartScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14608 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14609 | WDI_ControlBlockType* pWDICtx, |
| 14610 | WDI_EventInfoType* pEventData |
| 14611 | ) |
| 14612 | { |
| 14613 | WDI_StartScanRspParamsType wdiStartScanParams; |
| 14614 | WDI_StartScanRspCb wdiStartScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14615 | |
| 14616 | tHalStartScanRspMsg halStartScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14617 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14618 | |
| 14619 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14620 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14621 | -------------------------------------------------------------------------*/ |
| 14622 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14623 | ( NULL == pEventData->pEventData)) |
| 14624 | { |
| 14625 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14626 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14627 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14628 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14629 | } |
| 14630 | |
| 14631 | wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB; |
| 14632 | if( NULL == wdiStartScanRspCb) |
| 14633 | { |
| 14634 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14635 | "%s: call back function is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14636 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14637 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14638 | } |
| 14639 | |
| 14640 | /*------------------------------------------------------------------------- |
| 14641 | Extract response and send it to UMAC |
| 14642 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14643 | wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams, |
| 14644 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14645 | sizeof(halStartScanRspMsg.startScanRspParams)); |
| 14646 | |
| 14647 | wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14648 | halStartScanRspMsg.startScanRspParams.status); |
| 14649 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14650 | wdiStartScanParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14651 | halStartScanRspMsg.startScanRspParams.txMgmtPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14652 | wpalMemoryCopy( wdiStartScanParams.aStartTSF, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14653 | halStartScanRspMsg.startScanRspParams.startTSF, |
| 14654 | 2); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14655 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14656 | |
| 14657 | if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status ) |
| 14658 | { |
| 14659 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14660 | "Start scan failed with status %s (%d)", |
| 14661 | WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status), |
| 14662 | halStartScanRspMsg.startScanRspParams.status); |
| 14663 | /* send the status to UMAC, don't return from here*/ |
| 14664 | } |
| 14665 | |
| 14666 | /*Notify UMAC*/ |
| 14667 | wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData); |
| 14668 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14669 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14670 | |
| 14671 | }/*WDI_ProcessStartScanRsp*/ |
| 14672 | |
| 14673 | |
| 14674 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14675 | @brief Process End Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14676 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14677 | |
| 14678 | @param pWDICtx: pointer to the WLAN DAL context |
| 14679 | pEventData: pointer to the event information structure |
| 14680 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14681 | @see |
| 14682 | @return Result of the function call |
| 14683 | */ |
| 14684 | WDI_Status |
| 14685 | WDI_ProcessEndScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14686 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14687 | WDI_ControlBlockType* pWDICtx, |
| 14688 | WDI_EventInfoType* pEventData |
| 14689 | ) |
| 14690 | { |
| 14691 | WDI_Status wdiStatus; |
| 14692 | tHalEndScanRspMsg halEndScanRspMsg; |
| 14693 | WDI_EndScanRspCb wdiEndScanRspCb; |
| 14694 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14695 | |
| 14696 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14697 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14698 | -------------------------------------------------------------------------*/ |
| 14699 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14700 | ( NULL == pEventData->pEventData)) |
| 14701 | { |
| 14702 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14703 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14704 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14705 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14706 | } |
| 14707 | |
| 14708 | wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB; |
| 14709 | |
| 14710 | /*------------------------------------------------------------------------- |
| 14711 | Extract response and send it to UMAC |
| 14712 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14713 | wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams, |
| 14714 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14715 | sizeof(halEndScanRspMsg.endScanRspParams)); |
| 14716 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14717 | wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14718 | |
| 14719 | if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status ) |
| 14720 | { |
| 14721 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14722 | "End Scan failed with status %s (%d )", |
| 14723 | WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status), |
| 14724 | halEndScanRspMsg.endScanRspParams.status); |
| 14725 | /* send the status to UMAC, don't return from here*/ |
| 14726 | } |
| 14727 | |
| 14728 | /*Notify UMAC*/ |
| 14729 | wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14730 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14731 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14732 | }/*WDI_ProcessEndScanRsp*/ |
| 14733 | |
| 14734 | |
| 14735 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14736 | @brief Process Finish Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14737 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14738 | |
| 14739 | @param pWDICtx: pointer to the WLAN DAL context |
| 14740 | pEventData: pointer to the event information structure |
| 14741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14742 | @see |
| 14743 | @return Result of the function call |
| 14744 | */ |
| 14745 | WDI_Status |
| 14746 | WDI_ProcessFinishScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14747 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14748 | WDI_ControlBlockType* pWDICtx, |
| 14749 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14750 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14751 | { |
| 14752 | WDI_Status wdiStatus; |
| 14753 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14754 | |
| 14755 | tHalFinishScanRspMsg halFinishScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14756 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14757 | |
| 14758 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14759 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14760 | -------------------------------------------------------------------------*/ |
| 14761 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14762 | ( NULL == pEventData->pEventData)) |
| 14763 | { |
| 14764 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14765 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14766 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14767 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14768 | } |
| 14769 | |
| 14770 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB; |
| 14771 | |
| 14772 | /*------------------------------------------------------------------------- |
| 14773 | Extract response and send it to UMAC |
| 14774 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14775 | wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status, |
| 14776 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14777 | sizeof(halFinishScanRspMsg.finishScanRspParams.status)); |
| 14778 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14779 | wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14780 | |
| 14781 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14782 | "Finish scan response reported status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14783 | halFinishScanRspMsg.finishScanRspParams.status); |
| 14784 | |
| 14785 | if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&& |
| 14786 | ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status )) |
| 14787 | { |
| 14788 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14789 | "Finish Scan failed with status %s (%d)", |
| 14790 | WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status), |
| 14791 | halFinishScanRspMsg.finishScanRspParams.status); |
| 14792 | /* send the status to UMAC, don't return from here*/ |
| 14793 | } |
| 14794 | |
| 14795 | /*Notify UMAC*/ |
| 14796 | wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14797 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14798 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14799 | }/*WDI_ProcessFinishScanRsp*/ |
| 14800 | |
| 14801 | /** |
| 14802 | @brief Process Join Response function (called when a response |
| 14803 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14804 | |
| 14805 | @param pWDICtx: pointer to the WLAN DAL context |
| 14806 | pEventData: pointer to the event information structure |
| 14807 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14808 | @see |
| 14809 | @return Result of the function call |
| 14810 | */ |
| 14811 | WDI_Status |
| 14812 | WDI_ProcessJoinRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14813 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14814 | WDI_ControlBlockType* pWDICtx, |
| 14815 | WDI_EventInfoType* pEventData |
| 14816 | ) |
| 14817 | { |
| 14818 | WDI_Status wdiStatus; |
| 14819 | WDI_JoinRspCb wdiJoinRspCb; |
| 14820 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14821 | |
| 14822 | tHalJoinRspMsg halJoinRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14823 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14824 | |
| 14825 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14826 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14827 | -------------------------------------------------------------------------*/ |
| 14828 | if (( NULL == pWDICtx ) || |
| 14829 | ( NULL == pWDICtx->pfncRspCB ) || |
| 14830 | ( NULL == pEventData ) || |
| 14831 | ( NULL == pEventData->pEventData)) |
| 14832 | { |
| 14833 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14834 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14835 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14836 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14837 | } |
| 14838 | |
| 14839 | wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB; |
| 14840 | |
| 14841 | /*------------------------------------------------------------------------- |
| 14842 | Extract response and send it to UMAC |
| 14843 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14844 | wpalMemoryCopy( &halJoinRspMsg.joinRspParams, |
| 14845 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14846 | sizeof(halJoinRspMsg.joinRspParams)); |
| 14847 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14848 | wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14849 | |
| 14850 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14851 | |
| 14852 | /*----------------------------------------------------------------------- |
| 14853 | Join response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14854 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14855 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14856 | if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14857 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14858 | { |
| 14859 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14860 | "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or " |
| 14861 | "association no longer in progress %d - mysterious HAL response", |
| 14862 | __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14863 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14864 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14865 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14866 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14867 | } |
| 14868 | |
| 14869 | pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx]; |
| 14870 | |
| 14871 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14872 | Join Response is only allowed in init state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14873 | -----------------------------------------------------------------------*/ |
| 14874 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14875 | { |
| 14876 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14877 | "Join only allowed in Joining state - failure state is %d " |
| 14878 | "strange HAL response", pBSSSes->wdiAssocState); |
| 14879 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14880 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14882 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14883 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14884 | } |
| 14885 | |
| 14886 | |
| 14887 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14888 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14889 | -----------------------------------------------------------------------*/ |
| 14890 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 14891 | { |
| 14892 | /*Association was failed by HAL - remove session*/ |
| 14893 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14894 | |
| 14895 | /*Association no longer in progress */ |
| 14896 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14897 | |
| 14898 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14899 | WDI_DequeueAssocRequest(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14900 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14901 | } |
| 14902 | else |
| 14903 | { |
| 14904 | /*Transition to state Joining - this may be redundant as we are supposed |
| 14905 | to be in this state already - but just to be safe*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14906 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14907 | } |
| 14908 | |
| 14909 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14910 | |
| 14911 | /*Notify UMAC*/ |
| 14912 | wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14913 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14914 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14915 | }/*WDI_ProcessJoinRsp*/ |
| 14916 | |
| 14917 | |
| 14918 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14919 | @brief Process Config BSS Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14920 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14921 | |
| 14922 | @param pWDICtx: pointer to the WLAN DAL context |
| 14923 | pEventData: pointer to the event information structure |
| 14924 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14925 | @see |
| 14926 | @return Result of the function call |
| 14927 | */ |
| 14928 | WDI_Status |
| 14929 | WDI_ProcessConfigBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14930 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14931 | WDI_ControlBlockType* pWDICtx, |
| 14932 | WDI_EventInfoType* pEventData |
| 14933 | ) |
| 14934 | { |
| 14935 | WDI_ConfigBSSRspParamsType wdiConfigBSSParams; |
| 14936 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14937 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14938 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14939 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14940 | tConfigBssRspMsg halConfigBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14941 | WDI_AddStaParams wdiBcastAddSTAParam = {0}; |
| 14942 | WDI_AddStaParams wdiAddSTAParam = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14943 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14944 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14945 | |
| 14946 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14947 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14948 | -------------------------------------------------------------------------*/ |
| 14949 | if (( NULL == pEventData ) || |
| 14950 | ( NULL == pEventData->pEventData)) |
| 14951 | { |
| 14952 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 14953 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14954 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14955 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14956 | } |
| 14957 | |
| 14958 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB; |
| 14959 | |
| 14960 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14961 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14962 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14963 | wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams, |
| 14964 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14965 | sizeof(halConfigBssRspMsg.configBssRspParams)); |
| 14966 | |
| 14967 | wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14968 | halConfigBssRspMsg.configBssRspParams.status); |
| 14969 | if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus) |
| 14970 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14971 | wpalMemoryCopy( wdiConfigBSSParams.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14972 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID, |
| 14973 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14974 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14975 | wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14976 | |
| 14977 | wdiConfigBSSParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14978 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14979 | |
| 14980 | wdiConfigBSSParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14981 | halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14983 | wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14984 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14985 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14986 | wdiConfigBSSParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14987 | halConfigBssRspMsg.configBssRspParams.txMgmtPower; |
| 14988 | #endif |
| 14989 | wpalMemoryCopy( wdiConfigBSSParams.macSTA, |
| 14990 | halConfigBssRspMsg.configBssRspParams.staMac, |
| 14991 | WDI_MAC_ADDR_LEN ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14992 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14993 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14994 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14995 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14996 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14997 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 14998 | wdiConfigBSSParams.macBSSID, |
| 14999 | &pBSSSes); |
| 15000 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15001 | /*----------------------------------------------------------------------- |
| 15002 | Config BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15003 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15004 | -----------------------------------------------------------------------*/ |
| 15005 | if ( NULL == pBSSSes ) |
| 15006 | { |
| 15007 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15008 | "Association sequence for this BSS does not yet exist " |
| 15009 | "- mysterious HAL response"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15010 | |
| 15011 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15012 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15013 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15014 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15015 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15017 | /*Save data for this BSS*/ |
| 15018 | pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType; |
| 15019 | pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15020 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15021 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15022 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15023 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15024 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15025 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15026 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15027 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15028 | pBSSSes->ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15029 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
| 15030 | pBSSSes->bcastStaIdx = |
| 15031 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15032 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15033 | /* !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] | 15034 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15035 | /*------------------------------------------------------------------------- |
| 15036 | Add Peer STA |
| 15037 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15038 | wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15039 | wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx; |
| 15040 | wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15042 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15043 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15044 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15045 | wdiAddSTAParam.ucHTCapable = |
| 15046 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable; |
| 15047 | wdiAddSTAParam.ucStaType = |
| 15048 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType; |
| 15049 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15050 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15051 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 15052 | halConfigBssRspMsg.configBssRspParams.staMac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15053 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15054 | |
| 15055 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 15056 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID , |
| 15057 | WDI_MAC_ADDR_LEN); |
| 15058 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15059 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15060 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15061 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15062 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15063 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15064 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15065 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15066 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15067 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15068 | wdiAddSTAParam.ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15069 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15070 | wdiAddSTAParam.ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15071 | halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15073 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 15074 | "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15075 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15076 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 15077 | /*------------------------------------------------------------------------- |
| 15078 | Add Broadcast STA only in AP mode |
| 15079 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15080 | if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15081 | WDI_BSS_OPERATIONAL_MODE_AP ) |
| 15082 | { |
| 15083 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 15084 | "Add BCAST STA to table for index: %d", |
| 15085 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15086 | |
| 15087 | wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15088 | sizeof(WDI_AddStaParams) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15090 | WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam, |
| 15091 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
| 15092 | } |
| 15093 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15094 | } |
| 15095 | else |
| 15096 | { |
| 15097 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15098 | "Config BSS RSP failed with status : %s(%d)", |
| 15099 | WDI_getHALStatusMsgString( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15100 | halConfigBssRspMsg.configBssRspParams.status), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15101 | halConfigBssRspMsg.configBssRspParams.status); |
| 15102 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15103 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15104 | /*Association was failed by HAL - remove session*/ |
| 15105 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15106 | |
| 15107 | /*Association no longer in progress */ |
| 15108 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 15109 | |
| 15110 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 15111 | WDI_DequeueAssocRequest(pWDICtx); |
| 15112 | |
| 15113 | } |
| 15114 | |
| 15115 | /*Notify UMAC*/ |
| 15116 | wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData); |
| 15117 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15118 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15119 | }/*WDI_ProcessConfigBSSRsp*/ |
| 15120 | |
| 15121 | |
| 15122 | /** |
| 15123 | @brief Process Del BSS Response function (called when a response |
| 15124 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15125 | |
| 15126 | @param pWDICtx: pointer to the WLAN DAL context |
| 15127 | pEventData: pointer to the event information structure |
| 15128 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15129 | @see |
| 15130 | @return Result of the function call |
| 15131 | */ |
| 15132 | WDI_Status |
| 15133 | WDI_ProcessDelBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15134 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15135 | WDI_ControlBlockType* pWDICtx, |
| 15136 | WDI_EventInfoType* pEventData |
| 15137 | ) |
| 15138 | { |
| 15139 | WDI_DelBSSRspParamsType wdiDelBSSParams; |
| 15140 | WDI_DelBSSRspCb wdiDelBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15141 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15142 | WDI_BSSSessionType* pBSSSes = NULL; |
| 15143 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15144 | tDeleteBssRspMsg halDelBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15145 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15146 | |
| 15147 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15148 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15149 | -------------------------------------------------------------------------*/ |
| 15150 | if (( NULL == pEventData ) || |
| 15151 | ( NULL == pEventData->pEventData)) |
| 15152 | { |
| 15153 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15154 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15155 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15156 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15157 | } |
| 15158 | |
| 15159 | wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB; |
| 15160 | |
| 15161 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15162 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15163 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15164 | wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams, |
| 15165 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15166 | sizeof(halDelBssRspMsg.deleteBssRspParams)); |
| 15167 | |
| 15168 | |
| 15169 | wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15170 | halDelBssRspMsg.deleteBssRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15171 | |
| 15172 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15173 | |
| 15174 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15175 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15176 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15177 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 15178 | halDelBssRspMsg.deleteBssRspParams.bssIdx, |
| 15179 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15180 | |
| 15181 | /*----------------------------------------------------------------------- |
| 15182 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15183 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15184 | -----------------------------------------------------------------------*/ |
| 15185 | if ( NULL == pBSSSes ) |
| 15186 | { |
| 15187 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15188 | "Association sequence for this BSS does not yet exist or " |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15189 | "association no longer in progress - mysterious HAL response"); |
| 15190 | |
| 15191 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15192 | |
| 15193 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15194 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15195 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15196 | |
| 15197 | /*Extract BSSID for the response to UMAC*/ |
| 15198 | wpalMemoryCopy(wdiDelBSSParams.macBSSID, |
| 15199 | pBSSSes->macBSSID, WDI_MAC_ADDR_LEN); |
| 15200 | |
| 15201 | wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx; |
| 15202 | |
| 15203 | /*----------------------------------------------------------------------- |
| 15204 | The current session will be deleted |
| 15205 | -----------------------------------------------------------------------*/ |
| 15206 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15207 | |
| 15208 | |
| 15209 | /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */ |
| 15210 | if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15211 | { |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15212 | (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx ); |
Madan Mohan Koyyalamudi | f371f17 | 2012-10-31 16:35:43 -0700 | [diff] [blame] | 15213 | } |
Madan Mohan Koyyalamudi | cbb9f54 | 2012-11-15 17:30:05 -0800 | [diff] [blame] | 15214 | |
| 15215 | /* Delete the STA's in this BSS */ |
| 15216 | WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx); |
| 15217 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15218 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15219 | |
| 15220 | /*Notify UMAC*/ |
| 15221 | wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData); |
| 15222 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15223 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15224 | }/*WDI_ProcessDelBSSRsp*/ |
| 15225 | |
| 15226 | /** |
| 15227 | @brief Process Post Assoc Rsp function (called when a response |
| 15228 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15229 | |
| 15230 | @param pWDICtx: pointer to the WLAN DAL context |
| 15231 | pEventData: pointer to the event information structure |
| 15232 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15233 | @see |
| 15234 | @return Result of the function call |
| 15235 | */ |
| 15236 | WDI_Status |
| 15237 | WDI_ProcessPostAssocRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15238 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15239 | WDI_ControlBlockType* pWDICtx, |
| 15240 | WDI_EventInfoType* pEventData |
| 15241 | ) |
| 15242 | { |
| 15243 | WDI_PostAssocRspParamsType wdiPostAssocParams; |
| 15244 | WDI_PostAssocRspCb wdiPostAssocRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15245 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15246 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15247 | tPostAssocRspMsg halPostAssocRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15248 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15249 | |
| 15250 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15251 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15252 | -------------------------------------------------------------------------*/ |
| 15253 | if (( NULL == pEventData ) || |
| 15254 | ( NULL == pEventData->pEventData)) |
| 15255 | { |
| 15256 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15257 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15258 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15259 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15260 | } |
| 15261 | |
| 15262 | wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB; |
| 15263 | |
| 15264 | /*------------------------------------------------------------------------- |
| 15265 | Extract response and send it to UMAC |
| 15266 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15267 | wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams, |
| 15268 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15269 | sizeof(halPostAssocRspMsg.postAssocRspParams)); |
| 15270 | |
| 15271 | /*Extract the Post Assoc STA Params */ |
| 15272 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15273 | wdiPostAssocParams.staParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15274 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15275 | wdiPostAssocParams.staParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15276 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15277 | wdiPostAssocParams.staParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15278 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 15279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15280 | wdiPostAssocParams.wdiStatus = |
| 15281 | WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15282 | |
| 15283 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 15284 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15285 | wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA, |
| 15286 | pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15287 | WDI_MAC_ADDR_LEN); |
| 15288 | |
| 15289 | /* Extract Post Assoc BSS Params */ |
| 15290 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15291 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID, |
| 15292 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID, |
| 15293 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15294 | |
| 15295 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 15296 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15297 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15298 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext |
| 15299 | .macSTA, WDI_MAC_ADDR_LEN); |
| 15300 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15301 | wdiPostAssocParams.bssParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15302 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 15303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15304 | wdiPostAssocParams.bssParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15305 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
| 15306 | |
| 15307 | wdiPostAssocParams.bssParams.ucBSSIdx = |
| 15308 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 15309 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15310 | wdiPostAssocParams.bssParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15311 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx; |
| 15312 | |
| 15313 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15314 | |
| 15315 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15316 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15317 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15318 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15319 | wdiPostAssocParams.bssParams. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15320 | macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15321 | |
| 15322 | /*----------------------------------------------------------------------- |
| 15323 | Post assoc response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15324 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15325 | -----------------------------------------------------------------------*/ |
| 15326 | if (( NULL == pBSSSes ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15327 | ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15328 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 15329 | { |
| 15330 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15331 | "Association sequence for this BSS does not yet exist or " |
| 15332 | "association no longer in progress - mysterious HAL response"); |
| 15333 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15334 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15335 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15336 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15337 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15338 | } |
| 15339 | |
| 15340 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15341 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15342 | -----------------------------------------------------------------------*/ |
| 15343 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 15344 | { |
| 15345 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15346 | "Post Assoc not allowed before JOIN - failing request " |
| 15347 | "strange HAL response"); |
| 15348 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15349 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 15350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15351 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15352 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15353 | } |
| 15354 | |
| 15355 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15356 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15357 | -----------------------------------------------------------------------*/ |
| 15358 | if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus ) |
| 15359 | { |
| 15360 | /*Association was failed by HAL - remove session*/ |
| 15361 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 15362 | } |
| 15363 | else |
| 15364 | { |
| 15365 | /*Transition to state POST Assoc*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15366 | pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15367 | |
| 15368 | /*Save DPU Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15369 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15370 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15371 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15372 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15373 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15374 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15375 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15376 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature; |
| 15377 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15378 | pBSSSes->ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15379 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 15380 | } |
| 15381 | |
| 15382 | /*Association no longer in progress */ |
| 15383 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 15384 | |
| 15385 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 15386 | WDI_DequeueAssocRequest(pWDICtx); |
| 15387 | |
| 15388 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 15389 | |
| 15390 | /*Notify UMAC*/ |
| 15391 | wdiPostAssocRspCb( &wdiPostAssocParams, pWDICtx->pRspCBUserData); |
| 15392 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15393 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15394 | }/*WDI_ProcessPostAssocRsp*/ |
| 15395 | |
| 15396 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15397 | @brief Process Del STA Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15398 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15399 | |
| 15400 | @param pWDICtx: pointer to the WLAN DAL context |
| 15401 | pEventData: pointer to the event information structure |
| 15402 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15403 | @see |
| 15404 | @return Result of the function call |
| 15405 | */ |
| 15406 | WDI_Status |
| 15407 | WDI_ProcessDelSTARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15408 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15409 | WDI_ControlBlockType* pWDICtx, |
| 15410 | WDI_EventInfoType* pEventData |
| 15411 | ) |
| 15412 | { |
| 15413 | WDI_DelSTARspParamsType wdiDelSTARsp; |
| 15414 | WDI_DelSTARspCb wdiDelSTARspCb; |
| 15415 | wpt_uint8 staType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15416 | tDeleteStaRspMsg halDelStaRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15417 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15418 | |
| 15419 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15420 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15421 | -------------------------------------------------------------------------*/ |
| 15422 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15423 | ( NULL == pEventData->pEventData)) |
| 15424 | { |
| 15425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15426 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15427 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15428 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15429 | } |
| 15430 | |
| 15431 | wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB; |
| 15432 | |
| 15433 | /*------------------------------------------------------------------------- |
| 15434 | Extract response and send it to UMAC |
| 15435 | -------------------------------------------------------------------------*/ |
| 15436 | wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15437 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15438 | sizeof(halDelStaRspMsg.delStaRspParams)); |
| 15439 | |
| 15440 | wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15441 | wdiDelSTARsp.wdiStatus = |
| 15442 | WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15443 | |
| 15444 | WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType); |
| 15445 | |
| 15446 | /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */ |
| 15447 | if(staType == WDI_STA_ENTRY_SELF) |
| 15448 | { |
| 15449 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 15450 | |
| 15451 | /* At this point add the self-STA */ |
| 15452 | |
| 15453 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 15454 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 15455 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 15456 | |
| 15457 | #define WDI_DPU_SELF_STA_DEFAULT_IDX 0 |
| 15458 | #define WDI_DPU_SELF_STA_DEFAULT_SIG 0 |
| 15459 | |
| 15460 | //all DPU indices are the same for self STA |
| 15461 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 15462 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 15463 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 15464 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 15465 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 15466 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG; |
Madan Mohan Koyyalamudi | 15a48f0 | 2012-10-05 17:13:53 -0700 | [diff] [blame] | 15467 | |
| 15468 | pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15469 | } |
| 15470 | else |
| 15471 | { |
| 15472 | //Delete the station in the table |
| 15473 | WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx); |
| 15474 | } |
| 15475 | |
| 15476 | /*Notify UMAC*/ |
| 15477 | wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData); |
| 15478 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15479 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15480 | }/*WDI_ProcessDelSTARsp*/ |
| 15481 | |
| 15482 | |
| 15483 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15484 | Security Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15485 | ==========================================================================*/ |
| 15486 | |
| 15487 | /** |
| 15488 | @brief Process Set BSS Key Rsp function (called when a response |
| 15489 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15490 | |
| 15491 | @param pWDICtx: pointer to the WLAN DAL context |
| 15492 | pEventData: pointer to the event information structure |
| 15493 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15494 | @see |
| 15495 | @return Result of the function call |
| 15496 | */ |
| 15497 | WDI_Status |
| 15498 | WDI_ProcessSetBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15499 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15500 | WDI_ControlBlockType* pWDICtx, |
| 15501 | WDI_EventInfoType* pEventData |
| 15502 | ) |
| 15503 | { |
| 15504 | WDI_Status wdiStatus; |
| 15505 | eHalStatus halStatus; |
| 15506 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
| 15507 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15508 | |
| 15509 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15510 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15511 | -------------------------------------------------------------------------*/ |
| 15512 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15513 | ( NULL == pEventData->pEventData)) |
| 15514 | { |
| 15515 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15516 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15517 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15518 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15519 | } |
| 15520 | |
| 15521 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 15522 | |
| 15523 | /*------------------------------------------------------------------------- |
| 15524 | Extract response and send it to UMAC |
| 15525 | -------------------------------------------------------------------------*/ |
| 15526 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15527 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15528 | |
| 15529 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15530 | { |
| 15531 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15532 | "Set BSS Key failed with status %s (%d)", |
| 15533 | WDI_getHALStatusMsgString(halStatus), |
| 15534 | halStatus); |
| 15535 | /* send the status to UMAC, don't return from here*/ |
| 15536 | } |
| 15537 | |
| 15538 | /*Notify UMAC*/ |
| 15539 | wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15540 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15541 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15542 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 15543 | |
| 15544 | /** |
| 15545 | @brief Process Remove BSS Key Rsp function (called when a response |
| 15546 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15547 | |
| 15548 | @param pWDICtx: pointer to the WLAN DAL context |
| 15549 | pEventData: pointer to the event information structure |
| 15550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15551 | @see |
| 15552 | @return Result of the function call |
| 15553 | */ |
| 15554 | WDI_Status |
| 15555 | WDI_ProcessRemoveBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15556 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15557 | WDI_ControlBlockType* pWDICtx, |
| 15558 | WDI_EventInfoType* pEventData |
| 15559 | ) |
| 15560 | { |
| 15561 | WDI_Status wdiStatus; |
| 15562 | eHalStatus halStatus; |
| 15563 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
| 15564 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15565 | |
| 15566 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15567 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15568 | -------------------------------------------------------------------------*/ |
| 15569 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15570 | ( NULL == pEventData->pEventData)) |
| 15571 | { |
| 15572 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15573 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15574 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15575 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15576 | } |
| 15577 | |
| 15578 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 15579 | |
| 15580 | /*------------------------------------------------------------------------- |
| 15581 | Extract response and send it to UMAC |
| 15582 | -------------------------------------------------------------------------*/ |
| 15583 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15584 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15585 | |
| 15586 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15587 | { |
| 15588 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15589 | "Remove BSS Key failed with status %s (%d )", |
| 15590 | WDI_getHALStatusMsgString(halStatus), |
| 15591 | halStatus); |
| 15592 | /* send the status to UMAC, don't return from here*/ |
| 15593 | } |
| 15594 | |
| 15595 | /*Notify UMAC*/ |
| 15596 | wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15597 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15598 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15599 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 15600 | |
| 15601 | |
| 15602 | /** |
| 15603 | @brief Process Set STA Key Rsp function (called when a response |
| 15604 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15605 | |
| 15606 | @param pWDICtx: pointer to the WLAN DAL context |
| 15607 | pEventData: pointer to the event information structure |
| 15608 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15609 | @see |
| 15610 | @return Result of the function call |
| 15611 | */ |
| 15612 | WDI_Status |
| 15613 | WDI_ProcessSetStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15614 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15615 | WDI_ControlBlockType* pWDICtx, |
| 15616 | WDI_EventInfoType* pEventData |
| 15617 | ) |
| 15618 | { |
| 15619 | WDI_Status wdiStatus; |
| 15620 | eHalStatus halStatus; |
| 15621 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 15622 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15623 | |
| 15624 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15625 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15626 | -------------------------------------------------------------------------*/ |
| 15627 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15628 | ( NULL == pEventData->pEventData)) |
| 15629 | { |
| 15630 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15631 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15632 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15633 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15634 | } |
| 15635 | |
| 15636 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15637 | |
| 15638 | /*------------------------------------------------------------------------- |
| 15639 | Extract response and send it to UMAC |
| 15640 | -------------------------------------------------------------------------*/ |
| 15641 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15642 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15643 | |
| 15644 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15645 | { |
| 15646 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15647 | "Set STA Key failed with status %s (%d)", |
| 15648 | WDI_getHALStatusMsgString(halStatus), |
| 15649 | halStatus); |
| 15650 | /* send the status to UMAC, don't return from here*/ |
| 15651 | } |
| 15652 | |
| 15653 | /*Notify UMAC*/ |
| 15654 | wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15655 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15656 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15657 | }/*WDI_ProcessSetSTAKeyRsp*/ |
| 15658 | |
| 15659 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15660 | @brief Process Remove STA Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15661 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15662 | |
| 15663 | @param pWDICtx: pointer to the WLAN DAL context |
| 15664 | pEventData: pointer to the event information structure |
| 15665 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15666 | @see |
| 15667 | @return Result of the function call |
| 15668 | */ |
| 15669 | WDI_Status |
| 15670 | WDI_ProcessRemoveStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15671 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15672 | WDI_ControlBlockType* pWDICtx, |
| 15673 | WDI_EventInfoType* pEventData |
| 15674 | ) |
| 15675 | { |
| 15676 | WDI_Status wdiStatus; |
| 15677 | eHalStatus halStatus; |
| 15678 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 15679 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15680 | |
| 15681 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15682 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15683 | -------------------------------------------------------------------------*/ |
| 15684 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15685 | ( NULL == pEventData->pEventData)) |
| 15686 | { |
| 15687 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15688 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15689 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15690 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15691 | } |
| 15692 | |
| 15693 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15694 | |
| 15695 | /*------------------------------------------------------------------------- |
| 15696 | Extract response and send it to UMAC |
| 15697 | -------------------------------------------------------------------------*/ |
| 15698 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15699 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15700 | |
| 15701 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15702 | { |
| 15703 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15704 | "Remove STA Key failed with status %s (%d)", |
| 15705 | WDI_getHALStatusMsgString(halStatus), |
| 15706 | halStatus); |
| 15707 | /* send the status to UMAC, don't return from here*/ |
| 15708 | } |
| 15709 | |
| 15710 | /*Notify UMAC*/ |
| 15711 | wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15712 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15713 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15714 | }/*WDI_ProcessRemoveStaKeyRsp*/ |
| 15715 | |
| 15716 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15717 | @brief Process Set STA Bcast Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15718 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15719 | |
| 15720 | @param pWDICtx: pointer to the WLAN DAL context |
| 15721 | pEventData: pointer to the event information structure |
| 15722 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15723 | @see |
| 15724 | @return Result of the function call |
| 15725 | */ |
| 15726 | WDI_Status |
| 15727 | WDI_ProcessSetStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15728 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15729 | WDI_ControlBlockType* pWDICtx, |
| 15730 | WDI_EventInfoType* pEventData |
| 15731 | ) |
| 15732 | { |
| 15733 | WDI_Status wdiStatus; |
| 15734 | eHalStatus halStatus; |
| 15735 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb; |
| 15736 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15737 | |
| 15738 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15739 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15740 | -------------------------------------------------------------------------*/ |
| 15741 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15742 | ( NULL == pEventData->pEventData)) |
| 15743 | { |
| 15744 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15745 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15746 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15747 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15748 | } |
| 15749 | |
| 15750 | wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15751 | |
| 15752 | /*------------------------------------------------------------------------- |
| 15753 | Extract response and send it to UMAC |
| 15754 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15755 | wpalMemoryCopy( &halStatus, |
| 15756 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15757 | sizeof(halStatus)); |
| 15758 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15759 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15760 | |
| 15761 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15762 | { |
| 15763 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15764 | "Set STA Key failed with status %s (%d)", |
| 15765 | WDI_getHALStatusMsgString(halStatus), |
| 15766 | halStatus); |
| 15767 | /* send the status to UMAC, don't return from here*/ |
| 15768 | } |
| 15769 | |
| 15770 | /*Notify UMAC*/ |
| 15771 | wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15772 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15773 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15774 | }/*WDI_ProcessSetSTABcastKeyRsp*/ |
| 15775 | |
| 15776 | /** |
| 15777 | @brief Process Remove STA Bcast Key Rsp function (called when a |
| 15778 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15779 | |
| 15780 | @param pWDICtx: pointer to the WLAN DAL context |
| 15781 | pEventData: pointer to the event information structure |
| 15782 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15783 | @see |
| 15784 | @return Result of the function call |
| 15785 | */ |
| 15786 | WDI_Status |
| 15787 | WDI_ProcessRemoveStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15788 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15789 | WDI_ControlBlockType* pWDICtx, |
| 15790 | WDI_EventInfoType* pEventData |
| 15791 | ) |
| 15792 | { |
| 15793 | WDI_Status wdiStatus; |
| 15794 | eHalStatus halStatus; |
| 15795 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb; |
| 15796 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15797 | |
| 15798 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15799 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15800 | -------------------------------------------------------------------------*/ |
| 15801 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15802 | ( NULL == pEventData->pEventData)) |
| 15803 | { |
| 15804 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15805 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15806 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15807 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15808 | } |
| 15809 | |
| 15810 | wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15811 | |
| 15812 | /*------------------------------------------------------------------------- |
| 15813 | Extract response and send it to UMAC |
| 15814 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15815 | wpalMemoryCopy( &halStatus, |
| 15816 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15817 | sizeof(halStatus)); |
| 15818 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15819 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15820 | |
| 15821 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15822 | { |
| 15823 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15824 | "Remove STA Key failed with status %s (%d)", |
| 15825 | WDI_getHALStatusMsgString(halStatus), |
| 15826 | halStatus); |
| 15827 | /* send the status to UMAC, don't return from here*/ |
| 15828 | } |
| 15829 | |
| 15830 | /*Notify UMAC*/ |
| 15831 | wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15832 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15833 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15834 | }/*WDI_ProcessRemoveStaBcastKeyRsp*/ |
| 15835 | |
| 15836 | |
| 15837 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15838 | QoS and BA Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15839 | ==========================================================================*/ |
| 15840 | |
| 15841 | /** |
| 15842 | @brief Process Add TSpec Rsp function (called when a response |
| 15843 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15844 | |
| 15845 | @param pWDICtx: pointer to the WLAN DAL context |
| 15846 | pEventData: pointer to the event information structure |
| 15847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15848 | @see |
| 15849 | @return Result of the function call |
| 15850 | */ |
| 15851 | WDI_Status |
| 15852 | WDI_ProcessAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15853 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15854 | WDI_ControlBlockType* pWDICtx, |
| 15855 | WDI_EventInfoType* pEventData |
| 15856 | ) |
| 15857 | { |
| 15858 | WDI_Status wdiStatus; |
| 15859 | eHalStatus halStatus; |
| 15860 | WDI_AddTsRspCb wdiAddTsRspCb; |
| 15861 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15862 | |
| 15863 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15864 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15865 | -------------------------------------------------------------------------*/ |
| 15866 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15867 | ( NULL == pEventData->pEventData)) |
| 15868 | { |
| 15869 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15870 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15871 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15872 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15873 | } |
| 15874 | |
| 15875 | wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 15876 | |
| 15877 | /*------------------------------------------------------------------------- |
| 15878 | Extract response and send it to UMAC |
| 15879 | -------------------------------------------------------------------------*/ |
| 15880 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15881 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15882 | |
| 15883 | /*Notify UMAC*/ |
| 15884 | wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15885 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15886 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15887 | }/*WDI_ProcessAddTSpecRsp*/ |
| 15888 | |
| 15889 | |
| 15890 | /** |
| 15891 | @brief Process Del TSpec Rsp function (called when a response |
| 15892 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15893 | |
| 15894 | @param pWDICtx: pointer to the WLAN DAL context |
| 15895 | pEventData: pointer to the event information structure |
| 15896 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15897 | @see |
| 15898 | @return Result of the function call |
| 15899 | */ |
| 15900 | WDI_Status |
| 15901 | WDI_ProcessDelTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15902 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15903 | WDI_ControlBlockType* pWDICtx, |
| 15904 | WDI_EventInfoType* pEventData |
| 15905 | ) |
| 15906 | { |
| 15907 | WDI_Status wdiStatus; |
| 15908 | eHalStatus halStatus; |
| 15909 | WDI_DelTsRspCb wdiDelTsRspCb; |
| 15910 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15911 | |
| 15912 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15913 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15914 | -------------------------------------------------------------------------*/ |
| 15915 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15916 | ( NULL == pEventData->pEventData)) |
| 15917 | { |
| 15918 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15919 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15920 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15921 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15922 | } |
| 15923 | |
| 15924 | wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB; |
| 15925 | |
| 15926 | /*------------------------------------------------------------------------- |
| 15927 | Extract response and send it to UMAC |
| 15928 | -------------------------------------------------------------------------*/ |
| 15929 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15930 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15931 | |
| 15932 | /*Notify UMAC*/ |
| 15933 | wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15934 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15935 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15936 | }/*WDI_ProcessDelTSpecRsp*/ |
| 15937 | |
| 15938 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15939 | @brief Process Update EDCA Parameters Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15940 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15941 | |
| 15942 | @param pWDICtx: pointer to the WLAN DAL context |
| 15943 | pEventData: pointer to the event information structure |
| 15944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15945 | @see |
| 15946 | @return Result of the function call |
| 15947 | */ |
| 15948 | WDI_Status |
| 15949 | WDI_ProcessUpdateEDCAParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15950 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15951 | WDI_ControlBlockType* pWDICtx, |
| 15952 | WDI_EventInfoType* pEventData |
| 15953 | ) |
| 15954 | { |
| 15955 | WDI_Status wdiStatus; |
| 15956 | eHalStatus halStatus; |
| 15957 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb; |
| 15958 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15959 | |
| 15960 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15961 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15962 | -------------------------------------------------------------------------*/ |
| 15963 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15964 | ( NULL == pEventData->pEventData)) |
| 15965 | { |
| 15966 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 15967 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15968 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15969 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15970 | } |
| 15971 | |
| 15972 | wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB; |
| 15973 | |
| 15974 | /*------------------------------------------------------------------------- |
| 15975 | Extract response and send it to UMAC |
| 15976 | -------------------------------------------------------------------------*/ |
| 15977 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15978 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15979 | |
| 15980 | /*Notify UMAC*/ |
| 15981 | wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15982 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15983 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15984 | }/*WDI_ProcessUpdateEDCAParamsRsp*/ |
| 15985 | |
| 15986 | |
| 15987 | /** |
| 15988 | @brief Process Add BA Rsp function (called when a response |
| 15989 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15990 | |
| 15991 | @param pWDICtx: pointer to the WLAN DAL context |
| 15992 | pEventData: pointer to the event information structure |
| 15993 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15994 | @see |
| 15995 | @return Result of the function call |
| 15996 | */ |
| 15997 | WDI_Status |
| 15998 | WDI_ProcessAddBASessionRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15999 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16000 | WDI_ControlBlockType* pWDICtx, |
| 16001 | WDI_EventInfoType* pEventData |
| 16002 | ) |
| 16003 | { |
| 16004 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
| 16005 | |
| 16006 | tAddBASessionRspParams halBASessionRsp; |
| 16007 | WDI_AddBASessionRspParamsType wdiBASessionRsp; |
| 16008 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16009 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16010 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16011 | |
| 16012 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16013 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16014 | -------------------------------------------------------------------------*/ |
| 16015 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16016 | ( NULL == pEventData->pEventData)) |
| 16017 | { |
| 16018 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16019 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16020 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16021 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16022 | } |
| 16023 | |
| 16024 | wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB; |
| 16025 | |
| 16026 | /*------------------------------------------------------------------------- |
| 16027 | Extract response and send it to UMAC |
| 16028 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16029 | wpalMemoryCopy( &halBASessionRsp, |
| 16030 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16031 | sizeof(halBASessionRsp)); |
| 16032 | |
| 16033 | wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status); |
| 16034 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 16035 | if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16036 | { |
| 16037 | wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken; |
| 16038 | wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID; |
| 16039 | wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize; |
| 16040 | wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID; |
| 16041 | wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize; |
| 16042 | wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID; |
| 16043 | wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN; |
| 16044 | } |
| 16045 | |
| 16046 | /*Notify UMAC*/ |
| 16047 | wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData); |
| 16048 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16049 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16050 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16051 | |
| 16052 | |
| 16053 | /** |
| 16054 | @brief Process Del BA Rsp function (called when a response |
| 16055 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16056 | |
| 16057 | @param pWDICtx: pointer to the WLAN DAL context |
| 16058 | pEventData: pointer to the event information structure |
| 16059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16060 | @see |
| 16061 | @return Result of the function call |
| 16062 | */ |
| 16063 | WDI_Status |
| 16064 | WDI_ProcessDelBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16065 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16066 | WDI_ControlBlockType* pWDICtx, |
| 16067 | WDI_EventInfoType* pEventData |
| 16068 | ) |
| 16069 | { |
| 16070 | WDI_Status wdiStatus; |
| 16071 | eHalStatus halStatus; |
| 16072 | WDI_DelBARspCb wdiDelBARspCb; |
| 16073 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16074 | |
| 16075 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16076 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16077 | -------------------------------------------------------------------------*/ |
| 16078 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16079 | ( NULL == pEventData->pEventData)) |
| 16080 | { |
| 16081 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16082 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16083 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16084 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16085 | } |
| 16086 | |
| 16087 | wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB; |
| 16088 | |
| 16089 | /*------------------------------------------------------------------------- |
| 16090 | Extract response and send it to UMAC |
| 16091 | -------------------------------------------------------------------------*/ |
| 16092 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16093 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16094 | |
| 16095 | if ( eHAL_STATUS_SUCCESS == halStatus ) |
| 16096 | { |
| 16097 | /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/ |
| 16098 | } |
| 16099 | |
| 16100 | /*Notify UMAC*/ |
| 16101 | wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16102 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16103 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16104 | }/*WDI_ProcessDelBARsp*/ |
| 16105 | |
| 16106 | #ifdef FEATURE_WLAN_CCX |
| 16107 | /** |
| 16108 | @brief Process TSM Stats Rsp function (called when a response |
| 16109 | is being received over the bus from HAL) |
| 16110 | |
| 16111 | @param pWDICtx: pointer to the WLAN DAL context |
| 16112 | pEventData: pointer to the event information structure |
| 16113 | |
| 16114 | @see |
| 16115 | @return Result of the function call |
| 16116 | */ |
| 16117 | WDI_Status |
| 16118 | WDI_ProcessTsmStatsRsp |
| 16119 | ( |
| 16120 | WDI_ControlBlockType* pWDICtx, |
| 16121 | WDI_EventInfoType* pEventData |
| 16122 | ) |
| 16123 | { |
| 16124 | WDI_TsmRspCb wdiTsmStatsRspCb; |
| 16125 | tTsmStatsRspMsg halTsmStatsRspMsg; |
| 16126 | WDI_TSMStatsRspParamsType wdiTsmStatsRspParams; |
| 16127 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16128 | |
| 16129 | /*------------------------------------------------------------------------- |
| 16130 | Sanity check |
| 16131 | -------------------------------------------------------------------------*/ |
| 16132 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16133 | ( NULL == pEventData->pEventData)) |
| 16134 | { |
| 16135 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16136 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16137 | WDI_ASSERT(0); |
| 16138 | return WDI_STATUS_E_FAILURE; |
| 16139 | } |
| 16140 | |
| 16141 | wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB; |
| 16142 | |
| 16143 | /*------------------------------------------------------------------------- |
| 16144 | Unpack HAL Response Message - the header was already extracted by the |
| 16145 | main Response Handling procedure |
| 16146 | -------------------------------------------------------------------------*/ |
| 16147 | wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams, |
| 16148 | pEventData->pEventData, |
| 16149 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams)); |
| 16150 | |
| 16151 | wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly; |
| 16152 | wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist, |
| 16153 | halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist, |
| 16154 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/ |
| 16155 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0])); |
| 16156 | wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly; |
| 16157 | wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss; |
| 16158 | wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount; |
| 16159 | wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount; |
| 16160 | wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly; |
| 16161 | wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 16162 | halTsmStatsRspMsg.tsmStatsRspParams.status); |
| 16163 | |
| 16164 | /*Notify UMAC*/ |
| 16165 | wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData); |
| 16166 | |
| 16167 | return WDI_STATUS_SUCCESS; |
| 16168 | }/*WDI_ProcessTsmStatsRsp*/ |
| 16169 | |
| 16170 | #endif |
| 16171 | |
| 16172 | |
| 16173 | |
| 16174 | /** |
| 16175 | @brief Process Flush AC Rsp function (called when a response |
| 16176 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16177 | |
| 16178 | @param pWDICtx: pointer to the WLAN DAL context |
| 16179 | pEventData: pointer to the event information structure |
| 16180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16181 | @see |
| 16182 | @return Result of the function call |
| 16183 | */ |
| 16184 | WDI_Status |
| 16185 | WDI_ProcessFlushAcRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16186 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16187 | WDI_ControlBlockType* pWDICtx, |
| 16188 | WDI_EventInfoType* pEventData |
| 16189 | ) |
| 16190 | { |
| 16191 | WDI_Status wdiStatus; |
| 16192 | eHalStatus halStatus; |
| 16193 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
| 16194 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16195 | |
| 16196 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16197 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16198 | -------------------------------------------------------------------------*/ |
| 16199 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16200 | ( NULL == pEventData->pEventData)) |
| 16201 | { |
| 16202 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16203 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16204 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16205 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16206 | } |
| 16207 | |
| 16208 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB; |
| 16209 | |
| 16210 | /*------------------------------------------------------------------------- |
| 16211 | Extract response and send it to UMAC |
| 16212 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16213 | wpalMemoryCopy( &halStatus, |
| 16214 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16215 | sizeof(halStatus)); |
| 16216 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16217 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16218 | |
| 16219 | /*Notify UMAC*/ |
| 16220 | wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16221 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16222 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16223 | }/*WDI_ProcessFlushAcRsp*/ |
| 16224 | |
| 16225 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16226 | @brief Process BT AMP event Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16227 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16228 | |
| 16229 | @param pWDICtx: pointer to the WLAN DAL context |
| 16230 | pEventData: pointer to the event information structure |
| 16231 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16232 | @see |
| 16233 | @return Result of the function call |
| 16234 | */ |
| 16235 | WDI_Status |
| 16236 | WDI_ProcessBtAmpEventRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16237 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16238 | WDI_ControlBlockType* pWDICtx, |
| 16239 | WDI_EventInfoType* pEventData |
| 16240 | ) |
| 16241 | { |
| 16242 | WDI_Status wdiStatus; |
| 16243 | eHalStatus halStatus; |
| 16244 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
| 16245 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16246 | |
| 16247 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16248 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16249 | -------------------------------------------------------------------------*/ |
| 16250 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16251 | ( NULL == pEventData->pEventData)) |
| 16252 | { |
| 16253 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16254 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16255 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16256 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16257 | } |
| 16258 | |
| 16259 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB; |
| 16260 | |
| 16261 | /*------------------------------------------------------------------------- |
| 16262 | Extract response and send it to UMAC |
| 16263 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16264 | wpalMemoryCopy( &halStatus, |
| 16265 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16266 | sizeof(halStatus)); |
| 16267 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16268 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16269 | |
| 16270 | /*Notify UMAC*/ |
| 16271 | wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16272 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16273 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16274 | }/*WDI_ProcessBtAmpEventRsp*/ |
| 16275 | |
| 16276 | |
| 16277 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16278 | @brief Process ADD STA SELF Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16279 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16280 | |
| 16281 | @param pWDICtx: pointer to the WLAN DAL context |
| 16282 | pEventData: pointer to the event information structure |
| 16283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16284 | @see |
| 16285 | @return Result of the function call |
| 16286 | */ |
| 16287 | WDI_Status |
| 16288 | WDI_ProcessAddSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16289 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16290 | WDI_ControlBlockType* pWDICtx, |
| 16291 | WDI_EventInfoType* pEventData |
| 16292 | ) |
| 16293 | { |
| 16294 | WDI_AddSTASelfRspParamsType wdiAddSTASelfParams; |
| 16295 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb; |
| 16296 | tAddStaSelfRspMsg halAddStaSelfRsp; |
| 16297 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 16298 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16299 | |
| 16300 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16301 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16302 | -------------------------------------------------------------------------*/ |
| 16303 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16304 | ( NULL == pEventData->pEventData)) |
| 16305 | { |
| 16306 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16307 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16308 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16309 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16310 | } |
| 16311 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16312 | wdiAddSTASelfReqParamsRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16313 | (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB; |
| 16314 | |
| 16315 | /*------------------------------------------------------------------------- |
| 16316 | Extract response and send it to UMAC |
| 16317 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16318 | wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams, |
| 16319 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16320 | sizeof(halAddStaSelfRsp.addStaSelfRspParams)); |
| 16321 | |
| 16322 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16323 | wdiAddSTASelfParams.wdiStatus = |
| 16324 | WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16325 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16326 | wdiAddSTASelfParams.ucSTASelfIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16327 | halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16328 | wdiAddSTASelfParams.dpuIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16329 | halAddStaSelfRsp.addStaSelfRspParams.dpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16330 | wdiAddSTASelfParams.dpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16331 | halAddStaSelfRsp.addStaSelfRspParams.dpuSignature; |
| 16332 | |
| 16333 | wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta, |
| 16334 | pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr, |
| 16335 | WDI_MAC_ADDR_LEN); |
| 16336 | |
| 16337 | |
| 16338 | #ifdef HAL_SELF_STA_PER_BSS |
| 16339 | |
| 16340 | /* At this point add the self-STA */ |
| 16341 | |
| 16342 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 16343 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 16344 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 16345 | |
| 16346 | //all DPU indices are the same for self STA |
| 16347 | |
| 16348 | /*DPU Information*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16349 | wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16350 | wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature; |
| 16351 | wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 16352 | wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 16353 | wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 16354 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 16355 | |
| 16356 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta, |
| 16357 | WDI_MAC_ADDR_LEN); |
| 16358 | |
| 16359 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 16360 | wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx; |
| 16361 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16362 | if(halAddStaSelfRsp.addStaSelfRspParams.status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16363 | != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO) |
| 16364 | { |
| 16365 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 16366 | } |
| 16367 | #endif |
| 16368 | |
| 16369 | /*Notify UMAC*/ |
| 16370 | wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData); |
| 16371 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16372 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16373 | }/*WDI_ProcessAddSTASelfRsp*/ |
| 16374 | |
| 16375 | |
| 16376 | |
| 16377 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16378 | @brief WDI_ProcessDelSTASelfRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16379 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16380 | |
| 16381 | @param pWDICtx: pointer to the WLAN DAL context |
| 16382 | pEventData: pointer to the event information structure |
| 16383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16384 | @see |
| 16385 | @return Result of the function call |
| 16386 | */ |
| 16387 | WDI_Status |
| 16388 | WDI_ProcessDelSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16389 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16390 | WDI_ControlBlockType* pWDICtx, |
| 16391 | WDI_EventInfoType* pEventData |
| 16392 | ) |
| 16393 | { |
| 16394 | WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams; |
| 16395 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
| 16396 | tDelStaSelfRspParams delStaSelfRspParams; |
| 16397 | wpt_uint8 ucStaIdx; |
| 16398 | |
| 16399 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16400 | |
| 16401 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16402 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16403 | -------------------------------------------------------------------------*/ |
| 16404 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16405 | ( NULL == pEventData->pEventData)) |
| 16406 | { |
| 16407 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16408 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16409 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16410 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16411 | } |
| 16412 | |
| 16413 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB; |
| 16414 | |
| 16415 | /*------------------------------------------------------------------------- |
| 16416 | Extract response and send it to UMAC |
| 16417 | -------------------------------------------------------------------------*/ |
| 16418 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16419 | wpalMemoryCopy( &delStaSelfRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16420 | (wpt_uint8*)pEventData->pEventData, |
| 16421 | sizeof(tDelStaSelfRspParams)); |
| 16422 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16423 | wdiDelStaSelfRspParams.wdiStatus = |
| 16424 | WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16425 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16426 | /* delStaSelfRspParams.status is not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16427 | eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/ |
| 16428 | if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status ) |
| 16429 | { |
| 16430 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16431 | wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16432 | delStaSelfRspParams.selfMacAddr, |
| 16433 | &ucStaIdx); |
| 16434 | if(WDI_STATUS_E_FAILURE == wdiStatus) |
| 16435 | { |
| 16436 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16437 | "%s: Unable to extract the STA Idx ", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16438 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16439 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16440 | } |
| 16441 | WDI_STATableDelSta(pWDICtx, ucStaIdx); |
| 16442 | } |
| 16443 | |
| 16444 | /*Notify UMAC*/ |
| 16445 | wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData); |
| 16446 | |
| 16447 | return WDI_STATUS_SUCCESS; |
| 16448 | } |
| 16449 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16450 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 16451 | /** |
| 16452 | @brief Start Oem Data Rsp function (called when a |
| 16453 | response is being received over the bus from HAL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16454 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16455 | @param pWDICtx: pointer to the WLAN DAL context |
| 16456 | pEventData: pointer to the event information structure |
| 16457 | |
| 16458 | @see |
| 16459 | @return Result of the function call |
| 16460 | */ |
| 16461 | #define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName) |
| 16462 | |
| 16463 | WDI_Status |
| 16464 | WDI_ProcessStartOemDataRsp |
| 16465 | ( |
| 16466 | WDI_ControlBlockType* pWDICtx, |
| 16467 | WDI_EventInfoType* pEventData |
| 16468 | ) |
| 16469 | { |
| 16470 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 16471 | WDI_oemDataRspParamsType* wdiOemDataRspParams; |
| 16472 | tStartOemDataRspParams* halStartOemDataRspParams; |
| 16473 | |
| 16474 | /*------------------------------------------------------------------------- |
| 16475 | Sanity check |
| 16476 | -------------------------------------------------------------------------*/ |
| 16477 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16478 | ( NULL == pEventData->pEventData)) |
| 16479 | { |
| 16480 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16481 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16482 | WDI_ASSERT(0); |
| 16483 | return WDI_STATUS_E_FAILURE; |
| 16484 | } |
| 16485 | |
| 16486 | wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB; |
| 16487 | |
| 16488 | /*------------------------------------------------------------------------- |
| 16489 | Extract response and send it to UMAC |
| 16490 | -------------------------------------------------------------------------*/ |
| 16491 | halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData; |
| 16492 | |
| 16493 | |
| 16494 | //It is the responsibility of the application code to check for failure |
| 16495 | //conditions! |
| 16496 | |
| 16497 | //Allocate memory for WDI OEM DATA RSP structure |
| 16498 | wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ; |
| 16499 | |
| 16500 | if(NULL == wdiOemDataRspParams) |
| 16501 | { |
| 16502 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16503 | "Failed to allocate memory in OEM DATA Response %x %x %x ", |
| 16504 | pWDICtx, pEventData, pEventData->pEventData); |
| 16505 | WDI_ASSERT(0); |
| 16506 | return WDI_STATUS_E_FAILURE; |
| 16507 | } |
| 16508 | |
| 16509 | /* Populate WDI structure members */ |
| 16510 | wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); |
| 16511 | |
| 16512 | /*Notify UMAC*/ |
| 16513 | wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData); |
| 16514 | |
| 16515 | //Free memory allocated for WDI OEM_DATA MEAS RSP structure |
| 16516 | wpalMemoryFree(wdiOemDataRspParams); |
| 16517 | |
| 16518 | return WDI_STATUS_SUCCESS; |
| 16519 | }/*WDI_PrcoessStartOemDataRsp*/ |
| 16520 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16521 | |
| 16522 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16523 | Miscellaneous Control Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16524 | ===========================================================================*/ |
| 16525 | |
| 16526 | /** |
| 16527 | @brief Process Channel Switch Rsp function (called when a response |
| 16528 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16529 | |
| 16530 | @param pWDICtx: pointer to the WLAN DAL context |
| 16531 | pEventData: pointer to the event information structure |
| 16532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16533 | @see |
| 16534 | @return Result of the function call |
| 16535 | */ |
| 16536 | WDI_Status |
| 16537 | WDI_ProcessChannelSwitchRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16538 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16539 | WDI_ControlBlockType* pWDICtx, |
| 16540 | WDI_EventInfoType* pEventData |
| 16541 | ) |
| 16542 | { |
| 16543 | WDI_SwitchCHRspParamsType wdiSwitchChRsp; |
| 16544 | WDI_SwitchChRspCb wdiChSwitchRspCb; |
| 16545 | tSwitchChannelRspParams halSwitchChannelRsp; |
| 16546 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16547 | |
| 16548 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16549 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16550 | -------------------------------------------------------------------------*/ |
| 16551 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16552 | ( NULL == pEventData->pEventData)) |
| 16553 | { |
| 16554 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16555 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16556 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16557 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16558 | } |
| 16559 | |
| 16560 | wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB; |
| 16561 | |
| 16562 | /*------------------------------------------------------------------------- |
| 16563 | Extract response and send it to UMAC |
| 16564 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16565 | wpalMemoryCopy( &halSwitchChannelRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16566 | (wpt_uint8*)pEventData->pEventData, |
| 16567 | sizeof(halSwitchChannelRsp)); |
| 16568 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16569 | wdiSwitchChRsp.wdiStatus = |
| 16570 | WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16571 | wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber; |
| 16572 | |
| 16573 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16574 | wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16575 | #endif |
| 16576 | |
| 16577 | /*Notify UMAC*/ |
| 16578 | wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData); |
| 16579 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16580 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16581 | }/*WDI_ProcessChannelSwitchRsp*/ |
| 16582 | |
| 16583 | |
| 16584 | /** |
| 16585 | @brief Process Config STA Rsp function (called when a response |
| 16586 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16587 | |
| 16588 | @param pWDICtx: pointer to the WLAN DAL context |
| 16589 | pEventData: pointer to the event information structure |
| 16590 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16591 | @see |
| 16592 | @return Result of the function call |
| 16593 | */ |
| 16594 | WDI_Status |
| 16595 | WDI_ProcessConfigStaRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16596 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16597 | WDI_ControlBlockType* pWDICtx, |
| 16598 | WDI_EventInfoType* pEventData |
| 16599 | ) |
| 16600 | { |
| 16601 | WDI_ConfigSTARspParamsType wdiCfgSTAParams; |
| 16602 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
| 16603 | WDI_AddStaParams wdiAddSTAParam; |
| 16604 | |
| 16605 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16606 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16607 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16608 | tConfigStaRspMsg halConfigStaRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16609 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16610 | |
| 16611 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16612 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16613 | -------------------------------------------------------------------------*/ |
| 16614 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16615 | ( NULL == pEventData->pEventData)) |
| 16616 | { |
| 16617 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16618 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16619 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16620 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16621 | } |
| 16622 | |
| 16623 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB; |
| 16624 | |
| 16625 | /*------------------------------------------------------------------------- |
| 16626 | Extract response and send it to UMAC |
| 16627 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16628 | wpalMemoryCopy( &halConfigStaRsp.configStaRspParams, |
| 16629 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16630 | sizeof(halConfigStaRsp.configStaRspParams)); |
| 16631 | |
| 16632 | |
| 16633 | wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
| 16634 | wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx; |
| 16635 | wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16636 | wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 16637 | wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig; |
| 16638 | |
| 16639 | /* MAC Address of STA - take from cache as it does not come back in the |
| 16640 | response*/ |
| 16641 | wpalMemoryCopy( wdiCfgSTAParams.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16642 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16643 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16644 | |
| 16645 | wdiCfgSTAParams.wdiStatus = |
| 16646 | WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16647 | |
| 16648 | wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
| 16649 | wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
| 16650 | wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
| 16651 | |
| 16652 | if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus ) |
| 16653 | { |
| 16654 | if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16655 | { |
| 16656 | /* ADD STA to table */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16657 | wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16658 | wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16659 | wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16660 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16661 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16662 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16663 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16664 | wdiAddSTAParam.ucHTCapable = |
| 16665 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable; |
| 16666 | wdiAddSTAParam.ucStaType = |
| 16667 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType; |
| 16668 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16669 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16670 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 16671 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16672 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16673 | |
| 16674 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 16675 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID , |
| 16676 | WDI_MAC_ADDR_LEN); |
| 16677 | |
| 16678 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16679 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID, |
| 16680 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16681 | |
| 16682 | if ( NULL == pBSSSes ) |
| 16683 | { |
| 16684 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16685 | "Association for this BSSID is not in place"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16686 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16687 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16688 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16689 | } |
| 16690 | |
| 16691 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16692 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16693 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16694 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16695 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16696 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16697 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16698 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16699 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 16700 | wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled; |
| 16701 | wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16703 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 16704 | } |
| 16705 | if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 16706 | { |
| 16707 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 16708 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16709 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16710 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16711 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16712 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16713 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16714 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16715 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16716 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16717 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16718 | halConfigStaRsp.configStaRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16719 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16720 | halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16721 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16722 | halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 16723 | } |
| 16724 | } |
| 16725 | |
| 16726 | /*Notify UMAC*/ |
| 16727 | wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData); |
| 16728 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16729 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16730 | }/*WDI_ProcessConfigStaRsp*/ |
| 16731 | |
| 16732 | |
| 16733 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16734 | @brief Process Set Link State Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16735 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16736 | |
| 16737 | @param pWDICtx: pointer to the WLAN DAL context |
| 16738 | pEventData: pointer to the event information structure |
| 16739 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16740 | @see |
| 16741 | @return Result of the function call |
| 16742 | */ |
| 16743 | WDI_Status |
| 16744 | WDI_ProcessSetLinkStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16745 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16746 | WDI_ControlBlockType* pWDICtx, |
| 16747 | WDI_EventInfoType* pEventData |
| 16748 | ) |
| 16749 | { |
| 16750 | WDI_Status wdiStatus; |
| 16751 | eHalStatus halStatus; |
| 16752 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb; |
| 16753 | |
| 16754 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16755 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16756 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16757 | |
| 16758 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16759 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16760 | -------------------------------------------------------------------------*/ |
| 16761 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16762 | ( NULL == pEventData->pEventData)) |
| 16763 | { |
| 16764 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16765 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16766 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16767 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16768 | } |
| 16769 | |
| 16770 | wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB; |
| 16771 | |
| 16772 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 16773 | |
| 16774 | /*If the link is being transitioned to idle - the BSS is to be deleted |
| 16775 | - this type of ending a session is possible when UMAC has failed an |
| 16776 | - association session during Join*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16777 | if ( WDI_LINK_IDLE_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16778 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16779 | { |
| 16780 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16781 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16782 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16783 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 16784 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID, |
| 16785 | &pBSSSes); |
| 16786 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16787 | /*----------------------------------------------------------------------- |
| 16788 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16789 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16790 | -----------------------------------------------------------------------*/ |
| 16791 | if ( NULL == pBSSSes ) |
| 16792 | { |
| 16793 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 16794 | "Set link response received outside association session"); |
| 16795 | } |
| 16796 | else |
| 16797 | { |
| 16798 | /* For BT AMP roles no need to delete the sessions if assoc fails. There |
| 16799 | will be del BSS coming after this to stop the beaconing & cleaning up the |
| 16800 | sessions*/ |
| 16801 | if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&& |
| 16802 | ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType )) |
| 16803 | { |
| 16804 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16805 | The current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16806 | -----------------------------------------------------------------------*/ |
| 16807 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 16808 | |
| 16809 | /*----------------------------------------------------------------------- |
| 16810 | Check to see if this association is in progress - if so disable the |
| 16811 | flag as this has ended |
| 16812 | -----------------------------------------------------------------------*/ |
| 16813 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16814 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16815 | /*Association no longer in progress */ |
| 16816 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16817 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 16818 | WDI_DequeueAssocRequest(pWDICtx); |
| 16819 | } |
| 16820 | } |
| 16821 | } |
| 16822 | } |
| 16823 | /* If the link state has been set to POST ASSOC, reset the "association in |
| 16824 | progress" flag */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16825 | if ( WDI_LINK_POSTASSOC_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16826 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16827 | { |
| 16828 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16829 | WDI_DequeueAssocRequest(pWDICtx); |
| 16830 | } |
| 16831 | |
| 16832 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 16833 | |
| 16834 | /*------------------------------------------------------------------------- |
| 16835 | Extract response and send it to UMAC |
| 16836 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16837 | wpalMemoryCopy( &halStatus, |
| 16838 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16839 | sizeof(halStatus)); |
| 16840 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16841 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16842 | |
| 16843 | /*Notify UMAC*/ |
| 16844 | wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16845 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16846 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16847 | }/*WDI_ProcessSetLinkStateRsp*/ |
| 16848 | |
| 16849 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16850 | @brief Process Get Stats Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16851 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16852 | |
| 16853 | @param pWDICtx: pointer to the WLAN DAL context |
| 16854 | pEventData: pointer to the event information structure |
| 16855 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16856 | @see |
| 16857 | @return Result of the function call |
| 16858 | */ |
| 16859 | WDI_Status |
| 16860 | WDI_ProcessGetStatsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16861 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16862 | WDI_ControlBlockType* pWDICtx, |
| 16863 | WDI_EventInfoType* pEventData |
| 16864 | ) |
| 16865 | { |
| 16866 | WDI_GetStatsRspParamsType *wdiGetStatsRsp; |
| 16867 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 16868 | tHalStatsRspParams* pHalStatsRspParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16869 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16870 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16871 | |
| 16872 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16873 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16874 | -------------------------------------------------------------------------*/ |
| 16875 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16876 | ( NULL == pEventData->pEventData)) |
| 16877 | { |
| 16878 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 16879 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16880 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16881 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16882 | } |
| 16883 | |
| 16884 | /*------------------------------------------------------------------------- |
| 16885 | Extract response and send it to UMAC |
| 16886 | -------------------------------------------------------------------------*/ |
| 16887 | pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData; |
| 16888 | |
| 16889 | /*allocate the stats response buffer */ |
| 16890 | wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate( |
| 16891 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams) |
| 16892 | + sizeof(WDI_GetStatsRspParamsType)); |
| 16893 | |
| 16894 | if(NULL == wdiGetStatsRsp) |
| 16895 | { |
| 16896 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16897 | "Failed to allocate memory in Get Stats Response %x %x %x ", |
| 16898 | pWDICtx, pEventData, pEventData->pEventData); |
| 16899 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16900 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16901 | } |
| 16902 | |
| 16903 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB; |
| 16904 | |
| 16905 | wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen); |
| 16906 | wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType; |
| 16907 | wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen; |
| 16908 | wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status); |
| 16909 | wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId; |
| 16910 | wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask; |
| 16911 | |
| 16912 | /* copy the stats from buffer at the end of the tHalStatsRspParams message */ |
| 16913 | wpalMemoryCopy(wdiGetStatsRsp + 1, |
| 16914 | (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams), |
| 16915 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)); |
| 16916 | |
| 16917 | /*Notify UMAC*/ |
| 16918 | wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData); |
| 16919 | |
| 16920 | wpalMemoryFree(wdiGetStatsRsp); |
| 16921 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16922 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16923 | }/*WDI_ProcessGetStatsRsp*/ |
| 16924 | |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 16925 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 16926 | /** |
| 16927 | @brief Process Get Roam Rssi Rsp function (called when a response is |
| 16928 | being received over the bus from HAL) |
| 16929 | |
| 16930 | @param pWDICtx: pointer to the WLAN DAL context |
| 16931 | pEventData: pointer to the event information structure |
| 16932 | |
| 16933 | @see |
| 16934 | @return Result of the function call |
| 16935 | */ |
| 16936 | WDI_Status |
| 16937 | WDI_ProcessGetRoamRssiRsp |
| 16938 | ( |
| 16939 | WDI_ControlBlockType* pWDICtx, |
| 16940 | WDI_EventInfoType* pEventData |
| 16941 | ) |
| 16942 | { |
| 16943 | WDI_GetRoamRssiRspParamsType wdiGetRoamRssiRsp; |
| 16944 | WDI_GetRoamRssiRspCb wdiGetRoamRssiRspCb; |
| 16945 | tHalGetRoamRssiRspMsg halRoamRssiRspParams; |
| 16946 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16947 | |
| 16948 | /*------------------------------------------------------------------------- |
| 16949 | Sanity check |
| 16950 | -------------------------------------------------------------------------*/ |
| 16951 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16952 | ( NULL == pEventData->pEventData)) |
| 16953 | { |
| 16954 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16955 | "%s: Invalid parameters", __func__); |
| 16956 | WDI_ASSERT(0); |
| 16957 | return WDI_STATUS_E_FAILURE; |
| 16958 | } |
| 16959 | |
| 16960 | wdiGetRoamRssiRspCb = (WDI_GetRoamRssiRspCb)pWDICtx->pfncRspCB; |
| 16961 | if(NULL == wdiGetRoamRssiRspCb) |
| 16962 | { |
| 16963 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 16964 | "%s: call back function is NULL", __func__); |
| 16965 | WDI_ASSERT(0); |
| 16966 | return WDI_STATUS_E_FAILURE; |
| 16967 | } |
| 16968 | |
| 16969 | /*------------------------------------------------------------------------- |
| 16970 | Extract response and send it to UMAC |
| 16971 | -------------------------------------------------------------------------*/ |
| 16972 | wpalMemoryCopy( &halRoamRssiRspParams.roamRssiRspParams, |
| 16973 | pEventData->pEventData, |
| 16974 | sizeof(halRoamRssiRspParams.roamRssiRspParams)); |
| 16975 | |
| 16976 | wdiGetRoamRssiRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halRoamRssiRspParams.roamRssiRspParams.status); |
| 16977 | wdiGetRoamRssiRsp.ucSTAIdx = halRoamRssiRspParams.roamRssiRspParams.staId; |
| 16978 | wdiGetRoamRssiRsp.rssi = halRoamRssiRspParams.roamRssiRspParams.rssi; |
| 16979 | |
| 16980 | /*Notify UMAC*/ |
| 16981 | wdiGetRoamRssiRspCb( &wdiGetRoamRssiRsp, pWDICtx->pRspCBUserData); |
| 16982 | |
| 16983 | return WDI_STATUS_SUCCESS; |
| 16984 | }/*WDI_ProcessGetRoamRssiRsp*/ |
| 16985 | #endif |
| 16986 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16987 | |
| 16988 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16989 | @brief Process Update Cfg Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16990 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16991 | |
| 16992 | @param pWDICtx: pointer to the WLAN DAL context |
| 16993 | pEventData: pointer to the event information structure |
| 16994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16995 | @see |
| 16996 | @return Result of the function call |
| 16997 | */ |
| 16998 | WDI_Status |
| 16999 | WDI_ProcessUpdateCfgRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17000 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17001 | WDI_ControlBlockType* pWDICtx, |
| 17002 | WDI_EventInfoType* pEventData |
| 17003 | ) |
| 17004 | { |
| 17005 | WDI_Status wdiStatus; |
| 17006 | eHalStatus halStatus; |
| 17007 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb; |
| 17008 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17009 | |
| 17010 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17011 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17012 | -------------------------------------------------------------------------*/ |
| 17013 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17014 | ( NULL == pEventData->pEventData)) |
| 17015 | { |
| 17016 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17017 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17018 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17019 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17020 | } |
| 17021 | |
| 17022 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB; |
| 17023 | |
| 17024 | /*------------------------------------------------------------------------- |
| 17025 | Extract response and send it to UMAC |
| 17026 | -------------------------------------------------------------------------*/ |
| 17027 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17028 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17029 | |
| 17030 | /*Notify UMAC*/ |
| 17031 | wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17032 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17033 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17034 | }/*WDI_ProcessUpdateCfgRsp*/ |
| 17035 | |
| 17036 | |
| 17037 | |
| 17038 | /** |
| 17039 | @brief Process Add BA Rsp function (called when a response |
| 17040 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17041 | |
| 17042 | @param pWDICtx: pointer to the WLAN DAL context |
| 17043 | pEventData: pointer to the event information structure |
| 17044 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17045 | @see |
| 17046 | @return Result of the function call |
| 17047 | */ |
| 17048 | WDI_Status |
| 17049 | WDI_ProcessAddBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17050 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17051 | WDI_ControlBlockType* pWDICtx, |
| 17052 | WDI_EventInfoType* pEventData |
| 17053 | ) |
| 17054 | { |
| 17055 | WDI_AddBARspCb wdiAddBARspCb; |
| 17056 | |
| 17057 | tAddBARspParams halAddBARsp; |
| 17058 | WDI_AddBARspinfoType wdiAddBARsp; |
| 17059 | |
| 17060 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17061 | |
| 17062 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17063 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17064 | -------------------------------------------------------------------------*/ |
| 17065 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17066 | ( NULL == pEventData->pEventData)) |
| 17067 | { |
| 17068 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17069 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17070 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17071 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17072 | } |
| 17073 | |
| 17074 | wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB; |
| 17075 | |
| 17076 | /*------------------------------------------------------------------------- |
| 17077 | Extract response and send it to UMAC |
| 17078 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17079 | wpalMemoryCopy( &halAddBARsp, |
| 17080 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17081 | sizeof(halAddBARsp)); |
| 17082 | |
| 17083 | wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status); |
| 17084 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 17085 | if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17086 | { |
| 17087 | wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken; |
| 17088 | } |
| 17089 | |
| 17090 | /*Notify UMAC*/ |
| 17091 | wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData); |
| 17092 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17093 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17094 | }/*WDI_ProcessAddSessionBARsp*/ |
| 17095 | |
| 17096 | /** |
| 17097 | @brief Process Add BA Rsp function (called when a response |
| 17098 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17099 | |
| 17100 | @param pWDICtx: pointer to the WLAN DAL context |
| 17101 | pEventData: pointer to the event information structure |
| 17102 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17103 | @see |
| 17104 | @return Result of the function call |
| 17105 | */ |
| 17106 | WDI_Status |
| 17107 | WDI_ProcessTriggerBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17108 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17109 | WDI_ControlBlockType* pWDICtx, |
| 17110 | WDI_EventInfoType* pEventData |
| 17111 | ) |
| 17112 | { |
| 17113 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
| 17114 | |
| 17115 | tTriggerBARspParams* halTriggerBARsp; |
| 17116 | tTriggerBaRspCandidate* halBaCandidate; |
| 17117 | WDI_TriggerBARspParamsType* wdiTriggerBARsp; |
| 17118 | WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate; |
| 17119 | wpt_uint16 index; |
| 17120 | wpt_uint16 TidIndex; |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17121 | WDI_Status halTriggerBARspStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17122 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17123 | |
| 17124 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17125 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17126 | -------------------------------------------------------------------------*/ |
| 17127 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17128 | ( NULL == pEventData->pEventData)) |
| 17129 | { |
| 17130 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17131 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17132 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17133 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17134 | } |
| 17135 | |
| 17136 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB; |
| 17137 | |
| 17138 | /*------------------------------------------------------------------------- |
| 17139 | Extract response and send it to UMAC |
| 17140 | -------------------------------------------------------------------------*/ |
| 17141 | halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData; |
| 17142 | |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17143 | halTriggerBARspStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status); |
| 17144 | |
| 17145 | if ( WDI_STATUS_SUCCESS == halTriggerBARspStatus) |
| 17146 | { |
| 17147 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17148 | halTriggerBARsp->baCandidateCnt * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17149 | sizeof(WDI_TriggerBARspCandidateType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17150 | |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17151 | if(NULL == wdiTriggerBARsp) |
| 17152 | { |
| 17153 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17154 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 17155 | pWDICtx, pEventData, pEventData->pEventData); |
| 17156 | WDI_ASSERT(0); |
| 17157 | return WDI_STATUS_E_FAILURE; |
| 17158 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17159 | |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17160 | wdiTriggerBARsp->wdiStatus = halTriggerBARspStatus; |
| 17161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17162 | wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17163 | wpalMemoryCopy(wdiTriggerBARsp->macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17164 | halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN); |
| 17165 | |
| 17166 | wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1); |
| 17167 | halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1); |
| 17168 | |
| 17169 | for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++) |
| 17170 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17171 | wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17172 | halBaCandidate->staAddr, WDI_MAC_ADDR_LEN); |
| 17173 | for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++) |
| 17174 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17175 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17176 | halBaCandidate->baInfo[TidIndex].fBaEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17177 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17178 | halBaCandidate->baInfo[TidIndex].startingSeqNum; |
| 17179 | } |
| 17180 | wdiTriggerBARspCandidate++; |
| 17181 | halBaCandidate++; |
| 17182 | } |
| 17183 | } |
Tushnim Bhattacharyya | 3c2c315 | 2013-03-21 15:11:31 -0700 | [diff] [blame] | 17184 | else |
| 17185 | { |
| 17186 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType)); |
| 17187 | |
| 17188 | if(NULL == wdiTriggerBARsp) |
| 17189 | { |
| 17190 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17191 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 17192 | pWDICtx, pEventData, pEventData->pEventData); |
| 17193 | WDI_ASSERT(0); |
| 17194 | return WDI_STATUS_E_FAILURE; |
| 17195 | } |
| 17196 | |
| 17197 | wdiTriggerBARsp->wdiStatus = halTriggerBARspStatus; |
| 17198 | |
| 17199 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17200 | |
| 17201 | /*Notify UMAC*/ |
| 17202 | wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData); |
| 17203 | |
| 17204 | wpalMemoryFree(wdiTriggerBARsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17205 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17206 | }/*WDI_ProcessAddSessionBARsp*/ |
| 17207 | |
| 17208 | /** |
| 17209 | @brief Process Update Beacon Params Rsp function (called when a response |
| 17210 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17211 | |
| 17212 | @param pWDICtx: pointer to the WLAN DAL context |
| 17213 | pEventData: pointer to the event information structure |
| 17214 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17215 | @see |
| 17216 | @return Result of the function call |
| 17217 | */ |
| 17218 | WDI_Status |
| 17219 | WDI_ProcessUpdateBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17220 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17221 | WDI_ControlBlockType* pWDICtx, |
| 17222 | WDI_EventInfoType* pEventData |
| 17223 | ) |
| 17224 | { |
| 17225 | WDI_Status wdiStatus; |
| 17226 | eHalStatus halStatus; |
| 17227 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
| 17228 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17229 | |
| 17230 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17231 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17232 | -------------------------------------------------------------------------*/ |
| 17233 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17234 | ( NULL == pEventData->pEventData)) |
| 17235 | { |
| 17236 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17237 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17238 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17239 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17240 | } |
| 17241 | |
| 17242 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 17243 | |
| 17244 | /*------------------------------------------------------------------------- |
| 17245 | Extract response and send it to UMAC |
| 17246 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17247 | wpalMemoryCopy( &halStatus, |
| 17248 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17249 | sizeof(halStatus)); |
| 17250 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17251 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17252 | |
| 17253 | /*Notify UMAC*/ |
| 17254 | wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17255 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17256 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17257 | }/*WDI_ProcessUpdateBeaconParamsRsp*/ |
| 17258 | |
| 17259 | /** |
| 17260 | @brief Process Send Beacon template Rsp function (called when a response |
| 17261 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17262 | |
| 17263 | @param pWDICtx: pointer to the WLAN DAL context |
| 17264 | pEventData: pointer to the event information structure |
| 17265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17266 | @see |
| 17267 | @return Result of the function call |
| 17268 | */ |
| 17269 | WDI_Status |
| 17270 | WDI_ProcessSendBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17271 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17272 | WDI_ControlBlockType* pWDICtx, |
| 17273 | WDI_EventInfoType* pEventData |
| 17274 | ) |
| 17275 | { |
| 17276 | WDI_Status wdiStatus; |
| 17277 | eHalStatus halStatus; |
| 17278 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
| 17279 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17280 | |
| 17281 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17282 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17283 | -------------------------------------------------------------------------*/ |
| 17284 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17285 | ( NULL == pEventData->pEventData)) |
| 17286 | { |
| 17287 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17288 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17289 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17290 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17291 | } |
| 17292 | |
| 17293 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 17294 | |
| 17295 | /*------------------------------------------------------------------------- |
| 17296 | Extract response and send it to UMAC |
| 17297 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17298 | wpalMemoryCopy( &halStatus, |
| 17299 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17300 | sizeof(halStatus)); |
| 17301 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17302 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17303 | |
| 17304 | /*Notify UMAC*/ |
| 17305 | wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17306 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17307 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17308 | }/*WDI_ProcessSendBeaconParamsRsp*/ |
| 17309 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17310 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17311 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17312 | @brief Process Update Probe Resp Template Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17313 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17314 | |
| 17315 | @param pWDICtx: pointer to the WLAN DAL context |
| 17316 | pEventData: pointer to the event information structure |
| 17317 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17318 | @see |
| 17319 | @return Result of the function call |
| 17320 | */ |
| 17321 | WDI_Status |
| 17322 | WDI_ProcessUpdateProbeRspTemplateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17323 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17324 | WDI_ControlBlockType* pWDICtx, |
| 17325 | WDI_EventInfoType* pEventData |
| 17326 | ) |
| 17327 | { |
| 17328 | WDI_Status wdiStatus; |
| 17329 | eHalStatus halStatus; |
| 17330 | WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb; |
| 17331 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17332 | |
| 17333 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17334 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17335 | -------------------------------------------------------------------------*/ |
| 17336 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17337 | ( NULL == pEventData->pEventData)) |
| 17338 | { |
| 17339 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17340 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17341 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17342 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17343 | } |
| 17344 | |
| 17345 | wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB; |
| 17346 | |
| 17347 | /*------------------------------------------------------------------------- |
| 17348 | Extract response and send it to UMAC |
| 17349 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17350 | wpalMemoryCopy( &halStatus, |
| 17351 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17352 | sizeof(halStatus)); |
| 17353 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17354 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17355 | |
| 17356 | /*Notify UMAC*/ |
| 17357 | wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17358 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17359 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17360 | }/*WDI_ProcessUpdateProbeRspTemplateRsp*/ |
| 17361 | |
| 17362 | /** |
| 17363 | @brief Process Set Max Tx Power Rsp function (called when a response |
| 17364 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17365 | |
| 17366 | @param pWDICtx: pointer to the WLAN DAL context |
| 17367 | pEventData: pointer to the event information structure |
| 17368 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17369 | @see |
| 17370 | @return Result of the function call |
| 17371 | */ |
| 17372 | WDI_Status |
| 17373 | WDI_ProcessSetMaxTxPowerRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17374 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17375 | WDI_ControlBlockType* pWDICtx, |
| 17376 | WDI_EventInfoType* pEventData |
| 17377 | ) |
| 17378 | { |
| 17379 | tSetMaxTxPwrRspMsg halTxpowerrsp; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17380 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17381 | WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17383 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb; |
| 17384 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17385 | |
| 17386 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17387 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17388 | -------------------------------------------------------------------------*/ |
| 17389 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17390 | ( NULL == pEventData->pEventData)) |
| 17391 | { |
| 17392 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17393 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17394 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17395 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17396 | } |
| 17397 | |
| 17398 | wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB; |
| 17399 | |
| 17400 | /*------------------------------------------------------------------------- |
| 17401 | Extract response and send it to UMAC |
| 17402 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17403 | wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams, |
| 17404 | pEventData->pEventData, |
| 17405 | sizeof(halTxpowerrsp.setMaxTxPwrRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17406 | |
| 17407 | if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status ) |
| 17408 | { |
| 17409 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17410 | "Error status returned in Set Max Tx Power Response "); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17411 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 17412 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17413 | } |
| 17414 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17415 | wdiSetMaxTxPowerRspMsg.wdiStatus = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17416 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17417 | wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17418 | |
| 17419 | /*Notify UMAC*/ |
| 17420 | wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 17421 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17422 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17423 | } |
| 17424 | |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 17425 | /** |
| 17426 | @brief Process Set Tx Power Rsp function (called when a response |
| 17427 | is being received over the bus from HAL) |
| 17428 | |
| 17429 | @param pWDICtx: pointer to the WLAN DAL context |
| 17430 | pEventData: pointer to the event information structure |
| 17431 | |
| 17432 | @see |
| 17433 | @return Result of the function call |
| 17434 | */ |
| 17435 | WDI_Status |
| 17436 | WDI_ProcessSetTxPowerRsp |
| 17437 | ( |
| 17438 | WDI_ControlBlockType* pWDICtx, |
| 17439 | WDI_EventInfoType* pEventData |
| 17440 | ) |
| 17441 | { |
| 17442 | tSetTxPwrRspMsg halTxpowerrsp; |
| 17443 | WDI_SetTxPowerRspMsg wdiSetTxPowerRspMsg; |
| 17444 | WDA_SetTxPowerRspCb wdiReqStatusCb; |
| 17445 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17446 | |
| 17447 | /*------------------------------------------------------------------------- |
| 17448 | Sanity check |
| 17449 | -------------------------------------------------------------------------*/ |
| 17450 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17451 | ( NULL == pEventData->pEventData)) |
| 17452 | { |
| 17453 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17454 | "%s: Invalid parameters", __func__); |
| 17455 | WDI_ASSERT(0); |
| 17456 | return WDI_STATUS_E_FAILURE; |
| 17457 | } |
| 17458 | |
| 17459 | wdiReqStatusCb = (WDA_SetTxPowerRspCb)pWDICtx->pfncRspCB; |
| 17460 | |
| 17461 | /*------------------------------------------------------------------------- |
| 17462 | Extract response and send it to UMAC |
| 17463 | -------------------------------------------------------------------------*/ |
| 17464 | wpalMemoryCopy(&halTxpowerrsp.setTxPwrRspParams, |
| 17465 | pEventData->pEventData, |
| 17466 | sizeof(halTxpowerrsp.setTxPwrRspParams)); |
| 17467 | |
| 17468 | if (eHAL_STATUS_SUCCESS != halTxpowerrsp.setTxPwrRspParams.status) |
| 17469 | { |
| 17470 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17471 | "Error status returned in Set Tx Power Response "); |
| 17472 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 17473 | return WDI_STATUS_E_FAILURE; |
| 17474 | } |
| 17475 | |
| 17476 | wdiSetTxPowerRspMsg.wdiStatus = |
| 17477 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setTxPwrRspParams.status); |
| 17478 | |
| 17479 | /*Notify UMAC*/ |
| 17480 | wdiReqStatusCb(&wdiSetTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 17481 | |
| 17482 | return WDI_STATUS_SUCCESS; |
| 17483 | } |
| 17484 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17485 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17486 | @brief Process P2P Group Owner Notice Of Absense Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17487 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17488 | |
| 17489 | @param pWDICtx: pointer to the WLAN DAL context |
| 17490 | pEventData: pointer to the event information structure |
| 17491 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17492 | @see |
| 17493 | @return Result of the function call |
| 17494 | */ |
| 17495 | WDI_Status |
| 17496 | WDI_ProcessP2PGONOARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17497 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17498 | WDI_ControlBlockType* pWDICtx, |
| 17499 | WDI_EventInfoType* pEventData |
| 17500 | ) |
| 17501 | { |
| 17502 | WDI_Status wdiStatus; |
| 17503 | eHalStatus halStatus; |
| 17504 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb; |
| 17505 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17506 | |
| 17507 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17508 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17509 | -------------------------------------------------------------------------*/ |
| 17510 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17511 | ( NULL == pEventData->pEventData)) |
| 17512 | { |
| 17513 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17514 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17515 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17516 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17517 | } |
| 17518 | |
| 17519 | wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB; |
| 17520 | |
| 17521 | /*------------------------------------------------------------------------- |
| 17522 | Extract response and send it to UMAC |
| 17523 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17524 | wpalMemoryCopy( &halStatus, |
| 17525 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17526 | sizeof(halStatus)); |
| 17527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17528 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17529 | |
| 17530 | /*Notify UMAC*/ |
| 17531 | wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17532 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17533 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17534 | }/*WDI_ProcessP2PGONOARsp*/ |
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 Enter IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17537 | 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_ProcessEnterImpsRsp |
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_EnterImpsRspCb wdiEnterImpsRspCb; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17555 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17556 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17557 | |
| 17558 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17559 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17560 | -------------------------------------------------------------------------*/ |
| 17561 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17562 | ( NULL == pEventData->pEventData)) |
| 17563 | { |
| 17564 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17565 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17566 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17567 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17568 | } |
| 17569 | |
| 17570 | wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB; |
| 17571 | |
| 17572 | /*------------------------------------------------------------------------- |
| 17573 | Extract response and send it to UMAC |
| 17574 | -------------------------------------------------------------------------*/ |
| 17575 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17576 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17577 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17578 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17579 | /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state. |
| 17580 | * Other module states are taken care by PMC. |
| 17581 | * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails?? |
| 17582 | */ |
| 17583 | if (wdiStatus != WDI_STATUS_SUCCESS) { |
| 17584 | |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 17585 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17586 | "WDI Process Enter IMPS RSP failed With HAL Status Code: %d", |
| 17587 | halStatus); |
| 17588 | /* Call Back is not required as we are putting the DXE in FULL |
| 17589 | * and riva is already in full (IMPS RSP Failed)*/ |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17590 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17591 | |
| 17592 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) { |
| 17593 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17594 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 17595 | WDI_ASSERT(0); |
| 17596 | } |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17597 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17598 | /*Notify UMAC*/ |
| 17599 | wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17600 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17601 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17602 | }/*WDI_ProcessEnterImpsRsp*/ |
| 17603 | |
| 17604 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17605 | @brief Process Exit IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17606 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17607 | |
| 17608 | @param pWDICtx: pointer to the WLAN DAL context |
| 17609 | pEventData: pointer to the event information structure |
| 17610 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17611 | @see |
| 17612 | @return Result of the function call |
| 17613 | */ |
| 17614 | WDI_Status |
| 17615 | WDI_ProcessExitImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17616 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17617 | WDI_ControlBlockType* pWDICtx, |
| 17618 | WDI_EventInfoType* pEventData |
| 17619 | ) |
| 17620 | { |
| 17621 | WDI_Status wdiStatus; |
| 17622 | eHalStatus halStatus; |
| 17623 | WDI_ExitImpsRspCb wdiExitImpsRspCb; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17624 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17625 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17626 | |
| 17627 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17628 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17629 | -------------------------------------------------------------------------*/ |
| 17630 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17631 | ( NULL == pEventData->pEventData)) |
| 17632 | { |
| 17633 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17634 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17635 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17636 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17637 | } |
| 17638 | |
| 17639 | wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB; |
| 17640 | |
| 17641 | /*------------------------------------------------------------------------- |
| 17642 | Extract response and send it to UMAC |
| 17643 | -------------------------------------------------------------------------*/ |
| 17644 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17645 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17646 | |
| 17647 | // notify DTS that we are entering Full power |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17648 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17649 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 17650 | { |
| 17651 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17652 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 17653 | WDI_ASSERT(0); |
| 17654 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17655 | /*Notify UMAC*/ |
| 17656 | wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17657 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17658 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17659 | }/*WDI_ProcessExitImpsRsp*/ |
| 17660 | |
| 17661 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17662 | @brief Process Enter BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17663 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17664 | |
| 17665 | @param pWDICtx: pointer to the WLAN DAL context |
| 17666 | pEventData: pointer to the event information structure |
| 17667 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17668 | @see |
| 17669 | @return Result of the function call |
| 17670 | */ |
| 17671 | WDI_Status |
| 17672 | WDI_ProcessEnterBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17673 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17674 | WDI_ControlBlockType* pWDICtx, |
| 17675 | WDI_EventInfoType* pEventData |
| 17676 | ) |
| 17677 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17678 | eHalStatus halStatus = eHAL_STATUS_FAILURE; |
| 17679 | tHalEnterBmpsRspParams halEnterBmpsRsp; |
| 17680 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb; |
| 17681 | WDI_EnterBmpsRspParamsType wdiEnterBmpsRspparams; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17682 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17683 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17684 | |
| 17685 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17686 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17687 | -------------------------------------------------------------------------*/ |
| 17688 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17689 | ( NULL == pEventData->pEventData)) |
| 17690 | { |
| 17691 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17692 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17693 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17694 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17695 | } |
| 17696 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17697 | /*------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17698 | Extract response and send it to UMAC |
| 17699 | -------------------------------------------------------------------------*/ |
| 17700 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17701 | { |
| 17702 | wpalMemoryCopy( &halEnterBmpsRsp, |
| 17703 | pEventData->pEventData, |
| 17704 | sizeof(halEnterBmpsRsp)); |
| 17705 | |
| 17706 | //Used to print debug message |
| 17707 | halStatus = halEnterBmpsRsp.status; |
| 17708 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterBmpsRsp.status); |
| 17709 | wdiEnterBmpsRspparams.bssIdx = halEnterBmpsRsp.bssIdx; |
| 17710 | } |
| 17711 | else |
| 17712 | { |
| 17713 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17714 | wdiEnterBmpsRspparams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17715 | } |
| 17716 | |
| 17717 | wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17718 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17719 | /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state. |
| 17720 | * Other module states are taken care by PMC. |
| 17721 | * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails?? |
| 17722 | */ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17723 | if (wdiEnterBmpsRspparams.wdiStatus != WDI_STATUS_SUCCESS) |
| 17724 | { |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17725 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17726 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 17727 | "WDI Process Enter BMPS RSP failed With HAL Status Code: %d", |
| 17728 | halStatus); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17729 | /* Call Back is not required as we are putting the DXE in FULL |
| 17730 | * and riva is already in FULL (BMPS RSP Failed)*/ |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17731 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17732 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 17733 | { |
| 17734 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17735 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 17736 | WDI_ASSERT(0); |
| 17737 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17738 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 17739 | } |
| 17740 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17741 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17742 | wdiEnterBmpsRspCb( &wdiEnterBmpsRspparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17743 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17744 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17745 | }/*WDI_ProcessEnterBmpsRsp*/ |
| 17746 | |
| 17747 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17748 | @brief Process Exit BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17749 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17750 | |
| 17751 | @param pWDICtx: pointer to the WLAN DAL context |
| 17752 | pEventData: pointer to the event information structure |
| 17753 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17754 | @see |
| 17755 | @return Result of the function call |
| 17756 | */ |
| 17757 | WDI_Status |
| 17758 | WDI_ProcessExitBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17759 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17760 | WDI_ControlBlockType* pWDICtx, |
| 17761 | WDI_EventInfoType* pEventData |
| 17762 | ) |
| 17763 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17764 | eHalStatus halStatus; |
| 17765 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17766 | tHalExitBmpsRspParams halExitBmpsRsp; |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17767 | WDI_ExitBmpsRspParamsType wdiExitBmpsRspParams; |
| 17768 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17769 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17770 | |
| 17771 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17772 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17773 | -------------------------------------------------------------------------*/ |
| 17774 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17775 | ( NULL == pEventData->pEventData)) |
| 17776 | { |
| 17777 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17778 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17779 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17780 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17781 | } |
| 17782 | |
| 17783 | wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB; |
| 17784 | |
| 17785 | /*------------------------------------------------------------------------- |
| 17786 | Extract response and send it to UMAC |
| 17787 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17788 | |
| 17789 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17790 | { |
| 17791 | wpalMemoryCopy( &halExitBmpsRsp, |
| 17792 | pEventData->pEventData, |
| 17793 | sizeof(halExitBmpsRsp)); |
| 17794 | |
| 17795 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitBmpsRsp.status); |
| 17796 | wdiExitBmpsRspParams.bssIdx = halExitBmpsRsp.bssIdx; |
| 17797 | } |
| 17798 | else |
| 17799 | { |
| 17800 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17801 | wdiExitBmpsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17802 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17803 | |
| 17804 | // notify DTS that we are entering Full power |
Madan Mohan Koyyalamudi | edbc611 | 2012-12-12 14:01:38 -0800 | [diff] [blame] | 17805 | wptStatus = WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 17806 | if( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 17807 | { |
| 17808 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 17809 | "WDTS_SetPowerState returned with status %d when trying to notify DTS that host is entering Full Power state\n", wptStatus); |
| 17810 | WDI_ASSERT(0); |
| 17811 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17812 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
| 17813 | |
| 17814 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17815 | wdiExitBmpsRspCb( &wdiExitBmpsRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17816 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17817 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17818 | }/*WDI_ProcessExitBmpsRsp*/ |
| 17819 | |
| 17820 | /** |
| 17821 | @brief Process Enter UAPSD Rsp function (called when a response |
| 17822 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17823 | |
| 17824 | @param pWDICtx: pointer to the WLAN DAL context |
| 17825 | pEventData: pointer to the event information structure |
| 17826 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17827 | @see |
| 17828 | @return Result of the function call |
| 17829 | */ |
| 17830 | WDI_Status |
| 17831 | WDI_ProcessEnterUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17832 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17833 | WDI_ControlBlockType* pWDICtx, |
| 17834 | WDI_EventInfoType* pEventData |
| 17835 | ) |
| 17836 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17837 | eHalStatus halStatus; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17838 | tUapsdRspParams halEnterUapsdRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17839 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17840 | WDI_EnterUapsdRspParamsType wdiEnterUapsdRspParams; |
| 17841 | |
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 | wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB; |
| 17857 | |
| 17858 | /*------------------------------------------------------------------------- |
| 17859 | Extract response and send it to UMAC |
| 17860 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17861 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17862 | { |
| 17863 | wpalMemoryCopy( &halEnterUapsdRsp, |
| 17864 | pEventData->pEventData, |
| 17865 | sizeof(halEnterUapsdRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17866 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17867 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halEnterUapsdRsp.status); |
| 17868 | wdiEnterUapsdRspParams.bssIdx = halEnterUapsdRsp.bssIdx; |
| 17869 | } |
| 17870 | else |
| 17871 | { |
| 17872 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17873 | wdiEnterUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17874 | } |
| 17875 | |
| 17876 | if(WDI_STATUS_SUCCESS == wdiEnterUapsdRspParams.wdiStatus) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17877 | { |
| 17878 | // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed |
| 17879 | // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring |
| 17880 | // the traffic to decide when to suspend the trigger frames when there is no traffic |
| 17881 | // activity on the trigger enabled ACs |
| 17882 | pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX; |
| 17883 | |
| 17884 | #ifdef WLAN_PERF |
| 17885 | // Increment the BD signature to refresh the fast path BD utilization |
| 17886 | pWDICtx->uBdSigSerialNum++; |
| 17887 | #endif |
| 17888 | } |
| 17889 | |
| 17890 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17891 | wdiEnterUapsdRspCb( &wdiEnterUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17892 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17893 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17894 | }/*WDI_ProcessEnterUapsdRsp*/ |
| 17895 | |
| 17896 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17897 | @brief Process Exit UAPSD Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17898 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17899 | |
| 17900 | @param pWDICtx: pointer to the WLAN DAL context |
| 17901 | pEventData: pointer to the event information structure |
| 17902 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17903 | @see |
| 17904 | @return Result of the function call |
| 17905 | */ |
| 17906 | WDI_Status |
| 17907 | WDI_ProcessExitUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17908 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17909 | WDI_ControlBlockType* pWDICtx, |
| 17910 | WDI_EventInfoType* pEventData |
| 17911 | ) |
| 17912 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17913 | eHalStatus halStatus; |
| 17914 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17915 | tHalExitUapsdRspParams halExitUapsdRsp; |
| 17916 | WDI_ExitUapsdRspParamsType wdiExitUapsdRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17917 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17918 | |
| 17919 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17920 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17921 | -------------------------------------------------------------------------*/ |
| 17922 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17923 | ( NULL == pEventData->pEventData)) |
| 17924 | { |
| 17925 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17926 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17927 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17928 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17929 | } |
| 17930 | |
| 17931 | wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB; |
| 17932 | |
| 17933 | /*------------------------------------------------------------------------- |
| 17934 | Extract response and send it to UMAC |
| 17935 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17936 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 17937 | { |
| 17938 | wpalMemoryCopy( &halExitUapsdRsp, |
| 17939 | pEventData->pEventData, |
| 17940 | sizeof(halExitUapsdRsp)); |
| 17941 | |
| 17942 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halExitUapsdRsp.status); |
| 17943 | wdiExitUapsdRspParams.bssIdx = halExitUapsdRsp.bssIdx; |
| 17944 | } |
| 17945 | else |
| 17946 | { |
| 17947 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 17948 | wdiExitUapsdRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 17949 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17950 | // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM |
| 17951 | // directly instead of the FW WQ. |
| 17952 | pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT; |
| 17953 | |
| 17954 | #ifdef WLAN_PERF |
| 17955 | // Increment the BD signature to refresh the fast path BD utilization |
| 17956 | pWDICtx->uBdSigSerialNum++; |
| 17957 | #endif |
| 17958 | |
| 17959 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 17960 | wdiExitUapsdRspCb( &wdiExitUapsdRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17961 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17962 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17963 | }/*WDI_ProcessExitUapsdRsp*/ |
| 17964 | |
| 17965 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17966 | @brief Process set UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17967 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17968 | |
| 17969 | @param pWDICtx: pointer to the WLAN DAL context |
| 17970 | pEventData: pointer to the event information structure |
| 17971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17972 | @see |
| 17973 | @return Result of the function call |
| 17974 | */ |
| 17975 | WDI_Status |
| 17976 | WDI_ProcessSetUapsdAcParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17977 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17978 | WDI_ControlBlockType* pWDICtx, |
| 17979 | WDI_EventInfoType* pEventData |
| 17980 | ) |
| 17981 | { |
| 17982 | WDI_Status wdiStatus; |
| 17983 | eHalStatus halStatus; |
| 17984 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb; |
| 17985 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17986 | |
| 17987 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17988 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17989 | -------------------------------------------------------------------------*/ |
| 17990 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17991 | ( NULL == pEventData->pEventData)) |
| 17992 | { |
| 17993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 17994 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17995 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17996 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17997 | } |
| 17998 | |
| 17999 | wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB; |
| 18000 | |
| 18001 | /*------------------------------------------------------------------------- |
| 18002 | Extract response and send it to UMAC |
| 18003 | -------------------------------------------------------------------------*/ |
| 18004 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18005 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18006 | |
| 18007 | /*Notify UMAC*/ |
| 18008 | wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18009 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18010 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18011 | }/*WDI_ProcessSetUapsdAcParamsRsp*/ |
| 18012 | |
| 18013 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18014 | @brief Process update UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18015 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18016 | |
| 18017 | @param pWDICtx: pointer to the WLAN DAL context |
| 18018 | pEventData: pointer to the event information structure |
| 18019 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18020 | @see |
| 18021 | @return Result of the function call |
| 18022 | */ |
| 18023 | WDI_Status |
| 18024 | WDI_ProcessUpdateUapsdParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18025 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18026 | WDI_ControlBlockType* pWDICtx, |
| 18027 | WDI_EventInfoType* pEventData |
| 18028 | ) |
| 18029 | { |
| 18030 | WDI_Status wdiStatus; |
| 18031 | eHalStatus halStatus; |
| 18032 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb; |
| 18033 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18034 | |
| 18035 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18036 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18037 | -------------------------------------------------------------------------*/ |
| 18038 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18039 | ( NULL == pEventData->pEventData)) |
| 18040 | { |
| 18041 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18042 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18043 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18044 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18045 | } |
| 18046 | |
| 18047 | wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB; |
| 18048 | |
| 18049 | /*------------------------------------------------------------------------- |
| 18050 | Extract response and send it to UMAC |
| 18051 | -------------------------------------------------------------------------*/ |
| 18052 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18053 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18054 | |
| 18055 | /*Notify UMAC*/ |
| 18056 | wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18057 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18058 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18059 | }/*WDI_ProcessUpdateUapsdParamsRsp*/ |
| 18060 | |
| 18061 | /** |
| 18062 | @brief Process Configure RXP filter Rsp function (called when a |
| 18063 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18064 | |
| 18065 | @param pWDICtx: pointer to the WLAN DAL context |
| 18066 | pEventData: pointer to the event information structure |
| 18067 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18068 | @see |
| 18069 | @return Result of the function call |
| 18070 | */ |
| 18071 | WDI_Status |
| 18072 | WDI_ProcessConfigureRxpFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18073 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18074 | WDI_ControlBlockType* pWDICtx, |
| 18075 | WDI_EventInfoType* pEventData |
| 18076 | ) |
| 18077 | { |
| 18078 | WDI_Status wdiStatus; |
| 18079 | eHalStatus halStatus; |
| 18080 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb; |
| 18081 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18082 | |
| 18083 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18084 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18085 | -------------------------------------------------------------------------*/ |
| 18086 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18087 | ( NULL == pEventData->pEventData)) |
| 18088 | { |
| 18089 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18090 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18091 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18092 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18093 | } |
| 18094 | |
| 18095 | wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB; |
| 18096 | |
| 18097 | /*------------------------------------------------------------------------- |
| 18098 | Extract response and send it to UMAC |
| 18099 | -------------------------------------------------------------------------*/ |
| 18100 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18101 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18102 | |
| 18103 | /*Notify UMAC*/ |
| 18104 | wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18106 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18107 | }/*WDI_ProcessConfigureRxpFilterRsp*/ |
| 18108 | |
| 18109 | /** |
| 18110 | @brief Process Set beacon filter Rsp function (called when a |
| 18111 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18112 | |
| 18113 | @param pWDICtx: pointer to the WLAN DAL context |
| 18114 | pEventData: pointer to the event information structure |
| 18115 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18116 | @see |
| 18117 | @return Result of the function call |
| 18118 | */ |
| 18119 | WDI_Status |
| 18120 | WDI_ProcessSetBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18121 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18122 | WDI_ControlBlockType* pWDICtx, |
| 18123 | WDI_EventInfoType* pEventData |
| 18124 | ) |
| 18125 | { |
| 18126 | WDI_Status wdiStatus; |
| 18127 | eHalStatus halStatus; |
| 18128 | WDI_SetBeaconFilterCb wdiBeaconFilterCb; |
| 18129 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18130 | |
| 18131 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18132 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18133 | -------------------------------------------------------------------------*/ |
| 18134 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18135 | ( NULL == pEventData->pEventData)) |
| 18136 | { |
| 18137 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18138 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18139 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18140 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18141 | } |
| 18142 | |
| 18143 | wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB; |
| 18144 | |
| 18145 | /*------------------------------------------------------------------------- |
| 18146 | Extract response and send it to UMAC |
| 18147 | -------------------------------------------------------------------------*/ |
| 18148 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18149 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18150 | |
| 18151 | /*Notify UMAC*/ |
| 18152 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18153 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18154 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18155 | }/*WDI_ProcessSetBeaconFilterRsp*/ |
| 18156 | |
| 18157 | /** |
| 18158 | @brief Process remove beacon filter Rsp function (called when a |
| 18159 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18160 | |
| 18161 | @param pWDICtx: pointer to the WLAN DAL context |
| 18162 | pEventData: pointer to the event information structure |
| 18163 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18164 | @see |
| 18165 | @return Result of the function call |
| 18166 | */ |
| 18167 | WDI_Status |
| 18168 | WDI_ProcessRemBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18169 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18170 | WDI_ControlBlockType* pWDICtx, |
| 18171 | WDI_EventInfoType* pEventData |
| 18172 | ) |
| 18173 | { |
| 18174 | WDI_Status wdiStatus; |
| 18175 | eHalStatus halStatus; |
| 18176 | WDI_RemBeaconFilterCb wdiBeaconFilterCb; |
| 18177 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18178 | |
| 18179 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18180 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18181 | -------------------------------------------------------------------------*/ |
| 18182 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18183 | ( NULL == pEventData->pEventData)) |
| 18184 | { |
| 18185 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18186 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18187 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18188 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18189 | } |
| 18190 | |
| 18191 | wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB; |
| 18192 | |
| 18193 | /*------------------------------------------------------------------------- |
| 18194 | Extract response and send it to UMAC |
| 18195 | -------------------------------------------------------------------------*/ |
| 18196 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18197 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18198 | |
| 18199 | /*Notify UMAC*/ |
| 18200 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18201 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18202 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18203 | }/*WDI_ProcessRemBeaconFilterRsp*/ |
| 18204 | |
| 18205 | /** |
| 18206 | @brief Process set RSSI thresholds Rsp function (called when a |
| 18207 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18208 | |
| 18209 | @param pWDICtx: pointer to the WLAN DAL context |
| 18210 | pEventData: pointer to the event information structure |
| 18211 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18212 | @see |
| 18213 | @return Result of the function call |
| 18214 | */ |
| 18215 | WDI_Status |
| 18216 | WDI_ProcessSetRSSIThresoldsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18217 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18218 | WDI_ControlBlockType* pWDICtx, |
| 18219 | WDI_EventInfoType* pEventData |
| 18220 | ) |
| 18221 | { |
| 18222 | WDI_Status wdiStatus; |
| 18223 | eHalStatus halStatus; |
| 18224 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb; |
| 18225 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18226 | |
| 18227 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18228 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18229 | -------------------------------------------------------------------------*/ |
| 18230 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18231 | ( NULL == pEventData->pEventData)) |
| 18232 | { |
| 18233 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18234 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18235 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18236 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18237 | } |
| 18238 | |
| 18239 | wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB; |
| 18240 | |
| 18241 | /*------------------------------------------------------------------------- |
| 18242 | Extract response and send it to UMAC |
| 18243 | -------------------------------------------------------------------------*/ |
| 18244 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18245 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18246 | |
| 18247 | /*Notify UMAC*/ |
| 18248 | wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18249 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18250 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18251 | }/*WDI_ProcessSetRSSIThresoldsRsp*/ |
| 18252 | |
| 18253 | /** |
| 18254 | @brief Process host offload Rsp function (called when a |
| 18255 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18256 | |
| 18257 | @param pWDICtx: pointer to the WLAN DAL context |
| 18258 | pEventData: pointer to the event information structure |
| 18259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18260 | @see |
| 18261 | @return Result of the function call |
| 18262 | */ |
| 18263 | WDI_Status |
| 18264 | WDI_ProcessHostOffloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18265 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18266 | WDI_ControlBlockType* pWDICtx, |
| 18267 | WDI_EventInfoType* pEventData |
| 18268 | ) |
| 18269 | { |
| 18270 | WDI_Status wdiStatus; |
| 18271 | eHalStatus halStatus; |
| 18272 | WDI_HostOffloadCb wdiHostOffloadCb; |
| 18273 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18274 | |
| 18275 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18276 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18277 | -------------------------------------------------------------------------*/ |
| 18278 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18279 | ( NULL == pEventData->pEventData)) |
| 18280 | { |
| 18281 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18282 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18283 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18284 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18285 | } |
| 18286 | |
| 18287 | wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB; |
| 18288 | |
| 18289 | /*------------------------------------------------------------------------- |
| 18290 | Extract response and send it to UMAC |
| 18291 | -------------------------------------------------------------------------*/ |
| 18292 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18293 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18294 | |
| 18295 | /*Notify UMAC*/ |
| 18296 | wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18297 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18298 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18299 | }/*WDI_ProcessHostOffloadRsp*/ |
| 18300 | |
| 18301 | /** |
| 18302 | @brief Process keep alive Rsp function (called when a |
| 18303 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18304 | |
| 18305 | @param pWDICtx: pointer to the WLAN DAL context |
| 18306 | pEventData: pointer to the event information structure |
| 18307 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18308 | @see |
| 18309 | @return Result of the function call |
| 18310 | */ |
| 18311 | WDI_Status |
| 18312 | WDI_ProcessKeepAliveRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18313 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18314 | WDI_ControlBlockType* pWDICtx, |
| 18315 | WDI_EventInfoType* pEventData |
| 18316 | ) |
| 18317 | { |
| 18318 | WDI_Status wdiStatus; |
| 18319 | eHalStatus halStatus; |
| 18320 | WDI_KeepAliveCb wdiKeepAliveCb; |
| 18321 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18322 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18323 | "Received WDI_ProcessKeepAliveRsp Callback from HAL"); |
| 18324 | |
| 18325 | |
| 18326 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18327 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18328 | -------------------------------------------------------------------------*/ |
| 18329 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18330 | ( NULL == pEventData->pEventData)) |
| 18331 | { |
| 18332 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18333 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18334 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18335 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18336 | } |
| 18337 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18338 | wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB; |
| 18339 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18340 | /*------------------------------------------------------------------------- |
| 18341 | Extract response and send it to UMAC |
| 18342 | -------------------------------------------------------------------------*/ |
| 18343 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18344 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18345 | |
| 18346 | /*Notify UMAC*/ |
| 18347 | wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18348 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18349 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18350 | }/*WDI_ProcessKeepAliveRsp*/ |
| 18351 | |
| 18352 | /** |
| 18353 | @brief Process wowl add ptrn Rsp function (called when a |
| 18354 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18355 | |
| 18356 | @param pWDICtx: pointer to the WLAN DAL context |
| 18357 | pEventData: pointer to the event information structure |
| 18358 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18359 | @see |
| 18360 | @return Result of the function call |
| 18361 | */ |
| 18362 | WDI_Status |
| 18363 | WDI_ProcessWowlAddBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18364 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18365 | WDI_ControlBlockType* pWDICtx, |
| 18366 | WDI_EventInfoType* pEventData |
| 18367 | ) |
| 18368 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18369 | eHalStatus halStatus; |
| 18370 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18371 | tHalAddWowlBcastPtrnRspParams halAddWowlBcastPtrRsp; |
| 18372 | WDI_WowlAddBcPtrnRspParamsType wdiWowlAddBcPtrRsp; |
| 18373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18374 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18375 | |
| 18376 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18377 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18378 | -------------------------------------------------------------------------*/ |
| 18379 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18380 | ( NULL == pEventData->pEventData)) |
| 18381 | { |
| 18382 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18383 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18384 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18385 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18386 | } |
| 18387 | |
| 18388 | wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB; |
| 18389 | |
| 18390 | /*------------------------------------------------------------------------- |
| 18391 | Extract response and send it to UMAC |
| 18392 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18393 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18394 | { |
| 18395 | wpalMemoryCopy( &halAddWowlBcastPtrRsp, |
| 18396 | pEventData->pEventData, |
| 18397 | sizeof(halAddWowlBcastPtrRsp)); |
| 18398 | |
| 18399 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 18400 | WDI_HAL_2_WDI_STATUS(halAddWowlBcastPtrRsp.status); |
| 18401 | } |
| 18402 | else |
| 18403 | { |
| 18404 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18405 | wdiWowlAddBcPtrRsp.wdiStatus = |
| 18406 | WDI_HAL_2_WDI_STATUS(halStatus); |
| 18407 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18408 | |
| 18409 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18410 | wdiWowlAddBcPtrnCb( &wdiWowlAddBcPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18411 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18412 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18413 | }/*WDI_ProcessWowlAddBcPtrnRsp*/ |
| 18414 | |
| 18415 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18416 | @brief Process wowl delete ptrn Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18417 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18418 | |
| 18419 | @param pWDICtx: pointer to the WLAN DAL context |
| 18420 | pEventData: pointer to the event information structure |
| 18421 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18422 | @see |
| 18423 | @return Result of the function call |
| 18424 | */ |
| 18425 | WDI_Status |
| 18426 | WDI_ProcessWowlDelBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18427 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18428 | WDI_ControlBlockType* pWDICtx, |
| 18429 | WDI_EventInfoType* pEventData |
| 18430 | ) |
| 18431 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18432 | eHalStatus halStatus; |
| 18433 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18434 | tHalDelWowlBcastPtrnRspParams halDelWowlBcastPtrRsp; |
| 18435 | WDI_WowlDelBcPtrnRspParamsType wdiWowlDelBcstPtrRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18436 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18437 | |
| 18438 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18439 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18440 | -------------------------------------------------------------------------*/ |
| 18441 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18442 | ( NULL == pEventData->pEventData)) |
| 18443 | { |
| 18444 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18445 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18446 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18447 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18448 | } |
| 18449 | |
| 18450 | wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB; |
| 18451 | |
| 18452 | /*------------------------------------------------------------------------- |
| 18453 | Extract response and send it to UMAC |
| 18454 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18455 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18456 | { |
| 18457 | wpalMemoryCopy( &halDelWowlBcastPtrRsp, |
| 18458 | pEventData->pEventData, |
| 18459 | sizeof(halDelWowlBcastPtrRsp)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18460 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18461 | wdiWowlDelBcstPtrRsp.wdiStatus = |
| 18462 | WDI_HAL_2_WDI_STATUS(halDelWowlBcastPtrRsp.status); |
| 18463 | } |
| 18464 | else |
| 18465 | { |
| 18466 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18467 | wdiWowlDelBcstPtrRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18468 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18469 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18470 | wdiWowlDelBcPtrnCb( &wdiWowlDelBcstPtrRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18472 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18473 | }/*WDI_ProcessWowlDelBcPtrnRsp*/ |
| 18474 | |
| 18475 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18476 | @brief Process wowl enter Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18477 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18478 | |
| 18479 | @param pWDICtx: pointer to the WLAN DAL context |
| 18480 | pEventData: pointer to the event information structure |
| 18481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18482 | @see |
| 18483 | @return Result of the function call |
| 18484 | */ |
| 18485 | WDI_Status |
| 18486 | WDI_ProcessWowlEnterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18487 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18488 | WDI_ControlBlockType* pWDICtx, |
| 18489 | WDI_EventInfoType* pEventData |
| 18490 | ) |
| 18491 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18492 | eHalStatus halStatus; |
| 18493 | WDI_WowlEnterReqCb wdiWowlEnterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18494 | WDI_WowlEnterRspParamsType wdiwowlEnterRsp; |
| 18495 | tHalEnterWowlRspParams halEnterWowlRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18496 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18497 | |
| 18498 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18499 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18500 | -------------------------------------------------------------------------*/ |
| 18501 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18502 | ( NULL == pEventData->pEventData)) |
| 18503 | { |
| 18504 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18505 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18506 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18507 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18508 | } |
| 18509 | |
| 18510 | wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB; |
| 18511 | |
| 18512 | /*------------------------------------------------------------------------- |
| 18513 | Extract response and send it to UMAC |
| 18514 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18515 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18516 | { |
| 18517 | wpalMemoryCopy( &halEnterWowlRspParams, |
| 18518 | (wpt_uint8*)pEventData->pEventData, |
| 18519 | sizeof(halEnterWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18520 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18521 | wdiwowlEnterRsp.bssIdx = halEnterWowlRspParams.bssIdx; |
| 18522 | wdiwowlEnterRsp.status = |
| 18523 | WDI_HAL_2_WDI_STATUS(halEnterWowlRspParams.status); |
| 18524 | } |
| 18525 | else |
| 18526 | { |
| 18527 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18528 | wdiwowlEnterRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18529 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18530 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18531 | wdiWowlEnterCb( &wdiwowlEnterRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18532 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18533 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18534 | }/*WDI_ProcessWowlEnterRsp*/ |
| 18535 | |
| 18536 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18537 | @brief Process wowl exit Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18538 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18539 | |
| 18540 | @param pWDICtx: pointer to the WLAN DAL context |
| 18541 | pEventData: pointer to the event information structure |
| 18542 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18543 | @see |
| 18544 | @return Result of the function call |
| 18545 | */ |
| 18546 | WDI_Status |
| 18547 | WDI_ProcessWowlExitRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18548 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18549 | WDI_ControlBlockType* pWDICtx, |
| 18550 | WDI_EventInfoType* pEventData |
| 18551 | ) |
| 18552 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18553 | eHalStatus halStatus; |
| 18554 | WDI_WowlExitReqCb wdiWowlExitCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18555 | tHalExitWowlRspParams halExitWowlRspParams; |
| 18556 | WDI_WowlExitRspParamsType wdiWowlExitRsp; |
| 18557 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18558 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18559 | |
| 18560 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18561 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18562 | -------------------------------------------------------------------------*/ |
| 18563 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18564 | ( NULL == pEventData->pEventData)) |
| 18565 | { |
| 18566 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18567 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18568 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18569 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18570 | } |
| 18571 | |
| 18572 | wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB; |
| 18573 | |
| 18574 | /*------------------------------------------------------------------------- |
| 18575 | Extract response and send it to UMAC |
| 18576 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18577 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 18578 | { |
| 18579 | wpalMemoryCopy( &halExitWowlRspParams, |
| 18580 | pEventData->pEventData, |
| 18581 | sizeof(halExitWowlRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18582 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18583 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halExitWowlRspParams.status); |
| 18584 | wdiWowlExitRsp.bssIdx = halExitWowlRspParams.bssIdx; |
| 18585 | |
| 18586 | } |
| 18587 | else |
| 18588 | { |
| 18589 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 18590 | wdiWowlExitRsp.status = WDI_HAL_2_WDI_STATUS(halStatus); |
| 18591 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18592 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 18593 | wdiWowlExitCb( &wdiWowlExitRsp, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18594 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18595 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18596 | }/*WDI_ProcessWowlExitRsp*/ |
| 18597 | |
| 18598 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18599 | @brief Process Configure Apps CPU wakeup State Rsp function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18600 | (called when a response is being received over the bus |
| 18601 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18602 | |
| 18603 | @param pWDICtx: pointer to the WLAN DAL context |
| 18604 | pEventData: pointer to the event information structure |
| 18605 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18606 | @see |
| 18607 | @return Result of the function call |
| 18608 | */ |
| 18609 | WDI_Status |
| 18610 | WDI_ProcessConfigureAppsCpuWakeupStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18611 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18612 | WDI_ControlBlockType* pWDICtx, |
| 18613 | WDI_EventInfoType* pEventData |
| 18614 | ) |
| 18615 | { |
| 18616 | WDI_Status wdiStatus; |
| 18617 | eHalStatus halStatus; |
| 18618 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb; |
| 18619 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18620 | |
| 18621 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18622 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18623 | -------------------------------------------------------------------------*/ |
| 18624 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18625 | ( NULL == pEventData->pEventData)) |
| 18626 | { |
| 18627 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18628 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18629 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18630 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18631 | } |
| 18632 | |
| 18633 | wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB; |
| 18634 | |
| 18635 | /*------------------------------------------------------------------------- |
| 18636 | Extract response and send it to UMAC |
| 18637 | -------------------------------------------------------------------------*/ |
| 18638 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18639 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18640 | |
| 18641 | /*Notify UMAC*/ |
| 18642 | wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18643 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18644 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18645 | }/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/ |
| 18646 | |
| 18647 | |
| 18648 | /** |
| 18649 | @brief Process Nv download(called when a response |
| 18650 | 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] | 18651 | |
| 18652 | @param pWDICtx: pointer to the WLAN DAL context |
| 18653 | pEventData: pointer to the event information structure |
| 18654 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18655 | @see |
| 18656 | @return Result of the function call |
| 18657 | */ |
| 18658 | WDI_Status |
| 18659 | WDI_ProcessNvDownloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18660 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18661 | WDI_ControlBlockType* pWDICtx, |
| 18662 | WDI_EventInfoType* pEventData |
| 18663 | ) |
| 18664 | { |
| 18665 | |
| 18666 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 18667 | tHalNvImgDownloadRspParams halNvDownloadRsp; |
| 18668 | WDI_NvDownloadRspInfoType wdiNvDownloadRsp; |
| 18669 | |
| 18670 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18671 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18672 | -------------------------------------------------------------------------*/ |
| 18673 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18674 | ( NULL == pEventData->pEventData)) |
| 18675 | { |
| 18676 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18677 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18678 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18679 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18680 | } |
| 18681 | |
| 18682 | /*------------------------------------------------------------------------- |
| 18683 | Extract response and send it to UMAC |
| 18684 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18685 | wpalMemoryCopy( &halNvDownloadRsp, |
| 18686 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18687 | sizeof(halNvDownloadRsp)); |
| 18688 | |
| 18689 | wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status); |
| 18690 | |
| 18691 | if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18692 | (pWDICtx->wdiNvBlobInfo.usCurrentFragment != |
| 18693 | pWDICtx->wdiNvBlobInfo.usTotalFragment )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18694 | { |
| 18695 | WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18696 | (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18697 | } |
| 18698 | else |
| 18699 | { |
| 18700 | /*Reset the Nv related global information in WDI context information */ |
| 18701 | pWDICtx->wdiNvBlobInfo.usTotalFragment = 0; |
| 18702 | pWDICtx->wdiNvBlobInfo.usFragmentSize = 0; |
| 18703 | pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0; |
| 18704 | /*call WDA callback function for last fragment */ |
| 18705 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB; |
| 18706 | wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData); |
| 18707 | } |
| 18708 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18709 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18710 | } |
| 18711 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 18712 | /** |
| 18713 | @brief Process Add TSpec Rsp function (called when a response |
| 18714 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18715 | |
| 18716 | @param pWDICtx: pointer to the WLAN DAL context |
| 18717 | pEventData: pointer to the event information structure |
| 18718 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18719 | @see |
| 18720 | @return Result of the function call |
| 18721 | */ |
| 18722 | WDI_Status |
| 18723 | WDI_ProcessAggrAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18724 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18725 | WDI_ControlBlockType* pWDICtx, |
| 18726 | WDI_EventInfoType* pEventData |
| 18727 | ) |
| 18728 | { |
| 18729 | WDI_Status wdiStatus; |
| 18730 | tAggrAddTsRspParams aggrAddTsRsp; |
| 18731 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb; |
| 18732 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18733 | |
| 18734 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18735 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18736 | -------------------------------------------------------------------------*/ |
| 18737 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18738 | ( NULL == pEventData->pEventData)) |
| 18739 | { |
| 18740 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18741 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18742 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18743 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18744 | } |
| 18745 | |
| 18746 | wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 18747 | |
| 18748 | /*------------------------------------------------------------------------- |
| 18749 | Extract response and send it to UMAC |
| 18750 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18751 | wpalMemoryCopy( &aggrAddTsRsp, |
| 18752 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18753 | sizeof(aggrAddTsRsp)); |
| 18754 | |
| 18755 | /* What is the difference between status0 and status1? */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18756 | wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18757 | |
| 18758 | /*Notify UMAC*/ |
| 18759 | wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18760 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18761 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18762 | }/*WDI_ProcessAddTSpecRsp*/ |
| 18763 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 18764 | |
| 18765 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18766 | @brief WDI_ProcessHostResumeRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18767 | response 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_ProcessHostResumeRsp |
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 | { |
| 18782 | WDI_SuspendResumeRspParamsType wdiResumeRspParams; |
| 18783 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
| 18784 | tHalHostResumeRspParams hostResumeRspMsg; |
| 18785 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18786 | |
| 18787 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18788 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18789 | -------------------------------------------------------------------------*/ |
| 18790 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18791 | ( NULL == pEventData->pEventData)) |
| 18792 | { |
| 18793 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18794 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18795 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18796 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18797 | } |
| 18798 | |
| 18799 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB; |
| 18800 | |
| 18801 | /*------------------------------------------------------------------------- |
| 18802 | Extract response and send it to UMAC |
| 18803 | -------------------------------------------------------------------------*/ |
| 18804 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18805 | wpalMemoryCopy( &hostResumeRspMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18806 | (wpt_uint8*)pEventData->pEventData, |
| 18807 | sizeof(hostResumeRspMsg)); |
| 18808 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18809 | wdiResumeRspParams.wdiStatus = |
| 18810 | WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18811 | |
| 18812 | /*Notify UMAC*/ |
| 18813 | wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData); |
| 18814 | |
| 18815 | return WDI_STATUS_SUCCESS; |
| 18816 | } |
| 18817 | |
| 18818 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18819 | @brief Process Set Tx PER Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18820 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18821 | |
| 18822 | @param pWDICtx: pointer to the WLAN DAL context |
| 18823 | pEventData: pointer to the event information structure |
| 18824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18825 | @see |
| 18826 | @return Result of the function call |
| 18827 | */ |
| 18828 | WDI_Status |
| 18829 | WDI_ProcessSetTxPerTrackingRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18830 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18831 | WDI_ControlBlockType* pWDICtx, |
| 18832 | WDI_EventInfoType* pEventData |
| 18833 | ) |
| 18834 | { |
| 18835 | WDI_Status wdiStatus; |
| 18836 | eHalStatus halStatus; |
| 18837 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb; |
| 18838 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18839 | |
| 18840 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18841 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18842 | -------------------------------------------------------------------------*/ |
| 18843 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18844 | ( NULL == pEventData->pEventData)) |
| 18845 | { |
| 18846 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18847 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18848 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18849 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18850 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18851 | |
| 18852 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18853 | |
| 18854 | /*------------------------------------------------------------------------- |
| 18855 | Extract response and send it to UMAC |
| 18856 | -------------------------------------------------------------------------*/ |
| 18857 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18858 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18859 | |
| 18860 | /*Notify UMAC*/ |
| 18861 | pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 18862 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18863 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18864 | }/*WDI_ProcessSetTxPerTrackingRsp*/ |
| 18865 | |
| 18866 | /*========================================================================== |
| 18867 | Indications from HAL |
| 18868 | ==========================================================================*/ |
| 18869 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18870 | @brief Process Low RSSI Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18871 | indication of this kind is being received over the bus |
| 18872 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18873 | |
| 18874 | @param pWDICtx: pointer to the WLAN DAL context |
| 18875 | pEventData: pointer to the event information structure |
| 18876 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18877 | @see |
| 18878 | @return Result of the function call |
| 18879 | */ |
| 18880 | WDI_Status |
| 18881 | WDI_ProcessLowRSSIInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18882 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18883 | WDI_ControlBlockType* pWDICtx, |
| 18884 | WDI_EventInfoType* pEventData |
| 18885 | ) |
| 18886 | { |
| 18887 | WDI_LowLevelIndType wdiInd; |
| 18888 | tHalRSSINotificationIndMsg halRSSINotificationIndMsg; |
| 18889 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18890 | |
| 18891 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18892 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18893 | -------------------------------------------------------------------------*/ |
| 18894 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18895 | ( NULL == pEventData->pEventData)) |
| 18896 | { |
| 18897 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18898 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18899 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18900 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18901 | } |
| 18902 | |
| 18903 | /*------------------------------------------------------------------------- |
| 18904 | Extract indication and send it to UMAC |
| 18905 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18906 | wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams, |
| 18907 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18908 | sizeof(tHalRSSINotification)); |
| 18909 | |
| 18910 | /*Fill in the indication parameters*/ |
| 18911 | wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND; |
| 18912 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross = |
| 18913 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross; |
| 18914 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross = |
| 18915 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross; |
| 18916 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross = |
| 18917 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross; |
| 18918 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross = |
| 18919 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross; |
| 18920 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross = |
| 18921 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross; |
| 18922 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross = |
| 18923 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross; |
Madan Mohan Koyyalamudi | 313a593 | 2012-12-12 15:59:44 -0800 | [diff] [blame] | 18924 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.avgRssi = |
| 18925 | halRSSINotificationIndMsg.rssiNotificationParams.avgRssi; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18926 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 18927 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 18928 | { |
| 18929 | /*Notify UMAC of indication*/ |
| 18930 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18931 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18932 | |
| 18933 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18934 | }/*WDI_ProcessLowRSSIInd*/ |
| 18935 | |
| 18936 | |
| 18937 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18938 | @brief Process Missed Beacon Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18939 | an indication of this kind is being received over the |
| 18940 | bus from HAL) |
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_ProcessMissedBeaconInd |
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 | WDI_Status wdiStatus; |
| 18956 | eHalStatus halStatus; |
| 18957 | WDI_LowLevelIndType wdiInd; |
Leela Venkata Kiran Kumar Reddy Chirala | 949300d | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 18958 | tpHalMissedBeaconIndParams halMissedBeaconIndParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18959 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18960 | |
| 18961 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18962 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18963 | -------------------------------------------------------------------------*/ |
| 18964 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18965 | ( NULL == pEventData->pEventData)) |
| 18966 | { |
| 18967 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 18968 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18969 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18970 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18971 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 949300d | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 18972 | halMissedBeaconIndParams = (tpHalMissedBeaconIndParams)pEventData->pEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18973 | /*------------------------------------------------------------------------- |
| 18974 | Extract indication and send it to UMAC |
| 18975 | -------------------------------------------------------------------------*/ |
| 18976 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18977 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18978 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18979 | |
| 18980 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18981 | wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND; |
Leela Venkata Kiran Kumar Reddy Chirala | 949300d | 2013-02-27 19:50:05 -0800 | [diff] [blame] | 18982 | wdiInd.wdiIndicationData.wdiMissedBeaconInd.bssIdx = |
| 18983 | halMissedBeaconIndParams->bssIdx; |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 18984 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 18985 | { |
| 18986 | /*Notify UMAC*/ |
| 18987 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18988 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18989 | |
| 18990 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18991 | }/*WDI_ProcessMissedBeaconInd*/ |
| 18992 | |
| 18993 | |
| 18994 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18995 | @brief Process Unk Addr Frame Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18996 | an indication of this kind is being received over the |
| 18997 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18998 | |
| 18999 | @param pWDICtx: pointer to the WLAN DAL context |
| 19000 | pEventData: pointer to the event information structure |
| 19001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19002 | @see |
| 19003 | @return Result of the function call |
| 19004 | */ |
| 19005 | WDI_Status |
| 19006 | WDI_ProcessUnkAddrFrameInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19007 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19008 | WDI_ControlBlockType* pWDICtx, |
| 19009 | WDI_EventInfoType* pEventData |
| 19010 | ) |
| 19011 | { |
| 19012 | WDI_Status wdiStatus; |
| 19013 | eHalStatus halStatus; |
| 19014 | WDI_LowLevelIndType wdiInd; |
| 19015 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19016 | |
| 19017 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19018 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19019 | -------------------------------------------------------------------------*/ |
| 19020 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19021 | ( NULL == pEventData->pEventData)) |
| 19022 | { |
| 19023 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19024 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19025 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19026 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19027 | } |
| 19028 | |
| 19029 | /*------------------------------------------------------------------------- |
| 19030 | Extract indication and send it to UMAC |
| 19031 | -------------------------------------------------------------------------*/ |
| 19032 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 19033 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19034 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19035 | |
| 19036 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19037 | wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19038 | /* ! TO DO - fill in from HAL struct: |
| 19039 | wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/ |
| 19040 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19041 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19042 | { |
| 19043 | /*Notify UMAC*/ |
| 19044 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19045 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19046 | |
| 19047 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19048 | }/*WDI_ProcessUnkAddrFrameInd*/ |
| 19049 | |
| 19050 | |
| 19051 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19052 | @brief Process MIC Failure Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19053 | indication of this kind is being received over the bus |
| 19054 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19055 | |
| 19056 | @param pWDICtx: pointer to the WLAN DAL context |
| 19057 | pEventData: pointer to the event information structure |
| 19058 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19059 | @see |
| 19060 | @return Result of the function call |
| 19061 | */ |
| 19062 | WDI_Status |
| 19063 | WDI_ProcessMicFailureInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19064 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19065 | WDI_ControlBlockType* pWDICtx, |
| 19066 | WDI_EventInfoType* pEventData |
| 19067 | ) |
| 19068 | { |
| 19069 | WDI_LowLevelIndType wdiInd; |
| 19070 | tpSirMicFailureInd pHalMicFailureInd; |
| 19071 | |
| 19072 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19073 | |
| 19074 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19075 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19076 | -------------------------------------------------------------------------*/ |
| 19077 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19078 | ( NULL == pEventData->pEventData)) |
| 19079 | { |
| 19080 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19081 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19082 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19083 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19084 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19086 | pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData; |
| 19087 | /*------------------------------------------------------------------------- |
| 19088 | Extract indication and send it to UMAC |
| 19089 | -------------------------------------------------------------------------*/ |
| 19090 | |
| 19091 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19092 | wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19093 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId, |
| 19094 | pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN); |
| 19095 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr, |
| 19096 | pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN); |
| 19097 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr, |
| 19098 | pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN); |
| 19099 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr, |
| 19100 | pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19101 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19102 | pHalMicFailureInd->info.multicast; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19103 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19104 | pHalMicFailureInd->info.IV1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19105 | wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19106 | pHalMicFailureInd->info.keyId; |
| 19107 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC, |
| 19108 | pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE); |
| 19109 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr, |
| 19110 | pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN); |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19111 | |
| 19112 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19113 | { |
| 19114 | /*Notify UMAC*/ |
| 19115 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19116 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19117 | |
| 19118 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19119 | }/*WDI_ProcessMicFailureInd*/ |
| 19120 | |
| 19121 | |
| 19122 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19123 | @brief Process Fatal Failure Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19124 | an indication of this kind is being received over the |
| 19125 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19126 | |
| 19127 | @param pWDICtx: pointer to the WLAN DAL context |
| 19128 | pEventData: pointer to the event information structure |
| 19129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19130 | @see |
| 19131 | @return Result of the function call |
| 19132 | */ |
| 19133 | WDI_Status |
| 19134 | WDI_ProcessFatalErrorInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19135 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19136 | WDI_ControlBlockType* pWDICtx, |
| 19137 | WDI_EventInfoType* pEventData |
| 19138 | ) |
| 19139 | { |
| 19140 | WDI_Status wdiStatus; |
| 19141 | eHalStatus halStatus; |
| 19142 | WDI_LowLevelIndType wdiInd; |
| 19143 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19144 | |
| 19145 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19146 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19147 | -------------------------------------------------------------------------*/ |
| 19148 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19149 | ( NULL == pEventData->pEventData)) |
| 19150 | { |
| 19151 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19152 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19153 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19154 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19155 | } |
| 19156 | |
| 19157 | /*------------------------------------------------------------------------- |
| 19158 | Extract indication and send it to UMAC |
| 19159 | -------------------------------------------------------------------------*/ |
| 19160 | |
| 19161 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 19162 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19163 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19164 | |
| 19165 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19166 | "Fatal failure received from device %d ", halStatus ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19167 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19168 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19169 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 19170 | wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19171 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19172 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19173 | { |
| 19174 | /*Notify UMAC*/ |
| 19175 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19176 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19177 | |
| 19178 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19179 | }/*WDI_ProcessFatalErrorInd*/ |
| 19180 | |
| 19181 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19182 | @brief Process Delete STA Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19183 | an indication of this kind is being received over the |
| 19184 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19185 | |
| 19186 | @param pWDICtx: pointer to the WLAN DAL context |
| 19187 | pEventData: pointer to the event information structure |
| 19188 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19189 | @see |
| 19190 | @return Result of the function call |
| 19191 | */ |
| 19192 | WDI_Status |
| 19193 | WDI_ProcessDelSTAInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19194 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19195 | WDI_ControlBlockType* pWDICtx, |
| 19196 | WDI_EventInfoType* pEventData |
| 19197 | ) |
| 19198 | { |
| 19199 | tDeleteStaContextParams halDelSTACtx; |
| 19200 | WDI_LowLevelIndType wdiInd; |
| 19201 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19202 | |
| 19203 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19204 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19205 | -------------------------------------------------------------------------*/ |
| 19206 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19207 | ( NULL == pEventData->pEventData)) |
| 19208 | { |
| 19209 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19210 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19211 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19212 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19213 | } |
| 19214 | |
| 19215 | /*------------------------------------------------------------------------- |
| 19216 | Extract indication and send it to UMAC |
| 19217 | -------------------------------------------------------------------------*/ |
| 19218 | |
| 19219 | /* Parameters need to be unpacked according to HAL struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19220 | wpalMemoryCopy( &halDelSTACtx, |
| 19221 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19222 | sizeof(halDelSTACtx)); |
| 19223 | |
| 19224 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19225 | wdiInd.wdiIndicationType = WDI_DEL_STA_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19226 | |
| 19227 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2, |
| 19228 | halDelSTACtx.addr2, WDI_MAC_ADDR_LEN); |
| 19229 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID, |
| 19230 | halDelSTACtx.bssId, WDI_MAC_ADDR_LEN); |
| 19231 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19232 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19233 | halDelSTACtx.assocId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19234 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19235 | halDelSTACtx.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19236 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode = |
| 19237 | halDelSTACtx.reasonCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19238 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19239 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19240 | { |
| 19241 | /*Notify UMAC*/ |
| 19242 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19243 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19244 | |
| 19245 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19246 | }/*WDI_ProcessDelSTAInd*/ |
| 19247 | |
| 19248 | /** |
| 19249 | *@brief Process Coex Indication function (called when |
| 19250 | an indication of this kind is being received over the |
| 19251 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19252 | |
| 19253 | @param pWDICtx: pointer to the WLAN DAL context |
| 19254 | pEventData: pointer to the event information structure |
| 19255 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19256 | @see |
| 19257 | @return Result of the function call |
| 19258 | */ |
| 19259 | WDI_Status |
| 19260 | WDI_ProcessCoexInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19261 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19262 | WDI_ControlBlockType* pWDICtx, |
| 19263 | WDI_EventInfoType* pEventData |
| 19264 | ) |
| 19265 | { |
| 19266 | WDI_LowLevelIndType wdiInd; |
| 19267 | tCoexIndMsg halCoexIndMsg; |
| 19268 | wpt_uint32 index; |
| 19269 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19270 | |
| 19271 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19272 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19273 | -------------------------------------------------------------------------*/ |
| 19274 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19275 | ( NULL == pEventData->pEventData )) |
| 19276 | { |
| 19277 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19278 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19279 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19280 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19281 | } |
| 19282 | |
| 19283 | /*------------------------------------------------------------------------- |
| 19284 | Extract indication and send it to UMAC |
| 19285 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19286 | wpalMemoryCopy( &halCoexIndMsg.coexIndParams, |
| 19287 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19288 | sizeof(halCoexIndMsg.coexIndParams) ); |
| 19289 | |
| 19290 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19291 | wdiInd.wdiIndicationType = WDI_COEX_IND; |
| 19292 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19293 | for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++) |
| 19294 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19295 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19296 | } |
| 19297 | |
| 19298 | // DEBUG |
| 19299 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19300 | "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19301 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType, |
| 19302 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0], |
| 19303 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1], |
| 19304 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2], |
| 19305 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19306 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19307 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19308 | { |
| 19309 | /*Notify UMAC*/ |
| 19310 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19311 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19312 | |
| 19313 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19314 | }/*WDI_ProcessCoexInd*/ |
| 19315 | |
| 19316 | /** |
| 19317 | *@brief Process Tx Complete Indication function (called when |
| 19318 | an indication of this kind is being received over the |
| 19319 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19320 | |
| 19321 | @param pWDICtx: pointer to the WLAN DAL context |
| 19322 | pEventData: pointer to the event information structure |
| 19323 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19324 | @see |
| 19325 | @return Result of the function call |
| 19326 | */ |
| 19327 | WDI_Status |
| 19328 | WDI_ProcessTxCompleteInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19329 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19330 | WDI_ControlBlockType* pWDICtx, |
| 19331 | WDI_EventInfoType* pEventData |
| 19332 | ) |
| 19333 | { |
| 19334 | WDI_LowLevelIndType wdiInd; |
| 19335 | tTxComplIndMsg halTxComplIndMsg; |
| 19336 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19337 | |
| 19338 | /*------------------------------------------------------------------------- |
| 19339 | Sanity check |
| 19340 | -------------------------------------------------------------------------*/ |
| 19341 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19342 | ( NULL == pEventData->pEventData )) |
| 19343 | { |
| 19344 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19345 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19346 | WDI_ASSERT( 0 ); |
| 19347 | return WDI_STATUS_E_FAILURE; |
| 19348 | } |
| 19349 | |
| 19350 | /*------------------------------------------------------------------------- |
| 19351 | Extract indication and send it to UMAC |
| 19352 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19353 | wpalMemoryCopy( &halTxComplIndMsg.txComplParams, |
| 19354 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19355 | sizeof(halTxComplIndMsg.txComplParams) ); |
| 19356 | |
| 19357 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19358 | wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND; |
| 19359 | wdiInd.wdiIndicationData.tx_complete_status |
| 19360 | = halTxComplIndMsg.txComplParams.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19361 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19362 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19363 | { |
| 19364 | /*Notify UMAC*/ |
| 19365 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19366 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19367 | |
| 19368 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19369 | }/*WDI_ProcessTxCompleteInd*/ |
| 19370 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19371 | /** |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 19372 | *@brief Process Noa Start Indication function (called when |
| 19373 | an indication of this kind is being received over the |
| 19374 | bus from HAL) |
| 19375 | |
| 19376 | @param pWDICtx: pointer to the WLAN DAL context |
| 19377 | pEventData: pointer to the event information structure |
| 19378 | |
| 19379 | @see |
| 19380 | @return Result of the function call |
| 19381 | */ |
| 19382 | WDI_Status |
| 19383 | WDI_ProcessP2pNoaStartInd |
| 19384 | ( |
| 19385 | WDI_ControlBlockType* pWDICtx, |
| 19386 | WDI_EventInfoType* pEventData |
| 19387 | ) |
| 19388 | { |
| 19389 | WDI_LowLevelIndType wdiInd; |
| 19390 | tNoaStartIndMsg halNoaStartIndMsg; |
| 19391 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19392 | |
| 19393 | /*------------------------------------------------------------------------- |
| 19394 | Sanity check |
| 19395 | -------------------------------------------------------------------------*/ |
| 19396 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19397 | ( NULL == pEventData->pEventData )) |
| 19398 | { |
| 19399 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19400 | "%s: Invalid parameters", __func__); |
| 19401 | WDI_ASSERT( 0 ); |
| 19402 | return WDI_STATUS_E_FAILURE; |
| 19403 | } |
| 19404 | |
| 19405 | /*------------------------------------------------------------------------- |
| 19406 | Extract indication and send it to UMAC |
| 19407 | -------------------------------------------------------------------------*/ |
| 19408 | wpalMemoryCopy( &halNoaStartIndMsg.noaStartIndParams, |
| 19409 | pEventData->pEventData, |
| 19410 | sizeof(halNoaStartIndMsg.noaStartIndParams) ); |
| 19411 | |
| 19412 | /*Fill in the indication parameters*/ |
| 19413 | wdiInd.wdiIndicationType = WDI_P2P_NOA_START_IND; |
| 19414 | |
| 19415 | wdiInd.wdiIndicationData.wdiP2pNoaStartInfo.status |
| 19416 | = halNoaStartIndMsg.noaStartIndParams.status; |
| 19417 | |
| 19418 | wdiInd.wdiIndicationData.wdiP2pNoaStartInfo.bssIdx |
| 19419 | = halNoaStartIndMsg.noaStartIndParams.bssIdx; |
| 19420 | |
| 19421 | /*Notify UMAC*/ |
| 19422 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19423 | |
| 19424 | return WDI_STATUS_SUCCESS; |
| 19425 | }/*WDI_ProcessNoaAttrInd*/ |
| 19426 | |
| 19427 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19428 | *@brief Process Noa Attr Indication function (called when |
| 19429 | an indication of this kind is being received over the |
| 19430 | bus from HAL) |
| 19431 | |
| 19432 | @param pWDICtx: pointer to the WLAN DAL context |
| 19433 | pEventData: pointer to the event information structure |
| 19434 | |
| 19435 | @see |
| 19436 | @return Result of the function call |
| 19437 | */ |
| 19438 | WDI_Status |
| 19439 | WDI_ProcessP2pNoaAttrInd |
| 19440 | ( |
| 19441 | WDI_ControlBlockType* pWDICtx, |
| 19442 | WDI_EventInfoType* pEventData |
| 19443 | ) |
| 19444 | { |
| 19445 | WDI_LowLevelIndType wdiInd; |
| 19446 | tNoaAttrIndMsg halNoaAttrIndMsg; |
| 19447 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19448 | |
| 19449 | /*------------------------------------------------------------------------- |
| 19450 | Sanity check |
| 19451 | -------------------------------------------------------------------------*/ |
| 19452 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19453 | ( NULL == pEventData->pEventData )) |
| 19454 | { |
| 19455 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19456 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19457 | WDI_ASSERT( 0 ); |
| 19458 | return WDI_STATUS_E_FAILURE; |
| 19459 | } |
| 19460 | |
| 19461 | /*------------------------------------------------------------------------- |
| 19462 | Extract indication and send it to UMAC |
| 19463 | -------------------------------------------------------------------------*/ |
| 19464 | wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams, |
| 19465 | pEventData->pEventData, |
| 19466 | sizeof(halNoaAttrIndMsg.noaAttrIndParams) ); |
| 19467 | |
| 19468 | /*Fill in the indication parameters*/ |
| 19469 | wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19470 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19471 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status |
| 19472 | = halNoaAttrIndMsg.noaAttrIndParams.status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19473 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19474 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex |
| 19475 | = halNoaAttrIndMsg.noaAttrIndParams.index; |
| 19476 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag |
| 19477 | = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag; |
| 19478 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin |
| 19479 | = halNoaAttrIndMsg.noaAttrIndParams.ctWin; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19480 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19481 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt |
| 19482 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt; |
| 19483 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration |
| 19484 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration; |
| 19485 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval |
| 19486 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval; |
| 19487 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime |
| 19488 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19490 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt |
| 19491 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt; |
| 19492 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration |
| 19493 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration; |
| 19494 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval |
| 19495 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval; |
| 19496 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime |
| 19497 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime; |
| 19498 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19499 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19500 | { |
| 19501 | /*Notify UMAC*/ |
| 19502 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19503 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19504 | |
| 19505 | return WDI_STATUS_SUCCESS; |
| 19506 | }/*WDI_ProcessNoaAttrInd*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19507 | |
| 19508 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19509 | @brief Process Tx PER Hit Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19510 | an indication of this kind is being received over the |
| 19511 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19512 | |
| 19513 | @param pWDICtx: pointer to the WLAN DAL context |
| 19514 | pEventData: pointer to the event information structure |
| 19515 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19516 | @see |
| 19517 | @return Result of the function call |
| 19518 | */ |
| 19519 | WDI_Status |
| 19520 | WDI_ProcessTxPerHitInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19521 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19522 | WDI_ControlBlockType* pWDICtx, |
| 19523 | WDI_EventInfoType* pEventData |
| 19524 | ) |
| 19525 | { |
| 19526 | WDI_LowLevelIndType wdiInd; |
| 19527 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19528 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19529 | /*------------------------------------------------------------------------- |
| 19530 | Extract indication and send it to UMAC |
| 19531 | -------------------------------------------------------------------------*/ |
| 19532 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19533 | wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND; |
| 19534 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 19535 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 19536 | { |
| 19537 | /*Notify UMAC*/ |
| 19538 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 19539 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19540 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19541 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19542 | }/*WDI_ProcessTxPerHitInd*/ |
| 19543 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19544 | /** |
| 19545 | @brief WDI_ProcessFTMCommandReq |
| 19546 | Process FTM Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19547 | |
| 19548 | @param pWDICtx: pointer to the WLAN DAL context |
| 19549 | pEventData: pointer to the event information structure |
| 19550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19551 | @see |
| 19552 | @return Result of the function call |
| 19553 | */ |
| 19554 | WDI_Status |
| 19555 | WDI_ProcessFTMCommandReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19556 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19557 | WDI_ControlBlockType* pWDICtx, |
| 19558 | WDI_EventInfoType* pEventData |
| 19559 | ) |
| 19560 | { |
| 19561 | WDI_FTMCommandReqType *ftmCommandReq = NULL; |
| 19562 | wpt_uint8 *ftmCommandBuffer = NULL; |
| 19563 | wpt_uint16 dataOffset; |
| 19564 | wpt_uint16 bufferSize; |
| 19565 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19566 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19567 | -------------------------------------------------------------------------*/ |
| 19568 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19569 | ( NULL == pEventData->pEventData)) |
| 19570 | |
| 19571 | { |
| 19572 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19573 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19574 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19575 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19576 | } |
| 19577 | |
| 19578 | ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData; |
| 19579 | |
| 19580 | /* Get MSG Buffer */ |
| 19581 | WDI_GetMessageBuffer(pWDICtx, |
| 19582 | WDI_FTM_CMD_REQ, |
| 19583 | ftmCommandReq->bodyLength, |
| 19584 | &ftmCommandBuffer, |
| 19585 | &dataOffset, |
| 19586 | &bufferSize); |
| 19587 | |
| 19588 | wpalMemoryCopy(ftmCommandBuffer + dataOffset, |
| 19589 | ftmCommandReq->FTMCommandBody, |
| 19590 | ftmCommandReq->bodyLength); |
| 19591 | |
| 19592 | /* Send MSG */ |
| 19593 | return WDI_SendMsg(pWDICtx, |
| 19594 | ftmCommandBuffer, |
| 19595 | bufferSize, |
| 19596 | pEventData->pCBfnc, |
| 19597 | pEventData->pUserData, |
| 19598 | WDI_FTM_CMD_RESP); |
| 19599 | } |
| 19600 | |
| 19601 | /** |
| 19602 | @brief WDI_ProcessFTMCommandRsp |
| 19603 | Process FTM Command Response from HAL, simply route to HDD FTM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19604 | |
| 19605 | @param pWDICtx: pointer to the WLAN DAL context |
| 19606 | pEventData: pointer to the event information structure |
| 19607 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19608 | @see |
| 19609 | @return Result of the function call |
| 19610 | */ |
| 19611 | WDI_Status |
| 19612 | WDI_ProcessFTMCommandRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19613 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19614 | WDI_ControlBlockType* pWDICtx, |
| 19615 | WDI_EventInfoType* pEventData |
| 19616 | ) |
| 19617 | { |
| 19618 | WDI_FTMCommandRspCb ftmCMDRspCb; |
| 19619 | tProcessPttRspParams *ftmCMDRspData = NULL; |
| 19620 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19621 | |
| 19622 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19623 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19624 | -------------------------------------------------------------------------*/ |
| 19625 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19626 | ( NULL == pEventData->pEventData)) |
| 19627 | { |
| 19628 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19629 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19630 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19631 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19632 | } |
| 19633 | |
| 19634 | ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB; |
| 19635 | |
| 19636 | ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData; |
| 19637 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19638 | wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer, |
| 19639 | (void *)&ftmCMDRspData->pttMsgBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19640 | ftmCMDRspData->pttMsgBuffer.msgBodyLength); |
| 19641 | |
| 19642 | /*Notify UMAC*/ |
| 19643 | ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData); |
| 19644 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19645 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19646 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19647 | /** |
| 19648 | @brief WDI_ProcessHalDumpCmdReq |
| 19649 | Process hal dump Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19650 | |
| 19651 | @param pWDICtx: pointer to the WLAN DAL context |
| 19652 | pEventData: pointer to the event information structure |
| 19653 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19654 | @see |
| 19655 | @return Result of the function call |
| 19656 | */ |
| 19657 | WDI_Status |
| 19658 | WDI_ProcessHALDumpCmdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19659 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19660 | WDI_ControlBlockType* pWDICtx, |
| 19661 | WDI_EventInfoType* pEventData |
| 19662 | ) |
| 19663 | { |
| 19664 | WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL; |
| 19665 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL; |
| 19666 | wpt_uint16 usDataOffset = 0; |
| 19667 | wpt_uint16 usSendSize = 0; |
| 19668 | tHalDumpCmdReqMsg halDumpCmdReqMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19669 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19670 | |
| 19671 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19672 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19673 | -------------------------------------------------------------------------*/ |
| 19674 | if (( NULL == pEventData ) || |
| 19675 | ( NULL == pEventData->pEventData) || |
| 19676 | ( NULL == pEventData->pCBfnc )) |
| 19677 | { |
| 19678 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19679 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19680 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19681 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19682 | } |
| 19683 | |
| 19684 | pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData; |
| 19685 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc; |
| 19686 | |
| 19687 | /* Copying the HAL DUMP Command Information HAL Structure*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19688 | halDumpCmdReqMsg.dumpCmdReqParams.argument1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19689 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19690 | halDumpCmdReqMsg.dumpCmdReqParams.argument2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19691 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19692 | halDumpCmdReqMsg.dumpCmdReqParams.argument3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19693 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19694 | halDumpCmdReqMsg.dumpCmdReqParams.argument4 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19695 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19696 | halDumpCmdReqMsg.dumpCmdReqParams.argument5 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19697 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19698 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19699 | /*----------------------------------------------------------------------- |
| 19700 | Get message buffer |
| 19701 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19702 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19703 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams), |
| 19704 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19705 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19706 | (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) ))) |
| 19707 | { |
| 19708 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19709 | "Unable to get send buffer in HAL Dump Command req %x %x %x", |
| 19710 | pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb); |
| 19711 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19712 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19713 | } |
| 19714 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19715 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 19716 | &halDumpCmdReqMsg.dumpCmdReqParams, |
| 19717 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19718 | |
| 19719 | pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19720 | pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19721 | |
| 19722 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19723 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19724 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19725 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 19726 | wdiHALDumpCmdRspCb, pEventData->pUserData, |
| 19727 | WDI_HAL_DUMP_CMD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19728 | } |
| 19729 | |
| 19730 | /** |
| 19731 | @brief WDI_ProcessHalDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19732 | Process hal Dump Command Response from HAL, simply route to HDD |
| 19733 | |
| 19734 | @param pWDICtx: pointer to the WLAN DAL context |
| 19735 | pEventData: pointer to the event information structure |
| 19736 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19737 | @see |
| 19738 | @return Result of the function call |
| 19739 | */ |
| 19740 | WDI_Status |
| 19741 | WDI_ProcessHALDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19742 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19743 | WDI_ControlBlockType* pWDICtx, |
| 19744 | WDI_EventInfoType* pEventData |
| 19745 | ) |
| 19746 | { |
| 19747 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb; |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 19748 | tHalDumpCmdRspParams halDumpCmdRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19749 | WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp; |
| 19750 | |
| 19751 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19752 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19753 | -------------------------------------------------------------------------*/ |
| 19754 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 19755 | ( NULL == pEventData->pEventData)) |
| 19756 | { |
| 19757 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19758 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19759 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19760 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19761 | } |
| 19762 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19763 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19764 | |
| 19765 | /*Initialize the WDI Response structure */ |
| 19766 | wdiHALDumpCmdRsp.usBufferLen = 0; |
| 19767 | wdiHALDumpCmdRsp.pBuffer = NULL; |
| 19768 | |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 19769 | wpalMemoryCopy( &halDumpCmdRspParams, |
| 19770 | pEventData->pEventData, |
| 19771 | sizeof(tHalDumpCmdRspParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19772 | |
| 19773 | wdiHALDumpCmdRsp.wdiStatus = |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 19774 | WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19775 | |
| 19776 | if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 19777 | (halDumpCmdRspParams.rspLength != 0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19778 | { |
| 19779 | /* Copy the response data */ |
Gopichand Nakkala | ab4786d | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 19780 | wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams.rspLength; |
| 19781 | wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams.rspLength); |
| 19782 | |
| 19783 | wpalMemoryCopy( wdiHALDumpCmdRsp.pBuffer, |
| 19784 | &halDumpCmdRspParams.rspBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19785 | sizeof(wdiHALDumpCmdRsp.usBufferLen)); |
| 19786 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19787 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19788 | /*Notify UMAC*/ |
| 19789 | wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData); |
| 19790 | |
| 19791 | if(wdiHALDumpCmdRsp.pBuffer != NULL) |
| 19792 | { |
| 19793 | /* Free the allocated buffer */ |
| 19794 | wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer); |
| 19795 | } |
| 19796 | return WDI_STATUS_SUCCESS; |
| 19797 | } |
| 19798 | |
| 19799 | /*========================================================================== |
| 19800 | CONTRL TRANSPORT INTERACTION |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19801 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19802 | Callback function registered with the control transport - for receiving |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19803 | notifications and packets |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19804 | ==========================================================================*/ |
| 19805 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19806 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19807 | when it wishes to send up a notification like the ones |
| 19808 | mentioned above. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19809 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19810 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19811 | |
| 19812 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19813 | wctsEvent: the event being notified |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19814 | wctsNotifyCBData: the callback data of the user |
| 19815 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19816 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19817 | |
| 19818 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19819 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19820 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19821 | WDI_NotifyMsgCTSCB |
| 19822 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19823 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19824 | WCTS_NotifyEventType wctsEvent, |
| 19825 | void* wctsNotifyCBData |
| 19826 | ) |
| 19827 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19828 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19829 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19830 | |
| 19831 | if (NULL == pWDICtx ) |
| 19832 | { |
| 19833 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19834 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19835 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19836 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19837 | } |
| 19838 | |
| 19839 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 19840 | { |
| 19841 | /* callback presumably occurred after close */ |
| 19842 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19843 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19844 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19845 | } |
| 19846 | |
| 19847 | if ( WCTS_EVENT_OPEN == wctsEvent ) |
| 19848 | { |
| 19849 | /*Flag must be set atomically as it is checked from incoming request |
| 19850 | functions*/ |
| 19851 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19852 | pWDICtx->bCTOpened = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19853 | |
| 19854 | /*Nothing to do - so try to dequeue any pending request that may have |
| 19855 | occurred while we were trying to establish this*/ |
| 19856 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19857 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19858 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19859 | else if ( WCTS_EVENT_CLOSE == wctsEvent ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19860 | { |
| 19861 | /*Flag must be set atomically as it is checked from incoming request |
| 19862 | functions*/ |
| 19863 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19864 | pWDICtx->bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19865 | |
| 19866 | /*No other request will be processed from now on - fail all*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19867 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19868 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 19869 | |
| 19870 | /*Notify that the Control Channel is closed */ |
| 19871 | wpalEventSet(&pWDICtx->wctsActionEvent); |
| 19872 | } |
| 19873 | |
| 19874 | }/*WDI_NotifyMsgCTSCB*/ |
| 19875 | |
| 19876 | |
| 19877 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19878 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19879 | when it wishes to send up a packet received over the |
| 19880 | bus. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19881 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19882 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19883 | |
| 19884 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19885 | pMsg: the packet |
| 19886 | uLen: the packet length |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19887 | wctsRxMsgCBData: the callback data of the user |
| 19888 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19889 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19890 | |
| 19891 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19892 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19893 | void |
| 19894 | WDI_RXMsgCTSCB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19895 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19896 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19897 | void* pMsg, |
| 19898 | wpt_uint32 uLen, |
| 19899 | void* wctsRxMsgCBData |
| 19900 | ) |
| 19901 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19902 | tHalMsgHeader *pHalMsgHeader; |
| 19903 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19904 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData; |
| 19905 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19906 | |
| 19907 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19908 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19909 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19910 | if ((NULL == pWDICtx ) || ( NULL == pMsg ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19911 | ( uLen < sizeof(tHalMsgHeader))) |
| 19912 | { |
| 19913 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19914 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19915 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19916 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19917 | } |
| 19918 | |
| 19919 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 19920 | { |
| 19921 | /* callback presumably occurred after close */ |
| 19922 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 19923 | "%s: Invalid control block", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19924 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19925 | } |
| 19926 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19927 | /*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] | 19928 | context - so no serialization is necessary here |
| 19929 | ! - revisit this assumption */ |
| 19930 | |
| 19931 | pHalMsgHeader = (tHalMsgHeader *)pMsg; |
| 19932 | |
| 19933 | if ( uLen != pHalMsgHeader->msgLen ) |
| 19934 | { |
| 19935 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19936 | "Invalid packet received from HAL - catastrophic failure"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19937 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); |
| 19938 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19939 | } |
| 19940 | |
| 19941 | wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType ); |
| 19942 | |
| 19943 | /*The message itself starts after the header*/ |
| 19944 | wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader); |
| 19945 | wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader); |
| 19946 | wdiEventData.pCBfnc = gWDICb.pfncRspCB; |
| 19947 | wdiEventData.pUserData = gWDICb.pRspCBUserData; |
| 19948 | |
| 19949 | |
| 19950 | if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 19951 | { |
| 19952 | /*Stop the timer as the response was received */ |
| 19953 | /*!UT - check for potential race conditions between stop and response */ |
| 19954 | wpalTimerStop(&pWDICtx->wptResponseTimer); |
| 19955 | } |
| 19956 | /* Check if we receive a response message which is not expected */ |
| 19957 | else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN ) |
| 19958 | { |
| 19959 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 19960 | "Received response %s (%d) when expecting %s (%d) - catastrophic failure", |
| 19961 | WDI_getRespMsgString(wdiEventData.wdiResponse), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19962 | wdiEventData.wdiResponse, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19963 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 19964 | pWDICtx->wdiExpectedResponse); |
| 19965 | /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */ |
| 19966 | return; |
| 19967 | } |
| 19968 | |
| 19969 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19970 | "Rx smth from HAL: %d", wdiEventData.wdiResponse); |
| 19971 | |
| 19972 | /*Post response event to the state machine*/ |
| 19973 | WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData); |
| 19974 | |
| 19975 | }/*WDI_RXMsgCTSCB*/ |
| 19976 | |
| 19977 | |
| 19978 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19979 | Internal Helper Routines |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19980 | ========================================================================*/ |
| 19981 | |
| 19982 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19983 | @brief WDI_CleanCB - internal helper routine used to clean the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19984 | WDI Main Control Block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19985 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19986 | @param pWDICtx - pointer to the control block |
| 19987 | |
| 19988 | @return Result of the function call |
| 19989 | */ |
| 19990 | WPT_INLINE WDI_Status |
| 19991 | WDI_CleanCB |
| 19992 | ( |
| 19993 | WDI_ControlBlockType* pWDICtx |
| 19994 | ) |
| 19995 | { |
| 19996 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19997 | |
| 19998 | /*Clean the WDI Control Block*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19999 | wpalMemoryZero( pWDICtx, sizeof(*pWDICtx)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20000 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20001 | pWDICtx->uGlobalState = WDI_MAX_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20002 | pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS; |
| 20003 | pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS; |
| 20004 | |
| 20005 | WDI_ResetAssocSessions( pWDICtx ); |
| 20006 | |
| 20007 | return WDI_STATUS_SUCCESS; |
| 20008 | }/*WDI_CleanCB*/ |
| 20009 | |
| 20010 | |
| 20011 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20012 | @brief Process request helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20013 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20014 | |
| 20015 | @param pWDICtx: pointer to the WLAN DAL context |
| 20016 | pEventData: pointer to the event information structure |
| 20017 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20018 | @see |
| 20019 | @return Result of the function call |
| 20020 | */ |
| 20021 | WPT_INLINE WDI_Status |
| 20022 | WDI_ProcessRequest |
| 20023 | ( |
| 20024 | WDI_ControlBlockType* pWDICtx, |
| 20025 | WDI_EventInfoType* pEventData |
| 20026 | ) |
| 20027 | { |
| 20028 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20030 | /*!! Skip sanity check as this is called from the FSM functionss which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20031 | already checked these pointers*/ |
| 20032 | |
| 20033 | if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) && |
| 20034 | ( NULL != pfnReqProcTbl[pEventData->wdiRequest] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20035 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20036 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20037 | "Calling request processing function for req %s (%d) %x", |
| 20038 | WDI_getReqMsgString(pEventData->wdiRequest), |
| 20039 | pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]); |
| 20040 | return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData); |
| 20041 | } |
| 20042 | else |
| 20043 | { |
| 20044 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20045 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20046 | pEventData->wdiRequest); |
| 20047 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 20048 | } |
| 20049 | }/*WDI_ProcessRequest*/ |
| 20050 | |
| 20051 | |
| 20052 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20053 | @brief Get message helper function - it allocates memory for a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20054 | message that is to be sent to HAL accross the bus and |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20055 | prefixes it with a send message header |
| 20056 | |
| 20057 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20058 | wdiReqType: type of the request being sent |
| 20059 | uBufferLen: message buffer len |
| 20060 | pMsgBuffer: resulting allocated buffer |
| 20061 | pusDataOffset: offset in the buffer where the caller |
| 20062 | can start copying its message data |
| 20063 | puBufferSize: the resulting buffer size (offset+buff |
| 20064 | len) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20066 | @see |
| 20067 | @return Result of the function call |
| 20068 | */ |
| 20069 | WDI_Status |
| 20070 | WDI_GetMessageBuffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20071 | ( |
| 20072 | WDI_ControlBlockType* pWDICtx, |
| 20073 | WDI_RequestEnumType wdiReqType, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20074 | wpt_uint16 usBufferLen, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20075 | wpt_uint8** pMsgBuffer, |
| 20076 | wpt_uint16* pusDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20077 | wpt_uint16* pusBufferSize |
| 20078 | ) |
| 20079 | { |
| 20080 | tHalMsgHeader halMsgHeader; |
| 20081 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20082 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20083 | /*!! No sanity check here as we trust the called - ! check this assumption |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20084 | again*/ |
| 20085 | |
| 20086 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20087 | Try to allocate message buffer from PAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20088 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20089 | *pusBufferSize = sizeof(halMsgHeader) + usBufferLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20090 | *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize); |
| 20091 | if ( NULL == *pMsgBuffer ) |
| 20092 | { |
| 20093 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20094 | "Unable to allocate message buffer for req %s (%d)", |
| 20095 | WDI_getReqMsgString(wdiReqType), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20096 | wdiReqType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20097 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20098 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20099 | } |
| 20100 | |
| 20101 | /*------------------------------------------------------------------------- |
| 20102 | Fill in the message header |
| 20103 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20104 | halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType); |
| 20105 | /* Fill msgVersion */ |
| 20106 | #ifdef WLAN_FEATURE_11AC |
| 20107 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 20108 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20109 | else |
| 20110 | #endif |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 20111 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20112 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20113 | halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen; |
| 20114 | *pusDataOffset = sizeof(halMsgHeader); |
| 20115 | wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader)); |
| 20116 | |
| 20117 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20118 | }/*WDI_GetMessageBuffer*/ |
| 20119 | |
| 20120 | |
| 20121 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20122 | @brief Send message helper function - sends a message over the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20123 | bus using the control tranport and saves some info in |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20124 | the CB |
| 20125 | |
| 20126 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20127 | pSendBuffer: buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20128 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20129 | usSendSize size of the buffer to be sent |
| 20130 | pRspCb: response callback - save in the WDI |
| 20131 | CB |
| 20132 | pUserData: user data associated with the |
| 20133 | callback |
| 20134 | wdiExpectedResponse: the code of the response that is |
| 20135 | expected to be rx-ed for this request |
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 | @see |
| 20138 | @return Result of the function call |
| 20139 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20140 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20141 | WDI_SendMsg |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20142 | ( |
| 20143 | WDI_ControlBlockType* pWDICtx, |
| 20144 | wpt_uint8* pSendBuffer, |
| 20145 | wpt_uint32 usSendSize, |
| 20146 | void* pRspCb, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20147 | void* pUserData, |
| 20148 | WDI_ResponseEnumType wdiExpectedResponse |
| 20149 | ) |
| 20150 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20151 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20152 | wpt_uint32 ret; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20153 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20154 | |
| 20155 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20156 | Save needed info in the CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20157 | ------------------------------------------------------------------------*/ |
| 20158 | pWDICtx->pRspCBUserData = pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20159 | pWDICtx->pfncRspCB = pRspCb; |
| 20160 | pWDICtx->wdiExpectedResponse = wdiExpectedResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20161 | |
| 20162 | /*----------------------------------------------------------------------- |
| 20163 | Call the CTS to send this message over - free message afterwards |
| 20164 | - notify transport failure |
| 20165 | Note: CTS is reponsible for freeing the message buffer. |
| 20166 | -----------------------------------------------------------------------*/ |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20167 | ret = WCTS_SendMessage(pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize); |
| 20168 | if ((eWLAN_PAL_STATUS_SUCCESS != ret) && |
| 20169 | (eWLAN_PAL_STATUS_E_RESOURCES != ret)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20170 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20171 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20172 | "Failed to send message over the bus - catastrophic failure"); |
| 20173 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20174 | wdiStatus = WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20175 | } |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20176 | else |
| 20177 | { |
| 20178 | /* even when message was placed in CTS deferred Q, we will treat it |
| 20179 | success but log this info |
| 20180 | */ |
| 20181 | if (eWLAN_PAL_STATUS_E_RESOURCES == ret) |
| 20182 | { |
| 20183 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 20184 | "WDI_SendMsg: message placed in CTS deferred Q, expected " |
| 20185 | "response %s (%d)", |
| 20186 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 20187 | pWDICtx->wdiExpectedResponse); |
Gopichand Nakkala | 0f662fa | 2012-12-23 08:30:59 -0800 | [diff] [blame] | 20188 | WDI_ASSERT(0); |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20189 | } |
| 20190 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20191 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20192 | /*Check if originator provided a request status callback*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20193 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 20194 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20195 | /*Inform originator whether request went through or not*/ |
| 20196 | WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB; |
| 20197 | void *callbackContext = pWDICtx->pReqStatusUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20198 | pWDICtx->wdiReqStatusCB = NULL; |
| 20199 | pWDICtx->pReqStatusUserData = NULL; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20200 | callback(wdiStatus, callbackContext); |
| 20201 | |
| 20202 | /*For WDI requests which have registered a request callback, |
| 20203 | inform the WDA caller of the same via setting the return value |
| 20204 | (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt |
| 20205 | end up repeating the functonality in the req callback for the |
| 20206 | WDI_STATUS_E_FAILURE case*/ |
| 20207 | if (wdiStatus == WDI_STATUS_E_FAILURE) |
| 20208 | wdiStatus = WDI_STATUS_PENDING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20209 | } |
| 20210 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20211 | if ( wdiStatus == WDI_STATUS_SUCCESS ) |
| 20212 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20213 | /*Start timer for the expected response */ |
| 20214 | wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT); |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20215 | |
| 20216 | /*cache current timestamp for debugging */ |
Gopichand Nakkala | 0f662fa | 2012-12-23 08:30:59 -0800 | [diff] [blame] | 20217 | pWDICtx->uTimeStampRspTmrStart = wpalGetSystemTime(); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20218 | } |
| 20219 | else |
| 20220 | { |
Jeff Johnson | 1920a72 | 2012-12-10 14:28:09 -0800 | [diff] [blame] | 20221 | /*Inform upper stack layers that a transport fatal error occurred*/ |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20222 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 20223 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20224 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 20225 | return wdiStatus; |
| 20226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20227 | }/*WDI_SendMsg*/ |
| 20228 | |
| 20229 | |
| 20230 | |
| 20231 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20232 | @brief Send indication helper function - sends a message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20233 | the bus using the control transport and saves some info |
| 20234 | in the CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20235 | |
| 20236 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20237 | pSendBuffer: buffer to be sent |
| 20238 | usSendSize: size of the buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20240 | @see |
| 20241 | @return Result of the function call |
| 20242 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20243 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20244 | WDI_SendIndication |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20245 | ( |
| 20246 | WDI_ControlBlockType* pWDICtx, |
| 20247 | wpt_uint8* pSendBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20248 | wpt_uint32 usSendSize |
| 20249 | ) |
| 20250 | { |
| 20251 | wpt_uint32 uStatus ; |
| 20252 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20253 | |
| 20254 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20255 | Call the CTS to send this message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20256 | Note: CTS is reponsible for freeing the message buffer. |
| 20257 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20258 | uStatus = WCTS_SendMessage( pWDICtx->wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20259 | (void*)pSendBuffer, usSendSize ); |
| 20260 | |
| 20261 | /*Inform Upper MAC about the outcome of the request*/ |
| 20262 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 20263 | { |
| 20264 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20265 | "Send indication status : %d", uStatus); |
| 20266 | |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20267 | /* even if CTS placed indication into its deferred Q, we treat it |
| 20268 | * as success and let CTS drain its queue as per smd interrupt to CTS |
| 20269 | */ |
| 20270 | 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] | 20271 | pWDICtx->pReqStatusUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20272 | } |
| 20273 | |
| 20274 | /*If sending of the message failed - it is considered catastrophic and |
| 20275 | indicates an error with the device*/ |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20276 | if (( eWLAN_PAL_STATUS_SUCCESS != uStatus) && |
| 20277 | ( eWLAN_PAL_STATUS_E_RESOURCES != uStatus)) |
| 20278 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20279 | { |
| 20280 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20281 | "Failed to send indication over the bus - catastrophic failure"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20282 | |
| 20283 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 20284 | return WDI_STATUS_E_FAILURE; |
| 20285 | } |
| 20286 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20287 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20288 | }/*WDI_SendIndication*/ |
| 20289 | |
| 20290 | |
| 20291 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20292 | @brief WDI_DetectedDeviceError - called internally by DAL when |
| 20293 | it has detected a failure in the device |
| 20294 | |
| 20295 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20296 | usErrorCode: error code detected by WDI or received |
| 20297 | from HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20298 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20299 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20300 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20301 | */ |
| 20302 | void |
| 20303 | WDI_DetectedDeviceError |
| 20304 | ( |
| 20305 | WDI_ControlBlockType* pWDICtx, |
| 20306 | wpt_uint16 usErrorCode |
| 20307 | ) |
| 20308 | { |
| 20309 | WDI_LowLevelIndType wdiInd; |
| 20310 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20311 | |
| 20312 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20313 | "Device Error detected code: %d - transitioning to stopped state", |
| 20314 | usErrorCode); |
| 20315 | |
| 20316 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 20317 | |
| 20318 | WDI_STATableStop(pWDICtx); |
| 20319 | |
| 20320 | WDI_ResetAssocSessions(pWDICtx); |
| 20321 | |
| 20322 | /*Set the expected state transition to stopped - because the device |
| 20323 | experienced a failure*/ |
| 20324 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 20325 | |
| 20326 | /*Transition to stopped to fail all incomming requests from this point on*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20327 | WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20328 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20329 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20330 | |
| 20331 | /*TO DO: - there should be an attempt to reset the device here*/ |
| 20332 | |
| 20333 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 20334 | |
| 20335 | /*------------------------------------------------------------------------ |
| 20336 | Notify UMAC if a handler is registered |
| 20337 | ------------------------------------------------------------------------*/ |
| 20338 | if (pWDICtx->wdiLowLevelIndCB) |
| 20339 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20340 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 20341 | wdiInd.wdiIndicationData.usErrorCode = usErrorCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20342 | |
| 20343 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData); |
| 20344 | } |
| 20345 | }/*WDI_DetectedDeviceError*/ |
| 20346 | |
| 20347 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20348 | @brief This callback is invoked by the wpt when a timer that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20349 | we started on send message has expire - this should |
| 20350 | never happen - it means device is stuck and cannot |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20351 | reply - trigger catastrophic failure |
| 20352 | @param |
| 20353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20354 | pUserData: the callback data of the user (ptr to WDI CB) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20355 | |
| 20356 | @see |
| 20357 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20358 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20359 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20360 | WDI_ResponseTimerCB |
| 20361 | ( |
| 20362 | void *pUserData |
| 20363 | ) |
| 20364 | { |
| 20365 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 20366 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20367 | |
| 20368 | if (NULL == pWDICtx ) |
| 20369 | { |
| 20370 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20371 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20372 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20373 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20374 | } |
| 20375 | |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20376 | /*cache current timestamp for debugging */ |
Gopichand Nakkala | 0f662fa | 2012-12-23 08:30:59 -0800 | [diff] [blame] | 20377 | pWDICtx->uTimeStampRspTmrExp = wpalGetSystemTime(); |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20378 | |
| 20379 | /* If response timer is running at this time that means this timer |
| 20380 | * event is not for the last request but rather last-to-last request and |
| 20381 | * this timer event has come after we recevied respone for last-to-last |
| 20382 | * message |
| 20383 | */ |
| 20384 | if (VOS_TIMER_STATE_RUNNING == wpalTimerGetCurStatus(&pWDICtx->wptResponseTimer)) |
| 20385 | { |
| 20386 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 20387 | "WDI_ResponseTimerCB: timer in running state on timer event, " |
| 20388 | "ignore tmr event, timeStampTmrStart: %ld, timeStampTmrExp: %ld", |
| 20389 | pWDICtx->uTimeStampRspTmrStart, pWDICtx->uTimeStampRspTmrExp); |
| 20390 | return; |
| 20391 | } |
| 20392 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20393 | if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse ) |
| 20394 | { |
| 20395 | |
Madan Mohan Koyyalamudi | bf77107 | 2012-11-27 18:50:02 +0530 | [diff] [blame] | 20396 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20397 | "Timeout occurred while waiting for %s (%d) message from device " |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20398 | " - catastrophic failure, timeStampTmrStart: %ld, timeStampTmrExp: %ld", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20399 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20400 | pWDICtx->wdiExpectedResponse, pWDICtx->uTimeStampRspTmrStart, |
| 20401 | pWDICtx->uTimeStampRspTmrExp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20402 | /* WDI timeout means Riva is not responding or SMD communication to Riva |
| 20403 | * is not happening. The only possible way to recover from this error |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 20404 | * is to initiate SSR from APPS |
| 20405 | * There is also an option to re-enable wifi, which will eventually |
| 20406 | * trigger SSR |
| 20407 | */ |
| 20408 | #ifndef WDI_RE_ENABLE_WIFI_ON_WDI_TIMEOUT |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 20409 | wpalWcnssResetIntr(); |
| 20410 | /* if this timer fires, it means Riva did not receive the FIQ */ |
| 20411 | wpalTimerStart(&pWDICtx->ssrTimer, WDI_SSR_TIMEOUT); |
Madan Mohan Koyyalamudi | a2fc641 | 2012-10-21 12:06:12 -0700 | [diff] [blame] | 20412 | #else |
| 20413 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 20414 | wpalWlanReload(); |
| 20415 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20416 | } |
| 20417 | else |
| 20418 | { |
| 20419 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Gopichand Nakkala | b1fe40e | 2012-12-21 15:28:36 -0800 | [diff] [blame] | 20420 | "Timeout occurred but not waiting for any response %d " |
| 20421 | "timeStampTmrStart: %ld, timeStampTmrExp: %ld", |
| 20422 | pWDICtx->wdiExpectedResponse, pWDICtx->uTimeStampRspTmrStart, |
| 20423 | pWDICtx->uTimeStampRspTmrExp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20424 | } |
| 20425 | |
| 20426 | return; |
| 20427 | |
| 20428 | }/*WDI_ResponseTimerCB*/ |
| 20429 | |
| 20430 | |
| 20431 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20432 | @brief Process response helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20434 | |
| 20435 | @param pWDICtx: pointer to the WLAN DAL context |
| 20436 | pEventData: pointer to the event information structure |
| 20437 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20438 | @see |
| 20439 | @return Result of the function call |
| 20440 | */ |
| 20441 | WPT_INLINE WDI_Status |
| 20442 | WDI_ProcessResponse |
| 20443 | ( |
| 20444 | WDI_ControlBlockType* pWDICtx, |
| 20445 | WDI_EventInfoType* pEventData |
| 20446 | ) |
| 20447 | { |
| 20448 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20449 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20450 | /* Skip sanity check as this is called from the FSM functions which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20451 | already checked these pointers |
| 20452 | ! - revisit this assumption */ |
| 20453 | if (( pEventData->wdiResponse < WDI_MAX_RESP ) && |
| 20454 | ( NULL != pfnRspProcTbl[pEventData->wdiResponse] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20455 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20456 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20457 | "Calling response processing function for resp %s (%d) %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20458 | WDI_getRespMsgString(pEventData->wdiResponse), |
| 20459 | pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]); |
| 20460 | return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData); |
| 20461 | } |
| 20462 | else |
| 20463 | { |
| 20464 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20465 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20466 | pEventData->wdiResponse); |
| 20467 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 20468 | } |
| 20469 | }/*WDI_ProcessResponse*/ |
| 20470 | |
| 20471 | |
| 20472 | /*========================================================================= |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20473 | QUEUE SUPPORT UTILITY FUNCTIONS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20474 | =========================================================================*/ |
| 20475 | |
| 20476 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20477 | @brief Utility function used by the DAL Core to help queue a |
| 20478 | request that cannot be processed right away. |
| 20479 | @param |
| 20480 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20481 | pWDICtx: - pointer to the WDI control block |
| 20482 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20483 | queued |
| 20484 | |
| 20485 | @see |
| 20486 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20487 | */ |
| 20488 | WDI_Status |
| 20489 | WDI_QueuePendingReq |
| 20490 | ( |
| 20491 | WDI_ControlBlockType* pWDICtx, |
| 20492 | WDI_EventInfoType* pEventData |
| 20493 | ) |
| 20494 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20495 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20496 | WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20497 | void* pEventInfo = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20498 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20499 | |
| 20500 | if ( NULL == pEventDataQueue ) |
| 20501 | { |
| 20502 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20503 | "Cannot allocate memory for queueing"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20504 | WDI_ASSERT(0); |
| 20505 | return WDI_STATUS_MEM_FAILURE; |
| 20506 | } |
| 20507 | |
| 20508 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 20509 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 20510 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 20511 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20512 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20513 | |
| 20514 | if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL ) |
| 20515 | { |
| 20516 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20517 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20518 | if ( NULL == pEventInfo ) |
| 20519 | { |
| 20520 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20521 | "Cannot allocate memory for queueing event data info"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20522 | WDI_ASSERT(0); |
| 20523 | wpalMemoryFree(pEventDataQueue); |
| 20524 | return WDI_STATUS_MEM_FAILURE; |
| 20525 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20526 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20527 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 20528 | |
| 20529 | } |
| 20530 | pEventDataQueue->pEventData = pEventInfo; |
| 20531 | |
| 20532 | /*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] | 20533 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20534 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20535 | wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20536 | |
| 20537 | return WDI_STATUS_SUCCESS; |
| 20538 | }/*WDI_QueuePendingReq*/ |
| 20539 | |
| 20540 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20541 | @brief Callback function for serializing queued message |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20542 | processing in the control context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20543 | @param |
| 20544 | |
| 20545 | pMsg - pointer to the message |
| 20546 | |
| 20547 | @see |
| 20548 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20549 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20550 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20551 | WDI_PALCtrlMsgCB |
| 20552 | ( |
| 20553 | wpt_msg *pMsg |
| 20554 | ) |
| 20555 | { |
| 20556 | WDI_EventInfoType* pEventData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20557 | WDI_ControlBlockType* pWDICtx = NULL; |
| 20558 | WDI_Status wdiStatus; |
| 20559 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20560 | void* pUserData; |
| 20561 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20562 | |
| 20563 | if (( NULL == pMsg )|| |
| 20564 | ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) || |
| 20565 | ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext ))) |
| 20566 | { |
| 20567 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20568 | "Invalid message received on serialize ctrl context API"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20569 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20570 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20571 | } |
| 20572 | |
| 20573 | /*Transition back to the state that we had before serialization |
| 20574 | - serialization transitions us to BUSY to stop any incomming requests |
| 20575 | ! TO DO L: possible race condition here if a request comes in between the |
| 20576 | state transition and the post function*/ |
| 20577 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20578 | WDI_STATE_TRANSITION( pWDICtx, pMsg->val); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20579 | |
| 20580 | /*----------------------------------------------------------------------- |
| 20581 | Check to see what type of event we are serializing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20582 | - responses are never expected to come through here |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20583 | -----------------------------------------------------------------------*/ |
| 20584 | switch ( pEventData->wdiRequest ) |
| 20585 | { |
| 20586 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20587 | case WDI_STOP_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20588 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData); |
| 20589 | break; |
| 20590 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20591 | case WDI_NV_DOWNLOAD_REQ: |
| 20592 | // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT. |
| 20593 | // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly. |
| 20594 | if (pWDICtx->uGlobalState == WDI_STARTED_ST) |
| 20595 | { |
| 20596 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20597 | "%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] | 20598 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 20599 | } |
| 20600 | else |
| 20601 | { |
| 20602 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData); |
| 20603 | } |
| 20604 | |
| 20605 | break; |
| 20606 | |
| 20607 | default: |
| 20608 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 20609 | break; |
| 20610 | }/*switch ( pEventData->wdiRequest )*/ |
| 20611 | |
| 20612 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 20613 | { |
| 20614 | WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData); |
| 20615 | |
| 20616 | if ( NULL != pfnReqStatusCB ) |
| 20617 | { |
| 20618 | /*Fail the request*/ |
| 20619 | pfnReqStatusCB( wdiStatus, pUserData); |
| 20620 | } |
| 20621 | } |
| 20622 | |
| 20623 | /* Free data - that was allocated when queueing*/ |
| 20624 | if( pEventData != NULL ) |
| 20625 | { |
| 20626 | if( pEventData->pEventData != NULL ) |
| 20627 | { |
| 20628 | wpalMemoryFree(pEventData->pEventData); |
| 20629 | } |
| 20630 | wpalMemoryFree(pEventData); |
| 20631 | } |
| 20632 | |
| 20633 | if( pMsg != NULL ) |
| 20634 | { |
| 20635 | wpalMemoryFree(pMsg); |
| 20636 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20637 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20638 | }/*WDI_PALCtrlMsgCB*/ |
| 20639 | |
| 20640 | /** |
| 20641 | @brief Utility function used by the DAL Core to help dequeue |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20642 | and schedule for execution a pending request |
| 20643 | @param |
| 20644 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20645 | pWDICtx: - pointer to the WDI control block |
| 20646 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20647 | queued |
| 20648 | |
| 20649 | @see |
| 20650 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20651 | */ |
| 20652 | WDI_Status |
| 20653 | WDI_DequeuePendingReq |
| 20654 | ( |
| 20655 | WDI_ControlBlockType* pWDICtx |
| 20656 | ) |
| 20657 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20658 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20659 | WDI_EventInfoType* pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20660 | wpt_msg* palMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20661 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 20662 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20663 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20664 | |
| 20665 | if ( NULL == pNode ) |
| 20666 | { |
| 20667 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20668 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20669 | return WDI_STATUS_SUCCESS; |
| 20670 | } |
| 20671 | |
| 20672 | /*The node actually points to the 1st element inside the Event Data struct - |
| 20673 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20674 | pEventData = (WDI_EventInfoType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20675 | |
| 20676 | /*Serialize processing in the control thread |
| 20677 | !TO DO: - check to see if these are all the messages params that need |
| 20678 | to be filled in*/ |
| 20679 | palMsg = wpalMemoryAllocate(sizeof(wpt_msg)); |
| 20680 | |
| 20681 | if ( NULL == palMsg ) |
| 20682 | { |
| 20683 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20684 | "WDI_DequeuePendingReq: Cannot allocate memory for palMsg."); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20685 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20686 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20687 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20688 | palMsg->pContext = pWDICtx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20689 | palMsg->callback = WDI_PALCtrlMsgCB; |
| 20690 | palMsg->ptr = pEventData; |
| 20691 | |
| 20692 | /*Save the global state as we need it on the other side*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20693 | palMsg->val = pWDICtx->uGlobalState; |
| 20694 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20695 | /*Transition back to BUSY as we need to handle a queued request*/ |
| 20696 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20698 | wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg); |
| 20699 | |
| 20700 | return WDI_STATUS_PENDING; |
| 20701 | }/*WDI_DequeuePendingReq*/ |
| 20702 | |
| 20703 | |
| 20704 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20705 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20706 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20707 | away.- The assoc requests will be queued by BSSID |
| 20708 | @param |
| 20709 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20710 | pWDICtx: - pointer to the WDI control block |
| 20711 | pEventData: pointer to the evnt info that needs to be queued |
| 20712 | macBSSID: bssid |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20713 | |
| 20714 | @see |
| 20715 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20716 | */ |
| 20717 | WDI_Status |
| 20718 | WDI_QueueNewAssocRequest |
| 20719 | ( |
| 20720 | WDI_ControlBlockType* pWDICtx, |
| 20721 | WDI_EventInfoType* pEventData, |
| 20722 | wpt_macAddr macBSSID |
| 20723 | ) |
| 20724 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20725 | wpt_uint8 i; |
| 20726 | WDI_BSSSessionType* pSession = NULL; |
| 20727 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20728 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20729 | void* pEventInfo; |
| 20730 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20731 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20732 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20733 | |
| 20734 | /*------------------------------------------------------------------------ |
| 20735 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20736 | ------------------------------------------------------------------------*/ |
| 20737 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20738 | { |
| 20739 | if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse ) |
| 20740 | { |
| 20741 | /*Found an empty session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20742 | pSession = &pWDICtx->aBSSSessions[i]; |
| 20743 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20744 | } |
| 20745 | } |
| 20746 | |
| 20747 | if ( i >= WDI_MAX_BSS_SESSIONS ) |
| 20748 | { |
| 20749 | /*Cannot find any empty sessions*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20750 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20751 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20752 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20753 | /*------------------------------------------------------------------------ |
| 20754 | Fill in the BSSID for this session and set the usage flag |
| 20755 | ------------------------------------------------------------------------*/ |
| 20756 | wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20757 | pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20758 | |
| 20759 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20760 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20761 | ------------------------------------------------------------------------*/ |
| 20762 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 20763 | if ( NULL == pEventDataQueue ) |
| 20764 | { |
| 20765 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20766 | "%s: Cannot allocate memory for queue node", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20767 | WDI_ASSERT(0); |
| 20768 | return WDI_STATUS_MEM_FAILURE; |
| 20769 | } |
| 20770 | |
| 20771 | pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType)); |
| 20772 | if ( NULL == pSessionIdElement ) |
| 20773 | { |
| 20774 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20775 | "%s: Cannot allocate memory for session ID", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20776 | WDI_ASSERT(0); |
| 20777 | wpalMemoryFree(pEventDataQueue); |
| 20778 | return WDI_STATUS_MEM_FAILURE; |
| 20779 | } |
| 20780 | |
| 20781 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 20782 | if ( NULL == pEventInfo ) |
| 20783 | { |
| 20784 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20785 | "%s: Cannot allocate memory for event data info", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20786 | WDI_ASSERT(0); |
| 20787 | wpalMemoryFree(pSessionIdElement); |
| 20788 | wpalMemoryFree(pEventDataQueue); |
| 20789 | return WDI_STATUS_MEM_FAILURE; |
| 20790 | } |
| 20791 | |
| 20792 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 20793 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 20794 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 20795 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20796 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20797 | |
| 20798 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 20799 | pEventDataQueue->pEventData = pEventInfo; |
| 20800 | |
| 20801 | /*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] | 20802 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20803 | |
| 20804 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20805 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20806 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20807 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20808 | |
| 20809 | /*We need to maintain a separate list that keeps track of the order in which |
| 20810 | the new assoc requests are being queued such that we can start processing |
| 20811 | them in the order that they had arrived*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20812 | pSessionIdElement->ucIndex = i; |
| 20813 | pNode = (wpt_list_node*)pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20814 | |
| 20815 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20816 | "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20817 | wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20818 | |
| 20819 | /*Return pending as this is what the status of the request is since it has |
| 20820 | been queued*/ |
| 20821 | return WDI_STATUS_PENDING; |
| 20822 | }/*WDI_QueueNewAssocRequest*/ |
| 20823 | |
| 20824 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20825 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20826 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20827 | away.- The assoc requests will be queued by BSSID |
| 20828 | @param |
| 20829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20830 | pWDICtx: - pointer to the WDI control block |
| 20831 | pSession: - session in which to queue |
| 20832 | pEventData: pointer to the event info that needs to be |
| 20833 | queued |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20834 | |
| 20835 | @see |
| 20836 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20837 | */ |
| 20838 | WDI_Status |
| 20839 | WDI_QueueAssocRequest |
| 20840 | ( |
| 20841 | WDI_ControlBlockType* pWDICtx, |
| 20842 | WDI_BSSSessionType* pSession, |
| 20843 | WDI_EventInfoType* pEventData |
| 20844 | ) |
| 20845 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20846 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20847 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20848 | void* pEventInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20849 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20850 | |
| 20851 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20852 | Sanity check |
| 20853 | ------------------------------------------------------------------------*/ |
| 20854 | if (( NULL == pSession ) || ( NULL == pWDICtx )) |
| 20855 | { |
| 20856 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20857 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20858 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20859 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20860 | } |
| 20861 | |
| 20862 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20863 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20864 | ------------------------------------------------------------------------*/ |
| 20865 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 20866 | if ( NULL == pEventDataQueue ) |
| 20867 | { |
| 20868 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20869 | "%s: Cannot allocate memory for queueing", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20870 | WDI_ASSERT(0); |
| 20871 | return WDI_STATUS_MEM_FAILURE; |
| 20872 | } |
| 20873 | |
| 20874 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 20875 | if ( NULL == pEventInfo ) |
| 20876 | { |
| 20877 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 20878 | "%s: Cannot allocate memory for queueing event data info", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20879 | __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20880 | WDI_ASSERT(0); |
| 20881 | wpalMemoryFree(pEventDataQueue); |
| 20882 | return WDI_STATUS_MEM_FAILURE; |
| 20883 | } |
| 20884 | |
| 20885 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 20886 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 20887 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 20888 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20889 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20890 | pEventDataQueue->pEventData = pEventInfo; |
| 20891 | |
| 20892 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 20893 | |
| 20894 | /*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] | 20895 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20896 | |
| 20897 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20898 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20899 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20900 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20901 | |
| 20902 | /*The result of this operation is pending because the request has been |
| 20903 | queued and it will be processed at a later moment in time */ |
| 20904 | return WDI_STATUS_PENDING; |
| 20905 | }/*WDI_QueueAssocRequest*/ |
| 20906 | |
| 20907 | /** |
| 20908 | @brief Utility function used by the DAL Core to help dequeue |
| 20909 | an association request that was pending |
| 20910 | The request will be queued up in front of the main |
| 20911 | pending queue for imediate processing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20912 | @param |
| 20913 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20914 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20915 | |
| 20916 | |
| 20917 | @see |
| 20918 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20919 | */ |
| 20920 | WDI_Status |
| 20921 | WDI_DequeueAssocRequest |
| 20922 | ( |
| 20923 | WDI_ControlBlockType* pWDICtx |
| 20924 | ) |
| 20925 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20926 | wpt_list_node* pNode = NULL; |
| 20927 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20928 | WDI_BSSSessionType* pSession; |
| 20929 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20930 | |
| 20931 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20932 | Sanity check |
| 20933 | ------------------------------------------------------------------------*/ |
| 20934 | if ( NULL == pWDICtx ) |
| 20935 | { |
| 20936 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 20937 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20939 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20940 | } |
| 20941 | |
| 20942 | /*------------------------------------------------------------------------ |
| 20943 | An association has been completed => a new association can occur |
| 20944 | Check to see if there are any pending associations -> |
| 20945 | If so , transfer all the pending requests into the busy queue for |
| 20946 | processing |
| 20947 | These requests have arrived prior to the requests in the busy queue |
| 20948 | (bc they needed to be processed in order to be placed in this queue) |
| 20949 | => they will be placed at the front of the busy queue |
| 20950 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20951 | wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20952 | |
| 20953 | if ( NULL == pNode ) |
| 20954 | { |
| 20955 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20956 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20957 | return WDI_STATUS_SUCCESS; |
| 20958 | } |
| 20959 | |
| 20960 | /*The node actually points to the 1st element inside the Session Id struct - |
| 20961 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20962 | pSessionIdElement = (WDI_NextSessionIdType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20963 | |
| 20964 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 20965 | "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex); |
| 20966 | |
| 20967 | if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS ) |
| 20968 | { |
| 20969 | pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex]; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20970 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20971 | /*Transfer all the pending requests in this assoc queue to |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20972 | the front of the main waiting queue for subsequent execution*/ |
| 20973 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20974 | while ( NULL != pNode ) |
| 20975 | { |
| 20976 | /*Place it in front of the main pending list*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20977 | wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode); |
| 20978 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20979 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20980 | pSession->bAssocReqQueued = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20981 | } |
| 20982 | else |
| 20983 | { |
| 20984 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20985 | "Invalid session id queued up for assoc"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20986 | WPAL_ASSERT(0); |
| 20987 | wpalMemoryFree(pSessionIdElement); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20988 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20989 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20990 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20991 | /*Clean this up as it is no longer needed in order to prevent memory leak*/ |
| 20992 | wpalMemoryFree(pSessionIdElement); |
| 20993 | return WDI_STATUS_SUCCESS; |
| 20994 | }/*WDI_DequeueAssocRequest*/ |
| 20995 | |
| 20996 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20997 | @brief Utility function used by the DAL Core to clear any |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20998 | pending requests - all req cb will be called with |
| 20999 | failure and the queue will be emptied. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21000 | @param |
| 21001 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21002 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21003 | |
| 21004 | @see |
| 21005 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21006 | */ |
| 21007 | WDI_Status |
| 21008 | WDI_ClearPendingRequests |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21009 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21010 | WDI_ControlBlockType* pWDICtx |
| 21011 | ) |
| 21012 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21013 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21014 | WDI_EventInfoType* pEventDataQueue = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21015 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21016 | void* pUserData; |
| 21017 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21018 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21019 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21020 | |
| 21021 | /*------------------------------------------------------------------------ |
| 21022 | Go through all the requests and fail them - this will only be called |
| 21023 | 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] | 21024 | pending requests can no longer be sent down to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21025 | ------------------------------------------------------------------------*/ |
| 21026 | while( pNode ) |
| 21027 | { |
| 21028 | /*The node actually points to the 1st element inside the Event Data struct - |
| 21029 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21030 | pEventDataQueue = (WDI_EventInfoType*)pNode; |
| 21031 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21032 | WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData); |
| 21033 | if ( NULL != pfnReqStatusCB ) |
| 21034 | { |
| 21035 | /*Fail the request*/ |
| 21036 | pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData); |
| 21037 | } |
| 21038 | /* Free data - that was allocated when queueing */ |
| 21039 | if ( pEventDataQueue->pEventData != NULL ) |
| 21040 | { |
| 21041 | wpalMemoryFree(pEventDataQueue->pEventData); |
| 21042 | } |
| 21043 | wpalMemoryFree(pEventDataQueue); |
| 21044 | |
| 21045 | if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS) |
| 21046 | { |
| 21047 | break; |
| 21048 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21049 | } |
| 21050 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21051 | return WDI_STATUS_SUCCESS; |
| 21052 | }/*WDI_ClearPendingRequests*/ |
| 21053 | |
| 21054 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21055 | @brief Helper routine used to init the BSS Sessions in the WDI control block |
| 21056 | |
| 21057 | |
| 21058 | @param pWDICtx: pointer to the WLAN DAL context |
| 21059 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21060 | @see |
| 21061 | */ |
| 21062 | void |
| 21063 | WDI_ResetAssocSessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21064 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21065 | WDI_ControlBlockType* pWDICtx |
| 21066 | ) |
| 21067 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21068 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21069 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21070 | |
| 21071 | /*------------------------------------------------------------------------- |
| 21072 | No Sanity check |
| 21073 | -------------------------------------------------------------------------*/ |
| 21074 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21075 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21076 | wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21077 | pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST; |
| 21078 | pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX; |
| 21079 | pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX; |
| 21080 | } |
| 21081 | }/*WDI_ResetAssocSessions*/ |
| 21082 | |
| 21083 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21084 | @brief Helper routine used to find a session based on the BSSID |
| 21085 | |
| 21086 | |
| 21087 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21088 | macBSSID: BSSID of the session |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21089 | pSession: pointer to the session (if found) |
| 21090 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21091 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21092 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21093 | */ |
| 21094 | wpt_uint8 |
| 21095 | WDI_FindAssocSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21096 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21097 | WDI_ControlBlockType* pWDICtx, |
| 21098 | wpt_macAddr macBSSID, |
| 21099 | WDI_BSSSessionType** ppSession |
| 21100 | ) |
| 21101 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21102 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21103 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21104 | |
| 21105 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21106 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21107 | -------------------------------------------------------------------------*/ |
| 21108 | if ( NULL == ppSession ) |
| 21109 | { |
| 21110 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21111 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21112 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21113 | } |
| 21114 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21115 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21117 | /*------------------------------------------------------------------------ |
| 21118 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21119 | ------------------------------------------------------------------------*/ |
| 21120 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21121 | { |
Madan Mohan Koyyalamudi | 3528786 | 2012-10-22 14:52:46 -0700 | [diff] [blame] | 21122 | if ( (pWDICtx->aBSSSessions[i].bInUse == eWLAN_PAL_TRUE) && |
| 21123 | (eWLAN_PAL_TRUE == |
| 21124 | wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, |
| 21125 | WDI_MAC_ADDR_LEN)) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21126 | { |
| 21127 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21128 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21129 | return i; |
| 21130 | } |
| 21131 | } |
| 21132 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21133 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21134 | }/*WDI_FindAssocSession*/ |
| 21135 | |
| 21136 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21137 | @brief Helper routine used to find a session based on the BSSID |
| 21138 | |
| 21139 | |
| 21140 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21141 | ucBSSIdx: BSS Index of the session |
| 21142 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21144 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21145 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21146 | */ |
| 21147 | wpt_uint8 |
| 21148 | WDI_FindAssocSessionByBSSIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21149 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21150 | WDI_ControlBlockType* pWDICtx, |
| 21151 | wpt_uint16 ucBSSIdx, |
| 21152 | WDI_BSSSessionType** ppSession |
| 21153 | ) |
| 21154 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21155 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21156 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21157 | |
| 21158 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21159 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21160 | -------------------------------------------------------------------------*/ |
| 21161 | if ( NULL == ppSession ) |
| 21162 | { |
| 21163 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21164 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21165 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21166 | } |
| 21167 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21168 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21169 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21170 | /*------------------------------------------------------------------------ |
| 21171 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21172 | ------------------------------------------------------------------------*/ |
| 21173 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21174 | { |
| 21175 | if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx ) |
| 21176 | { |
| 21177 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21178 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21179 | return i; |
| 21180 | } |
| 21181 | } |
| 21182 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21183 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21184 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 21185 | |
| 21186 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21187 | @brief Helper routine used to find a session based on the BSSID |
| 21188 | |
| 21189 | |
| 21190 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21191 | ucBSSIdx: BSS Index of the session |
| 21192 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21193 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21194 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21195 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21196 | */ |
| 21197 | wpt_uint8 |
| 21198 | WDI_FindAssocSessionByIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21199 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21200 | WDI_ControlBlockType* pWDICtx, |
| 21201 | wpt_uint16 usIdx, |
| 21202 | WDI_BSSSessionType** ppSession |
| 21203 | ) |
| 21204 | { |
| 21205 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21206 | |
| 21207 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21208 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21209 | -------------------------------------------------------------------------*/ |
| 21210 | if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS ) |
| 21211 | { |
| 21212 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21213 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21214 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21215 | } |
| 21216 | |
| 21217 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21218 | *ppSession = &pWDICtx->aBSSSessions[usIdx]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21219 | |
| 21220 | return usIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21221 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21222 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 21223 | |
| 21224 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21225 | @brief Helper routine used to find an empty session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21226 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21227 | |
| 21228 | |
| 21229 | @param pWDICtx: pointer to the WLAN DAL context |
| 21230 | pSession: pointer to the session (if found) |
| 21231 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21232 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21233 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21234 | */ |
| 21235 | wpt_uint8 |
| 21236 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21237 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21238 | WDI_ControlBlockType* pWDICtx, |
| 21239 | WDI_BSSSessionType** ppSession |
| 21240 | ) |
| 21241 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21242 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21243 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21244 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21245 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21246 | -------------------------------------------------------------------------*/ |
| 21247 | if ( NULL == ppSession ) |
| 21248 | { |
| 21249 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21250 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21251 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21252 | } |
| 21253 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21254 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21255 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21256 | /*------------------------------------------------------------------------ |
| 21257 | Search for a session that it is not in use |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21258 | ------------------------------------------------------------------------*/ |
| 21259 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21260 | { |
| 21261 | if ( ! pWDICtx->aBSSSessions[i].bInUse ) |
| 21262 | { |
| 21263 | /*Found a session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21264 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21265 | return i; |
| 21266 | } |
| 21267 | } |
| 21268 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21269 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21270 | }/*WDI_FindEmptySession*/ |
| 21271 | |
| 21272 | |
| 21273 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21274 | @brief Helper routine used to get the total count of active |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21275 | sessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21276 | |
| 21277 | |
| 21278 | @param pWDICtx: pointer to the WLAN DAL context |
| 21279 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21280 | @see |
| 21281 | @return Number of sessions in use |
| 21282 | */ |
| 21283 | wpt_uint8 |
| 21284 | WDI_GetActiveSessionsCount |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21285 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21286 | WDI_ControlBlockType* pWDICtx |
| 21287 | ) |
| 21288 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21289 | wpt_uint8 i, ucCount = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21290 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21291 | |
| 21292 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21293 | Count all sessions in use |
| 21294 | ------------------------------------------------------------------------*/ |
| 21295 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 21296 | { |
| 21297 | if ( pWDICtx->aBSSSessions[i].bInUse ) |
| 21298 | { |
| 21299 | ucCount++; |
| 21300 | } |
| 21301 | } |
| 21302 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21303 | return ucCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21304 | }/*WDI_GetActiveSessionsCount*/ |
| 21305 | |
| 21306 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21307 | @brief Helper routine used to delete session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21308 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21309 | |
| 21310 | |
| 21311 | @param pWDICtx: pointer to the WLAN DAL context |
| 21312 | pSession: pointer to the session (if found) |
| 21313 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21314 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21315 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21316 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21317 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21318 | WDI_DeleteSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21319 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21320 | WDI_ControlBlockType* pWDICtx, |
| 21321 | WDI_BSSSessionType* ppSession |
| 21322 | ) |
| 21323 | { |
| 21324 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21325 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21326 | -------------------------------------------------------------------------*/ |
| 21327 | if ( NULL == ppSession ) |
| 21328 | { |
| 21329 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21330 | "%s: Invalid parameters", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21331 | return ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21332 | } |
| 21333 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21334 | /*------------------------------------------------------------------------ |
| 21335 | Reset the entries int session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21336 | ------------------------------------------------------------------------*/ |
| 21337 | wpal_list_destroy(&ppSession->wptPendingQueue); |
| 21338 | wpalMemoryZero(ppSession, sizeof(*ppSession)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21339 | ppSession->wdiAssocState = WDI_ASSOC_INIT_ST; |
| 21340 | ppSession->bInUse = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21341 | ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE; |
| 21342 | wpal_list_init(&ppSession->wptPendingQueue); |
| 21343 | |
| 21344 | }/*WDI_DeleteSession*/ |
| 21345 | |
| 21346 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21347 | @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] | 21348 | The bcast STA ID is assigned by HAL and must be valid. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21349 | @param |
| 21350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21351 | WDI_AddStaParams: - pointer to the WDI Add STA params |
| 21352 | usBcastStaIdx: - Broadcast STA index passed by HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21353 | |
| 21354 | @see |
| 21355 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21356 | */ |
| 21357 | void |
| 21358 | WDI_AddBcastSTAtoSTATable |
| 21359 | ( |
| 21360 | WDI_ControlBlockType* pWDICtx, |
| 21361 | WDI_AddStaParams * staParams, |
| 21362 | wpt_uint16 usBcastStaIdx |
| 21363 | ) |
| 21364 | { |
| 21365 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 21366 | wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 21367 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21368 | |
| 21369 | /*--------------------------------------------------------------------- |
| 21370 | Sanity check |
| 21371 | ---------------------------------------------------------------------*/ |
| 21372 | if ( NULL == staParams ) |
| 21373 | { |
| 21374 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 21375 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21376 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21377 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21378 | } |
| 21379 | |
| 21380 | wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex; |
| 21381 | wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature; |
| 21382 | wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex; |
| 21383 | wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature; |
| 21384 | wdiAddSTAParam.dpuIndex = staParams->dpuIndex; |
| 21385 | wdiAddSTAParam.dpuSig = staParams->dpuSig; |
| 21386 | wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID, |
| 21387 | WDI_MAC_ADDR_LEN ); |
| 21388 | wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN ); |
| 21389 | wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx; |
| 21390 | wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable; |
| 21391 | wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled; |
| 21392 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST; |
| 21393 | wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled; |
| 21394 | wdiAddSTAParam.ucSTAIdx = usBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21395 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21396 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 21397 | } |
| 21398 | |
| 21399 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21400 | @brief NV blob will be divided into fragments of size 4kb and |
| 21401 | Sent to HAL |
| 21402 | |
| 21403 | @param pWDICtx: pointer to the WLAN DAL context |
| 21404 | pEventData: pointer to the event information structure |
| 21405 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21406 | @see |
| 21407 | @return Result of the function call |
| 21408 | */ |
| 21409 | |
| 21410 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21411 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21412 | WDI_ControlBlockType* pWDICtx, |
| 21413 | WDI_EventInfoType* pEventData |
| 21414 | ) |
| 21415 | { |
| 21416 | |
| 21417 | tHalNvImgDownloadReqMsg halNvImgDownloadParam; |
| 21418 | wpt_uint8* pSendBuffer = NULL; |
| 21419 | wpt_uint16 usDataOffset = 0; |
| 21420 | wpt_uint16 usSendSize = 0; |
| 21421 | wpt_uint16 usCurrentFragmentSize =0; |
| 21422 | wpt_uint8* pSrcBuffer = NULL; |
| 21423 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ; |
| 21424 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 21425 | |
| 21426 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc; |
| 21427 | WDI_ASSERT(NULL != wdiNvDownloadRspCb); |
| 21428 | pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData; |
| 21429 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21430 | /* Sanity Check is done by the caller */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21431 | pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress; |
| 21432 | |
| 21433 | /* Update the current Fragment Number */ |
| 21434 | pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1; |
| 21435 | |
| 21436 | /*Update the HAL REQ structure */ |
| 21437 | /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/ |
| 21438 | halNvImgDownloadParam.nvImageReqParams.fragNumber = |
| 21439 | pWDICtx->wdiNvBlobInfo.usCurrentFragment-1; |
| 21440 | |
| 21441 | /* 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] | 21442 | 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] | 21443 | image will be sent to HAL*/ |
| 21444 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21445 | if(pWDICtx->wdiNvBlobInfo.usTotalFragment |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21446 | == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21447 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21448 | /* Taking care of boundry condition */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21449 | if( !(usCurrentFragmentSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21450 | pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE )) |
| 21451 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 21452 | |
| 21453 | /*Update the HAL REQ structure */ |
| 21454 | halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1; |
| 21455 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize; |
| 21456 | |
| 21457 | } |
| 21458 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21459 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21460 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 21461 | |
| 21462 | /*Update the HAL REQ structure */ |
| 21463 | halNvImgDownloadParam.nvImageReqParams.isLastFragment =0; |
| 21464 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize; |
| 21465 | } |
| 21466 | |
| 21467 | /*----------------------------------------------------------------------- |
| 21468 | Get message buffer |
| 21469 | -----------------------------------------------------------------------*/ |
| 21470 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ, |
| 21471 | sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize, |
| 21472 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21473 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21474 | (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize ))) |
| 21475 | { |
| 21476 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 21477 | "Unable to get send buffer in NV Download req %x %x ", |
| 21478 | pEventData, pwdiNvDownloadReqParams); |
| 21479 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21480 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21481 | } |
| 21482 | |
| 21483 | /* Copying the Hal NV download REQ structure */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21484 | wpalMemoryCopy(pSendBuffer + usDataOffset , |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21485 | &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams)); |
| 21486 | |
| 21487 | /* Appending the NV image fragment */ |
| 21488 | wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams), |
| 21489 | (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE), |
| 21490 | usCurrentFragmentSize); |
| 21491 | |
| 21492 | pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21493 | pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21494 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21495 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 21496 | wdiNvDownloadRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21497 | WDI_NV_DOWNLOAD_RESP); |
| 21498 | |
| 21499 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21500 | /*============================================================================ |
| 21501 | Helper inline functions for |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21502 | ============================================================================*/ |
| 21503 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21504 | @brief Helper routine used to find a session based on the BSSID |
| 21505 | @param pContext: pointer to the WLAN DAL context |
| 21506 | @param pDPContext: pointer to the Datapath context |
| 21507 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21508 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21509 | @return |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21510 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21511 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21512 | WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext) |
| 21513 | { |
| 21514 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 21515 | |
| 21516 | pCB->pDPContext = pDPContext; |
| 21517 | return; |
| 21518 | } |
| 21519 | |
| 21520 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21521 | @brief Helper routine used to find a session based on the BSSID |
| 21522 | |
| 21523 | |
| 21524 | @param pContext: pointer to the WLAN DAL context |
| 21525 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21526 | @see |
| 21527 | @return pointer to Datapath context |
| 21528 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21529 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21530 | WDI_DS_GetDatapathContext (void *pContext) |
| 21531 | { |
| 21532 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 21533 | return pCB->pDPContext; |
| 21534 | } |
| 21535 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21536 | @brief Helper routine used to find a session based on the BSSID |
| 21537 | |
| 21538 | |
| 21539 | @param pContext: pointer to the WLAN DAL context |
| 21540 | @param pDTDriverContext: pointer to the Transport Driver context |
| 21541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21542 | @see |
| 21543 | @return void |
| 21544 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21545 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21546 | WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext) |
| 21547 | { |
| 21548 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 21549 | |
| 21550 | pCB->pDTDriverContext = pDTDriverContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21551 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21552 | } |
| 21553 | |
| 21554 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21555 | @brief Helper routine used to find a session based on the BSSID |
| 21556 | |
| 21557 | |
| 21558 | @param pWDICtx: pointer to the WLAN DAL context |
| 21559 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21560 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21561 | @return pointer to datapath context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21562 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21563 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21564 | WDT_GetTransportDriverContext (void *pContext) |
| 21565 | { |
| 21566 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21567 | return(pCB->pDTDriverContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21568 | } |
| 21569 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21570 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21571 | Helper inline converters |
| 21572 | ============================================================================*/ |
| 21573 | /*Convert WDI driver type into HAL driver type*/ |
| 21574 | WPT_STATIC WPT_INLINE WDI_Status |
| 21575 | WDI_HAL_2_WDI_STATUS |
| 21576 | ( |
| 21577 | eHalStatus halStatus |
| 21578 | ) |
| 21579 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21580 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21581 | the chances of getting inlined*/ |
| 21582 | switch( halStatus ) |
| 21583 | { |
| 21584 | case eHAL_STATUS_SUCCESS: |
| 21585 | case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 21586 | case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 21587 | return WDI_STATUS_SUCCESS; |
| 21588 | case eHAL_STATUS_FAILURE: |
| 21589 | return WDI_STATUS_E_FAILURE; |
| 21590 | case eHAL_STATUS_FAILED_ALLOC: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21591 | return WDI_STATUS_MEM_FAILURE; |
| 21592 | /*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] | 21593 | they refer to specific internal modules of our device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21594 | default: |
| 21595 | return WDI_STATUS_DEV_INTERNAL_FAILURE; |
| 21596 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21597 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21598 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21599 | }/*WDI_HAL_2_WDI_STATUS*/ |
| 21600 | |
| 21601 | /*Convert WDI request type into HAL request type*/ |
| 21602 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 21603 | WDI_2_HAL_REQ_TYPE |
| 21604 | ( |
| 21605 | WDI_RequestEnumType wdiReqType |
| 21606 | ) |
| 21607 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21608 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21609 | the chances of getting inlined*/ |
| 21610 | switch( wdiReqType ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21611 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21612 | case WDI_START_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21613 | return WLAN_HAL_START_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21614 | case WDI_STOP_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21615 | return WLAN_HAL_STOP_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21616 | case WDI_INIT_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21617 | return WLAN_HAL_INIT_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21618 | case WDI_START_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21619 | return WLAN_HAL_START_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21620 | case WDI_END_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21621 | return WLAN_HAL_END_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21622 | case WDI_FINISH_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21623 | return WLAN_HAL_FINISH_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21624 | case WDI_JOIN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21625 | return WLAN_HAL_JOIN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21626 | case WDI_CONFIG_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21627 | return WLAN_HAL_CONFIG_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21628 | case WDI_DEL_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21629 | return WLAN_HAL_DELETE_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21630 | case WDI_POST_ASSOC_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21631 | return WLAN_HAL_POST_ASSOC_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21632 | case WDI_DEL_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21633 | return WLAN_HAL_DELETE_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21634 | case WDI_SET_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21635 | return WLAN_HAL_SET_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21636 | case WDI_RMV_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21637 | return WLAN_HAL_RMV_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21638 | case WDI_SET_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21639 | return WLAN_HAL_SET_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21640 | case WDI_RMV_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21641 | return WLAN_HAL_RMV_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21642 | case WDI_SET_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21643 | return WLAN_HAL_SET_BCASTKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21644 | case WDI_RMV_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21645 | //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] | 21646 | return WLAN_HAL_RMV_STAKEY_REQ; |
| 21647 | case WDI_ADD_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21648 | return WLAN_HAL_ADD_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21649 | case WDI_DEL_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21650 | return WLAN_HAL_DEL_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21651 | case WDI_UPD_EDCA_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21652 | return WLAN_HAL_UPD_EDCA_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21653 | case WDI_ADD_BA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21654 | return WLAN_HAL_ADD_BA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21655 | case WDI_DEL_BA_REQ: |
| 21656 | return WLAN_HAL_DEL_BA_REQ; |
| 21657 | #ifdef FEATURE_WLAN_CCX |
| 21658 | case WDI_TSM_STATS_REQ: |
| 21659 | return WLAN_HAL_TSM_STATS_REQ; |
| 21660 | #endif |
| 21661 | case WDI_CH_SWITCH_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21662 | return WLAN_HAL_CH_SWITCH_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21663 | case WDI_CONFIG_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21664 | return WLAN_HAL_CONFIG_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21665 | case WDI_SET_LINK_ST_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21666 | return WLAN_HAL_SET_LINK_ST_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21667 | case WDI_GET_STATS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21668 | return WLAN_HAL_GET_STATS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21669 | case WDI_UPDATE_CFG_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21670 | return WLAN_HAL_UPDATE_CFG_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21671 | case WDI_ADD_BA_SESSION_REQ: |
| 21672 | return WLAN_HAL_ADD_BA_SESSION_REQ; |
| 21673 | case WDI_TRIGGER_BA_REQ: |
| 21674 | return WLAN_HAL_TRIGGER_BA_REQ; |
| 21675 | case WDI_UPD_BCON_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21676 | return WLAN_HAL_UPDATE_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21677 | case WDI_SND_BCON_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21678 | return WLAN_HAL_SEND_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21679 | case WDI_UPD_PROBE_RSP_TEMPLATE_REQ: |
| 21680 | return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ; |
| 21681 | case WDI_SET_MAX_TX_POWER_REQ: |
| 21682 | return WLAN_HAL_SET_MAX_TX_POWER_REQ; |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 21683 | case WDI_SET_TX_POWER_REQ: |
| 21684 | return WLAN_HAL_SET_TX_POWER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21685 | case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ: |
| 21686 | return WLAN_HAL_SET_P2P_GONOA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21687 | case WDI_ENTER_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21688 | return WLAN_HAL_ENTER_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21689 | case WDI_EXIT_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21690 | return WLAN_HAL_EXIT_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21691 | case WDI_ENTER_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21692 | return WLAN_HAL_ENTER_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21693 | case WDI_EXIT_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21694 | return WLAN_HAL_EXIT_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21695 | case WDI_ENTER_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21696 | return WLAN_HAL_ENTER_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21697 | case WDI_EXIT_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21698 | return WLAN_HAL_EXIT_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21699 | case WDI_SET_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21700 | return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21701 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21702 | return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21703 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21704 | return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21705 | case WDI_SET_BEACON_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21706 | return WLAN_HAL_ADD_BCN_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21707 | case WDI_REM_BEACON_FILTER_REQ: |
| 21708 | return WLAN_HAL_REM_BCN_FILTER_REQ; |
| 21709 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 21710 | return WLAN_HAL_SET_RSSI_THRESH_REQ; |
| 21711 | case WDI_HOST_OFFLOAD_REQ: |
| 21712 | return WLAN_HAL_HOST_OFFLOAD_REQ; |
| 21713 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 21714 | return WLAN_HAL_ADD_WOWL_BCAST_PTRN; |
| 21715 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 21716 | return WLAN_HAL_DEL_WOWL_BCAST_PTRN; |
| 21717 | case WDI_WOWL_ENTER_REQ: |
| 21718 | return WLAN_HAL_ENTER_WOWL_REQ; |
| 21719 | case WDI_WOWL_EXIT_REQ: |
| 21720 | return WLAN_HAL_EXIT_WOWL_REQ; |
| 21721 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 21722 | return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
| 21723 | case WDI_NV_DOWNLOAD_REQ: |
| 21724 | return WLAN_HAL_DOWNLOAD_NV_REQ; |
| 21725 | case WDI_FLUSH_AC_REQ: |
| 21726 | return WLAN_HAL_TL_HAL_FLUSH_AC_REQ; |
| 21727 | case WDI_BTAMP_EVENT_REQ: |
| 21728 | return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ; |
| 21729 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21730 | case WDI_AGGR_ADD_TS_REQ: |
| 21731 | return WLAN_HAL_AGGR_ADD_TS_REQ; |
| 21732 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21733 | case WDI_FTM_CMD_REQ: |
| 21734 | return WLAN_HAL_PROCESS_PTT_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21735 | case WDI_ADD_STA_SELF_REQ: |
| 21736 | return WLAN_HAL_ADD_STA_SELF_REQ; |
| 21737 | case WDI_DEL_STA_SELF_REQ: |
| 21738 | return WLAN_HAL_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21739 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 21740 | case WDI_START_OEM_DATA_REQ: |
| 21741 | return WLAN_HAL_START_OEM_DATA_REQ; |
| 21742 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21743 | case WDI_HOST_RESUME_REQ: |
| 21744 | return WLAN_HAL_HOST_RESUME_REQ; |
| 21745 | case WDI_HOST_SUSPEND_IND: |
| 21746 | return WLAN_HAL_HOST_SUSPEND_IND; |
Madan Mohan Koyyalamudi | 2826000 | 2013-01-10 21:56:05 -0800 | [diff] [blame] | 21747 | case WDI_TRAFFIC_STATS_IND: |
| 21748 | return WLAN_HAL_CLASS_B_STATS_IND; |
Chet Lanctot | a96bb43 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 21749 | #ifdef WLAN_FEATURE_11W |
| 21750 | case WDI_EXCLUDE_UNENCRYPTED_IND: |
| 21751 | return WLAN_HAL_EXCLUDE_UNENCRYPTED_IND; |
| 21752 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21753 | case WDI_KEEP_ALIVE_REQ: |
| 21754 | return WLAN_HAL_KEEP_ALIVE_REQ; |
| 21755 | |
| 21756 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 21757 | case WDI_SET_PREF_NETWORK_REQ: |
| 21758 | return WLAN_HAL_SET_PREF_NETWORK_REQ; |
| 21759 | case WDI_SET_RSSI_FILTER_REQ: |
| 21760 | return WLAN_HAL_SET_RSSI_FILTER_REQ; |
| 21761 | case WDI_UPDATE_SCAN_PARAMS_REQ: |
| 21762 | return WLAN_HAL_UPDATE_SCAN_PARAM_REQ; |
| 21763 | #endif // FEATURE_WLAN_SCAN_PNO |
| 21764 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 21765 | return WLAN_HAL_SET_TX_PER_TRACKING_REQ; |
| 21766 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 21767 | case WDI_8023_MULTICAST_LIST_REQ: |
| 21768 | return WLAN_HAL_8023_MULTICAST_LIST_REQ; |
| 21769 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21770 | return WLAN_HAL_SET_PACKET_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21771 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 21772 | return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ; |
| 21773 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 21774 | return WLAN_HAL_CLEAR_PACKET_FILTER_REQ; |
| 21775 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 21776 | case WDI_HAL_DUMP_CMD_REQ: |
| 21777 | return WLAN_HAL_DUMP_COMMAND_REQ; |
| 21778 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 21779 | case WDI_GTK_OFFLOAD_REQ: |
| 21780 | return WLAN_HAL_GTK_OFFLOAD_REQ; |
| 21781 | case WDI_GTK_OFFLOAD_GETINFO_REQ: |
| 21782 | return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ; |
| 21783 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 21784 | |
| 21785 | case WDI_INIT_SCAN_CON_REQ: |
| 21786 | return WLAN_HAL_INIT_SCAN_CON_REQ; |
| 21787 | case WDI_SET_POWER_PARAMS_REQ: |
| 21788 | return WLAN_HAL_SET_POWER_PARAMS_REQ; |
| 21789 | case WDI_SET_TM_LEVEL_REQ: |
| 21790 | return WLAN_HAL_SET_THERMAL_MITIGATION_REQ; |
| 21791 | case WDI_FEATURE_CAPS_EXCHANGE_REQ: |
| 21792 | return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 21793 | #ifdef WLAN_FEATURE_11AC |
| 21794 | case WDI_UPDATE_VHT_OP_MODE_REQ: |
| 21795 | return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ; |
| 21796 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 21797 | case WDI_GET_ROAM_RSSI_REQ: |
| 21798 | return WLAN_HAL_GET_ROAM_RSSI_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21799 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21800 | return WLAN_HAL_MSG_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21801 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21802 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21803 | }/*WDI_2_HAL_REQ_TYPE*/ |
| 21804 | |
| 21805 | /*Convert WDI response type into HAL response type*/ |
| 21806 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 21807 | HAL_2_WDI_RSP_TYPE |
| 21808 | ( |
| 21809 | tHalHostMsgType halMsg |
| 21810 | ) |
| 21811 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21812 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21813 | the chances of getting inlined*/ |
| 21814 | switch( halMsg ) |
| 21815 | { |
| 21816 | case WLAN_HAL_START_RSP: |
| 21817 | return WDI_START_RESP; |
| 21818 | case WLAN_HAL_STOP_RSP: |
| 21819 | return WDI_STOP_RESP; |
| 21820 | case WLAN_HAL_INIT_SCAN_RSP: |
| 21821 | return WDI_INIT_SCAN_RESP; |
| 21822 | case WLAN_HAL_START_SCAN_RSP: |
| 21823 | return WDI_START_SCAN_RESP; |
| 21824 | case WLAN_HAL_END_SCAN_RSP: |
| 21825 | return WDI_END_SCAN_RESP; |
| 21826 | case WLAN_HAL_FINISH_SCAN_RSP: |
| 21827 | return WDI_FINISH_SCAN_RESP; |
| 21828 | case WLAN_HAL_CONFIG_STA_RSP: |
| 21829 | return WDI_CONFIG_STA_RESP; |
| 21830 | case WLAN_HAL_DELETE_STA_RSP: |
| 21831 | return WDI_DEL_STA_RESP; |
| 21832 | case WLAN_HAL_CONFIG_BSS_RSP: |
| 21833 | return WDI_CONFIG_BSS_RESP; |
| 21834 | case WLAN_HAL_DELETE_BSS_RSP: |
| 21835 | return WDI_DEL_BSS_RESP; |
| 21836 | case WLAN_HAL_JOIN_RSP: |
| 21837 | return WDI_JOIN_RESP; |
| 21838 | case WLAN_HAL_POST_ASSOC_RSP: |
| 21839 | return WDI_POST_ASSOC_RESP; |
| 21840 | case WLAN_HAL_SET_BSSKEY_RSP: |
| 21841 | return WDI_SET_BSS_KEY_RESP; |
| 21842 | case WLAN_HAL_SET_STAKEY_RSP: |
| 21843 | return WDI_SET_STA_KEY_RESP; |
| 21844 | case WLAN_HAL_RMV_BSSKEY_RSP: |
| 21845 | return WDI_RMV_BSS_KEY_RESP; |
| 21846 | case WLAN_HAL_RMV_STAKEY_RSP: |
| 21847 | return WDI_RMV_STA_KEY_RESP; |
| 21848 | case WLAN_HAL_SET_BCASTKEY_RSP: |
| 21849 | return WDI_SET_STA_BCAST_KEY_RESP; |
| 21850 | //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP: |
| 21851 | // return WDI_RMV_STA_BCAST_KEY_RESP; |
| 21852 | case WLAN_HAL_ADD_TS_RSP: |
| 21853 | return WDI_ADD_TS_RESP; |
| 21854 | case WLAN_HAL_DEL_TS_RSP: |
| 21855 | return WDI_DEL_TS_RESP; |
| 21856 | case WLAN_HAL_UPD_EDCA_PARAMS_RSP: |
| 21857 | return WDI_UPD_EDCA_PRMS_RESP; |
| 21858 | case WLAN_HAL_ADD_BA_RSP: |
| 21859 | return WDI_ADD_BA_RESP; |
| 21860 | case WLAN_HAL_DEL_BA_RSP: |
| 21861 | return WDI_DEL_BA_RESP; |
| 21862 | #ifdef FEATURE_WLAN_CCX |
| 21863 | case WLAN_HAL_TSM_STATS_RSP: |
| 21864 | return WDI_TSM_STATS_RESP; |
| 21865 | #endif |
| 21866 | case WLAN_HAL_CH_SWITCH_RSP: |
| 21867 | return WDI_CH_SWITCH_RESP; |
| 21868 | case WLAN_HAL_SET_LINK_ST_RSP: |
| 21869 | return WDI_SET_LINK_ST_RESP; |
| 21870 | case WLAN_HAL_GET_STATS_RSP: |
| 21871 | return WDI_GET_STATS_RESP; |
| 21872 | case WLAN_HAL_UPDATE_CFG_RSP: |
| 21873 | return WDI_UPDATE_CFG_RESP; |
| 21874 | case WLAN_HAL_ADD_BA_SESSION_RSP: |
| 21875 | return WDI_ADD_BA_SESSION_RESP; |
| 21876 | case WLAN_HAL_TRIGGER_BA_RSP: |
| 21877 | return WDI_TRIGGER_BA_RESP; |
| 21878 | case WLAN_HAL_UPDATE_BEACON_RSP: |
| 21879 | return WDI_UPD_BCON_PRMS_RESP; |
| 21880 | case WLAN_HAL_SEND_BEACON_RSP: |
| 21881 | return WDI_SND_BCON_RESP; |
| 21882 | case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP: |
| 21883 | return WDI_UPD_PROBE_RSP_TEMPLATE_RESP; |
| 21884 | /*Indications*/ |
| 21885 | case WLAN_HAL_RSSI_NOTIFICATION_IND: |
| 21886 | return WDI_HAL_RSSI_NOTIFICATION_IND; |
| 21887 | case WLAN_HAL_MISSED_BEACON_IND: |
| 21888 | return WDI_HAL_MISSED_BEACON_IND; |
| 21889 | case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND: |
| 21890 | return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND; |
| 21891 | case WLAN_HAL_MIC_FAILURE_IND: |
| 21892 | return WDI_HAL_MIC_FAILURE_IND; |
| 21893 | case WLAN_HAL_FATAL_ERROR_IND: |
| 21894 | return WDI_HAL_FATAL_ERROR_IND; |
| 21895 | case WLAN_HAL_DELETE_STA_CONTEXT_IND: |
| 21896 | return WDI_HAL_DEL_STA_IND; |
| 21897 | case WLAN_HAL_COEX_IND: |
| 21898 | return WDI_HAL_COEX_IND; |
| 21899 | case WLAN_HAL_OTA_TX_COMPL_IND: |
| 21900 | return WDI_HAL_TX_COMPLETE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21901 | case WLAN_HAL_P2P_NOA_ATTR_IND: |
| 21902 | return WDI_HAL_P2P_NOA_ATTR_IND; |
Viral Modi | 9dc288a | 2012-12-10 13:09:21 -0800 | [diff] [blame] | 21903 | case WLAN_HAL_P2P_NOA_START_IND: |
| 21904 | return WDI_HAL_P2P_NOA_START_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21905 | case WLAN_HAL_TX_PER_HIT_IND: |
| 21906 | return WDI_HAL_TX_PER_HIT_IND; |
| 21907 | case WLAN_HAL_SET_MAX_TX_POWER_RSP: |
| 21908 | return WDI_SET_MAX_TX_POWER_RESP; |
schang | d82195a | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 21909 | case WLAN_HAL_SET_TX_POWER_RSP: |
| 21910 | return WDI_SET_TX_POWER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21911 | case WLAN_HAL_SET_P2P_GONOA_RSP: |
| 21912 | return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21913 | case WLAN_HAL_ENTER_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21914 | return WDI_ENTER_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21915 | case WLAN_HAL_EXIT_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21916 | return WDI_EXIT_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21917 | case WLAN_HAL_ENTER_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21918 | return WDI_ENTER_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21919 | case WLAN_HAL_EXIT_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21920 | return WDI_EXIT_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21921 | case WLAN_HAL_ENTER_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21922 | return WDI_ENTER_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21923 | case WLAN_HAL_EXIT_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21924 | return WDI_EXIT_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21925 | case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21926 | return WDI_SET_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21927 | case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21928 | return WDI_UPDATE_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21929 | case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21930 | return WDI_CONFIGURE_RXP_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21931 | case WLAN_HAL_ADD_BCN_FILTER_RSP: |
| 21932 | return WDI_SET_BEACON_FILTER_RESP; |
| 21933 | case WLAN_HAL_REM_BCN_FILTER_RSP: |
| 21934 | return WDI_REM_BEACON_FILTER_RESP; |
| 21935 | case WLAN_HAL_SET_RSSI_THRESH_RSP: |
| 21936 | return WDI_SET_RSSI_THRESHOLDS_RESP; |
| 21937 | case WLAN_HAL_HOST_OFFLOAD_RSP: |
| 21938 | return WDI_HOST_OFFLOAD_RESP; |
| 21939 | case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP: |
| 21940 | return WDI_WOWL_ADD_BC_PTRN_RESP; |
| 21941 | case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP: |
| 21942 | return WDI_WOWL_DEL_BC_PTRN_RESP; |
| 21943 | case WLAN_HAL_ENTER_WOWL_RSP: |
| 21944 | return WDI_WOWL_ENTER_RESP; |
| 21945 | case WLAN_HAL_EXIT_WOWL_RSP: |
| 21946 | return WDI_WOWL_EXIT_RESP; |
| 21947 | case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP: |
| 21948 | return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP; |
| 21949 | case WLAN_HAL_DOWNLOAD_NV_RSP: |
| 21950 | return WDI_NV_DOWNLOAD_RESP; |
| 21951 | case WLAN_HAL_TL_HAL_FLUSH_AC_RSP: |
| 21952 | return WDI_FLUSH_AC_RESP; |
| 21953 | case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP: |
| 21954 | return WDI_BTAMP_EVENT_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21955 | case WLAN_HAL_PROCESS_PTT_RSP: |
| 21956 | return WDI_FTM_CMD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21957 | case WLAN_HAL_ADD_STA_SELF_RSP: |
| 21958 | return WDI_ADD_STA_SELF_RESP; |
| 21959 | case WLAN_HAL_DEL_STA_SELF_RSP: |
| 21960 | return WDI_DEL_STA_SELF_RESP; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21961 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 21962 | case WLAN_HAL_START_OEM_DATA_RSP: |
| 21963 | return WDI_START_OEM_DATA_RESP; |
| 21964 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21965 | case WLAN_HAL_HOST_RESUME_RSP: |
| 21966 | return WDI_HOST_RESUME_RESP; |
| 21967 | case WLAN_HAL_KEEP_ALIVE_RSP: |
| 21968 | return WDI_KEEP_ALIVE_RESP; |
| 21969 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 21970 | case WLAN_HAL_SET_PREF_NETWORK_RSP: |
| 21971 | return WDI_SET_PREF_NETWORK_RESP; |
| 21972 | case WLAN_HAL_SET_RSSI_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21973 | return WDI_SET_RSSI_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21974 | case WLAN_HAL_UPDATE_SCAN_PARAM_RSP: |
| 21975 | return WDI_UPDATE_SCAN_PARAMS_RESP; |
| 21976 | case WLAN_HAL_PREF_NETW_FOUND_IND: |
| 21977 | return WDI_HAL_PREF_NETWORK_FOUND_IND; |
| 21978 | #endif // FEATURE_WLAN_SCAN_PNO |
| 21979 | case WLAN_HAL_SET_TX_PER_TRACKING_RSP: |
| 21980 | return WDI_SET_TX_PER_TRACKING_RESP; |
| 21981 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 21982 | case WLAN_HAL_8023_MULTICAST_LIST_RSP: |
| 21983 | return WDI_8023_MULTICAST_LIST_RESP; |
| 21984 | case WLAN_HAL_SET_PACKET_FILTER_RSP: |
| 21985 | return WDI_RECEIVE_FILTER_SET_FILTER_RESP; |
| 21986 | case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP: |
| 21987 | return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP; |
| 21988 | case WLAN_HAL_CLEAR_PACKET_FILTER_RSP: |
| 21989 | return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP; |
| 21990 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 21991 | |
| 21992 | case WLAN_HAL_DUMP_COMMAND_RSP: |
| 21993 | return WDI_HAL_DUMP_CMD_RESP; |
| 21994 | case WLAN_HAL_SET_POWER_PARAMS_RSP: |
| 21995 | return WDI_SET_POWER_PARAMS_RESP; |
| 21996 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21997 | case WLAN_HAL_AGGR_ADD_TS_RSP: |
| 21998 | return WDI_AGGR_ADD_TS_RESP; |
| 21999 | #endif |
| 22000 | |
| 22001 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 22002 | case WLAN_HAL_GTK_OFFLOAD_RSP: |
| 22003 | return WDI_GTK_OFFLOAD_RESP; |
| 22004 | case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP: |
| 22005 | return WDI_GTK_OFFLOAD_GETINFO_RESP; |
| 22006 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 22007 | #ifdef WLAN_WAKEUP_EVENTS |
| 22008 | case WLAN_HAL_WAKE_REASON_IND: |
| 22009 | return WDI_HAL_WAKE_REASON_IND; |
| 22010 | #endif // WLAN_WAKEUP_EVENTS |
| 22011 | |
| 22012 | case WLAN_HAL_SET_THERMAL_MITIGATION_RSP: |
| 22013 | return WDI_SET_TM_LEVEL_RESP; |
| 22014 | case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP: |
| 22015 | return WDI_FEATURE_CAPS_EXCHANGE_RESP; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 22016 | #ifdef WLAN_FEATURE_11AC |
| 22017 | case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP: |
| 22018 | return WDI_UPDATE_VHT_OP_MODE_RESP; |
| 22019 | #endif |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 22020 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 22021 | case WLAN_HAL_GET_ROAM_RSSI_RSP: |
| 22022 | return WDI_GET_ROAM_RSSI_RESP; |
| 22023 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22024 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22025 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22026 | } |
| 22027 | |
| 22028 | }/*HAL_2_WDI_RSP_TYPE*/ |
| 22029 | |
| 22030 | |
| 22031 | /*Convert WDI driver type into HAL driver type*/ |
| 22032 | WPT_STATIC WPT_INLINE tDriverType |
| 22033 | WDI_2_HAL_DRV_TYPE |
| 22034 | ( |
| 22035 | WDI_DriverType wdiDriverType |
| 22036 | ) |
| 22037 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22038 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22039 | the chances of getting inlined*/ |
| 22040 | switch( wdiDriverType ) |
| 22041 | { |
| 22042 | case WDI_DRIVER_TYPE_PRODUCTION: |
| 22043 | return eDRIVER_TYPE_PRODUCTION; |
| 22044 | case WDI_DRIVER_TYPE_MFG: |
| 22045 | return eDRIVER_TYPE_MFG; |
| 22046 | case WDI_DRIVER_TYPE_DVT: |
| 22047 | return eDRIVER_TYPE_DVT; |
| 22048 | } |
| 22049 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22050 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22051 | }/*WDI_2_HAL_DRV_TYPE*/ |
| 22052 | |
| 22053 | |
| 22054 | /*Convert WDI stop reason into HAL stop reason*/ |
| 22055 | WPT_STATIC WPT_INLINE tHalStopType |
| 22056 | WDI_2_HAL_STOP_REASON |
| 22057 | ( |
| 22058 | WDI_StopType wdiDriverType |
| 22059 | ) |
| 22060 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22061 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22062 | the chances of getting inlined*/ |
| 22063 | switch( wdiDriverType ) |
| 22064 | { |
| 22065 | case WDI_STOP_TYPE_SYS_RESET: |
| 22066 | return HAL_STOP_TYPE_SYS_RESET; |
| 22067 | case WDI_DRIVER_TYPE_MFG: |
| 22068 | return WDI_STOP_TYPE_SYS_DEEP_SLEEP; |
| 22069 | case WDI_STOP_TYPE_RF_KILL: |
| 22070 | return HAL_STOP_TYPE_RF_KILL; |
| 22071 | } |
| 22072 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22073 | return HAL_STOP_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22074 | }/*WDI_2_HAL_STOP_REASON*/ |
| 22075 | |
| 22076 | |
| 22077 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 22078 | WPT_STATIC WPT_INLINE eHalSysMode |
| 22079 | WDI_2_HAL_SCAN_MODE |
| 22080 | ( |
| 22081 | WDI_ScanMode wdiScanMode |
| 22082 | ) |
| 22083 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22084 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22085 | the chances of getting inlined*/ |
| 22086 | switch( wdiScanMode ) |
| 22087 | { |
| 22088 | case WDI_SCAN_MODE_NORMAL: |
| 22089 | return eHAL_SYS_MODE_NORMAL; |
| 22090 | case WDI_SCAN_MODE_LEARN: |
| 22091 | return eHAL_SYS_MODE_LEARN; |
| 22092 | case WDI_SCAN_MODE_SCAN: |
| 22093 | return eHAL_SYS_MODE_SCAN; |
| 22094 | case WDI_SCAN_MODE_PROMISC: |
| 22095 | return eHAL_SYS_MODE_PROMISC; |
| 22096 | case WDI_SCAN_MODE_SUSPEND_LINK: |
| 22097 | return eHAL_SYS_MODE_SUSPEND_LINK; |
Madan Mohan Koyyalamudi | 9b87678 | 2012-10-11 16:22:51 -0700 | [diff] [blame] | 22098 | case WDI_SCAN_MODE_ROAM_SCAN: |
| 22099 | return eHAL_SYS_MODE_ROAM_SCAN; |
| 22100 | case WDI_SCAN_MODE_ROAM_SUSPEND_LINK: |
| 22101 | return eHAL_SYS_MODE_ROAM_SUSPEND_LINK; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22102 | } |
| 22103 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22104 | return eHAL_SYS_MODE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22105 | }/*WDI_2_HAL_SCAN_MODE*/ |
| 22106 | |
| 22107 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22108 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22109 | WDI_2_HAL_SEC_CH_OFFSET |
| 22110 | ( |
| 22111 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 22112 | ) |
| 22113 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22114 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22115 | the chances of getting inlined*/ |
| 22116 | switch( wdiSecChOffset ) |
| 22117 | { |
| 22118 | case WDI_SECONDARY_CHANNEL_OFFSET_NONE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22119 | return PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22120 | case WDI_SECONDARY_CHANNEL_OFFSET_UP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22121 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22122 | case WDI_SECONDARY_CHANNEL_OFFSET_DOWN: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22123 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 22124 | #ifdef WLAN_FEATURE_11AC |
| 22125 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 22126 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 22127 | case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 22128 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 22129 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 22130 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 22131 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 22132 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 22133 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 22134 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 22135 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 22136 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 22137 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 22138 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 22139 | #endif |
| 22140 | default: |
| 22141 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22142 | } |
| 22143 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22144 | return PHY_CHANNEL_BONDING_STATE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22145 | }/*WDI_2_HAL_SEC_CH_OFFSET*/ |
| 22146 | |
| 22147 | /*Convert WDI BSS type into HAL BSS type*/ |
| 22148 | WPT_STATIC WPT_INLINE tSirBssType |
| 22149 | WDI_2_HAL_BSS_TYPE |
| 22150 | ( |
| 22151 | WDI_BssType wdiBSSType |
| 22152 | ) |
| 22153 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22154 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22155 | the chances of getting inlined*/ |
| 22156 | switch( wdiBSSType ) |
| 22157 | { |
| 22158 | case WDI_INFRASTRUCTURE_MODE: |
| 22159 | return eSIR_INFRASTRUCTURE_MODE; |
| 22160 | case WDI_INFRA_AP_MODE: |
| 22161 | return eSIR_INFRA_AP_MODE; |
| 22162 | case WDI_IBSS_MODE: |
| 22163 | return eSIR_IBSS_MODE; |
| 22164 | case WDI_BTAMP_STA_MODE: |
| 22165 | return eSIR_BTAMP_STA_MODE; |
| 22166 | case WDI_BTAMP_AP_MODE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22167 | return eSIR_BTAMP_AP_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22168 | case WDI_BSS_AUTO_MODE: |
| 22169 | return eSIR_AUTO_MODE; |
| 22170 | } |
| 22171 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22172 | return eSIR_DONOT_USE_BSS_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22173 | }/*WDI_2_HAL_BSS_TYPE*/ |
| 22174 | |
| 22175 | /*Convert WDI NW type into HAL NW type*/ |
| 22176 | WPT_STATIC WPT_INLINE tSirNwType |
| 22177 | WDI_2_HAL_NW_TYPE |
| 22178 | ( |
| 22179 | WDI_NwType wdiNWType |
| 22180 | ) |
| 22181 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22182 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22183 | the chances of getting inlined*/ |
| 22184 | switch( wdiNWType ) |
| 22185 | { |
| 22186 | case WDI_11A_NW_TYPE: |
| 22187 | return eSIR_11A_NW_TYPE; |
| 22188 | case WDI_11B_NW_TYPE: |
| 22189 | return eSIR_11B_NW_TYPE; |
| 22190 | case WDI_11G_NW_TYPE: |
| 22191 | return eSIR_11G_NW_TYPE; |
| 22192 | case WDI_11N_NW_TYPE: |
| 22193 | return eSIR_11N_NW_TYPE; |
| 22194 | } |
| 22195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22196 | return eSIR_DONOT_USE_NW_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22197 | }/*WDI_2_HAL_NW_TYPE*/ |
| 22198 | |
| 22199 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 22200 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 22201 | WDI_2_HAL_CB_STATE |
| 22202 | ( |
| 22203 | WDI_PhyChanBondState wdiCbState |
| 22204 | ) |
| 22205 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22206 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22207 | the chances of getting inlined*/ |
| 22208 | switch ( wdiCbState ) |
| 22209 | { |
| 22210 | case WDI_PHY_SINGLE_CHANNEL_CENTERED: |
| 22211 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 22212 | case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 22213 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 22214 | case WDI_PHY_DOUBLE_CHANNEL_CENTERED: |
| 22215 | return PHY_DOUBLE_CHANNEL_CENTERED; |
| 22216 | case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 22217 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22218 | #ifdef WLAN_FEATURE_11AC |
| 22219 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 22220 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 22221 | case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 22222 | return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; |
| 22223 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 22224 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 22225 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 22226 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 22227 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 22228 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
| 22229 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 22230 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 22231 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 22232 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 22233 | #endif |
| 22234 | case WDI_MAX_CB_STATE: |
| 22235 | default: |
| 22236 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22237 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22238 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22239 | return PHY_CHANNEL_BONDING_STATE_MAX; |
| 22240 | }/*WDI_2_HAL_CB_STATE*/ |
| 22241 | |
| 22242 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 22243 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 22244 | WDI_2_HAL_HT_OPER_MODE |
| 22245 | ( |
| 22246 | WDI_HTOperatingMode wdiHTOperMode |
| 22247 | ) |
| 22248 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22249 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22250 | the chances of getting inlined*/ |
| 22251 | switch ( wdiHTOperMode ) |
| 22252 | { |
| 22253 | case WDI_HT_OP_MODE_PURE: |
| 22254 | return eSIR_HT_OP_MODE_PURE; |
| 22255 | case WDI_HT_OP_MODE_OVERLAP_LEGACY: |
| 22256 | return eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 22257 | case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT: |
| 22258 | return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 22259 | case WDI_HT_OP_MODE_MIXED: |
| 22260 | return eSIR_HT_OP_MODE_MIXED; |
| 22261 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22262 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22263 | return eSIR_HT_OP_MODE_MAX; |
| 22264 | }/*WDI_2_HAL_HT_OPER_MODE*/ |
| 22265 | |
| 22266 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 22267 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 22268 | WDI_2_HAL_MIMO_PS |
| 22269 | ( |
| 22270 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 22271 | ) |
| 22272 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22273 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22274 | the chances of getting inlined*/ |
| 22275 | switch ( wdiHTOperMode ) |
| 22276 | { |
| 22277 | case WDI_HT_MIMO_PS_STATIC: |
| 22278 | return eSIR_HT_MIMO_PS_STATIC; |
| 22279 | case WDI_HT_MIMO_PS_DYNAMIC: |
| 22280 | return eSIR_HT_MIMO_PS_DYNAMIC; |
| 22281 | case WDI_HT_MIMO_PS_NA: |
| 22282 | return eSIR_HT_MIMO_PS_NA; |
| 22283 | case WDI_HT_MIMO_PS_NO_LIMIT: |
| 22284 | return eSIR_HT_MIMO_PS_NO_LIMIT; |
| 22285 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22286 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22287 | return eSIR_HT_MIMO_PS_MAX; |
| 22288 | }/*WDI_2_HAL_MIMO_PS*/ |
| 22289 | |
| 22290 | /*Convert WDI ENC type into HAL ENC type*/ |
| 22291 | WPT_STATIC WPT_INLINE tAniEdType |
| 22292 | WDI_2_HAL_ENC_TYPE |
| 22293 | ( |
| 22294 | WDI_EncryptType wdiEncType |
| 22295 | ) |
| 22296 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22297 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22298 | the chances of getting inlined*/ |
| 22299 | switch ( wdiEncType ) |
| 22300 | { |
| 22301 | case WDI_ENCR_NONE: |
| 22302 | return eSIR_ED_NONE; |
| 22303 | |
| 22304 | case WDI_ENCR_WEP40: |
| 22305 | return eSIR_ED_WEP40; |
| 22306 | |
| 22307 | case WDI_ENCR_WEP104: |
| 22308 | return eSIR_ED_WEP104; |
| 22309 | |
| 22310 | case WDI_ENCR_TKIP: |
| 22311 | return eSIR_ED_TKIP; |
| 22312 | |
| 22313 | case WDI_ENCR_CCMP: |
| 22314 | return eSIR_ED_CCMP; |
| 22315 | |
| 22316 | case WDI_ENCR_AES_128_CMAC: |
| 22317 | return eSIR_ED_AES_128_CMAC; |
| 22318 | #if defined(FEATURE_WLAN_WAPI) |
| 22319 | case WDI_ENCR_WPI: |
| 22320 | return eSIR_ED_WPI; |
| 22321 | #endif |
| 22322 | default: |
| 22323 | return eSIR_ED_NOT_IMPLEMENTED; |
| 22324 | } |
| 22325 | |
| 22326 | }/*WDI_2_HAL_ENC_TYPE*/ |
| 22327 | |
| 22328 | /*Convert WDI WEP type into HAL WEP type*/ |
| 22329 | WPT_STATIC WPT_INLINE tAniWepType |
| 22330 | WDI_2_HAL_WEP_TYPE |
| 22331 | ( |
| 22332 | WDI_WepType wdiWEPType |
| 22333 | ) |
| 22334 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22335 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22336 | the chances of getting inlined*/ |
| 22337 | switch ( wdiWEPType ) |
| 22338 | { |
| 22339 | case WDI_WEP_STATIC: |
| 22340 | return eSIR_WEP_STATIC; |
| 22341 | |
| 22342 | case WDI_WEP_DYNAMIC: |
| 22343 | return eSIR_WEP_DYNAMIC; |
| 22344 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22345 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22346 | return eSIR_WEP_MAX; |
| 22347 | }/*WDI_2_HAL_WEP_TYPE*/ |
| 22348 | |
| 22349 | WPT_STATIC WPT_INLINE tSirLinkState |
| 22350 | WDI_2_HAL_LINK_STATE |
| 22351 | ( |
| 22352 | WDI_LinkStateType wdiLinkState |
| 22353 | ) |
| 22354 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22355 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22356 | the chances of getting inlined*/ |
| 22357 | switch ( wdiLinkState ) |
| 22358 | { |
| 22359 | case WDI_LINK_IDLE_STATE: |
| 22360 | return eSIR_LINK_IDLE_STATE; |
| 22361 | |
| 22362 | case WDI_LINK_PREASSOC_STATE: |
| 22363 | return eSIR_LINK_PREASSOC_STATE; |
| 22364 | |
| 22365 | case WDI_LINK_POSTASSOC_STATE: |
| 22366 | return eSIR_LINK_POSTASSOC_STATE; |
| 22367 | |
| 22368 | case WDI_LINK_AP_STATE: |
| 22369 | return eSIR_LINK_AP_STATE; |
| 22370 | |
| 22371 | case WDI_LINK_IBSS_STATE: |
| 22372 | return eSIR_LINK_IBSS_STATE; |
| 22373 | |
| 22374 | case WDI_LINK_BTAMP_PREASSOC_STATE: |
| 22375 | return eSIR_LINK_BTAMP_PREASSOC_STATE; |
| 22376 | |
| 22377 | case WDI_LINK_BTAMP_POSTASSOC_STATE: |
| 22378 | return eSIR_LINK_BTAMP_POSTASSOC_STATE; |
| 22379 | |
| 22380 | case WDI_LINK_BTAMP_AP_STATE: |
| 22381 | return eSIR_LINK_BTAMP_AP_STATE; |
| 22382 | |
| 22383 | case WDI_LINK_BTAMP_STA_STATE: |
| 22384 | return eSIR_LINK_BTAMP_STA_STATE; |
| 22385 | |
| 22386 | case WDI_LINK_LEARN_STATE: |
| 22387 | return eSIR_LINK_LEARN_STATE; |
| 22388 | |
| 22389 | case WDI_LINK_SCAN_STATE: |
| 22390 | return eSIR_LINK_SCAN_STATE; |
| 22391 | |
| 22392 | case WDI_LINK_FINISH_SCAN_STATE: |
| 22393 | return eSIR_LINK_FINISH_SCAN_STATE; |
| 22394 | |
| 22395 | case WDI_LINK_INIT_CAL_STATE: |
| 22396 | return eSIR_LINK_INIT_CAL_STATE; |
| 22397 | |
| 22398 | case WDI_LINK_FINISH_CAL_STATE: |
| 22399 | return eSIR_LINK_FINISH_CAL_STATE; |
| 22400 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22401 | case WDI_LINK_LISTEN_STATE: |
| 22402 | return eSIR_LINK_LISTEN_STATE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22403 | |
| 22404 | default: |
| 22405 | return eSIR_LINK_MAX; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22406 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22407 | } |
| 22408 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22409 | /*Translate a STA Context from WDI into HAL*/ |
| 22410 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22411 | void |
| 22412 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22413 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22414 | tConfigStaParams* phalConfigSta, |
| 22415 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 22416 | ) |
| 22417 | { |
| 22418 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22419 | #ifdef WLAN_FEATURE_11AC |
| 22420 | /* Get the Version 1 Handler */ |
| 22421 | tConfigStaParams_V1* phalConfigSta_V1 = NULL; |
| 22422 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 22423 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22424 | phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22425 | } |
| 22426 | #endif |
| 22427 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22428 | the chances of getting inlined*/ |
| 22429 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22430 | wpalMemoryCopy(phalConfigSta->bssId, |
| 22431 | pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN); |
| 22432 | |
| 22433 | wpalMemoryCopy(phalConfigSta->staMac, |
| 22434 | pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22435 | |
| 22436 | phalConfigSta->assocId = pwdiConfigSta->usAssocId; |
| 22437 | phalConfigSta->staType = pwdiConfigSta->wdiSTAType; |
| 22438 | phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported; |
| 22439 | phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval; |
| 22440 | phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled; |
| 22441 | phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable; |
| 22442 | phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet; |
| 22443 | phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode; |
| 22444 | phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection; |
| 22445 | phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize; |
| 22446 | phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity; |
| 22447 | phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize; |
| 22448 | phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz; |
| 22449 | phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz; |
| 22450 | phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled; |
| 22451 | phalConfigSta->action = pwdiConfigSta->wdiAction; |
| 22452 | phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD; |
| 22453 | phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen; |
| 22454 | phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable; |
| 22455 | phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport; |
| 22456 | phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio; |
| 22457 | phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz; |
| 22458 | phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22459 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22460 | phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS); |
| 22461 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22462 | phalConfigSta->supportedRates.opRateMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22463 | pwdiConfigSta->wdiSupportedRates.opRateMode; |
| 22464 | for(i = 0; i < SIR_NUM_11B_RATES; i ++) |
| 22465 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22466 | phalConfigSta->supportedRates.llbRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22467 | pwdiConfigSta->wdiSupportedRates.llbRates[i]; |
| 22468 | } |
| 22469 | for(i = 0; i < SIR_NUM_11A_RATES; i ++) |
| 22470 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22471 | phalConfigSta->supportedRates.llaRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22472 | pwdiConfigSta->wdiSupportedRates.llaRates[i]; |
| 22473 | } |
| 22474 | for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++) |
| 22475 | { |
| 22476 | phalConfigSta->supportedRates.aniLegacyRates[i] = |
| 22477 | pwdiConfigSta->wdiSupportedRates.aLegacyRates[i]; |
| 22478 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22479 | phalConfigSta->supportedRates.aniEnhancedRateBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22480 | pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap; |
| 22481 | for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++) |
| 22482 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22483 | phalConfigSta->supportedRates.supportedMCSSet[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22484 | pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i]; |
| 22485 | } |
| 22486 | phalConfigSta->supportedRates.rxHighestDataRate = |
| 22487 | pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate; |
| 22488 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22489 | #ifdef WLAN_FEATURE_11AC |
| 22490 | if(phalConfigSta_V1 != NULL) |
| 22491 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22492 | phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap; |
| 22493 | phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate; |
| 22494 | phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap; |
| 22495 | phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22496 | } |
| 22497 | #endif |
| 22498 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22499 | phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22500 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22501 | #ifdef WLAN_FEATURE_11AC |
| 22502 | if(phalConfigSta_V1 != NULL) |
| 22503 | { |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22504 | phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta; |
| 22505 | phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet; |
Shailender Karmuchi | 31f9ebe | 2013-01-17 12:51:24 -0800 | [diff] [blame] | 22506 | phalConfigSta_V1->vhtTxBFEnabled = pwdiConfigSta->ucVhtTxBFEnabled; |
Gopichand Nakkala | b7ed0a6 | 2013-01-04 11:41:02 -0800 | [diff] [blame] | 22507 | phalConfigSta_V1->htLdpcEnabled = pwdiConfigSta->ucHtLdpcEnabled; |
| 22508 | phalConfigSta_V1->vhtLdpcEnabled = pwdiConfigSta->ucVhtLdpcEnabled; |
| 22509 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22510 | } |
| 22511 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22512 | }/*WDI_CopyWDIStaCtxToHALStaCtx*/; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22513 | |
| 22514 | /*Translate a Rate set info from WDI into HAL*/ |
| 22515 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22516 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22517 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22518 | tSirMacRateSet* pHalRateSet, |
| 22519 | WDI_RateSet* pwdiRateSet |
| 22520 | ) |
| 22521 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22522 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22523 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22524 | |
| 22525 | pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )? |
| 22526 | pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX; |
| 22527 | |
| 22528 | for ( i = 0; i < pHalRateSet->numRates; i++ ) |
| 22529 | { |
| 22530 | pHalRateSet->rate[i] = pwdiRateSet->aRates[i]; |
| 22531 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22532 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22533 | }/*WDI_CopyWDIRateSetToHALRateSet*/ |
| 22534 | |
| 22535 | |
| 22536 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 22537 | WPT_STATIC WPT_INLINE void |
| 22538 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22539 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22540 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 22541 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 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 | |
| 22547 | phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd; |
| 22548 | phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci; |
| 22549 | phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm; |
| 22550 | phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn; |
| 22551 | |
| 22552 | phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max; |
| 22553 | phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min; |
| 22554 | phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit; |
| 22555 | }/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/ |
| 22556 | |
| 22557 | |
| 22558 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 22559 | WPT_STATIC WPT_INLINE void |
| 22560 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 22561 | ( |
| 22562 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 22563 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 22564 | ) |
| 22565 | { |
| 22566 | pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer; |
| 22567 | pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type; |
| 22568 | pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType; |
| 22569 | pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS; |
| 22570 | pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS; |
| 22571 | pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag; |
| 22572 | pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry; |
| 22573 | pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt; |
| 22574 | pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData; |
| 22575 | pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep; |
| 22576 | pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order; |
| 22577 | |
| 22578 | pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo; |
| 22579 | pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi; |
| 22580 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22581 | wpalMemoryCopy(pmacMgmtHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22582 | pwdiMacMgmtHdr->da, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22583 | wpalMemoryCopy(pmacMgmtHdr->sa, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22584 | pwdiMacMgmtHdr->sa, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22585 | wpalMemoryCopy(pmacMgmtHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22586 | pwdiMacMgmtHdr->bssId, 6); |
| 22587 | |
| 22588 | pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum; |
| 22589 | pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo; |
| 22590 | pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi; |
| 22591 | |
| 22592 | }/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/ |
| 22593 | |
| 22594 | |
| 22595 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 22596 | WPT_STATIC WPT_INLINE void |
| 22597 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 22598 | ( |
| 22599 | tConfigBssParams* phalConfigBSS, |
| 22600 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 22601 | ) |
| 22602 | { |
| 22603 | |
| 22604 | wpt_uint8 keyIndex = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22605 | #ifdef WLAN_FEATURE_11AC |
| 22606 | /* Get the Version 1 Handler */ |
| 22607 | tConfigBssParams_V1* phalConfigBSS_V1 = NULL; |
| 22608 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 22609 | phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22610 | #endif |
| 22611 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22612 | wpalMemoryCopy( phalConfigBSS->bssId, |
| 22613 | pwdiConfigBSS->macBSSID, |
| 22614 | WDI_MAC_ADDR_LEN); |
| 22615 | |
| 22616 | #ifdef HAL_SELF_STA_PER_BSS |
| 22617 | wpalMemoryCopy( phalConfigBSS->selfMacAddr, |
| 22618 | pwdiConfigBSS->macSelfAddr, |
| 22619 | WDI_MAC_ADDR_LEN); |
| 22620 | #endif |
| 22621 | |
| 22622 | phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType); |
| 22623 | |
| 22624 | phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode; |
| 22625 | phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType); |
| 22626 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22627 | phalConfigBSS->shortSlotTimeSupported = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22628 | pwdiConfigBSS->ucShortSlotTimeSupported; |
| 22629 | phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist; |
| 22630 | phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist; |
| 22631 | phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist; |
| 22632 | phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist; |
| 22633 | phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22634 | phalConfigBSS->fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22635 | pwdiConfigBSS->ucTXOPProtectionFullSupport; |
| 22636 | phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode; |
| 22637 | phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval; |
| 22638 | phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod; |
| 22639 | phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet; |
| 22640 | phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel; |
| 22641 | phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel; |
| 22642 | phalConfigBSS->action = pwdiConfigBSS->wdiAction; |
| 22643 | phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable; |
| 22644 | phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled; |
| 22645 | phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled; |
| 22646 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22647 | phalConfigBSS->htOperMode = |
| 22648 | WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22649 | |
| 22650 | phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection; |
| 22651 | phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit; |
| 22652 | phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn; |
| 22653 | phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn; |
| 22654 | |
| 22655 | #ifdef WLAN_FEATURE_VOWIFI |
| 22656 | phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower; |
| 22657 | #endif |
| 22658 | |
| 22659 | /*! Used 32 as magic number because that is how the ssid is declared inside the |
| 22660 | hal header - hal needs a macro for it */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22661 | phalConfigBSS->ssId.length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22662 | (pwdiConfigBSS->wdiSSID.ucLength <= 32)? |
| 22663 | pwdiConfigBSS->wdiSSID.ucLength : 32; |
| 22664 | wpalMemoryCopy(phalConfigBSS->ssId.ssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22665 | pwdiConfigBSS->wdiSSID.sSSID, |
| 22666 | phalConfigBSS->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22667 | |
| 22668 | WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext, |
| 22669 | &pwdiConfigBSS->wdiSTAContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22670 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22671 | WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet, |
| 22672 | &pwdiConfigBSS->wdiRateSet); |
| 22673 | |
| 22674 | phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid; |
| 22675 | |
| 22676 | if(phalConfigBSS->edcaParamsValid) |
| 22677 | { |
| 22678 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe, |
| 22679 | &pwdiConfigBSS->wdiBEEDCAParams); |
| 22680 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk, |
| 22681 | &pwdiConfigBSS->wdiBKEDCAParams); |
| 22682 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi, |
| 22683 | &pwdiConfigBSS->wdiVIEDCAParams); |
| 22684 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo, |
| 22685 | &pwdiConfigBSS->wdiVOEDCAParams); |
| 22686 | } |
| 22687 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22688 | phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22689 | |
| 22690 | phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn; |
| 22691 | |
| 22692 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 22693 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22694 | phalConfigBSS->extSetStaKeyParamValid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22695 | pwdiConfigBSS->bExtSetStaKeyParamValid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22696 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22697 | if( phalConfigBSS->extSetStaKeyParamValid ) |
| 22698 | { |
| 22699 | /*----------------------------------------------------------------------- |
| 22700 | Copy the STA Key parameters into the HAL message |
| 22701 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22702 | phalConfigBSS->extSetStaKeyParam.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22703 | WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType); |
| 22704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22705 | phalConfigBSS->extSetStaKeyParam.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22706 | WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType ); |
| 22707 | |
| 22708 | phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx; |
| 22709 | |
| 22710 | phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx; |
| 22711 | |
| 22712 | phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc; |
| 22713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22714 | for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ; |
| 22715 | keyIndex++) |
| 22716 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22717 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22718 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId; |
| 22719 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast = |
| 22720 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast; |
| 22721 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection = |
| 22722 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection; |
| 22723 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22724 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22725 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22726 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22727 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22728 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22729 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength; |
| 22730 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22731 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22732 | WDI_MAX_KEY_LENGTH); |
| 22733 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22734 | } |
| 22735 | else/* phalConfigBSS->extSetStaKeyParamValid is not set */ |
| 22736 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22737 | wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22738 | sizeof(phalConfigBSS->extSetStaKeyParam) ); |
| 22739 | } |
| 22740 | |
| 22741 | #endif /*WLAN_FEATURE_VOWIFI_11R*/ |
| 22742 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22743 | #ifdef WLAN_FEATURE_11AC |
| 22744 | if(phalConfigBSS_V1 != NULL) |
| 22745 | { |
| 22746 | phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta; |
| 22747 | phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet; |
| 22748 | } |
| 22749 | #endif |
| 22750 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22751 | }/*WDI_CopyWDIConfigBSSToHALConfigBSS*/ |
| 22752 | |
| 22753 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22754 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22755 | pointed to by user data */ |
| 22756 | WPT_STATIC WPT_INLINE void |
| 22757 | WDI_ExtractRequestCBFromEvent |
| 22758 | ( |
| 22759 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22760 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22761 | void** ppUserData |
| 22762 | ) |
| 22763 | { |
| 22764 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22765 | switch ( pEvent->wdiRequest ) |
| 22766 | { |
| 22767 | case WDI_START_REQ: |
| 22768 | *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22769 | *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData; |
| 22770 | break; |
| 22771 | case WDI_STOP_REQ: |
| 22772 | *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22773 | *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData; |
| 22774 | break; |
| 22775 | case WDI_INIT_SCAN_REQ: |
| 22776 | *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22777 | *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 22778 | break; |
| 22779 | case WDI_START_SCAN_REQ: |
| 22780 | *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22781 | *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 22782 | break; |
| 22783 | case WDI_END_SCAN_REQ: |
| 22784 | *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22785 | *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 22786 | break; |
| 22787 | case WDI_FINISH_SCAN_REQ: |
| 22788 | *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22789 | *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 22790 | break; |
| 22791 | case WDI_JOIN_REQ: |
| 22792 | *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22793 | *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData; |
| 22794 | break; |
| 22795 | case WDI_CONFIG_BSS_REQ: |
| 22796 | *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22797 | *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 22798 | break; |
| 22799 | case WDI_DEL_BSS_REQ: |
| 22800 | *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22801 | *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 22802 | break; |
| 22803 | case WDI_POST_ASSOC_REQ: |
| 22804 | *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22805 | *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData; |
| 22806 | break; |
| 22807 | case WDI_DEL_STA_REQ: |
| 22808 | *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22809 | *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22810 | break; |
| 22811 | case WDI_DEL_STA_SELF_REQ: |
| 22812 | *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22813 | *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData; |
| 22814 | break; |
| 22815 | |
| 22816 | case WDI_SET_BSS_KEY_REQ: |
| 22817 | *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22818 | *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 22819 | break; |
| 22820 | case WDI_RMV_BSS_KEY_REQ: |
| 22821 | *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22822 | *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 22823 | break; |
| 22824 | case WDI_SET_STA_KEY_REQ: |
| 22825 | *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22826 | *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 22827 | break; |
| 22828 | case WDI_RMV_STA_KEY_REQ: |
| 22829 | *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22830 | *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 22831 | break; |
| 22832 | case WDI_ADD_TS_REQ: |
| 22833 | *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22834 | *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 22835 | break; |
| 22836 | case WDI_DEL_TS_REQ: |
| 22837 | *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22838 | *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 22839 | break; |
| 22840 | case WDI_UPD_EDCA_PRMS_REQ: |
| 22841 | *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22842 | *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData; |
| 22843 | break; |
| 22844 | case WDI_ADD_BA_SESSION_REQ: |
| 22845 | *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22846 | *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData; |
| 22847 | break; |
| 22848 | case WDI_DEL_BA_REQ: |
| 22849 | *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22850 | *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22851 | break; |
| 22852 | #ifdef FEATURE_WLAN_CCX |
| 22853 | case WDI_TSM_STATS_REQ: |
| 22854 | *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22855 | *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22856 | break; |
| 22857 | #endif |
| 22858 | case WDI_CH_SWITCH_REQ: |
| 22859 | *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22860 | *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData; |
| 22861 | break; |
| 22862 | case WDI_CONFIG_STA_REQ: |
| 22863 | *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22864 | *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22865 | break; |
| 22866 | case WDI_SET_LINK_ST_REQ: |
| 22867 | *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22868 | *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData; |
| 22869 | break; |
| 22870 | case WDI_GET_STATS_REQ: |
| 22871 | *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22872 | *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22873 | break; |
Srinivas Girigowda | 2471d83 | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 22874 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 22875 | case WDI_GET_ROAM_RSSI_REQ: |
| 22876 | *ppfnReqCB = ((WDI_GetRoamRssiReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22877 | *ppUserData = ((WDI_GetRoamRssiReqParamsType*)pEvent->pEventData)->pUserData; |
| 22878 | break; |
| 22879 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22880 | case WDI_UPDATE_CFG_REQ: |
| 22881 | *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22882 | *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData; |
| 22883 | break; |
| 22884 | case WDI_ADD_BA_REQ: |
| 22885 | *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22886 | *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22887 | break; |
| 22888 | case WDI_TRIGGER_BA_REQ: |
| 22889 | *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22890 | *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 22891 | break; |
| 22892 | case WDI_UPD_BCON_PRMS_REQ: |
| 22893 | *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22894 | *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 22895 | break; |
| 22896 | case WDI_SND_BCON_REQ: |
| 22897 | *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22898 | *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 22899 | break; |
| 22900 | case WDI_ENTER_BMPS_REQ: |
| 22901 | *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22902 | *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22903 | break; |
| 22904 | case WDI_EXIT_BMPS_REQ: |
| 22905 | *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22906 | *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22907 | break; |
| 22908 | case WDI_ENTER_UAPSD_REQ: |
| 22909 | *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22910 | *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 22911 | break; |
| 22912 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
| 22913 | *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22914 | *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 22915 | break; |
| 22916 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
| 22917 | *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22918 | *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22919 | break; |
| 22920 | case WDI_SET_BEACON_FILTER_REQ: |
| 22921 | *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22922 | *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22923 | break; |
| 22924 | case WDI_REM_BEACON_FILTER_REQ: |
| 22925 | *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22926 | *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22927 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22928 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 22929 | *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22930 | *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData; |
| 22931 | break; |
| 22932 | case WDI_HOST_OFFLOAD_REQ: |
| 22933 | *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22934 | *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData; |
| 22935 | break; |
| 22936 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 22937 | *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22938 | *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 22939 | break; |
| 22940 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 22941 | *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22942 | *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 22943 | break; |
| 22944 | case WDI_WOWL_ENTER_REQ: |
| 22945 | *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22946 | *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22947 | break; |
| 22948 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 22949 | *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22950 | *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData; |
| 22951 | break; |
| 22952 | case WDI_FLUSH_AC_REQ: |
| 22953 | *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22954 | *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData; |
| 22955 | break; |
| 22956 | case WDI_BTAMP_EVENT_REQ: |
| 22957 | *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22958 | *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData; |
| 22959 | break; |
| 22960 | case WDI_KEEP_ALIVE_REQ: |
| 22961 | *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22962 | *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData; |
| 22963 | break; |
| 22964 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 22965 | *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22966 | *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData; |
Tushnim Bhattacharyya | e39194c | 2013-03-08 10:15:42 -0800 | [diff] [blame] | 22967 | break; |
| 22968 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
| 22969 | *ppfnReqCB = ((WDI_SetRcvPktFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22970 | *ppUserData = ((WDI_SetRcvPktFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 22971 | break; |
| 22972 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 22973 | *ppfnReqCB = ((WDI_RcvFltPktMatchCntReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22974 | *ppUserData = ((WDI_RcvFltPktMatchCntReqParamsType*)pEvent->pEventData)->pUserData; |
| 22975 | break; |
| 22976 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 22977 | *ppfnReqCB = ((WDI_RcvFltPktClearReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 22978 | *ppUserData = ((WDI_RcvFltPktClearReqParamsType*)pEvent->pEventData)->pUserData; |
| 22979 | break; |
| 22980 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22981 | default: |
| 22982 | *ppfnReqCB = NULL; |
| 22983 | *ppUserData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22984 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22985 | } |
| 22986 | }/*WDI_ExtractRequestCBFromEvent*/ |
| 22987 | |
| 22988 | |
| 22989 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22990 | @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22991 | frame xtl is enabled for a particular STA. |
| 22992 | |
| 22993 | WDI_PostAssocReq must have been called. |
| 22994 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22995 | @param uSTAIdx: STA index |
| 22996 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22997 | @see WDI_PostAssocReq |
| 22998 | @return Result of the function call |
| 22999 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23000 | wpt_boolean |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23001 | WDI_IsHwFrameTxTranslationCapable |
| 23002 | ( |
| 23003 | wpt_uint8 uSTAIdx |
| 23004 | ) |
| 23005 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23006 | /*!! FIX ME - this must eventually be per station - for now just feedback |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23007 | uma value*/ |
| 23008 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23009 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23010 | ------------------------------------------------------------------------*/ |
| 23011 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23012 | { |
| 23013 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23014 | "WDI API call before module is initialized - Fail request"); |
| 23015 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23016 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23017 | } |
| 23018 | |
Gopichand Nakkala | ba26127 | 2013-01-03 15:45:56 -0800 | [diff] [blame] | 23019 | #ifdef WLAN_SOFTAP_VSTA_FEATURE |
| 23020 | if (IS_VSTA_IDX(uSTAIdx)) |
| 23021 | { |
| 23022 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23023 | "STA %d is a Virtual STA, " |
| 23024 | "HW frame translation disabled", uSTAIdx); |
| 23025 | return eWLAN_PAL_FALSE; |
| 23026 | } |
| 23027 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23028 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23029 | return gWDICb.bFrameTransEnabled; |
| 23030 | }/*WDI_IsHwFrameTxTranslationCapable*/ |
| 23031 | |
| 23032 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 23033 | /** |
| 23034 | @brief WDI_SetPreferredNetworkList |
| 23035 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23036 | @param pwdiPNOScanReqParams: the Set PNO as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23037 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23038 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23039 | wdiPNOScanCb: callback for passing back the response |
| 23040 | of the Set PNO operation received from the |
| 23041 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23042 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23043 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23044 | callback |
| 23045 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23046 | @return Result of the function call |
| 23047 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23048 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23049 | WDI_SetPreferredNetworkReq |
| 23050 | ( |
| 23051 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 23052 | WDI_PNOScanCb wdiPNOScanCb, |
| 23053 | void* pUserData |
| 23054 | ) |
| 23055 | { |
| 23056 | WDI_EventInfoType wdiEventData = {{0}}; |
| 23057 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23058 | |
| 23059 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23060 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23061 | ------------------------------------------------------------------------*/ |
| 23062 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23063 | { |
| 23064 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23065 | "WDI API call before module is initialized - Fail request"); |
| 23066 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23067 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23068 | } |
| 23069 | |
| 23070 | /*------------------------------------------------------------------------ |
| 23071 | Fill in Event data and post to the Main FSM |
| 23072 | ------------------------------------------------------------------------*/ |
| 23073 | wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23074 | wdiEventData.pEventData = pwdiPNOScanReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23075 | wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23076 | wdiEventData.pCBfnc = wdiPNOScanCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23077 | wdiEventData.pUserData = pUserData; |
| 23078 | |
| 23079 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23080 | } |
| 23081 | |
| 23082 | |
| 23083 | /** |
| 23084 | @brief WDI_SetRssiFilterReq |
| 23085 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23086 | @param pwdiRssiFilterReqParams: the Set RSSI Filter as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23087 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23088 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23089 | wdiRssiFilterCb: callback for passing back the response |
| 23090 | of the Set RSSI Filter operation received from the |
| 23091 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23092 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23093 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23094 | callback |
| 23095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23096 | @return Result of the function call |
| 23097 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23098 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23099 | WDI_SetRssiFilterReq |
| 23100 | ( |
| 23101 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams, |
| 23102 | WDI_RssiFilterCb wdiRssiFilterCb, |
| 23103 | void* pUserData |
| 23104 | ) |
| 23105 | { |
| 23106 | WDI_EventInfoType wdiEventData = {{0}}; |
| 23107 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23108 | |
| 23109 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23110 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23111 | ------------------------------------------------------------------------*/ |
| 23112 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23113 | { |
| 23114 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23115 | "WDI API call before module is initialized - Fail request"); |
| 23116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23117 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23118 | } |
| 23119 | |
| 23120 | /*------------------------------------------------------------------------ |
| 23121 | Fill in Event data and post to the Main FSM |
| 23122 | ------------------------------------------------------------------------*/ |
| 23123 | wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23124 | wdiEventData.pEventData = pwdiRssiFilterReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23125 | wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23126 | wdiEventData.pCBfnc = wdiRssiFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23127 | wdiEventData.pUserData = pUserData; |
| 23128 | |
| 23129 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23130 | }/*WDI_SetRssiFilterReq*/ |
| 23131 | |
| 23132 | /** |
| 23133 | @brief WDI_UpdateScanParamsReq |
| 23134 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23135 | @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23136 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23137 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23138 | wdiUpdateScanParamsCb: callback for passing back the response |
| 23139 | of the Set PNO operation received from the |
| 23140 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23141 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23142 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23143 | callback |
| 23144 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23145 | @return Result of the function call |
| 23146 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23147 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23148 | WDI_UpdateScanParamsReq |
| 23149 | ( |
| 23150 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType, |
| 23151 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb, |
| 23152 | void* pUserData |
| 23153 | ) |
| 23154 | { |
| 23155 | WDI_EventInfoType wdiEventData = {{0}}; |
| 23156 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23157 | |
| 23158 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23159 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23160 | ------------------------------------------------------------------------*/ |
| 23161 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23162 | { |
| 23163 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23164 | "WDI API call before module is initialized - Fail request"); |
| 23165 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23166 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23167 | } |
| 23168 | |
| 23169 | /*------------------------------------------------------------------------ |
| 23170 | Fill in Event data and post to the Main FSM |
| 23171 | ------------------------------------------------------------------------*/ |
| 23172 | wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23173 | wdiEventData.pEventData = pwdiUpdateScanParamsInfoType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23174 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23175 | wdiEventData.pCBfnc = wdiUpdateScanParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23176 | wdiEventData.pUserData = pUserData; |
| 23177 | |
| 23178 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23179 | } |
| 23180 | |
| 23181 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23182 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23183 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23184 | |
| 23185 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23186 | pwdiPNOScanReqParams: pointer to the info received |
| 23187 | from upper layers |
| 23188 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23189 | and its size |
| 23190 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23191 | @return Result of the function call |
| 23192 | */ |
| 23193 | |
| 23194 | WDI_Status |
| 23195 | WDI_PackPreferredNetworkList |
| 23196 | ( |
| 23197 | WDI_ControlBlockType* pWDICtx, |
| 23198 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 23199 | wpt_uint8** ppSendBuffer, |
| 23200 | wpt_uint16* pSize |
| 23201 | ) |
| 23202 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23203 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23204 | wpt_uint16 usDataOffset = 0; |
| 23205 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23206 | tpPrefNetwListParams pPrefNetwListParams = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23207 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23208 | /*----------------------------------------------------------------------- |
| 23209 | Get message buffer |
| 23210 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23211 | 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] | 23212 | sizeof(tPrefNetwListParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23213 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23214 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParams) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23215 | { |
| 23216 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23217 | "Unable to get send buffer in Set PNO req %x ", |
| 23218 | pwdiPNOScanReqParams); |
| 23219 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23220 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23221 | } |
| 23222 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23223 | pPrefNetwListParams = (tpPrefNetwListParams)(pSendBuffer + usDataOffset); |
| 23224 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23225 | /*------------------------------------------------------------------------- |
| 23226 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 23227 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23228 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23229 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23230 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23231 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 23232 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23233 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23234 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23235 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23236 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23237 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 23238 | |
| 23239 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23240 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23241 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 23242 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 23243 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 23244 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23245 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23246 | { |
| 23247 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23248 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23249 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 23250 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23251 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23252 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23253 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23254 | |
| 23255 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23256 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23257 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23258 | |
| 23259 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23260 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23261 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23262 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23263 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23264 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23265 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Madan Mohan Koyyalamudi | a208d10 | 2012-10-15 15:18:18 -0700 | [diff] [blame] | 23266 | (pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount < |
| 23267 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 23268 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount : |
| 23269 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23270 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23271 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23272 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23273 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23274 | |
| 23275 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23276 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23277 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 23278 | |
| 23279 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23280 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23281 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 23282 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23283 | } |
| 23284 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23285 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23286 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23287 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 23288 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 23289 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 23290 | |
| 23291 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23292 | "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] | 23293 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23294 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 23295 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 23296 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23297 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23298 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23299 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23300 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23301 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23302 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 23303 | } |
| 23304 | |
| 23305 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23306 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23307 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 23308 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23309 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23310 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23311 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23312 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23313 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23314 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23315 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23316 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23317 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 23318 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23319 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23320 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23321 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23322 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23323 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23324 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23325 | |
| 23326 | /*Set the output values*/ |
| 23327 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23328 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23329 | |
| 23330 | return WDI_STATUS_SUCCESS; |
| 23331 | }/*WDI_PackPreferredNetworkList*/ |
| 23332 | |
| 23333 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23334 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23335 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23336 | |
| 23337 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23338 | pwdiPNOScanReqParams: pointer to the info received |
| 23339 | from upper layers |
| 23340 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23341 | and its size |
| 23342 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23343 | @return Result of the function call |
| 23344 | */ |
| 23345 | |
| 23346 | WDI_Status |
| 23347 | WDI_PackPreferredNetworkListNew |
| 23348 | ( |
| 23349 | WDI_ControlBlockType* pWDICtx, |
| 23350 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 23351 | wpt_uint8** ppSendBuffer, |
| 23352 | wpt_uint16* pSize |
| 23353 | ) |
| 23354 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23355 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23356 | wpt_uint16 usDataOffset = 0; |
| 23357 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23358 | tpPrefNetwListParamsNew pPrefNetwListParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23359 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23360 | |
| 23361 | /*----------------------------------------------------------------------- |
| 23362 | Get message buffer |
| 23363 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23364 | 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] | 23365 | sizeof(tPrefNetwListParamsNew), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23366 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23367 | ( usSendSize < (usDataOffset + sizeof(tPrefNetwListParamsNew) ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23368 | { |
| 23369 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23370 | "Unable to get send buffer in Set PNO req %x ", |
| 23371 | pwdiPNOScanReqParams); |
| 23372 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23373 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23374 | } |
| 23375 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23376 | pPrefNetwListParams = (tpPrefNetwListParamsNew)(pSendBuffer + usDataOffset); |
| 23377 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23378 | /*------------------------------------------------------------------------- |
| 23379 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 23380 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23381 | pPrefNetwListParams->enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23382 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23383 | pPrefNetwListParams->modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23384 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 23385 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23386 | pPrefNetwListParams->ucNetworksCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23387 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23388 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23389 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23390 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 23391 | |
| 23392 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23393 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23394 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 23395 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 23396 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 23397 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23398 | for ( i = 0; i < pPrefNetwListParams->ucNetworksCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23399 | { |
| 23400 | /*SSID of the BSS*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23401 | pPrefNetwListParams->aNetworks[i].ssId.length |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23402 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 23403 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23404 | wpalMemoryCopy( pPrefNetwListParams->aNetworks[i].ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23405 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23406 | pPrefNetwListParams->aNetworks[i].ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23407 | |
| 23408 | /*Authentication type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23409 | pPrefNetwListParams->aNetworks[i].authentication = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23410 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23411 | |
| 23412 | /*Encryption type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23413 | pPrefNetwListParams->aNetworks[i].encryption = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23414 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23415 | |
| 23416 | /*SSID bcast type for the network*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23417 | pPrefNetwListParams->aNetworks[i].bcastNetworkType = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23418 | (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23419 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23420 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23421 | 0 - if all channels */ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23422 | pPrefNetwListParams->aNetworks[i].ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23423 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount; |
| 23424 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23425 | wpalMemoryCopy(pPrefNetwListParams->aNetworks[i].aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23426 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23427 | pPrefNetwListParams->aNetworks[i].ucChannelCount); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23428 | |
| 23429 | /*Indicates the RSSI threshold for the network to be considered*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23430 | pPrefNetwListParams->aNetworks[i].rssiThreshold = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23431 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 23432 | |
| 23433 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23434 | "WDI SET PNO: SSID %d %s", |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23435 | pPrefNetwListParams->aNetworks[i].ssId.length, |
| 23436 | pPrefNetwListParams->aNetworks[i].ssId.ssId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23437 | } |
| 23438 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23439 | pPrefNetwListParams->scanTimers.ucScanTimersCount = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23440 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23441 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 23442 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 23443 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 23444 | |
| 23445 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23446 | "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] | 23447 | pPrefNetwListParams->scanTimers.ucScanTimersCount, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23448 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 23449 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 23450 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23451 | for ( i = 0; i < pPrefNetwListParams->scanTimers.ucScanTimersCount; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23452 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23453 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23454 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23455 | pPrefNetwListParams->scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23456 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 23457 | } |
| 23458 | |
| 23459 | /*Copy the probe template*/ |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23460 | pPrefNetwListParams->us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23461 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 23462 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23463 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23464 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23465 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23466 | wpalMemoryCopy(pPrefNetwListParams->a24GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23467 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23468 | pPrefNetwListParams->us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23469 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23470 | pPrefNetwListParams->us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23471 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 23472 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 23473 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23474 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23475 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23476 | wpalMemoryCopy(pPrefNetwListParams->a5GProbeTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23477 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 23478 | pPrefNetwListParams->us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23480 | |
| 23481 | /*Set the output values*/ |
| 23482 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23483 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23484 | |
| 23485 | return WDI_STATUS_SUCCESS; |
| 23486 | }/*WDI_PackPreferredNetworkListNew*/ |
| 23487 | |
| 23488 | /** |
| 23489 | @brief Process Set Preferred Network List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23490 | |
| 23491 | @param pWDICtx: pointer to the WLAN DAL context |
| 23492 | pEventData: pointer to the event information structure |
| 23493 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23494 | @return Result of the function call |
| 23495 | */ |
| 23496 | WDI_Status |
| 23497 | WDI_ProcessSetPreferredNetworkReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23498 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23499 | WDI_ControlBlockType* pWDICtx, |
| 23500 | WDI_EventInfoType* pEventData |
| 23501 | ) |
| 23502 | { |
| 23503 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL; |
| 23504 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23505 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23506 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23507 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23508 | |
| 23509 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23510 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23511 | -------------------------------------------------------------------------*/ |
| 23512 | if (( NULL == pEventData ) || |
| 23513 | ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) || |
| 23514 | ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc))) |
| 23515 | { |
| 23516 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23517 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23518 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23519 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23520 | } |
| 23521 | |
| 23522 | /*------------------------------------------------------------------------- |
| 23523 | Pack the PNO request structure based on version |
| 23524 | -------------------------------------------------------------------------*/ |
| 23525 | if ( pWDICtx->wdiPNOVersion > 0 ) |
| 23526 | { |
| 23527 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23528 | "%s: PNO new version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23529 | pWDICtx->wdiPNOVersion); |
| 23530 | |
| 23531 | wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams, |
| 23532 | &pSendBuffer, &usSendSize); |
| 23533 | } |
| 23534 | else |
| 23535 | { |
| 23536 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23537 | "%s: PNO old version %d ", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23538 | pWDICtx->wdiPNOVersion); |
| 23539 | |
| 23540 | wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams, |
| 23541 | &pSendBuffer, &usSendSize); |
| 23542 | } |
| 23543 | |
| 23544 | if (( WDI_STATUS_SUCCESS != wdiStatus )|| |
| 23545 | ( NULL == pSendBuffer )||( 0 == usSendSize )) |
| 23546 | { |
| 23547 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23548 | "%s: failed to pack request parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23549 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23550 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23551 | } |
| 23552 | |
| 23553 | pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23554 | pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23555 | |
| 23556 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23557 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23558 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23559 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23560 | wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23561 | } |
| 23562 | |
| 23563 | /** |
| 23564 | @brief Process Set RSSI Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23565 | |
| 23566 | @param pWDICtx: pointer to the WLAN DAL context |
| 23567 | pEventData: pointer to the event information structure |
| 23568 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23569 | @see |
| 23570 | @return Result of the function call |
| 23571 | */ |
| 23572 | WDI_Status |
| 23573 | WDI_ProcessSetRssiFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23574 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23575 | WDI_ControlBlockType* pWDICtx, |
| 23576 | WDI_EventInfoType* pEventData |
| 23577 | ) |
| 23578 | { |
| 23579 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL; |
| 23580 | WDI_RssiFilterCb wdiRssiFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23581 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23582 | wpt_uint16 usDataOffset = 0; |
| 23583 | wpt_uint16 usSendSize = 0; |
| 23584 | wpt_uint8 ucRssiThreshold; |
| 23585 | |
| 23586 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23587 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23588 | -------------------------------------------------------------------------*/ |
| 23589 | if (( NULL == pEventData ) || |
| 23590 | ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) || |
| 23591 | ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc))) |
| 23592 | { |
| 23593 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23594 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23595 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23596 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23597 | } |
| 23598 | |
| 23599 | /*----------------------------------------------------------------------- |
| 23600 | Get message buffer |
| 23601 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23602 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23603 | sizeof(ucRssiThreshold), |
| 23604 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23605 | ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) ))) |
| 23606 | { |
| 23607 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23608 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 23609 | pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb); |
| 23610 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23611 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23612 | } |
| 23613 | |
| 23614 | ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold; |
| 23615 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23616 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23617 | &ucRssiThreshold, |
| 23618 | sizeof(ucRssiThreshold)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23619 | |
| 23620 | pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23621 | pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23622 | |
| 23623 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23624 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23625 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23626 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23627 | wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23628 | } |
| 23629 | |
| 23630 | |
| 23631 | /** |
| 23632 | @brief Process Update Scan Params function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23633 | |
| 23634 | @param pWDICtx: pointer to the WLAN DAL context |
| 23635 | pEventData: pointer to the event information structure |
| 23636 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23637 | @see |
| 23638 | @return Result of the function call |
| 23639 | */ |
| 23640 | WDI_Status |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23641 | WDI_PackUpdateScanParamsReq |
| 23642 | ( |
| 23643 | WDI_ControlBlockType* pWDICtx, |
| 23644 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams, |
| 23645 | wpt_uint8** ppSendBuffer, |
| 23646 | wpt_uint16* pSize |
| 23647 | ) |
| 23648 | { |
| 23649 | wpt_uint8* pSendBuffer = NULL; |
| 23650 | wpt_uint16 usDataOffset = 0; |
| 23651 | wpt_uint16 usSendSize = 0; |
| 23652 | tUpdateScanParams updateScanParams = {0}; |
| 23653 | |
| 23654 | |
Varun Reddy Yeturu | 9163b67 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 23655 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23656 | "Begin WDI Update Scan Parameters Old Style Params"); |
| 23657 | /*----------------------------------------------------------------------- |
| 23658 | Get message buffer |
| 23659 | -----------------------------------------------------------------------*/ |
| 23660 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
| 23661 | sizeof(updateScanParams), |
| 23662 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23663 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 23664 | { |
| 23665 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23666 | "Unable to get send buffer in Update Scan Params req %x", |
| 23667 | pwdiUpdateScanParams); |
| 23668 | WDI_ASSERT(0); |
| 23669 | return WDI_STATUS_E_FAILURE; |
| 23670 | } |
| 23671 | |
| 23672 | // |
| 23673 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 23674 | // |
| 23675 | |
| 23676 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 23677 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
| 23678 | |
| 23679 | updateScanParams.ucChannelCount = |
| 23680 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 23681 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 23682 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 23683 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
| 23684 | |
| 23685 | wpalMemoryCopy( updateScanParams.aChannels, |
| 23686 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 23687 | updateScanParams.ucChannelCount); |
| 23688 | |
| 23689 | |
| 23690 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 23691 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 23692 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 23693 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 23694 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 23695 | |
| 23696 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23697 | &updateScanParams, |
| 23698 | sizeof(updateScanParams)); |
| 23699 | |
| 23700 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
| 23701 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
| 23702 | |
Varun Reddy Yeturu | 9163b67 | 2013-02-11 14:05:06 -0800 | [diff] [blame] | 23703 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23704 | "End Update Scan Parameters Old Style"); |
| 23705 | |
| 23706 | /*Set the output values*/ |
| 23707 | *ppSendBuffer = pSendBuffer; |
| 23708 | *pSize = usSendSize; |
| 23709 | |
| 23710 | return WDI_STATUS_SUCCESS; |
| 23711 | } |
| 23712 | |
| 23713 | /** |
| 23714 | @brief Process Update Scan Params function |
| 23715 | |
| 23716 | @param pWDICtx: pointer to the WLAN DAL context |
| 23717 | pEventData: pointer to the event information structure |
| 23718 | |
| 23719 | @see |
| 23720 | @return Result of the function call |
| 23721 | */ |
| 23722 | WDI_Status |
| 23723 | WDI_PackUpdateScanParamsReqEx |
| 23724 | ( |
| 23725 | WDI_ControlBlockType* pWDICtx, |
| 23726 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams, |
| 23727 | wpt_uint8** ppSendBuffer, |
| 23728 | wpt_uint16* pSize |
| 23729 | ) |
| 23730 | { |
| 23731 | wpt_uint8* pSendBuffer = NULL; |
| 23732 | wpt_uint16 usDataOffset = 0; |
| 23733 | wpt_uint16 usSendSize = 0; |
| 23734 | tUpdateScanParamsEx updateScanParams = {0}; |
| 23735 | |
| 23736 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23737 | /*----------------------------------------------------------------------- |
| 23738 | Get message buffer |
| 23739 | -----------------------------------------------------------------------*/ |
| 23740 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
| 23741 | sizeof(updateScanParams), |
| 23742 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23743 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 23744 | { |
| 23745 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23746 | "Unable to get send buffer in Update Scan Params Ex req %x", |
| 23747 | pwdiUpdateScanParams); |
| 23748 | WDI_ASSERT(0); |
| 23749 | return WDI_STATUS_E_FAILURE; |
| 23750 | } |
| 23751 | |
| 23752 | // |
| 23753 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 23754 | // |
| 23755 | |
| 23756 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 23757 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
| 23758 | |
| 23759 | updateScanParams.ucChannelCount = |
| 23760 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 23761 | WLAN_HAL_PNO_MAX_NETW_CHANNELS_EX)? |
| 23762 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 23763 | WLAN_HAL_PNO_MAX_NETW_CHANNELS_EX; |
| 23764 | |
| 23765 | wpalMemoryCopy( updateScanParams.aChannels, |
| 23766 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 23767 | updateScanParams.ucChannelCount); |
| 23768 | |
| 23769 | |
| 23770 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 23771 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 23772 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 23773 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 23774 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 23775 | |
| 23776 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23777 | &updateScanParams, |
| 23778 | sizeof(updateScanParams)); |
| 23779 | |
| 23780 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
| 23781 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
| 23782 | |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23783 | /*Set the output values*/ |
| 23784 | *ppSendBuffer = pSendBuffer; |
| 23785 | *pSize = usSendSize; |
| 23786 | |
| 23787 | return WDI_STATUS_SUCCESS; |
| 23788 | } |
| 23789 | |
| 23790 | /** |
| 23791 | @brief Process Update Scan Params function |
| 23792 | |
| 23793 | @param pWDICtx: pointer to the WLAN DAL context |
| 23794 | pEventData: pointer to the event information structure |
| 23795 | |
| 23796 | @see |
| 23797 | @return Result of the function call |
| 23798 | */ |
| 23799 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23800 | WDI_ProcessUpdateScanParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23801 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23802 | WDI_ControlBlockType* pWDICtx, |
| 23803 | WDI_EventInfoType* pEventData |
| 23804 | ) |
| 23805 | { |
| 23806 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL; |
| 23807 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23808 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23809 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 1f11a39 | 2012-12-27 17:31:42 -0800 | [diff] [blame] | 23810 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23811 | |
| 23812 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23813 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23814 | -------------------------------------------------------------------------*/ |
| 23815 | if (( NULL == pEventData ) || |
| 23816 | ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) || |
| 23817 | ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc))) |
| 23818 | { |
| 23819 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23820 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23821 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23822 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23823 | } |
| 23824 | |
| 23825 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23826 | "Begin WDI Update Scan Parameters"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23827 | |
| 23828 | // |
| 23829 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 23830 | // |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23831 | if ( pWDICtx->wlanVersion.revision < 1 ) |
| 23832 | { |
Madan Mohan Koyyalamudi | 1f11a39 | 2012-12-27 17:31:42 -0800 | [diff] [blame] | 23833 | wdiStatus = WDI_PackUpdateScanParamsReq( pWDICtx, pwdiUpdateScanParams, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23834 | &pSendBuffer, &usSendSize); |
| 23835 | } |
| 23836 | else |
| 23837 | { |
Madan Mohan Koyyalamudi | 1f11a39 | 2012-12-27 17:31:42 -0800 | [diff] [blame] | 23838 | wdiStatus = WDI_PackUpdateScanParamsReqEx( pWDICtx, pwdiUpdateScanParams, |
| 23839 | &pSendBuffer, &usSendSize); |
| 23840 | } |
| 23841 | |
| 23842 | if(WDI_STATUS_SUCCESS != wdiStatus) |
| 23843 | { |
| 23844 | //memory allocation failed |
| 23845 | return WDI_STATUS_E_FAILURE; |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23846 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23847 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23848 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23849 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23850 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23851 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Pratik Bhalgat | d440459 | 2012-11-22 17:49:14 +0530 | [diff] [blame] | 23852 | wdiUpdateScanParamsCb, pEventData->pUserData, |
| 23853 | WDI_UPDATE_SCAN_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23854 | } |
| 23855 | |
| 23856 | /** |
| 23857 | @brief Process Preferred Network Found Indication function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23858 | |
| 23859 | @param pWDICtx: pointer to the WLAN DAL context |
| 23860 | pEventData: pointer to the event information structure |
| 23861 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23862 | @see |
| 23863 | @return Result of the function call |
| 23864 | */ |
| 23865 | WDI_Status |
| 23866 | WDI_ProcessPrefNetworkFoundInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23867 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23868 | WDI_ControlBlockType* pWDICtx, |
| 23869 | WDI_EventInfoType* pEventData |
| 23870 | ) |
| 23871 | { |
| 23872 | WDI_LowLevelIndType wdiInd; |
| 23873 | tPrefNetwFoundInd prefNetwFoundInd = {{0}}; |
| 23874 | |
| 23875 | |
| 23876 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23877 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23878 | -------------------------------------------------------------------------*/ |
| 23879 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23880 | ( NULL == pEventData->pEventData )) |
| 23881 | { |
| 23882 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 23883 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23884 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23885 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23886 | } |
| 23887 | |
| 23888 | /*------------------------------------------------------------------------- |
| 23889 | Extract indication and send it to UMAC |
| 23890 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23891 | wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams, |
| 23892 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23893 | sizeof(tPrefNetwFoundParams)); |
| 23894 | |
| 23895 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23896 | wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23897 | |
| 23898 | wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32); |
| 23899 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23900 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23901 | (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23902 | prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23903 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23904 | wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 23905 | prefNetwFoundInd.prefNetwFoundParams.ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23906 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength); |
| 23907 | |
| 23908 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi = |
| 23909 | prefNetwFoundInd.prefNetwFoundParams.rssi; |
| 23910 | |
| 23911 | // DEBUG |
| 23912 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 23913 | "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)", |
| 23914 | wdiInd.wdiIndicationType, |
| 23915 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 23916 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi ); |
| 23917 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 23918 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 23919 | { |
| 23920 | /*Notify UMAC*/ |
| 23921 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 23922 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23923 | |
| 23924 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23925 | } |
| 23926 | |
| 23927 | /** |
| 23928 | @brief Process PNO Rsp function (called when a |
| 23929 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23930 | |
| 23931 | @param pWDICtx: pointer to the WLAN DAL context |
| 23932 | pEventData: pointer to the event information structure |
| 23933 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23934 | @see |
| 23935 | @return Result of the function call |
| 23936 | */ |
| 23937 | WDI_Status |
| 23938 | WDI_ProcessSetPreferredNetworkRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23939 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23940 | WDI_ControlBlockType* pWDICtx, |
| 23941 | WDI_EventInfoType* pEventData |
| 23942 | ) |
| 23943 | { |
| 23944 | WDI_Status wdiStatus; |
| 23945 | eHalStatus halStatus; |
| 23946 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
| 23947 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23948 | |
| 23949 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23950 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23951 | -------------------------------------------------------------------------*/ |
| 23952 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23953 | ( NULL == pEventData->pEventData )) |
| 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 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23962 | wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23963 | |
| 23964 | /*------------------------------------------------------------------------- |
| 23965 | Extract response and send it to UMAC |
| 23966 | -------------------------------------------------------------------------*/ |
| 23967 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23968 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23969 | |
| 23970 | /*Notify UMAC*/ |
| 23971 | wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23972 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23973 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23974 | }/*WDI_ProcessSetPreferredNetworkRsp*/ |
| 23975 | |
| 23976 | /** |
| 23977 | @brief Process RSSI Filter Rsp function (called when a |
| 23978 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23979 | |
| 23980 | @param pWDICtx: pointer to the WLAN DAL context |
| 23981 | pEventData: pointer to the event information structure |
| 23982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23983 | @see |
| 23984 | @return Result of the function call |
| 23985 | */ |
| 23986 | WDI_Status |
| 23987 | WDI_ProcessSetRssiFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23988 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23989 | WDI_ControlBlockType* pWDICtx, |
| 23990 | WDI_EventInfoType* pEventData |
| 23991 | ) |
| 23992 | { |
| 23993 | WDI_Status wdiStatus; |
| 23994 | eHalStatus halStatus; |
| 23995 | WDI_RssiFilterCb wdiRssiFilterCb; |
| 23996 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23997 | |
| 23998 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23999 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24000 | -------------------------------------------------------------------------*/ |
| 24001 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24002 | ( NULL == pEventData->pEventData )) |
| 24003 | { |
| 24004 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24005 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24006 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24007 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24008 | } |
| 24009 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24010 | wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24011 | |
| 24012 | /*------------------------------------------------------------------------- |
| 24013 | Extract response and send it to UMAC |
| 24014 | -------------------------------------------------------------------------*/ |
| 24015 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24016 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24017 | |
| 24018 | /*Notify UMAC*/ |
| 24019 | wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24021 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24022 | }/*WDI_ProcessSetRssiFilterRsp*/ |
| 24023 | |
| 24024 | /** |
| 24025 | @brief Process Update Scan Params Rsp function (called when a |
| 24026 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24027 | |
| 24028 | @param pWDICtx: pointer to the WLAN DAL context |
| 24029 | pEventData: pointer to the event information structure |
| 24030 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24031 | @see |
| 24032 | @return Result of the function call |
| 24033 | */ |
| 24034 | WDI_Status |
| 24035 | WDI_ProcessUpdateScanParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24036 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24037 | WDI_ControlBlockType* pWDICtx, |
| 24038 | WDI_EventInfoType* pEventData |
| 24039 | ) |
| 24040 | { |
| 24041 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24042 | tUpdateScanParamsResp halUpdScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24043 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24044 | wpt_uint32 uStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24045 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24046 | |
| 24047 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24048 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24049 | -------------------------------------------------------------------------*/ |
| 24050 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24051 | ( NULL == pEventData->pEventData )) |
| 24052 | { |
| 24053 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24054 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24055 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24056 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24057 | } |
| 24058 | |
| 24059 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24060 | "Process UPD scan params ptr : %x", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24061 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24062 | wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24063 | |
| 24064 | /*------------------------------------------------------------------------- |
| 24065 | Extract response and send it to UMAC |
| 24066 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24067 | wpalMemoryCopy( (void *)&halUpdScanParams.status, |
| 24068 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24069 | sizeof(halUpdScanParams.status)); |
| 24070 | |
| 24071 | uStatus = halUpdScanParams.status; |
| 24072 | |
| 24073 | /*Extract PNO version - 1st bit of the status */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24074 | pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24075 | |
| 24076 | /*Remove version bit*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24077 | uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24078 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24079 | wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24080 | |
| 24081 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24082 | "UPD Scan Parameters rsp with status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24083 | halUpdScanParams.status); |
| 24084 | |
| 24085 | /*Notify UMAC*/ |
| 24086 | wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24087 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24088 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24089 | } |
| 24090 | #endif // FEATURE_WLAN_SCAN_PNO |
| 24091 | |
| 24092 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24093 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24094 | WDI_8023MulticastListReq |
| 24095 | ( |
| 24096 | WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo, |
| 24097 | WDI_8023MulticastListCb wdi8023MulticastListCallback, |
| 24098 | void* pUserData |
| 24099 | ) |
| 24100 | { |
| 24101 | WDI_EventInfoType wdiEventData; |
| 24102 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24103 | |
| 24104 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24105 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24106 | |
| 24107 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24108 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24109 | ------------------------------------------------------------------------*/ |
| 24110 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24111 | { |
| 24112 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24113 | "WDI API call before module is initialized - Fail request"); |
| 24114 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24115 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24116 | } |
| 24117 | |
| 24118 | /*------------------------------------------------------------------------ |
| 24119 | Fill in Event data and post to the Main FSM |
| 24120 | ------------------------------------------------------------------------*/ |
| 24121 | wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24122 | wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24123 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24124 | wdiEventData.pCBfnc = wdi8023MulticastListCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24125 | wdiEventData.pUserData = pUserData; |
| 24126 | |
| 24127 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24128 | } |
| 24129 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24130 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24131 | WDI_ReceiveFilterSetFilterReq |
| 24132 | ( |
| 24133 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo, |
| 24134 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback, |
| 24135 | void* pUserData |
| 24136 | ) |
| 24137 | { |
| 24138 | WDI_EventInfoType wdiEventData; |
| 24139 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24140 | |
| 24141 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24142 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24143 | |
| 24144 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24145 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24146 | ------------------------------------------------------------------------*/ |
| 24147 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24148 | { |
| 24149 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24150 | "WDI API call before module is initialized - Fail request"); |
| 24151 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24152 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24153 | } |
| 24154 | |
| 24155 | /*------------------------------------------------------------------------ |
| 24156 | Fill in Event data and post to the Main FSM |
| 24157 | ------------------------------------------------------------------------*/ |
| 24158 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24159 | wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo; |
| 24160 | wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) + |
Yue Ma | a450e8a | 2013-03-18 18:05:27 -0700 | [diff] [blame] | 24161 | (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 24162 | * sizeof(WDI_RcvPktFilterFieldParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24163 | wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24164 | wdiEventData.pUserData = pUserData; |
| 24165 | |
| 24166 | |
| 24167 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24168 | } |
| 24169 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24170 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24171 | WDI_FilterMatchCountReq |
| 24172 | ( |
| 24173 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo, |
| 24174 | WDI_FilterMatchCountCb wdiFilterMatchCountCallback, |
| 24175 | void* pUserData |
| 24176 | ) |
| 24177 | { |
| 24178 | WDI_EventInfoType wdiEventData; |
| 24179 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24180 | |
| 24181 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24182 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24183 | |
| 24184 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24185 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24186 | ------------------------------------------------------------------------*/ |
| 24187 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24188 | { |
| 24189 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24190 | "WDI API call before module is initialized - Fail request"); |
| 24191 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24192 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24193 | } |
| 24194 | |
| 24195 | /*------------------------------------------------------------------------ |
| 24196 | Fill in Event data and post to the Main FSM |
| 24197 | ------------------------------------------------------------------------*/ |
| 24198 | wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24199 | wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24200 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24201 | wdiEventData.pCBfnc = wdiFilterMatchCountCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24202 | wdiEventData.pUserData = pUserData; |
| 24203 | |
| 24204 | |
| 24205 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24206 | } |
| 24207 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24208 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24209 | WDI_ReceiveFilterClearFilterReq |
| 24210 | ( |
| 24211 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo, |
| 24212 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback, |
| 24213 | void* pUserData |
| 24214 | ) |
| 24215 | { |
| 24216 | WDI_EventInfoType wdiEventData; |
| 24217 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24218 | |
| 24219 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24220 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24221 | |
| 24222 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24223 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24224 | ------------------------------------------------------------------------*/ |
| 24225 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24226 | { |
| 24227 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24228 | "WDI API call before module is initialized - Fail request"); |
| 24229 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24230 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24231 | } |
| 24232 | |
| 24233 | /*------------------------------------------------------------------------ |
| 24234 | Fill in Event data and post to the Main FSM |
| 24235 | ------------------------------------------------------------------------*/ |
| 24236 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24237 | wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24238 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24239 | wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24240 | wdiEventData.pUserData = pUserData; |
| 24241 | |
| 24242 | |
| 24243 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24244 | } |
| 24245 | |
| 24246 | /** |
| 24247 | @brief Process 8023 Multicast List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24248 | |
| 24249 | @param pWDICtx: pointer to the WLAN DAL context |
| 24250 | pEventData: pointer to the event information structure |
| 24251 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24252 | @see |
| 24253 | @return Result of the function call |
| 24254 | */ |
| 24255 | WDI_Status |
| 24256 | WDI_Process8023MulticastListReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24257 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24258 | WDI_ControlBlockType* pWDICtx, |
| 24259 | WDI_EventInfoType* pEventData |
| 24260 | ) |
| 24261 | { |
| 24262 | WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL; |
| 24263 | WDI_8023MulticastListCb wdi8023MulticastListCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24264 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24265 | wpt_uint16 usDataOffset = 0; |
| 24266 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24267 | tpHalRcvFltMcAddrListType pRcvFltMcAddrListType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24268 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24269 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 24270 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24271 | |
| 24272 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24273 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24274 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24275 | pRcvFltMcAddrListType = wpalMemoryAllocate(sizeof(tHalRcvFltMcAddrListType)) ; |
| 24276 | if( NULL == pRcvFltMcAddrListType ) |
| 24277 | { |
| 24278 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24279 | "Failed to alloc in WDI_Process8023MulticastListReq"); |
| 24280 | return WDI_STATUS_E_FAILURE; |
| 24281 | } |
| 24282 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24283 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24284 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24285 | -------------------------------------------------------------------------*/ |
| 24286 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24287 | ( NULL == (pwdiFltPktSetMcListReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24288 | (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24289 | ( NULL == (wdi8023MulticastListCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24290 | (WDI_8023MulticastListCb)pEventData->pCBfnc))) |
| 24291 | { |
| 24292 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24293 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24294 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24295 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24296 | return WDI_STATUS_E_FAILURE; |
| 24297 | } |
| 24298 | |
| 24299 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 24300 | pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId, |
| 24301 | &pBSSSes); |
| 24302 | if ( NULL == pBSSSes ) |
| 24303 | { |
| 24304 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24305 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24306 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24307 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24308 | } |
| 24309 | |
| 24310 | /*----------------------------------------------------------------------- |
| 24311 | Get message buffer |
| 24312 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24313 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 24314 | WDI_8023_MULTICAST_LIST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24315 | sizeof(tHalRcvFltMcAddrListType), |
| 24316 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24317 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType)))) |
| 24318 | { |
| 24319 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24320 | "Unable to get send buffer in " |
| 24321 | "WDI_Process8023MulticastListReq() %x %x %x", |
| 24322 | pEventData, pwdiFltPktSetMcListReqParamsType, |
| 24323 | wdi8023MulticastListCb); |
| 24324 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24325 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24326 | } |
| 24327 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24328 | pRcvFltMcAddrListType->cMulticastAddr = |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24329 | pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt; |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24330 | for( i = 0; i < pRcvFltMcAddrListType->cMulticastAddr; i++ ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24331 | { |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24332 | wpalMemoryCopy(pRcvFltMcAddrListType->multicastAddr[i], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24333 | pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i], |
| 24334 | sizeof(tSirMacAddr)); |
| 24335 | } |
| 24336 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24337 | pRcvFltMcAddrListType->bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24338 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24339 | pRcvFltMcAddrListType, |
| 24340 | sizeof(tHalRcvFltMcAddrListType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24341 | |
| 24342 | pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24343 | pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24344 | |
| 24345 | |
Madan Mohan Koyyalamudi | cfb9f4d | 2012-10-21 12:35:08 -0700 | [diff] [blame] | 24346 | wpalMemoryFree(pRcvFltMcAddrListType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24347 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24348 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24349 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24350 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24351 | wdi8023MulticastListCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24352 | WDI_8023_MULTICAST_LIST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24353 | } |
| 24354 | |
| 24355 | /** |
| 24356 | @brief Process Receive Filter Set Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24357 | |
| 24358 | @param pWDICtx: pointer to the WLAN DAL context |
| 24359 | pEventData: pointer to the event information structure |
| 24360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24361 | @see |
| 24362 | @return Result of the function call |
| 24363 | */ |
| 24364 | WDI_Status |
| 24365 | WDI_ProcessReceiveFilterSetFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24366 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24367 | WDI_ControlBlockType* pWDICtx, |
| 24368 | WDI_EventInfoType* pEventData |
| 24369 | ) |
| 24370 | { |
| 24371 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL; |
| 24372 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24373 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24374 | wpt_uint16 usDataOffset = 0; |
| 24375 | wpt_uint16 usSendSize = 0; |
| 24376 | wpt_uint32 usRcvPktFilterCfgSize; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24377 | tHalRcvPktFilterCfgType *pRcvPktFilterCfg = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24378 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24379 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 24380 | WDI_BSSSessionType* pBSSSes = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24381 | tHalSessionizedRcvPktFilterCfgType *pSessRcvPktFilterCfg = NULL; |
| 24382 | wpt_uint32 usSessRcvPktFilterCfgSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24383 | |
| 24384 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24385 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24386 | |
| 24387 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24388 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24389 | -------------------------------------------------------------------------*/ |
| 24390 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24391 | ( NULL == (pwdiSetRcvPktFilterReqInfo = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24392 | (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24393 | ( NULL == (wdiReceiveFilterSetFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24394 | (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc))) |
| 24395 | { |
| 24396 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24397 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24398 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24399 | return WDI_STATUS_E_FAILURE; |
| 24400 | } |
| 24401 | |
| 24402 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 24403 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId, |
| 24404 | &pBSSSes); |
| 24405 | if ( NULL == pBSSSes ) |
| 24406 | { |
| 24407 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24408 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24409 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24410 | } |
| 24411 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24412 | if( WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION) ) |
| 24413 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24414 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24415 | usSessRcvPktFilterCfgSize = sizeof(tHalSessionizedRcvPktFilterCfgType) + |
| 24416 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 24417 | * sizeof(tHalSessionizedRcvPktFilterCfgType)); |
| 24418 | |
| 24419 | pSessRcvPktFilterCfg = (tHalSessionizedRcvPktFilterCfgType *)wpalMemoryAllocate( |
| 24420 | usSessRcvPktFilterCfgSize); |
| 24421 | |
| 24422 | if(NULL == pSessRcvPktFilterCfg) |
| 24423 | { |
| 24424 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24425 | "%s: Failed to allocate memory for " |
| 24426 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24427 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24428 | WDI_ASSERT(0); |
| 24429 | return WDI_STATUS_E_FAILURE; |
| 24430 | } |
| 24431 | |
| 24432 | wpalMemoryZero(pSessRcvPktFilterCfg, usSessRcvPktFilterCfgSize); |
| 24433 | |
| 24434 | /*----------------------------------------------------------------------- |
| 24435 | Get message buffer |
| 24436 | -----------------------------------------------------------------------*/ |
| 24437 | |
| 24438 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RECEIVE_FILTER_SET_FILTER_REQ, |
| 24439 | usSessRcvPktFilterCfgSize, |
| 24440 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24441 | ( usSendSize < (usDataOffset + usSessRcvPktFilterCfgSize))) |
| 24442 | { |
| 24443 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24444 | "Unable to get send buffer in " |
| 24445 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 24446 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 24447 | wdiReceiveFilterSetFilterCb); |
| 24448 | WDI_ASSERT(0); |
| 24449 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 24450 | return WDI_STATUS_E_FAILURE; |
| 24451 | } |
| 24452 | |
| 24453 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24454 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
| 24455 | usSendSize,pSessRcvPktFilterCfg); |
| 24456 | |
| 24457 | pSessRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 24458 | pSessRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 24459 | pSessRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 24460 | pSessRcvPktFilterCfg->coleasceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
| 24461 | |
| 24462 | pSessRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx; |
| 24463 | |
| 24464 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24465 | "Out: FID %d FT %d",pSessRcvPktFilterCfg->filterId, |
| 24466 | pSessRcvPktFilterCfg->filterType); |
| 24467 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24468 | "NParams %d CT %d",pSessRcvPktFilterCfg->numParams, |
| 24469 | pSessRcvPktFilterCfg->coleasceTime); |
| 24470 | |
| 24471 | for ( i = 0; i < pSessRcvPktFilterCfg->numParams; i++ ) |
| 24472 | { |
| 24473 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 24474 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 24475 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 24476 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 24477 | pSessRcvPktFilterCfg->paramsData[i].dataOffset = |
| 24478 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 24479 | pSessRcvPktFilterCfg->paramsData[i].dataLength = |
| 24480 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
| 24481 | |
| 24482 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].compareData, |
| 24483 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 24484 | 8); |
| 24485 | wpalMemoryCopy(&pSessRcvPktFilterCfg->paramsData[i].dataMask, |
| 24486 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 24487 | 8); |
| 24488 | |
| 24489 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24490 | "Out:Proto %d Comp Flag %d \n", |
| 24491 | pSessRcvPktFilterCfg->paramsData[i].protocolLayer, |
| 24492 | pSessRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 24493 | |
| 24494 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24495 | "Data Offset %d Data Len %d\n", |
| 24496 | pSessRcvPktFilterCfg->paramsData[i].dataOffset, |
| 24497 | pSessRcvPktFilterCfg->paramsData[i].dataLength); |
| 24498 | |
| 24499 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24500 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 24501 | pSessRcvPktFilterCfg->paramsData[i].compareData[0], |
| 24502 | pSessRcvPktFilterCfg->paramsData[i].compareData[1], |
| 24503 | pSessRcvPktFilterCfg->paramsData[i].compareData[2], |
| 24504 | pSessRcvPktFilterCfg->paramsData[i].compareData[3], |
| 24505 | pSessRcvPktFilterCfg->paramsData[i].compareData[4], |
| 24506 | pSessRcvPktFilterCfg->paramsData[i].compareData[5]); |
| 24507 | |
| 24508 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24509 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 24510 | pSessRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 24511 | pSessRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 24512 | pSessRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 24513 | pSessRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 24514 | pSessRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 24515 | pSessRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 24516 | } |
| 24517 | |
| 24518 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24519 | pSessRcvPktFilterCfg, |
| 24520 | usSessRcvPktFilterCfgSize); |
| 24521 | |
| 24522 | |
| 24523 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 24524 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
| 24525 | |
| 24526 | wpalMemoryFree(pSessRcvPktFilterCfg); |
| 24527 | |
| 24528 | } |
| 24529 | /*If SLM_SESSIONIZATION is not supported then do this */ |
| 24530 | else |
| 24531 | { |
| 24532 | usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) + |
| 24533 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 24534 | * sizeof(tHalRcvPktFilterParams)); |
| 24535 | |
| 24536 | pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24537 | usRcvPktFilterCfgSize); |
| 24538 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24539 | if(NULL == pRcvPktFilterCfg) |
| 24540 | { |
| 24541 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24542 | "%s: Failed to allocate memory for " |
| 24543 | "tHalRcvPktFilterCfgType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24544 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24545 | WDI_ASSERT(0); |
| 24546 | return WDI_STATUS_E_FAILURE; |
| 24547 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24548 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24549 | wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24550 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24551 | /*----------------------------------------------------------------------- |
| 24552 | Get message buffer |
| 24553 | -----------------------------------------------------------------------*/ |
| 24554 | 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] | 24555 | usRcvPktFilterCfgSize, |
| 24556 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24557 | ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize))) |
| 24558 | { |
| 24559 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24560 | "Unable to get send buffer in " |
| 24561 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 24562 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 24563 | wdiReceiveFilterSetFilterCb); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24564 | WDI_ASSERT(0); |
| 24565 | wpalMemoryFree(pRcvPktFilterCfg); |
| 24566 | return WDI_STATUS_E_FAILURE; |
| 24567 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24568 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24569 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24570 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24571 | usSendSize,usRcvPktFilterCfgSize); |
| 24572 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24573 | pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
| 24574 | pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
| 24575 | pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
| 24576 | pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24577 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24578 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24579 | "Out: FID %d FT %d",pRcvPktFilterCfg->filterId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24580 | pRcvPktFilterCfg->filterType); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24581 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24582 | "NParams %d CT %d",pRcvPktFilterCfg->numParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24583 | pRcvPktFilterCfg->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24584 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24585 | for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ ) |
| 24586 | { |
| 24587 | pRcvPktFilterCfg->paramsData[i].protocolLayer = |
| 24588 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
| 24589 | pRcvPktFilterCfg->paramsData[i].cmpFlag = |
| 24590 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
| 24591 | pRcvPktFilterCfg->paramsData[i].dataOffset = |
| 24592 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
| 24593 | pRcvPktFilterCfg->paramsData[i].dataLength = |
| 24594 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24595 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24596 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24597 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 24598 | 8); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24599 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24600 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 24601 | 8); |
| 24602 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24603 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24604 | "Out:Proto %d Comp Flag %d \n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24605 | pRcvPktFilterCfg->paramsData[i].protocolLayer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24606 | pRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 24607 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24608 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24609 | "Data Offset %d Data Len %d\n", |
| 24610 | pRcvPktFilterCfg->paramsData[i].dataOffset, |
| 24611 | pRcvPktFilterCfg->paramsData[i].dataLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24612 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24613 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24614 | "CData: %d:%d:%d:%d:%d:%d\n", |
| 24615 | pRcvPktFilterCfg->paramsData[i].compareData[0], |
| 24616 | pRcvPktFilterCfg->paramsData[i].compareData[1], |
| 24617 | pRcvPktFilterCfg->paramsData[i].compareData[2], |
| 24618 | pRcvPktFilterCfg->paramsData[i].compareData[3], |
| 24619 | pRcvPktFilterCfg->paramsData[i].compareData[4], |
| 24620 | pRcvPktFilterCfg->paramsData[i].compareData[5]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24621 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24622 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24623 | "MData: %d:%d:%d:%d:%d:%d\n", |
| 24624 | pRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 24625 | pRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 24626 | pRcvPktFilterCfg->paramsData[i].dataMask[2], |
| 24627 | pRcvPktFilterCfg->paramsData[i].dataMask[3], |
| 24628 | pRcvPktFilterCfg->paramsData[i].dataMask[4], |
| 24629 | pRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 24630 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24631 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24632 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24633 | pRcvPktFilterCfg, |
| 24634 | usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24635 | |
| 24636 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24637 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
| 24638 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24639 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24640 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24641 | "%s",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24642 | wpalMemoryFree(pRcvPktFilterCfg); |
| 24643 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24644 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24645 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24646 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24647 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24648 | wdiReceiveFilterSetFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24649 | WDI_RECEIVE_FILTER_SET_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24650 | } |
| 24651 | |
| 24652 | /** |
| 24653 | @brief Process Packet Filter Match Count Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24654 | |
| 24655 | @param pWDICtx: pointer to the WLAN DAL context |
| 24656 | pEventData: pointer to the event information structure |
| 24657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24658 | @see |
| 24659 | @return Result of the function call |
| 24660 | */ |
| 24661 | WDI_Status |
| 24662 | WDI_ProcessFilterMatchCountReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24663 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24664 | WDI_ControlBlockType* pWDICtx, |
| 24665 | WDI_EventInfoType* pEventData |
| 24666 | ) |
| 24667 | { |
| 24668 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType = |
| 24669 | NULL; |
| 24670 | WDI_FilterMatchCountCb wdiFilterMatchCountCb = |
| 24671 | NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24672 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24673 | wpt_uint16 usDataOffset = 0; |
| 24674 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24675 | tHalRcvFltPktMatchCntReqParams rcvFltPktMatchCntReqParam = {0}; |
| 24676 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 24677 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24678 | |
| 24679 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24680 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24681 | |
| 24682 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24683 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24684 | -------------------------------------------------------------------------*/ |
| 24685 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24686 | ( NULL == (pwdiRcvFltPktMatchCntReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24687 | (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24688 | ( NULL == (wdiFilterMatchCountCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24689 | (WDI_FilterMatchCountCb)pEventData->pCBfnc))) |
| 24690 | { |
| 24691 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24692 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24693 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24694 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24695 | } |
| 24696 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24697 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 24698 | pwdiRcvFltPktMatchCntReqParamsType->bssId, |
| 24699 | &pBSSSes); |
| 24700 | if ( NULL == pBSSSes ) |
| 24701 | { |
| 24702 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24703 | " %s : Association for this BSSID does not exist",__func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24704 | return WDI_STATUS_E_FAILURE; |
| 24705 | } |
| 24706 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24707 | /*----------------------------------------------------------------------- |
| 24708 | Get message buffer |
| 24709 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24710 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 24711 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24712 | sizeof(tHalRcvFltPktMatchCntReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24713 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24714 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktMatchCntReqParams)))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24715 | { |
| 24716 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24717 | "Unable to get send buffer in " |
| 24718 | "WDI_ProcessFilterMatchCountReq() %x %x %x", |
| 24719 | pEventData, pwdiRcvFltPktMatchCntReqParamsType, |
| 24720 | wdiFilterMatchCountCb); |
| 24721 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24722 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24723 | } |
| 24724 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24725 | rcvFltPktMatchCntReqParam.bssIdx = pBSSSes->ucBSSIdx; |
| 24726 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24727 | &rcvFltPktMatchCntReqParam, |
| 24728 | sizeof(rcvFltPktMatchCntReqParam)); |
| 24729 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24730 | // |
| 24731 | // Don't need to fill send buffer other than header |
| 24732 | // |
| 24733 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24734 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24735 | |
| 24736 | |
| 24737 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24738 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24739 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24740 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24741 | wdiFilterMatchCountCb, |
| 24742 | pEventData->pUserData, |
| 24743 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24744 | } |
| 24745 | |
| 24746 | /** |
| 24747 | @brief Process Receive Filter Clear Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24748 | |
| 24749 | @param pWDICtx: pointer to the WLAN DAL context |
| 24750 | pEventData: pointer to the event information structure |
| 24751 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24752 | @see |
| 24753 | @return Result of the function call |
| 24754 | */ |
| 24755 | WDI_Status |
| 24756 | WDI_ProcessReceiveFilterClearFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24757 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24758 | WDI_ControlBlockType* pWDICtx, |
| 24759 | WDI_EventInfoType* pEventData |
| 24760 | ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24761 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24762 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL; |
| 24763 | WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24764 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24765 | wpt_uint16 usDataOffset = 0; |
| 24766 | wpt_uint16 usSendSize = 0; |
| 24767 | tHalRcvFltPktClearParam rcvFltPktClearParam; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24768 | wpt_uint8 ucCurrentSessionId = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24769 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24770 | |
| 24771 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24772 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24773 | |
| 24774 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24775 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24776 | -------------------------------------------------------------------------*/ |
| 24777 | if (( NULL == pEventData ) || |
| 24778 | ( NULL == (pwdiRcvFltPktClearReqParamsType = |
| 24779 | (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24780 | ( NULL == (wdiRcvFltPktClearFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24781 | (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc))) |
| 24782 | { |
| 24783 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24784 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24785 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24786 | return WDI_STATUS_E_FAILURE; |
| 24787 | } |
| 24788 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24789 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24790 | pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId, |
| 24791 | &pBSSSes); |
| 24792 | if ( NULL == pBSSSes ) |
| 24793 | { |
| 24794 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24795 | " %s : Association for this BSSID does not exist",__func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24796 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24797 | } |
| 24798 | |
| 24799 | /*----------------------------------------------------------------------- |
| 24800 | Get message buffer |
| 24801 | -----------------------------------------------------------------------*/ |
| 24802 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24803 | WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24804 | sizeof(tHalRcvFltPktClearParam), |
| 24805 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24806 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam)))) |
| 24807 | { |
| 24808 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24809 | "Unable to get send buffer in " |
| 24810 | "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x", |
| 24811 | pEventData, pwdiRcvFltPktClearReqParamsType, |
| 24812 | wdiRcvFltPktClearFilterCb); |
| 24813 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24814 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24815 | } |
| 24816 | |
| 24817 | |
| 24818 | rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24819 | filterClearParam.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24820 | rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24821 | filterClearParam.filterId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24822 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24823 | rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx; |
| 24824 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24825 | &rcvFltPktClearParam, |
| 24826 | sizeof(rcvFltPktClearParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24827 | |
| 24828 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24829 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24830 | |
| 24831 | |
| 24832 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24833 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24834 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24835 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24836 | wdiRcvFltPktClearFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24837 | WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24838 | } |
| 24839 | |
| 24840 | /** |
| 24841 | @brief Process 8023 Multicast List Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24842 | |
| 24843 | @param pWDICtx: pointer to the WLAN DAL context |
| 24844 | pEventData: pointer to the event information structure |
| 24845 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24846 | @see |
| 24847 | @return Result of the function call |
| 24848 | */ |
| 24849 | WDI_Status |
| 24850 | WDI_Process8023MulticastListRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24851 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24852 | WDI_ControlBlockType* pWDICtx, |
| 24853 | WDI_EventInfoType* pEventData |
| 24854 | ) |
| 24855 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24856 | eHalStatus halStatus; |
| 24857 | WDI_8023MulticastListCb wdi8023MulticastListCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24858 | tHalRcvFltPktSetMcListRspType halRcvFltPktSetMcListRsp; |
| 24859 | WDI_RcvFltPktSetMcListRspParamsType wdiRcvFltPktSetMcListRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24860 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24861 | |
| 24862 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24863 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24864 | |
| 24865 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24866 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24867 | -------------------------------------------------------------------------*/ |
| 24868 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24869 | ( NULL == pEventData->pEventData )) |
| 24870 | { |
| 24871 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24872 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24873 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24874 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24875 | } |
| 24876 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24877 | wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24878 | |
| 24879 | /*------------------------------------------------------------------------- |
| 24880 | Extract response and send it to UMAC |
| 24881 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24882 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24883 | { |
| 24884 | wpalMemoryCopy( &halRcvFltPktSetMcListRsp, |
| 24885 | pEventData->pEventData, |
| 24886 | sizeof(halRcvFltPktSetMcListRsp)); |
| 24887 | |
| 24888 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = |
| 24889 | WDI_HAL_2_WDI_STATUS(halRcvFltPktSetMcListRsp.status); |
| 24890 | wdiRcvFltPktSetMcListRspInfo.bssIdx = |
| 24891 | halRcvFltPktSetMcListRsp.bssIdx; |
| 24892 | } |
| 24893 | else |
| 24894 | { |
| 24895 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24896 | wdiRcvFltPktSetMcListRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24897 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24898 | |
| 24899 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24900 | wdi8023MulticastListCb(&wdiRcvFltPktSetMcListRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24901 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24902 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24903 | } |
| 24904 | |
| 24905 | /** |
| 24906 | @brief Process Set Rsp function (called when a |
| 24907 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24908 | |
| 24909 | @param pWDICtx: pointer to the WLAN DAL context |
| 24910 | pEventData: pointer to the event information structure |
| 24911 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24912 | @see |
| 24913 | @return Result of the function call |
| 24914 | */ |
| 24915 | WDI_Status |
| 24916 | WDI_ProcessReceiveFilterSetFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24917 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24918 | WDI_ControlBlockType* pWDICtx, |
| 24919 | WDI_EventInfoType* pEventData |
| 24920 | ) |
| 24921 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24922 | eHalStatus halStatus; |
| 24923 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24924 | tHalSetPktFilterRspParams halSetPktFilterRspParams; |
| 24925 | WDI_SetRcvPktFilterRspParamsType wdiSetRcvPktFilterRspInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24926 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24927 | |
| 24928 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24929 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24930 | |
| 24931 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24932 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24933 | -------------------------------------------------------------------------*/ |
| 24934 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24935 | ( NULL == pEventData->pEventData )) |
| 24936 | { |
| 24937 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24938 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24939 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24940 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24941 | } |
| 24942 | |
| 24943 | wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24944 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24945 | |
| 24946 | /*------------------------------------------------------------------------- |
| 24947 | Extract response and send it to UMAC |
| 24948 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24949 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 24950 | { |
| 24951 | wpalMemoryCopy( &halSetPktFilterRspParams, |
| 24952 | pEventData->pEventData, |
| 24953 | sizeof(halSetPktFilterRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24954 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24955 | wdiSetRcvPktFilterRspInfo.bssIdx = halSetPktFilterRspParams.bssIdx; |
| 24956 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halSetPktFilterRspParams.status); |
| 24957 | } |
| 24958 | else |
| 24959 | { |
| 24960 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24961 | wdiSetRcvPktFilterRspInfo.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24962 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24963 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24964 | wdiReceiveFilterSetFilterCb(&wdiSetRcvPktFilterRspInfo, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24965 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24966 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24967 | } |
| 24968 | |
| 24969 | /** |
| 24970 | @brief Process Packet Filter Match Count Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24971 | |
| 24972 | @param pWDICtx: pointer to the WLAN DAL context |
| 24973 | pEventData: pointer to the event information structure |
| 24974 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24975 | @see |
| 24976 | @return Result of the function call |
| 24977 | */ |
| 24978 | WDI_Status |
| 24979 | WDI_ProcessFilterMatchCountRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24980 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24981 | WDI_ControlBlockType* pWDICtx, |
| 24982 | WDI_EventInfoType* pEventData |
| 24983 | ) |
| 24984 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24985 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24986 | WDI_FilterMatchCountCb wdiFilterMatchCountCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 24987 | tHalRcvFltPktMatchRspParams halRcvFltrPktMatachRsp; |
| 24988 | WDI_RcvFltPktMatchCntRspParamsType wdiRcvFltPktMatchRspParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24989 | |
| 24990 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24991 | |
| 24992 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 24993 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24994 | |
| 24995 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24996 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24997 | -------------------------------------------------------------------------*/ |
| 24998 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24999 | ( NULL == pEventData->pEventData )) |
| 25000 | { |
| 25001 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25002 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25003 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25004 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25005 | } |
| 25006 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25007 | wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25008 | |
| 25009 | /*------------------------------------------------------------------------- |
| 25010 | Extract response and send it to UMAC |
| 25011 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25012 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25013 | { |
| 25014 | wpalMemoryCopy( &halRcvFltrPktMatachRsp, |
| 25015 | pEventData->pEventData, |
| 25016 | sizeof(halRcvFltrPktMatachRsp)); |
| 25017 | |
| 25018 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halRcvFltrPktMatachRsp.status); |
| 25019 | wdiRcvFltPktMatchRspParams.bssIdx = halRcvFltrPktMatachRsp.bssIdx; |
| 25020 | } |
| 25021 | else |
| 25022 | { |
| 25023 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25024 | wdiRcvFltPktMatchRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25025 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25026 | |
| 25027 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25028 | wdiFilterMatchCountCb(&wdiRcvFltPktMatchRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25030 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25031 | } |
| 25032 | |
| 25033 | /** |
| 25034 | @brief Process Receive Filter Clear Filter Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25035 | |
| 25036 | @param pWDICtx: pointer to the WLAN DAL context |
| 25037 | pEventData: pointer to the event information structure |
| 25038 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25039 | @see |
| 25040 | @return Result of the function call |
| 25041 | */ |
| 25042 | WDI_Status |
| 25043 | WDI_ProcessReceiveFilterClearFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25044 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25045 | WDI_ControlBlockType* pWDICtx, |
| 25046 | WDI_EventInfoType* pEventData |
| 25047 | ) |
| 25048 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25049 | eHalStatus halStatus; |
| 25050 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25051 | tHalRcvFltPktClearParam halRcvFltPktClearRspMsg; |
| 25052 | WDI_RcvFltPktClearRspParamsType wdiRcvFltPktClearRspParamsType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25053 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25054 | |
| 25055 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25056 | "%s",__func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25057 | |
| 25058 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25059 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25060 | -------------------------------------------------------------------------*/ |
| 25061 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25062 | ( NULL == pEventData->pEventData )) |
| 25063 | { |
| 25064 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25065 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25066 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25067 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25068 | } |
| 25069 | |
| 25070 | wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25071 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25072 | |
| 25073 | /*------------------------------------------------------------------------- |
| 25074 | Extract response and send it to UMAC |
| 25075 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25076 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25077 | { |
| 25078 | wpalMemoryCopy( &halRcvFltPktClearRspMsg, |
| 25079 | pEventData->pEventData, |
| 25080 | sizeof(halRcvFltPktClearRspMsg)); |
| 25081 | |
| 25082 | wdiRcvFltPktClearRspParamsType.wdiStatus = |
| 25083 | WDI_HAL_2_WDI_STATUS(halRcvFltPktClearRspMsg.status); |
| 25084 | wdiRcvFltPktClearRspParamsType.bssIdx = |
| 25085 | halRcvFltPktClearRspMsg.bssIdx; |
| 25086 | } |
| 25087 | else |
| 25088 | { |
| 25089 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25090 | wdiRcvFltPktClearRspParamsType.wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25091 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25092 | |
| 25093 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25094 | wdiReceiveFilterClearFilterCb(&wdiRcvFltPktClearRspParamsType, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25095 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25096 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25097 | } |
| 25098 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 25099 | |
| 25100 | /** |
| 25101 | @brief Process Shutdown Rsp function |
| 25102 | There is no shutdown response comming from HAL |
| 25103 | - function just kept for simmetry |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25104 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25105 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25106 | pEventData: pointer to the event information structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25107 | |
| 25108 | @see |
| 25109 | @return Result of the function call |
| 25110 | */ |
| 25111 | WDI_Status |
| 25112 | WDI_ProcessShutdownRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25113 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25114 | WDI_ControlBlockType* pWDICtx, |
| 25115 | WDI_EventInfoType* pEventData |
| 25116 | ) |
| 25117 | { |
| 25118 | /*There is no shutdown response comming from HAL - function just kept for |
| 25119 | simmetry */ |
| 25120 | WDI_ASSERT(0); |
| 25121 | return WDI_STATUS_SUCCESS; |
| 25122 | }/*WDI_ProcessShutdownRsp*/ |
| 25123 | |
| 25124 | /** |
| 25125 | @brief WDI_SetPowerParamsReq |
| 25126 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25127 | @param pwdiPowerParamsReqParams: the Set Power Params as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25128 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25129 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25130 | wdiPowerParamsCb: callback for passing back the response |
| 25131 | of the Set Power Params operation received from the |
| 25132 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25134 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25135 | callback |
| 25136 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25137 | @return Result of the function call |
| 25138 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25139 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25140 | WDI_SetPowerParamsReq |
| 25141 | ( |
| 25142 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams, |
| 25143 | WDI_SetPowerParamsCb wdiPowerParamsCb, |
| 25144 | void* pUserData |
| 25145 | ) |
| 25146 | { |
| 25147 | WDI_EventInfoType wdiEventData; |
| 25148 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25149 | |
| 25150 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25151 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25152 | ------------------------------------------------------------------------*/ |
| 25153 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25154 | { |
| 25155 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25156 | "WDI API call before module is initialized - Fail request"); |
| 25157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25158 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25159 | } |
| 25160 | |
| 25161 | /*------------------------------------------------------------------------ |
| 25162 | Fill in Event data and post to the Main FSM |
| 25163 | ------------------------------------------------------------------------*/ |
| 25164 | wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25165 | wdiEventData.pEventData = pwdiPowerParamsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25166 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25167 | wdiEventData.pCBfnc = wdiPowerParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25168 | wdiEventData.pUserData = pUserData; |
| 25169 | |
| 25170 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25171 | }/*WDI_SetPowerParamsReq*/ |
| 25172 | |
| 25173 | /** |
| 25174 | @brief Process Set Power Params Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25175 | |
| 25176 | @param pWDICtx: pointer to the WLAN DAL context |
| 25177 | pEventData: pointer to the event information structure |
| 25178 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25179 | @see |
| 25180 | @return Result of the function call |
| 25181 | */ |
| 25182 | WDI_Status |
| 25183 | WDI_ProcessSetPowerParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25184 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25185 | WDI_ControlBlockType* pWDICtx, |
| 25186 | WDI_EventInfoType* pEventData |
| 25187 | ) |
| 25188 | { |
| 25189 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL; |
| 25190 | WDI_SetPowerParamsCb wdiPowerParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25191 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25192 | wpt_uint16 usDataOffset = 0; |
| 25193 | wpt_uint16 usSendSize = 0; |
| 25194 | tSetPowerParamsType powerParams; |
| 25195 | |
| 25196 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25197 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25198 | -------------------------------------------------------------------------*/ |
| 25199 | if (( NULL == pEventData ) || |
| 25200 | ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) || |
| 25201 | ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc))) |
| 25202 | { |
| 25203 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25204 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25205 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25206 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25207 | } |
| 25208 | |
| 25209 | /*----------------------------------------------------------------------- |
| 25210 | Get message buffer |
| 25211 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25212 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25213 | sizeof(powerParams), |
| 25214 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25215 | ( usSendSize < (usDataOffset + sizeof(powerParams) ))) |
| 25216 | { |
| 25217 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25218 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 25219 | pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb); |
| 25220 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25221 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25222 | } |
| 25223 | |
| 25224 | /* Ignore DTIM */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25225 | powerParams.uIgnoreDTIM = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25226 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM; |
| 25227 | |
| 25228 | /*DTIM Period*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25229 | powerParams.uDTIMPeriod = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25230 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod; |
| 25231 | |
| 25232 | /* Listen Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25233 | powerParams.uListenInterval= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25234 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval; |
| 25235 | |
| 25236 | /* Broadcast Multicas Filter */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25237 | powerParams.uBcastMcastFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25238 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter; |
| 25239 | |
| 25240 | /* Beacon Early Termination */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25241 | powerParams.uEnableBET = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25242 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET; |
| 25243 | |
| 25244 | /* Beacon Early Termination Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25245 | powerParams.uBETInterval = |
| 25246 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25247 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25248 | |
| 25249 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25250 | &powerParams, |
| 25251 | sizeof(powerParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25252 | |
| 25253 | pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25254 | pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25255 | |
| 25256 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25257 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25258 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25259 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25260 | wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25261 | } |
| 25262 | |
| 25263 | /** |
| 25264 | @brief Process Power Params Rsp function (called when a |
| 25265 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25266 | |
| 25267 | @param pWDICtx: pointer to the WLAN DAL context |
| 25268 | pEventData: pointer to the event information structure |
| 25269 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25270 | @see |
| 25271 | @return Result of the function call |
| 25272 | */ |
| 25273 | WDI_Status |
| 25274 | WDI_ProcessSetPowerParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25275 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25276 | WDI_ControlBlockType* pWDICtx, |
| 25277 | WDI_EventInfoType* pEventData |
| 25278 | ) |
| 25279 | { |
| 25280 | WDI_Status wdiStatus; |
| 25281 | eHalStatus halStatus; |
| 25282 | WDI_SetPowerParamsCb wdiPowerParamsCb; |
| 25283 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25284 | |
| 25285 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25286 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25287 | -------------------------------------------------------------------------*/ |
| 25288 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25289 | ( NULL == pEventData->pEventData )) |
| 25290 | { |
| 25291 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25292 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25293 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25294 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25295 | } |
| 25296 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25297 | wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25298 | |
| 25299 | /*------------------------------------------------------------------------- |
| 25300 | Extract response and send it to UMAC |
| 25301 | -------------------------------------------------------------------------*/ |
| 25302 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25303 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25304 | |
| 25305 | /*Notify UMAC*/ |
| 25306 | wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 25307 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 25308 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25309 | }/*WDI_ProcessSetPowerParamsRsp*/ |
| 25310 | |
| 25311 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 25312 | /** |
| 25313 | @brief WDI_GTKOffloadReq will be called when the upper MAC |
| 25314 | wants to set GTK Rekey Counter while in power save. Upon |
| 25315 | the call of this API the WLAN DAL will pack and send a |
| 25316 | HAL GTK offload request message to the lower RIVA |
| 25317 | sub-system if DAL is in state STARTED. |
| 25318 | |
| 25319 | In state BUSY this request will be queued. Request won't |
| 25320 | be allowed in any other state. |
| 25321 | |
| 25322 | WDI_PostAssocReq must have been called. |
| 25323 | |
| 25324 | @param pwdiGtkOffloadParams: the GTK offload as specified |
| 25325 | by the Device Interface |
| 25326 | |
| 25327 | wdiGtkOffloadCb: callback for passing back the response |
| 25328 | of the GTK offload operation received from the device |
| 25329 | |
| 25330 | pUserData: user data will be passed back with the |
| 25331 | callback |
| 25332 | |
| 25333 | @see WDI_PostAssocReq |
| 25334 | @return Result of the function call |
| 25335 | */ |
| 25336 | WDI_Status |
| 25337 | WDI_GTKOffloadReq |
| 25338 | ( |
| 25339 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg, |
| 25340 | WDI_GtkOffloadCb wdiGtkOffloadCb, |
| 25341 | void* pUserData |
| 25342 | ) |
| 25343 | { |
| 25344 | WDI_EventInfoType wdiEventData = {0}; |
| 25345 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25346 | |
| 25347 | /*------------------------------------------------------------------------ |
| 25348 | Sanity Check |
| 25349 | ------------------------------------------------------------------------*/ |
| 25350 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25351 | { |
| 25352 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25353 | "WDI API call before module is initialized - Fail request"); |
| 25354 | |
| 25355 | return WDI_STATUS_E_NOT_ALLOWED; |
| 25356 | } |
| 25357 | |
| 25358 | /*------------------------------------------------------------------------ |
| 25359 | Fill in Event data and post to the Main FSM |
| 25360 | ------------------------------------------------------------------------*/ |
| 25361 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ; |
| 25362 | wdiEventData.pEventData = pwdiGtkOffloadReqMsg; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 25363 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25364 | wdiEventData.pCBfnc = wdiGtkOffloadCb; |
| 25365 | wdiEventData.pUserData = pUserData; |
| 25366 | |
| 25367 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25368 | } |
| 25369 | |
| 25370 | |
| 25371 | /** |
| 25372 | @brief WDI_GTKOffloadGetInfoReq will be called when the upper |
| 25373 | MAC wants to get GTK Rekey Counter while in power save. |
| 25374 | Upon the call of this API the WLAN DAL will pack and |
| 25375 | send a HAL GTK offload request message to the lower RIVA |
| 25376 | sub-system if DAL is in state STARTED. |
| 25377 | |
| 25378 | In state BUSY this request will be queued. Request won't |
| 25379 | be allowed in any other state. |
| 25380 | |
| 25381 | WDI_PostAssocReq must have been called. |
| 25382 | |
| 25383 | @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload |
| 25384 | Information Message as specified by the |
| 25385 | Device Interface |
| 25386 | |
| 25387 | wdiGtkOffloadGetInfoCb: callback for passing back the |
| 25388 | response of the GTK offload operation received from the |
| 25389 | device |
| 25390 | |
| 25391 | pUserData: user data will be passed back with the |
| 25392 | callback |
| 25393 | |
| 25394 | @see WDI_PostAssocReq |
| 25395 | @return Result of the function call |
| 25396 | */ |
| 25397 | WDI_Status |
| 25398 | WDI_GTKOffloadGetInfoReq |
| 25399 | ( |
| 25400 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg, |
| 25401 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb, |
| 25402 | void* pUserData |
| 25403 | ) |
| 25404 | { |
| 25405 | WDI_EventInfoType wdiEventData = {0}; |
| 25406 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25407 | |
| 25408 | /*------------------------------------------------------------------------ |
| 25409 | Sanity Check |
| 25410 | ------------------------------------------------------------------------*/ |
| 25411 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 25412 | { |
| 25413 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 25414 | "WDI API call before module is initialized - Fail request"); |
| 25415 | |
| 25416 | return WDI_STATUS_E_NOT_ALLOWED; |
| 25417 | } |
| 25418 | |
| 25419 | /*------------------------------------------------------------------------ |
| 25420 | Fill in Event data and post to the Main FSM |
| 25421 | ------------------------------------------------------------------------*/ |
| 25422 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ; |
| 25423 | wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg; |
| 25424 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg); |
| 25425 | wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb; |
| 25426 | wdiEventData.pUserData = pUserData; |
| 25427 | |
| 25428 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 25429 | } |
| 25430 | |
| 25431 | |
| 25432 | /** |
| 25433 | @brief Process set GTK Offload Request function |
| 25434 | |
| 25435 | @param pWDICtx: pointer to the WLAN DAL context |
| 25436 | pEventData: pointer to the event information structure |
| 25437 | |
| 25438 | @see |
| 25439 | @return Result of the function call |
| 25440 | */ |
| 25441 | WDI_Status |
| 25442 | WDI_ProcessGTKOffloadReq |
| 25443 | ( |
| 25444 | WDI_ControlBlockType* pWDICtx, |
| 25445 | WDI_EventInfoType* pEventData |
| 25446 | ) |
| 25447 | { |
| 25448 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL; |
| 25449 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
| 25450 | wpt_uint8* pSendBuffer = NULL; |
| 25451 | wpt_uint16 usDataOffset = 0; |
| 25452 | wpt_uint16 usSendSize = 0; |
| 25453 | tHalGtkOffloadReqParams gtkOffloadReqParams = {0}; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25454 | wpt_uint8 ucCurrentSessionId = 0; |
| 25455 | WDI_BSSSessionType* pBSSSes = NULL; |
| 25456 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25457 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25458 | |
| 25459 | /*------------------------------------------------------------------------- |
| 25460 | Sanity check |
| 25461 | -------------------------------------------------------------------------*/ |
| 25462 | if (( NULL == pEventData ) || |
| 25463 | ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) || |
| 25464 | ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc))) |
| 25465 | { |
| 25466 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25467 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25468 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25469 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25470 | } |
| 25471 | |
| 25472 | /*----------------------------------------------------------------------- |
| 25473 | Get message buffer |
| 25474 | -----------------------------------------------------------------------*/ |
| 25475 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ, |
| 25476 | sizeof(gtkOffloadReqParams), |
| 25477 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25478 | ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) ))) |
| 25479 | { |
| 25480 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25481 | "Unable to get send buffer in GTK offload req %x %x %x", |
| 25482 | pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb); |
| 25483 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25484 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25485 | } |
| 25486 | |
| 25487 | // |
| 25488 | // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams |
| 25489 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25490 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 25491 | pwdiGtkOffloadReqMsg->gtkOffloadReqParams.bssId, |
| 25492 | &pBSSSes); |
| 25493 | if ( NULL == pBSSSes ) |
| 25494 | { |
| 25495 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25496 | " %s : Association for this BSSID does not exist", __func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25497 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25498 | } |
| 25499 | |
| 25500 | gtkOffloadReqParams.bssIdx = pBSSSes->ucBSSIdx; |
| 25501 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25502 | gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags; |
| 25503 | // Copy KCK |
| 25504 | wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16); |
| 25505 | // Copy KEK |
| 25506 | wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16); |
| 25507 | // Copy KeyReplayCounter |
| 25508 | wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t)); |
| 25509 | |
| 25510 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25511 | >kOffloadReqParams, |
| 25512 | sizeof(gtkOffloadReqParams)); |
| 25513 | |
| 25514 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB; |
| 25515 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData; |
| 25516 | |
| 25517 | /*------------------------------------------------------------------------- |
| 25518 | Send Get STA Request to HAL |
| 25519 | -------------------------------------------------------------------------*/ |
| 25520 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25521 | wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25522 | |
| 25523 | fail: |
| 25524 | // Release the message buffer so we don't leak |
| 25525 | wpalMemoryFree(pSendBuffer); |
| 25526 | |
| 25527 | failRequest: |
| 25528 | //WDA should have failure check to avoid the memory leak |
| 25529 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25530 | } |
| 25531 | |
| 25532 | |
| 25533 | /** |
| 25534 | @brief Process GTK Offload Get Information Request function |
| 25535 | |
| 25536 | @param pWDICtx: pointer to the WLAN DAL context |
| 25537 | pEventData: pointer to the event information structure |
| 25538 | |
| 25539 | @see |
| 25540 | @return Result of the function call |
| 25541 | */ |
| 25542 | WDI_Status |
| 25543 | WDI_ProcessGTKOffloadGetInfoReq |
| 25544 | ( |
| 25545 | WDI_ControlBlockType* pWDICtx, |
| 25546 | WDI_EventInfoType* pEventData |
| 25547 | ) |
| 25548 | { |
| 25549 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL; |
| 25550 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
| 25551 | wpt_uint8* pSendBuffer = NULL; |
| 25552 | wpt_uint16 usDataOffset = 0; |
| 25553 | wpt_uint16 usSendSize = 0; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25554 | tHalGtkOffloadGetInfoReqParams halGtkOffloadGetInfoReqParams; |
| 25555 | wpt_uint8 ucCurrentSessionId = 0; |
| 25556 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25557 | |
| 25558 | /*------------------------------------------------------------------------- |
| 25559 | Sanity check |
| 25560 | -------------------------------------------------------------------------*/ |
| 25561 | if (( NULL == pEventData ) || |
| 25562 | ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) || |
| 25563 | ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc))) |
| 25564 | { |
| 25565 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25566 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25567 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25568 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25569 | } |
| 25570 | |
| 25571 | /*----------------------------------------------------------------------- |
| 25572 | Get message buffer |
| 25573 | -----------------------------------------------------------------------*/ |
| 25574 | 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] | 25575 | sizeof(halGtkOffloadGetInfoReqParams), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25576 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25577 | ( usSendSize < ( usDataOffset + sizeof(halGtkOffloadGetInfoReqParams))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25578 | { |
| 25579 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25580 | "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x", |
| 25581 | pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb); |
| 25582 | WDI_ASSERT(0); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25583 | goto failRequest; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25584 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25585 | ucCurrentSessionId = WDI_FindAssocSession( pWDICtx, |
| 25586 | pwdiGtkOffloadGetInfoReqMsg->WDI_GtkOffloadGetInfoReqParams.bssId, |
| 25587 | &pBSSSes); |
| 25588 | if ( NULL == pBSSSes ) |
| 25589 | { |
| 25590 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25591 | " %s : Association for this BSSID does not exist",__func__); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25592 | goto fail; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25593 | } |
| 25594 | halGtkOffloadGetInfoReqParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25595 | |
| 25596 | // |
| 25597 | // Don't need to fill send buffer other than header |
| 25598 | // |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25599 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25600 | &halGtkOffloadGetInfoReqParams, |
| 25601 | sizeof(halGtkOffloadGetInfoReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25602 | |
| 25603 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB; |
| 25604 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData; |
| 25605 | |
| 25606 | /*------------------------------------------------------------------------- |
| 25607 | Send Get STA Request to HAL |
| 25608 | -------------------------------------------------------------------------*/ |
| 25609 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25610 | wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP); |
Venkata Prathyusha Kuntupalli | 10bf4c2 | 2013-02-12 11:23:46 -0800 | [diff] [blame] | 25611 | fail: |
| 25612 | // Release the message buffer so we don't leak |
| 25613 | wpalMemoryFree(pSendBuffer); |
| 25614 | |
| 25615 | failRequest: |
| 25616 | //WDA should have failure check to avoid the memory leak |
| 25617 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25618 | } |
| 25619 | |
| 25620 | /** |
| 25621 | @brief Process host offload Rsp function (called when a |
| 25622 | response is being received over the bus from HAL) |
| 25623 | |
| 25624 | @param pWDICtx: pointer to the WLAN DAL context |
| 25625 | pEventData: pointer to the event information structure |
| 25626 | |
| 25627 | @see |
| 25628 | @return Result of the function call |
| 25629 | */ |
| 25630 | WDI_Status |
| 25631 | WDI_ProcessGtkOffloadRsp |
| 25632 | ( |
| 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_GtkOffloadCb wdiGtkOffloadCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25639 | tHalGtkOffloadRspParams halGtkOffloadRspParams; |
| 25640 | WDI_GtkOffloadRspParams wdiGtkOffloadRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25641 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25642 | |
| 25643 | wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB; |
| 25644 | |
| 25645 | /*------------------------------------------------------------------------- |
| 25646 | Sanity check |
| 25647 | -------------------------------------------------------------------------*/ |
| 25648 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25649 | ( NULL == pEventData->pEventData)) |
| 25650 | { |
| 25651 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25652 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25653 | WDI_ASSERT(0); |
| 25654 | return WDI_STATUS_E_FAILURE; |
| 25655 | } |
| 25656 | |
| 25657 | /*------------------------------------------------------------------------- |
| 25658 | Extract response and send it to UMAC |
| 25659 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25660 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25661 | { |
| 25662 | wpalMemoryCopy( &halGtkOffloadRspParams, |
| 25663 | pEventData->pEventData, |
| 25664 | sizeof(halGtkOffloadRspParams)); |
| 25665 | |
| 25666 | wdiGtkOffloadRsparams.ulStatus = |
| 25667 | WDI_HAL_2_WDI_STATUS(halGtkOffloadRspParams.status); |
| 25668 | wdiGtkOffloadRsparams.bssIdx = |
| 25669 | halGtkOffloadRspParams.bssIdx; |
| 25670 | } |
| 25671 | else |
| 25672 | { |
| 25673 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25674 | wdiGtkOffloadRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25675 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25676 | |
| 25677 | /*Notify UMAC*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25678 | wdiGtkOffloadCb( &wdiGtkOffloadRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25679 | |
| 25680 | return WDI_STATUS_SUCCESS; |
| 25681 | } |
| 25682 | |
| 25683 | /** |
| 25684 | @brief Process GTK Offload Get Information Response function |
| 25685 | |
| 25686 | @param pWDICtx: pointer to the WLAN DAL context |
| 25687 | pEventData: pointer to the event information structure |
| 25688 | |
| 25689 | @see |
| 25690 | @return Result of the function call |
| 25691 | */ |
| 25692 | WDI_Status |
| 25693 | WDI_ProcessGTKOffloadGetInfoRsp |
| 25694 | ( |
| 25695 | WDI_ControlBlockType* pWDICtx, |
| 25696 | WDI_EventInfoType* pEventData |
| 25697 | ) |
| 25698 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25699 | eHalStatus halStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25700 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25701 | tHalGtkOffloadGetInfoRspParams halGtkOffloadGetInfoRspParams; |
| 25702 | WDI_GtkOffloadGetInfoRspParams wdiGtkOffloadGetInfoRsparams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25703 | |
| 25704 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25705 | |
| 25706 | wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB; |
| 25707 | |
| 25708 | /*------------------------------------------------------------------------- |
| 25709 | Sanity check |
| 25710 | -------------------------------------------------------------------------*/ |
| 25711 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25712 | ( NULL == pEventData->pEventData )) |
| 25713 | { |
| 25714 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25715 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25716 | WDI_ASSERT(0); |
| 25717 | return WDI_STATUS_E_FAILURE; |
| 25718 | } |
| 25719 | |
| 25720 | /*------------------------------------------------------------------------- |
| 25721 | Extract response and send it to UMAC |
| 25722 | -------------------------------------------------------------------------*/ |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25723 | if(WDI_getFwWlanFeatCaps(SLM_SESSIONIZATION)) |
| 25724 | { |
| 25725 | wpalMemoryCopy( &halGtkOffloadGetInfoRspParams, |
| 25726 | pEventData->pEventData, |
| 25727 | sizeof(halGtkOffloadGetInfoRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25728 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25729 | wdiGtkOffloadGetInfoRsparams.ulStatus = |
| 25730 | WDI_HAL_2_WDI_STATUS(halGtkOffloadGetInfoRspParams.status); |
| 25731 | wdiGtkOffloadGetInfoRsparams.ullKeyReplayCounter = |
| 25732 | halGtkOffloadGetInfoRspParams.ullKeyReplayCounter; |
| 25733 | wdiGtkOffloadGetInfoRsparams.ulTotalRekeyCount = |
| 25734 | halGtkOffloadGetInfoRspParams.ulTotalRekeyCount; |
| 25735 | wdiGtkOffloadGetInfoRsparams.ulGTKRekeyCount = |
| 25736 | halGtkOffloadGetInfoRspParams.ulGTKRekeyCount; |
| 25737 | wdiGtkOffloadGetInfoRsparams.ulIGTKRekeyCount = |
| 25738 | halGtkOffloadGetInfoRspParams.ulIGTKRekeyCount; |
| 25739 | wdiGtkOffloadGetInfoRsparams.bssIdx = |
| 25740 | halGtkOffloadGetInfoRspParams.bssIdx; |
| 25741 | } |
| 25742 | else |
| 25743 | { |
| 25744 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25745 | wdiGtkOffloadGetInfoRsparams.ulStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25746 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25747 | /*Notify UMAC*/ |
| 25748 | //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 25749 | //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 25750 | wdiGtkOffloadGetInfoCb(&wdiGtkOffloadGetInfoRsparams, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25751 | |
| 25752 | return WDI_STATUS_SUCCESS; |
| 25753 | } |
| 25754 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 25755 | |
| 25756 | #ifdef WLAN_WAKEUP_EVENTS |
| 25757 | WDI_Status |
| 25758 | WDI_ProcessWakeReasonInd |
| 25759 | ( |
| 25760 | WDI_ControlBlockType* pWDICtx, |
| 25761 | WDI_EventInfoType* pEventData |
| 25762 | ) |
| 25763 | { |
| 25764 | WDI_LowLevelIndType *pWdiInd; |
| 25765 | tpWakeReasonParams pWakeReasonParams; |
| 25766 | wpt_uint32 allocSize = 0; |
| 25767 | |
| 25768 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25769 | "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25770 | |
| 25771 | /*------------------------------------------------------------------------- |
| 25772 | Sanity check |
| 25773 | -------------------------------------------------------------------------*/ |
| 25774 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25775 | ( NULL == pEventData->pEventData )) |
| 25776 | { |
| 25777 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25778 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25779 | WDI_ASSERT( 0 ); |
| 25780 | return WDI_STATUS_E_FAILURE; |
| 25781 | } |
| 25782 | |
| 25783 | /*------------------------------------------------------------------------- |
| 25784 | Extract indication and send it to UMAC |
| 25785 | -------------------------------------------------------------------------*/ |
| 25786 | pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData); |
| 25787 | |
| 25788 | allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1); |
| 25789 | |
| 25790 | //Allocate memory for WDI_WakeReasonIndType structure |
| 25791 | pWdiInd = wpalMemoryAllocate(allocSize) ; |
| 25792 | |
| 25793 | if(NULL == pWdiInd) |
| 25794 | { |
| 25795 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25796 | "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ", |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25797 | __func__, pWDICtx, pEventData, pEventData->pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25798 | WDI_ASSERT(0); |
| 25799 | return WDI_STATUS_E_FAILURE; |
| 25800 | } |
| 25801 | |
| 25802 | wpalMemoryZero(pWdiInd, allocSize); |
| 25803 | |
| 25804 | /* Fill in the indication parameters*/ |
| 25805 | // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams |
| 25806 | pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND; |
| 25807 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason; |
| 25808 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg; |
| 25809 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen; |
| 25810 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen; |
| 25811 | wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]), |
| 25812 | &(pWakeReasonParams->aDataStart[0]), |
| 25813 | pWakeReasonParams->ulStoredDataLen); |
| 25814 | |
ltimariu | 034f7d6 | 2013-01-24 18:54:33 -0800 | [diff] [blame] | 25815 | |
| 25816 | if ( pWDICtx->wdiLowLevelIndCB ) |
| 25817 | { |
| 25818 | /*Notify UMAC*/ |
| 25819 | pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData ); |
| 25820 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25821 | |
| 25822 | //Free memory allocated for WDI_WakeReasonIndType structure |
| 25823 | wpalMemoryFree(pWdiInd); |
| 25824 | |
| 25825 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25826 | "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25827 | |
| 25828 | return WDI_STATUS_SUCCESS; |
| 25829 | } |
| 25830 | #endif // WLAN_WAKEUP_EVENTS |
| 25831 | |
| 25832 | void WDI_GetWcnssCompiledApiVersion |
| 25833 | ( |
| 25834 | WDI_WlanVersionType *pWcnssApiVersion |
| 25835 | ) |
| 25836 | { |
| 25837 | pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR; |
| 25838 | pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR; |
| 25839 | pWcnssApiVersion->version = WLAN_HAL_VER_VERSION; |
| 25840 | pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION; |
| 25841 | } |
| 25842 | |
| 25843 | /** |
| 25844 | @brief Process Set TM Level Rsp function (called when a |
| 25845 | response is being received over the bus from HAL) |
| 25846 | |
| 25847 | @param pWDICtx: pointer to the WLAN DAL context |
| 25848 | pEventData: pointer to the event information structure |
| 25849 | |
| 25850 | @see |
| 25851 | @return Result of the function call |
| 25852 | */ |
| 25853 | WDI_Status |
| 25854 | WDI_ProcessSetTmLevelRsp |
| 25855 | ( |
| 25856 | WDI_ControlBlockType* pWDICtx, |
| 25857 | WDI_EventInfoType* pEventData |
| 25858 | ) |
| 25859 | { |
| 25860 | WDI_Status wdiStatus; |
| 25861 | eHalStatus halStatus; |
| 25862 | WDI_SetTmLevelCb wdiSetTmLevelCb; |
| 25863 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 25864 | |
| 25865 | /*------------------------------------------------------------------------- |
| 25866 | Sanity check |
| 25867 | -------------------------------------------------------------------------*/ |
| 25868 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 25869 | ( NULL == pEventData->pEventData )) |
| 25870 | { |
| 25871 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25872 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25873 | WDI_ASSERT(0); |
| 25874 | return WDI_STATUS_E_FAILURE; |
| 25875 | } |
| 25876 | |
| 25877 | wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
| 25878 | |
| 25879 | /*------------------------------------------------------------------------- |
| 25880 | Extract response and send it to UMAC |
| 25881 | -------------------------------------------------------------------------*/ |
| 25882 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 25883 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 25884 | |
| 25885 | /*Notify UMAC*/ |
| 25886 | wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 25887 | |
| 25888 | return WDI_STATUS_SUCCESS; |
| 25889 | }/*WDI_ProcessSetTmLevelRsp*/ |
| 25890 | |
| 25891 | /** |
| 25892 | @brief Process Set Thermal Mitigation level Changed request |
| 25893 | |
| 25894 | @param pWDICtx: pointer to the WLAN DAL context |
| 25895 | pEventData: pointer to the event information structure |
| 25896 | |
| 25897 | @see |
| 25898 | @return Result of the function call |
| 25899 | */ |
| 25900 | WDI_Status |
| 25901 | WDI_ProcessSetTmLevelReq |
| 25902 | ( |
| 25903 | WDI_ControlBlockType* pWDICtx, |
| 25904 | WDI_EventInfoType* pEventData |
| 25905 | ) |
| 25906 | { |
| 25907 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL; |
| 25908 | WDI_SetTmLevelCb wdiSetTmLevelCb = NULL; |
| 25909 | wpt_uint8* pSendBuffer = NULL; |
| 25910 | wpt_uint16 usDataOffset = 0; |
| 25911 | wpt_uint16 usSendSize = 0; |
| 25912 | tSetThermalMitgationType halTmMsg; |
| 25913 | |
| 25914 | /*------------------------------------------------------------------------- |
| 25915 | Sanity check |
| 25916 | -------------------------------------------------------------------------*/ |
| 25917 | if (( NULL == pEventData ) || |
| 25918 | ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) || |
| 25919 | ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc))) |
| 25920 | { |
| 25921 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 25922 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 25923 | WDI_ASSERT(0); |
| 25924 | return WDI_STATUS_E_FAILURE; |
| 25925 | } |
| 25926 | |
| 25927 | /*----------------------------------------------------------------------- |
| 25928 | Get message buffer |
| 25929 | -----------------------------------------------------------------------*/ |
| 25930 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ, |
| 25931 | sizeof(halTmMsg), |
| 25932 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 25933 | ( usSendSize < (usDataOffset + sizeof(halTmMsg) ))) |
| 25934 | { |
| 25935 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 25936 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 25937 | pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb); |
| 25938 | WDI_ASSERT(0); |
| 25939 | return WDI_STATUS_E_FAILURE; |
| 25940 | } |
| 25941 | |
| 25942 | halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode; |
| 25943 | halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel; |
| 25944 | |
| 25945 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 25946 | &halTmMsg, |
| 25947 | sizeof(halTmMsg)); |
| 25948 | |
| 25949 | pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData; |
| 25950 | pWDICtx->pfncRspCB = NULL; |
| 25951 | /*------------------------------------------------------------------------- |
| 25952 | Send Get STA Request to HAL |
| 25953 | -------------------------------------------------------------------------*/ |
| 25954 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 25955 | wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP); |
| 25956 | } |
| 25957 | |
| 25958 | /* Fill the value from the global features enabled array to the global capabilities |
| 25959 | * bitmap struct |
| 25960 | */ |
| 25961 | static void |
| 25962 | FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len) |
| 25963 | { |
| 25964 | wpt_int8 i; |
| 25965 | for (i=0; i<len; i++) |
| 25966 | { |
| 25967 | setFeatCaps(fCaps, enabledFeat[i]); |
| 25968 | } |
| 25969 | } |
| 25970 | |
| 25971 | /** |
| 25972 | @brief WDI_featureCapsExchangeReq |
| 25973 | Post feature capability bitmap exchange event. |
| 25974 | Host will send its own capability to FW in this req and |
| 25975 | expect FW to send its capability back as a bitmap in Response |
| 25976 | |
| 25977 | @param |
| 25978 | |
| 25979 | wdiFeatureCapsExchangeCb: callback called on getting the response. |
| 25980 | It is kept to mantain similarity between WDI reqs and if needed, can |
| 25981 | be used in future. Currently, It is set to NULL |
| 25982 | |
| 25983 | pUserData: user data will be passed back with the |
| 25984 | callback |
| 25985 | |
| 25986 | @see |
| 25987 | @return Result of the function call |
| 25988 | */ |
| 25989 | WDI_Status |
| 25990 | WDI_featureCapsExchangeReq |
| 25991 | ( |
| 25992 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb, |
| 25993 | void* pUserData |
| 25994 | ) |
| 25995 | { |
| 25996 | WDI_EventInfoType wdiEventData; |
| 25997 | wpt_int32 fCapsStructSize; |
| 25998 | |
| 25999 | /*------------------------------------------------------------------------ |
| 26000 | Sanity Check |
| 26001 | ------------------------------------------------------------------------*/ |
| 26002 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 26003 | { |
| 26004 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26005 | "WDI API call before module is initialized - Fail request"); |
| 26006 | |
| 26007 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26008 | } |
| 26009 | |
| 26010 | /* Allocate memory separately for global variable carrying FW caps */ |
| 26011 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 26012 | gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 26013 | if ( NULL == gpHostWlanFeatCaps ) |
| 26014 | { |
| 26015 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26016 | "Cannot allocate memory for host capability info\n"); |
| 26017 | WDI_ASSERT(0); |
| 26018 | return WDI_STATUS_MEM_FAILURE; |
| 26019 | } |
| 26020 | |
| 26021 | wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize); |
| 26022 | |
| 26023 | /*------------------------------------------------------------------------ |
| 26024 | Fill in Event data and post to the Main FSM |
| 26025 | ------------------------------------------------------------------------*/ |
| 26026 | FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures, |
| 26027 | (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0]))); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26028 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 26029 | "Host caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26030 | gpHostWlanFeatCaps->featCaps[0], |
| 26031 | gpHostWlanFeatCaps->featCaps[1], |
| 26032 | gpHostWlanFeatCaps->featCaps[2], |
| 26033 | gpHostWlanFeatCaps->featCaps[3] |
| 26034 | ); |
| 26035 | |
| 26036 | wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ; |
| 26037 | wdiEventData.pEventData = gpHostWlanFeatCaps; |
| 26038 | wdiEventData.uEventDataSize = fCapsStructSize; |
| 26039 | wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb; |
| 26040 | wdiEventData.pUserData = pUserData; |
| 26041 | |
| 26042 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 26043 | } |
| 26044 | |
| 26045 | /** |
Yathish | d871319 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 26046 | @brief Disable Active mode offload in Host |
| 26047 | |
| 26048 | @param void |
| 26049 | @see |
| 26050 | @return void |
| 26051 | */ |
| 26052 | void |
| 26053 | WDI_disableCapablityFeature(wpt_uint8 feature_index) |
| 26054 | { |
| 26055 | supportEnabledFeatures[feature_index] = 0; |
| 26056 | return; |
| 26057 | } |
| 26058 | |
| 26059 | /** |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26060 | @brief Process Host-FW Capability Exchange Request function |
| 26061 | |
| 26062 | @param pWDICtx: pointer to the WLAN DAL context |
| 26063 | pEventData: pointer to the event information structure |
| 26064 | |
| 26065 | @see |
| 26066 | @return Result of the function call |
| 26067 | */ |
| 26068 | WDI_Status |
| 26069 | WDI_ProcessFeatureCapsExchangeReq |
| 26070 | ( |
| 26071 | WDI_ControlBlockType* pWDICtx, |
| 26072 | WDI_EventInfoType* pEventData |
| 26073 | ) |
| 26074 | { |
| 26075 | wpt_uint8* pSendBuffer = NULL; |
| 26076 | wpt_uint16 usDataOffset = 0; |
| 26077 | wpt_uint16 usSendSize = 0; |
| 26078 | wpt_uint16 usLen = 0; |
| 26079 | |
| 26080 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26081 | |
| 26082 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26083 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26084 | |
| 26085 | /*------------------------------------------------------------------------- |
| 26086 | Sanity check |
| 26087 | -------------------------------------------------------------------------*/ |
| 26088 | /* Call back function is NULL since not required for cap exchange req */ |
| 26089 | if (( NULL == pEventData ) || |
| 26090 | ( NULL == (tWlanFeatCaps *)pEventData->pEventData)) |
| 26091 | { |
| 26092 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26093 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26094 | WDI_ASSERT(0); |
| 26095 | return WDI_STATUS_E_FAILURE; |
| 26096 | } |
| 26097 | |
| 26098 | /*----------------------------------------------------------------------- |
| 26099 | Get message buffer |
| 26100 | -----------------------------------------------------------------------*/ |
| 26101 | usLen = sizeof(tWlanFeatCaps); |
| 26102 | |
| 26103 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 26104 | WDI_FEATURE_CAPS_EXCHANGE_REQ, |
| 26105 | usLen, |
| 26106 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 26107 | ( usSendSize < (usDataOffset + usLen ))) |
| 26108 | { |
| 26109 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 26110 | "Unable to get send buffer in feat caps exchange req %x %x", |
| 26111 | pEventData, (tWlanFeatCaps *)pEventData->pEventData); |
| 26112 | WDI_ASSERT(0); |
| 26113 | return WDI_STATUS_E_FAILURE; |
| 26114 | } |
| 26115 | |
| 26116 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26117 | "Host Caps - %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26118 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0], |
| 26119 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1], |
| 26120 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2], |
| 26121 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3] |
| 26122 | ); |
| 26123 | |
| 26124 | /* Copy host caps after the offset in the send buffer */ |
| 26125 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 26126 | (tWlanFeatCaps *)pEventData->pEventData, |
| 26127 | usLen); |
| 26128 | |
| 26129 | /*------------------------------------------------------------------------- |
| 26130 | Send Start Request to HAL |
| 26131 | -------------------------------------------------------------------------*/ |
| 26132 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 26133 | (WDI_StartRspCb)pEventData->pCBfnc, |
| 26134 | pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP); |
| 26135 | |
| 26136 | }/*WDI_ProcessFeatureCapsExchangeReq*/ |
| 26137 | |
| 26138 | /** |
| 26139 | @brief Process Host-FW Capability Exchange Response function |
| 26140 | |
| 26141 | @param pWDICtx: pointer to the WLAN DAL context |
| 26142 | pEventData: pointer to the event information structure |
| 26143 | |
| 26144 | @see |
| 26145 | @return Result of the function call |
| 26146 | */ |
| 26147 | WDI_Status |
| 26148 | WDI_ProcessFeatureCapsExchangeRsp |
| 26149 | ( |
| 26150 | WDI_ControlBlockType* pWDICtx, |
| 26151 | WDI_EventInfoType* pEventData |
| 26152 | ) |
| 26153 | { |
| 26154 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb; |
| 26155 | wpt_int32 fCapsStructSize; |
| 26156 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26157 | |
| 26158 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26159 | "%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26160 | |
| 26161 | /*------------------------------------------------------------------------- |
| 26162 | Sanity check |
| 26163 | -------------------------------------------------------------------------*/ |
| 26164 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26165 | ( NULL == pEventData->pEventData )) |
| 26166 | { |
| 26167 | /* It will go here when riva is old (doesn't understand this msg) and host is new */ |
| 26168 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26169 | "%s: Invalid parameters", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26170 | WDI_ASSERT(0); |
| 26171 | return WDI_STATUS_E_FAILURE; |
| 26172 | } |
| 26173 | |
| 26174 | /* Allocate memory separately for global variable carrying FW caps */ |
| 26175 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 26176 | gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 26177 | if ( NULL == gpFwWlanFeatCaps ) |
| 26178 | { |
| 26179 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26180 | "Cannot allocate memory for host capability info\n"); |
| 26181 | WDI_ASSERT(0); |
| 26182 | return WDI_STATUS_MEM_FAILURE; |
| 26183 | } |
| 26184 | |
| 26185 | /*------------------------------------------------------------------------- |
| 26186 | Unpack HAL Response Message - the header was already extracted by the |
| 26187 | main Response Handling procedure |
| 26188 | -------------------------------------------------------------------------*/ |
| 26189 | /*------------------------------------------------------------------------- |
| 26190 | Extract response and send it to UMAC |
| 26191 | -------------------------------------------------------------------------*/ |
| 26192 | |
| 26193 | wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData, |
| 26194 | fCapsStructSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 26195 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 26196 | "FW caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26197 | gpFwWlanFeatCaps->featCaps[0], |
| 26198 | gpFwWlanFeatCaps->featCaps[1], |
| 26199 | gpFwWlanFeatCaps->featCaps[2], |
| 26200 | gpFwWlanFeatCaps->featCaps[3] |
| 26201 | ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26202 | wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB; |
| 26203 | |
| 26204 | /*Notify UMAC - there is no callback right now but can be used in future if reqd */ |
| 26205 | if (wdiFeatureCapsExchangeCb != NULL) |
| 26206 | wdiFeatureCapsExchangeCb(NULL, NULL); |
| 26207 | |
| 26208 | return WDI_STATUS_SUCCESS; |
| 26209 | } |
| 26210 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 26211 | #ifdef WLAN_FEATURE_11AC |
| 26212 | WDI_Status |
| 26213 | WDI_ProcessUpdateVHTOpModeRsp |
| 26214 | ( |
| 26215 | WDI_ControlBlockType* pWDICtx, |
| 26216 | WDI_EventInfoType* pEventData |
| 26217 | ) |
| 26218 | { |
| 26219 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 26220 | WDI_Status wdiStatus; |
| 26221 | eHalStatus halStatus; |
| 26222 | |
| 26223 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26224 | |
| 26225 | /*------------------------------------------------------------------------- |
| 26226 | Sanity check |
| 26227 | -------------------------------------------------------------------------*/ |
| 26228 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 26229 | ( NULL == pEventData->pEventData)) |
| 26230 | { |
| 26231 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26232 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 26233 | WDI_ASSERT(0); |
| 26234 | return WDI_STATUS_E_FAILURE; |
| 26235 | } |
| 26236 | wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc; |
| 26237 | |
| 26238 | /*------------------------------------------------------------------------- |
| 26239 | Extract response and send it to UMAC |
| 26240 | -------------------------------------------------------------------------*/ |
| 26241 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 26242 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 26243 | |
| 26244 | /*Notify UMAC*/ |
| 26245 | wdiVHTOpModeCb( wdiStatus, pEventData->pUserData); |
| 26246 | |
| 26247 | return WDI_STATUS_SUCCESS; |
| 26248 | } |
| 26249 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 26250 | /** |
| 26251 | @brief WDI_getHostWlanFeatCaps |
| 26252 | WDI API that returns whether the feature passed to it as enum value in |
| 26253 | "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global |
| 26254 | variable storing host capability bitmap to find this. This can be used by |
| 26255 | other moduels to decide certain things like call different APIs based on |
| 26256 | whether a particular feature is supported. |
| 26257 | |
| 26258 | @param |
| 26259 | |
| 26260 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h. |
| 26261 | |
| 26262 | @see |
| 26263 | @return |
| 26264 | 0 - if the feature is NOT supported in host |
| 26265 | any non-zero value - if the feature is SUPPORTED in host. |
| 26266 | */ |
| 26267 | wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 26268 | { |
| 26269 | wpt_uint8 featSupported = 0; |
| 26270 | if (gpHostWlanFeatCaps != NULL) |
| 26271 | { |
| 26272 | getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported); |
| 26273 | } |
| 26274 | else |
| 26275 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 26276 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 26277 | "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] | 26278 | } |
| 26279 | return featSupported; |
| 26280 | } |
| 26281 | |
| 26282 | /** |
| 26283 | @brief WDI_getFwWlanFeatCaps |
| 26284 | WDI API that returns whether the feature passed to it as enum value in |
| 26285 | "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global |
| 26286 | variable storing host capability bitmap to find this. This can be used by |
| 26287 | other moduels to decide certain things like call different APIs based on |
| 26288 | whether a particular feature is supported. |
| 26289 | |
| 26290 | @param |
| 26291 | |
| 26292 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap |
| 26293 | in wlan_hal_msg.h. |
| 26294 | |
| 26295 | @see |
| 26296 | @return |
| 26297 | 0 - if the feature is NOT supported in FW |
| 26298 | any non-zero value - if the feature is SUPPORTED in FW. |
| 26299 | */ |
| 26300 | wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 26301 | { |
| 26302 | wpt_uint8 featSupported = 0; |
| 26303 | if (gpFwWlanFeatCaps != NULL) |
| 26304 | { |
| 26305 | getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported); |
| 26306 | } |
| 26307 | else |
| 26308 | { |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 26309 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame] | 26310 | "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] | 26311 | } |
| 26312 | return featSupported; |
| 26313 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 26314 | |
| 26315 | #ifdef WLAN_FEATURE_11AC |
| 26316 | WDI_Status |
| 26317 | WDI_ProcessUpdateVHTOpModeReq |
| 26318 | ( |
| 26319 | WDI_ControlBlockType* pWDICtx, |
| 26320 | WDI_EventInfoType* pEventData |
| 26321 | ) |
| 26322 | { |
| 26323 | WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL; |
| 26324 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 26325 | wpt_uint8* pSendBuffer = NULL; |
| 26326 | wpt_uint16 usDataOffset = 0; |
| 26327 | wpt_uint16 usSendSize = 0; |
| 26328 | |
| 26329 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26330 | |
| 26331 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26332 | "%s", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 26333 | |
| 26334 | /*------------------------------------------------------------------------- |
| 26335 | Sanity check |
| 26336 | -------------------------------------------------------------------------*/ |
| 26337 | if (( NULL == pEventData ) || |
| 26338 | ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) || |
| 26339 | ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc))) |
| 26340 | { |
| 26341 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26342 | "%s: Invalid parameters", __func__); |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 26343 | WDI_ASSERT(0); |
| 26344 | return WDI_STATUS_E_FAILURE; |
| 26345 | } |
| 26346 | |
| 26347 | /*----------------------------------------------------------------------- |
| 26348 | Get message buffer |
| 26349 | -----------------------------------------------------------------------*/ |
| 26350 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ, |
| 26351 | sizeof(WDI_UpdateVHTOpMode), |
| 26352 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 26353 | ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) ))) |
| 26354 | { |
| 26355 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26356 | "Unable to get send buffer in update vht opMode req"); |
| 26357 | WDI_ASSERT(0); |
| 26358 | return WDI_STATUS_E_FAILURE; |
| 26359 | } |
| 26360 | |
| 26361 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26362 | "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId); |
| 26363 | |
| 26364 | wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams, |
| 26365 | sizeof(WDI_UpdateVHTOpMode)); |
| 26366 | |
| 26367 | /*------------------------------------------------------------------------- |
| 26368 | Send Start Request to HAL |
| 26369 | -------------------------------------------------------------------------*/ |
| 26370 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 26371 | wdiVHTOpModeCb, |
| 26372 | pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP); |
| 26373 | |
| 26374 | } |
| 26375 | |
| 26376 | WDI_Status |
| 26377 | WDI_UpdateVHTOpModeReq |
| 26378 | ( |
| 26379 | WDI_UpdateVHTOpMode *pData, |
| 26380 | WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb, |
| 26381 | void* pUserData |
| 26382 | ) |
| 26383 | { |
| 26384 | WDI_EventInfoType wdiEventData; |
| 26385 | |
| 26386 | /*------------------------------------------------------------------------ |
| 26387 | Sanity Check |
| 26388 | ------------------------------------------------------------------------*/ |
| 26389 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 26390 | { |
| 26391 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 26392 | "WDI API call before module is initialized - Fail request"); |
| 26393 | |
| 26394 | return WDI_STATUS_E_NOT_ALLOWED; |
| 26395 | } |
| 26396 | |
| 26397 | /*------------------------------------------------------------------------ |
| 26398 | Fill in Event data and post to the Main FSM |
| 26399 | ------------------------------------------------------------------------*/ |
| 26400 | wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ; |
| 26401 | wdiEventData.pEventData = pData; |
| 26402 | wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode); |
| 26403 | wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb; |
| 26404 | wdiEventData.pUserData = pUserData; |
| 26405 | |
| 26406 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 26407 | "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId); |
| 26408 | |
| 26409 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 26410 | |
| 26411 | } |
| 26412 | #endif |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 26413 | |
| 26414 | /** |
| 26415 | @brief WDI_TransportChannelDebug - |
| 26416 | Display DXE Channel debugging information |
| 26417 | User may request to display DXE channel snapshot |
| 26418 | Or if host driver detects any abnormal stcuk may display |
Madan Mohan Koyyalamudi | 8b7f1e6 | 2012-10-05 14:56:51 -0700 | [diff] [blame] | 26419 | |
Jeff Johnson | bf9616f | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 26420 | @param displaySnapshot : Display DXE snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 26421 | @param enableStallDetect : Enable stall detect feature |
| 26422 | This feature will take effect to data performance |
| 26423 | Not integrate till fully verification |
| 26424 | @see |
| 26425 | @return none |
| 26426 | */ |
| 26427 | void WDI_TransportChannelDebug |
| 26428 | ( |
| 26429 | wpt_boolean displaySnapshot, |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 26430 | wpt_boolean toggleStallDetect |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 26431 | ) |
| 26432 | { |
Madan Mohan Koyyalamudi | 24a00f9 | 2012-10-22 15:21:02 -0700 | [diff] [blame] | 26433 | WDTS_ChannelDebug(displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 26434 | return; |
Madan Mohan Koyyalamudi | 3352adb | 2012-09-28 14:57:24 -0700 | [diff] [blame] | 26435 | } |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 26436 | /** |
| 26437 | @brief WDI_SsrTimerCB |
| 26438 | Callback function for SSR timer, if this is called then the graceful |
| 26439 | shutdown for Riva did not happen. |
| 26440 | |
| 26441 | @param pUserData : user data to timer |
| 26442 | |
| 26443 | @see |
| 26444 | @return none |
| 26445 | */ |
| 26446 | void |
| 26447 | WDI_SsrTimerCB |
| 26448 | ( |
| 26449 | void *pUserData |
| 26450 | ) |
| 26451 | { |
| 26452 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 26453 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 26454 | |
| 26455 | if (NULL == pWDICtx ) |
| 26456 | { |
| 26457 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 26458 | "%s: Invalid parameters", __func__); |
Madan Mohan Koyyalamudi | 0bfd000 | 2012-10-24 14:39:37 -0700 | [diff] [blame] | 26459 | WDI_ASSERT(0); |
| 26460 | return; |
| 26461 | } |
| 26462 | wpalRivaSubystemRestart(); |
| 26463 | |
| 26464 | return; |
| 26465 | |
| 26466 | }/*WDI_SsrTimerCB*/ |