Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 | |
| 22 | /*=========================================================================== |
| 23 | |
| 24 | W L A N _ Q C T _ W D I. C |
| 25 | |
| 26 | OVERVIEW: |
| 27 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 28 | This software unit holds the implementation of the WLAN Device Abstraction |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | Layer Interface. |
| 30 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 31 | 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] | 32 | MAC implementation that wishes to use the WLAN Device. |
| 33 | |
| 34 | DEPENDENCIES: |
| 35 | |
| 36 | Are listed for each API below. |
| 37 | |
| 38 | |
| 39 | Copyright (c) 2008 QUALCOMM Incorporated. |
| 40 | All Rights Reserved. |
| 41 | Qualcomm Confidential and Proprietary |
| 42 | ===========================================================================*/ |
| 43 | |
| 44 | /*=========================================================================== |
| 45 | |
| 46 | EDIT HISTORY FOR FILE |
| 47 | |
| 48 | |
| 49 | This section contains comments describing changes made to the module. |
| 50 | Notice that changes are listed in reverse chronological order. |
| 51 | |
| 52 | |
| 53 | $Header$$DateTime$$Author$ |
| 54 | |
| 55 | |
| 56 | when who what, where, why |
| 57 | ---------- --- -------------------------------------------------------- |
| 58 | 10/05/11 hap Adding support for Keep Alive |
| 59 | 2010-08-09 lti Created module |
| 60 | |
| 61 | ===========================================================================*/ |
| 62 | |
| 63 | /*---------------------------------------------------------------------------- |
| 64 | * Include Files |
| 65 | * -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 66 | #include "wlan_qct_wdi.h" |
| 67 | #include "wlan_qct_wdi_i.h" |
| 68 | #include "wlan_qct_wdi_sta.h" |
| 69 | #include "wlan_qct_wdi_dp.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 70 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 71 | #include "wlan_qct_wdi_cts.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 72 | |
| 73 | #include "wlan_qct_pal_api.h" |
| 74 | #include "wlan_qct_pal_type.h" |
| 75 | #include "wlan_qct_pal_status.h" |
| 76 | #include "wlan_qct_pal_sync.h" |
| 77 | #include "wlan_qct_pal_msg.h" |
| 78 | #include "wlan_qct_pal_trace.h" |
| 79 | #include "wlan_qct_pal_packet.h" |
| 80 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 81 | #include "wlan_qct_wdi_dts.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 82 | |
| 83 | #include "wlan_hal_msg.h" |
| 84 | |
| 85 | #ifdef ANI_MANF_DIAG |
| 86 | #include "pttMsgApi.h" |
| 87 | #endif /* ANI_MANF_DIAG */ |
| 88 | |
| 89 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 90 | WLAN DAL Control Path Internal Data Definitions and Declarations |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 91 | ===========================================================================*/ |
| 92 | #define WDI_WCTS_ACTION_TIMEOUT 2000 /* in msec a very high upper limit */ |
| 93 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 94 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 95 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 96 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 97 | |
| 98 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 99 | #define WDI_PNO_VERSION_MASK 0x8000 |
| 100 | #endif |
| 101 | |
| 102 | /* host capability bitmap global */ |
| 103 | static tWlanFeatCaps *gpHostWlanFeatCaps = NULL; |
| 104 | /* FW capability bitmap global */ |
| 105 | static tWlanFeatCaps *gpFwWlanFeatCaps = NULL; |
| 106 | /* array of features supported. Need to add a new feature |
| 107 | * and other two places - wlan_hal_msg.h and halMsg.c (FW file) |
| 108 | */ |
| 109 | static placeHolderInCapBitmap supportEnabledFeatures[] = |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 110 | {MCC, P2P, DOT11AC, SLM_SESSIONIZATION, DOT11AC_OPMODE}; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | |
| 112 | /*-------------------------------------------------------------------------- |
| 113 | WLAN DAL State Machine |
| 114 | --------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 115 | WPT_STATIC const WDI_MainFsmEntryType wdiMainFSM[WDI_MAX_ST] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 116 | { |
| 117 | /*WDI_INIT_ST*/ |
| 118 | {{ |
| 119 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 120 | NULL, /*WDI_STOP_EVENT*/ |
| 121 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 122 | WDI_MainRspInit, /*WDI_RESPONSE_EVENT*/ |
| 123 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
| 124 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 125 | }}, |
| 126 | |
| 127 | /*WDI_STARTED_ST*/ |
| 128 | {{ |
| 129 | WDI_MainStartStarted, /*WDI_START_EVENT*/ |
| 130 | WDI_MainStopStarted, /*WDI_STOP_EVENT*/ |
| 131 | WDI_MainReqStarted, /*WDI_REQUEST_EVENT*/ |
| 132 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 133 | NULL, /*WDI_CLOSE_EVENT*/ |
| 134 | WDI_MainShutdown /*WDI_SHUTDOWN_EVENT*/ |
| 135 | }}, |
| 136 | |
| 137 | /*WDI_STOPPED_ST*/ |
| 138 | {{ |
| 139 | WDI_MainStart, /*WDI_START_EVENT*/ |
| 140 | WDI_MainStopStopped, /*WDI_STOP_EVENT*/ |
| 141 | NULL, /*WDI_REQUEST_EVENT*/ |
| 142 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 143 | WDI_MainClose, /*WDI_CLOSE_EVENT*/ |
| 144 | NULL /*WDI_SHUTDOWN_EVENT*/ |
| 145 | }}, |
| 146 | |
| 147 | /*WDI_BUSY_ST*/ |
| 148 | {{ |
| 149 | WDI_MainStartBusy, /*WDI_START_EVENT*/ |
| 150 | WDI_MainStopBusy, /*WDI_STOP_EVENT*/ |
| 151 | WDI_MainReqBusy, /*WDI_REQUEST_EVENT*/ |
| 152 | WDI_MainRsp, /*WDI_RESPONSE_EVENT*/ |
| 153 | WDI_MainCloseBusy, /*WDI_CLOSE_EVENT*/ |
| 154 | WDI_MainShutdownBusy /*WDI_SHUTDOWN_EVENT*/ |
| 155 | }} |
| 156 | }; |
| 157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 158 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 159 | DAL Request Processing Array - the functions in this table will only be |
| 160 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 161 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 162 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 163 | WDI_ReqProcFuncType pfnReqProcTbl[WDI_MAX_UMAC_IND] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 164 | { |
| 165 | /*INIT*/ |
| 166 | WDI_ProcessStartReq, /* WDI_START_REQ */ |
| 167 | WDI_ProcessStopReq, /* WDI_STOP_REQ */ |
| 168 | WDI_ProcessCloseReq, /* WDI_CLOSE_REQ */ |
| 169 | |
| 170 | /*SCAN*/ |
| 171 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_REQ */ |
| 172 | WDI_ProcessStartScanReq, /* WDI_START_SCAN_REQ */ |
| 173 | WDI_ProcessEndScanReq, /* WDI_END_SCAN_REQ */ |
| 174 | WDI_ProcessFinishScanReq, /* WDI_FINISH_SCAN_REQ */ |
| 175 | |
| 176 | /*ASSOCIATION*/ |
| 177 | WDI_ProcessJoinReq, /* WDI_JOIN_REQ */ |
| 178 | WDI_ProcessConfigBSSReq, /* WDI_CONFIG_BSS_REQ */ |
| 179 | WDI_ProcessDelBSSReq, /* WDI_DEL_BSS_REQ */ |
| 180 | WDI_ProcessPostAssocReq, /* WDI_POST_ASSOC_REQ */ |
| 181 | WDI_ProcessDelSTAReq, /* WDI_DEL_STA_REQ */ |
| 182 | |
| 183 | /* Security */ |
| 184 | WDI_ProcessSetBssKeyReq, /* WDI_SET_BSS_KEY_REQ */ |
| 185 | WDI_ProcessRemoveBssKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 186 | WDI_ProcessSetStaKeyReq, /* WDI_SET_STA_KEY_REQ */ |
| 187 | WDI_ProcessRemoveStaKeyReq, /* WDI_RMV_BSS_KEY_REQ */ |
| 188 | |
| 189 | /* QoS and BA APIs */ |
| 190 | WDI_ProcessAddTSpecReq, /* WDI_ADD_TS_REQ */ |
| 191 | WDI_ProcessDelTSpecReq, /* WDI_DEL_TS_REQ */ |
| 192 | WDI_ProcessUpdateEDCAParamsReq, /* WDI_UPD_EDCA_PRMS_REQ */ |
| 193 | WDI_ProcessAddBASessionReq, /* WDI_ADD_BA_SESSION_REQ */ |
| 194 | WDI_ProcessDelBAReq, /* WDI_DEL_BA_REQ */ |
| 195 | |
| 196 | /* Miscellaneous Control APIs */ |
| 197 | WDI_ProcessChannelSwitchReq, /* WDI_CH_SWITCH_REQ */ |
| 198 | WDI_ProcessConfigStaReq, /* WDI_CONFIG_STA_REQ */ |
| 199 | WDI_ProcessSetLinkStateReq, /* WDI_SET_LINK_ST_REQ */ |
| 200 | WDI_ProcessGetStatsReq, /* WDI_GET_STATS_REQ */ |
| 201 | WDI_ProcessUpdateCfgReq, /* WDI_UPDATE_CFG_REQ */ |
| 202 | |
| 203 | /*BA APIs*/ |
| 204 | WDI_ProcessAddBAReq, /* WDI_ADD_BA_REQ */ |
| 205 | WDI_ProcessTriggerBAReq, /* WDI_TRIGGER_BA_REQ */ |
| 206 | |
| 207 | /*Beacon processing APIs*/ |
| 208 | WDI_ProcessUpdateBeaconParamsReq, /* WDI_UPD_BCON_PRMS_REQ */ |
| 209 | WDI_ProcessSendBeaconParamsReq, /* WDI_SND_BCON_REQ */ |
| 210 | |
| 211 | WDI_ProcessUpdateProbeRspTemplateReq, /* WDI_UPD_PROBE_RSP_TEMPLATE_REQ */ |
| 212 | WDI_ProcessSetStaBcastKeyReq, /* WDI_SET_STA_BCAST_KEY_REQ */ |
| 213 | WDI_ProcessRemoveStaBcastKeyReq, /* WDI_RMV_STA_BCAST_KEY_REQ */ |
| 214 | WDI_ProcessSetMaxTxPowerReq, /*WDI_SET_MAX_TX_POWER_REQ*/ |
| 215 | #ifdef WLAN_FEATURE_P2P |
| 216 | WDI_ProcessP2PGONOAReq, /* WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ */ |
| 217 | #else |
| 218 | NULL, |
| 219 | #endif |
| 220 | /* PowerSave APIs */ |
| 221 | WDI_ProcessEnterImpsReq, /* WDI_ENTER_IMPS_REQ */ |
| 222 | WDI_ProcessExitImpsReq, /* WDI_EXIT_IMPS_REQ */ |
| 223 | WDI_ProcessEnterBmpsReq, /* WDI_ENTER_BMPS_REQ */ |
| 224 | WDI_ProcessExitBmpsReq, /* WDI_EXIT_BMPS_REQ */ |
| 225 | WDI_ProcessEnterUapsdReq, /* WDI_ENTER_UAPSD_REQ */ |
| 226 | WDI_ProcessExitUapsdReq, /* WDI_EXIT_UAPSD_REQ */ |
| 227 | WDI_ProcessSetUapsdAcParamsReq, /* WDI_SET_UAPSD_PARAM_REQ */ |
| 228 | WDI_ProcessUpdateUapsdParamsReq, /* WDI_UPDATE_UAPSD_PARAM_REQ */ |
| 229 | WDI_ProcessConfigureRxpFilterReq, /* WDI_CONFIGURE_RXP_FILTER_REQ */ |
| 230 | WDI_ProcessSetBeaconFilterReq, /* WDI_SET_BEACON_FILTER_REQ */ |
| 231 | WDI_ProcessRemBeaconFilterReq, /* WDI_REM_BEACON_FILTER_REQ */ |
| 232 | WDI_ProcessSetRSSIThresholdsReq, /* WDI_SET_RSSI_THRESHOLDS_REQ */ |
| 233 | WDI_ProcessHostOffloadReq, /* WDI_HOST_OFFLOAD_REQ */ |
| 234 | WDI_ProcessWowlAddBcPtrnReq, /* WDI_WOWL_ADD_BC_PTRN_REQ */ |
| 235 | WDI_ProcessWowlDelBcPtrnReq, /* WDI_WOWL_DEL_BC_PTRN_REQ */ |
| 236 | WDI_ProcessWowlEnterReq, /* WDI_WOWL_ENTER_REQ */ |
| 237 | WDI_ProcessWowlExitReq, /* WDI_WOWL_EXIT_REQ */ |
| 238 | WDI_ProcessConfigureAppsCpuWakeupStateReq, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ */ |
| 239 | /*NV Download APIs*/ |
| 240 | WDI_ProcessNvDownloadReq, /* WDI_NV_DOWNLOAD_REQ*/ |
| 241 | WDI_ProcessFlushAcReq, /* WDI_FLUSH_AC_REQ */ |
| 242 | WDI_ProcessBtAmpEventReq, /* WDI_BTAMP_EVENT_REQ */ |
| 243 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 244 | WDI_ProcessAggrAddTSpecReq, /* WDI_AGGR_ADD_TS_REQ */ |
| 245 | #else |
| 246 | NULL, |
| 247 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 248 | WDI_ProcessAddSTASelfReq, /* WDI_ADD_STA_SELF_REQ */ |
| 249 | WDI_ProcessDelSTASelfReq, /* WDI DEL STA SELF REQ */ |
| 250 | #ifdef ANI_MANF_DIAG |
| 251 | WDI_ProcessFTMCommandReq, /* WDI_FTM_CMD_REQ */ |
| 252 | #else |
| 253 | NULL, |
| 254 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 255 | |
| 256 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 257 | WDI_ProcessStartOemDataReq, /*WDI_START_OEM_DATA_REQ*/ |
| 258 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 260 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | WDI_ProcessHostResumeReq, /*WDI_HOST_RESUME_REQ*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 262 | |
| 263 | WDI_ProcessKeepAliveReq, /* WDI_KEEP_ALIVE_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 264 | |
| 265 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 266 | WDI_ProcessSetPreferredNetworkReq, /* WDI_SET_PREF_NETWORK_REQ */ |
| 267 | WDI_ProcessSetRssiFilterReq, /* WDI_SET_RSSI_FILTER_REQ */ |
| 268 | WDI_ProcessUpdateScanParamsReq, /* WDI_UPDATE_SCAN_PARAMS_REQ */ |
| 269 | #else |
| 270 | NULL, |
| 271 | NULL, |
| 272 | NULL, |
| 273 | #endif /* FEATURE_WLAN_SCAN_PNO */ |
| 274 | |
| 275 | WDI_ProcessSetTxPerTrackingReq, /* WDI_SET_TX_PER_TRACKING_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 276 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 278 | /* WDI_8023_MULTICAST_LIST_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 279 | WDI_Process8023MulticastListReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 280 | /* WDI_RECEIVE_FILTER_SET_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 281 | WDI_ProcessReceiveFilterSetFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 283 | WDI_ProcessFilterMatchCountReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 284 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 285 | WDI_ProcessReceiveFilterClearFilterReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 286 | #else |
| 287 | NULL, |
| 288 | NULL, |
| 289 | NULL, |
| 290 | NULL, |
| 291 | #endif // WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 292 | WDI_ProcessInitScanReq, /* WDI_INIT_SCAN_CON_REQ */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 293 | WDI_ProcessHALDumpCmdReq, /*WDI_HAL_DUMP_CMD_REQ */ |
| 294 | WDI_ProcessShutdownReq, /* WDI_SHUTDOWN_REQ */ |
| 295 | |
| 296 | WDI_ProcessSetPowerParamsReq, /*WDI_SET_POWER_PARAMS_REQ*/ |
| 297 | #ifdef FEATURE_WLAN_CCX |
| 298 | WDI_ProcessTSMStatsReq, /* WDI_TSM_STATS_REQ */ |
| 299 | #else |
| 300 | NULL, |
| 301 | #endif |
| 302 | |
| 303 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 304 | WDI_ProcessGTKOffloadReq, /* WDI_GTK_OFFLOAD_REQ */ |
| 305 | WDI_ProcessGTKOffloadGetInfoReq, /* WDI_GTK_OFFLOAD_GETINFO_REQ */ |
| 306 | #else |
| 307 | NULL, |
| 308 | NULL, |
| 309 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 310 | |
| 311 | WDI_ProcessSetTmLevelReq, /*WDI_SET_TM_LEVEL_REQ*/ |
| 312 | WDI_ProcessFeatureCapsExchangeReq, /* WDI_FEATURE_CAPS_EXCHANGE_REQ */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 313 | #ifdef WLAN_FEATURE_11AC |
| 314 | WDI_ProcessUpdateVHTOpModeReq, /* WDI_UPDATE_VHT_OP_MODE_REQ */ |
| 315 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 316 | /*------------------------------------------------------------------------- |
| 317 | Indications |
| 318 | -------------------------------------------------------------------------*/ |
| 319 | WDI_ProcessHostSuspendInd, /* WDI_HOST_SUSPEND_IND*/ |
| 320 | }; |
| 321 | |
| 322 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 323 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 324 | DAL Request Processing Array - the functions in this table will only be |
| 325 | called when the processing of the specific request is allowed by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 326 | Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 327 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 328 | WDI_RspProcFuncType pfnRspProcTbl[WDI_MAX_RESP] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 329 | { |
| 330 | /*INIT*/ |
| 331 | WDI_ProcessStartRsp, /* WDI_START_RESP */ |
| 332 | WDI_ProcessStopRsp, /* WDI_STOP_RESP */ |
| 333 | WDI_ProcessCloseRsp, /* WDI_CLOSE_RESP */ |
| 334 | |
| 335 | /*SCAN*/ |
| 336 | WDI_ProcessInitScanRsp, /* WDI_INIT_SCAN_RESP */ |
| 337 | WDI_ProcessStartScanRsp, /* WDI_START_SCAN_RESP */ |
| 338 | WDI_ProcessEndScanRsp, /* WDI_END_SCAN_RESP */ |
| 339 | WDI_ProcessFinishScanRsp, /* WDI_FINISH_SCAN_RESP */ |
| 340 | |
| 341 | /* ASSOCIATION*/ |
| 342 | WDI_ProcessJoinRsp, /* WDI_JOIN_RESP */ |
| 343 | WDI_ProcessConfigBSSRsp, /* WDI_CONFIG_BSS_RESP */ |
| 344 | WDI_ProcessDelBSSRsp, /* WDI_DEL_BSS_RESP */ |
| 345 | WDI_ProcessPostAssocRsp, /* WDI_POST_ASSOC_RESP */ |
| 346 | WDI_ProcessDelSTARsp, /* WDI_DEL_STA_RESP */ |
| 347 | |
| 348 | /* Security */ |
| 349 | WDI_ProcessSetBssKeyRsp, /* WDI_SET_BSS_KEY_RESP */ |
| 350 | WDI_ProcessRemoveBssKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 351 | WDI_ProcessSetStaKeyRsp, /* WDI_SET_STA_KEY_RESP */ |
| 352 | WDI_ProcessRemoveStaKeyRsp, /* WDI_RMV_BSS_KEY_RESP */ |
| 353 | |
| 354 | /* QoS and BA APIs */ |
| 355 | WDI_ProcessAddTSpecRsp, /* WDI_ADD_TS_RESP */ |
| 356 | WDI_ProcessDelTSpecRsp, /* WDI_DEL_TS_RESP */ |
| 357 | WDI_ProcessUpdateEDCAParamsRsp, /* WDI_UPD_EDCA_PRMS_RESP */ |
| 358 | WDI_ProcessAddBASessionRsp, /* WDI_ADD_BA_SESSION_RESP */ |
| 359 | WDI_ProcessDelBARsp, /* WDI_DEL_BA_RESP */ |
| 360 | |
| 361 | /* Miscellaneous Control APIs */ |
| 362 | WDI_ProcessChannelSwitchRsp, /* WDI_CH_SWITCH_RESP */ |
| 363 | WDI_ProcessConfigStaRsp, /* WDI_CONFIG_STA_RESP */ |
| 364 | WDI_ProcessSetLinkStateRsp, /* WDI_SET_LINK_ST_RESP */ |
| 365 | WDI_ProcessGetStatsRsp, /* WDI_GET_STATS_RESP */ |
| 366 | WDI_ProcessUpdateCfgRsp, /* WDI_UPDATE_CFG_RESP */ |
| 367 | |
| 368 | /* BA APIs*/ |
| 369 | WDI_ProcessAddBARsp, /* WDI_ADD_BA_RESP */ |
| 370 | WDI_ProcessTriggerBARsp, /* WDI_TRIGGER_BA_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 371 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 372 | /* IBSS APIs*/ |
| 373 | WDI_ProcessUpdateBeaconParamsRsp, /* WDI_UPD_BCON_PRMS_RSP */ |
| 374 | WDI_ProcessSendBeaconParamsRsp, /* WDI_SND_BCON_RSP */ |
| 375 | |
| 376 | /*Soft AP APIs*/ |
| 377 | WDI_ProcessUpdateProbeRspTemplateRsp,/*WDI_UPD_PROBE_RSP_TEMPLATE_RESP */ |
| 378 | WDI_ProcessSetStaBcastKeyRsp, /*WDI_SET_STA_BCAST_KEY_RESP */ |
| 379 | WDI_ProcessRemoveStaBcastKeyRsp, /*WDI_RMV_STA_BCAST_KEY_RESP */ |
| 380 | WDI_ProcessSetMaxTxPowerRsp, /*WDI_SET_MAX_TX_POWER_RESP */ |
| 381 | |
| 382 | /* PowerSave APIs */ |
| 383 | WDI_ProcessEnterImpsRsp, /* WDI_ENTER_IMPS_RESP */ |
| 384 | WDI_ProcessExitImpsRsp, /* WDI_EXIT_IMPS_RESP */ |
| 385 | WDI_ProcessEnterBmpsRsp, /* WDI_ENTER_BMPS_RESP */ |
| 386 | WDI_ProcessExitBmpsRsp, /* WDI_EXIT_BMPS_RESP */ |
| 387 | WDI_ProcessEnterUapsdRsp, /* WDI_ENTER_UAPSD_RESP */ |
| 388 | WDI_ProcessExitUapsdRsp, /* WDI_EXIT_UAPSD_RESP */ |
| 389 | WDI_ProcessSetUapsdAcParamsRsp, /* WDI_SET_UAPSD_PARAM_RESP */ |
| 390 | WDI_ProcessUpdateUapsdParamsRsp, /* WDI_UPDATE_UAPSD_PARAM_RESP */ |
| 391 | WDI_ProcessConfigureRxpFilterRsp,/* WDI_CONFIGURE_RXP_FILTER_RESP */ |
| 392 | WDI_ProcessSetBeaconFilterRsp, /* WDI_SET_BEACON_FILTER_RESP */ |
| 393 | WDI_ProcessRemBeaconFilterRsp, /* WDI_REM_BEACON_FILTER_RESP */ |
| 394 | WDI_ProcessSetRSSIThresoldsRsp, /* WDI_SET_RSSI_THRESHOLDS_RESP */ |
| 395 | WDI_ProcessHostOffloadRsp, /* WDI_HOST_OFFLOAD_RESP */ |
| 396 | WDI_ProcessWowlAddBcPtrnRsp, /* WDI_WOWL_ADD_BC_PTRN_RESP */ |
| 397 | WDI_ProcessWowlDelBcPtrnRsp, /* WDI_WOWL_DEL_BC_PTRN_RESP */ |
| 398 | WDI_ProcessWowlEnterRsp, /* WDI_WOWL_ENTER_RESP */ |
| 399 | WDI_ProcessWowlExitRsp, /* WDI_WOWL_EXIT_RESP */ |
| 400 | WDI_ProcessConfigureAppsCpuWakeupStateRsp, /* WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 401 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 402 | |
| 403 | WDI_ProcessNvDownloadRsp, /* WDI_NV_DOWNLOAD_RESP*/ |
| 404 | |
| 405 | WDI_ProcessFlushAcRsp, /* WDI_FLUSH_AC_RESP */ |
| 406 | WDI_ProcessBtAmpEventRsp, /* WDI_BTAMP_EVENT_RESP */ |
| 407 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 408 | WDI_ProcessAggrAddTSpecRsp, /* WDI_AGGR_ADD_TS_RESP */ |
| 409 | #else |
| 410 | NULL, |
| 411 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 412 | WDI_ProcessAddSTASelfRsp, /* WDI_ADD_STA_SELF_RESP */ |
| 413 | WDI_ProcessDelSTASelfRsp, /* WDI_DEL_STA_SELF_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 414 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 415 | WDI_ProcessStartOemDataRsp, /*WDI_START_OEM_DATA_RESP*/ |
| 416 | #else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 417 | NULL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 418 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 419 | WDI_ProcessHostResumeRsp, /*WDI_HOST_RESUME_RESP*/ |
| 420 | |
| 421 | #ifdef WLAN_FEATURE_P2P |
| 422 | WDI_ProcessP2PGONOARsp, /*WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP */ |
| 423 | #else |
| 424 | NULL, |
| 425 | #endif |
| 426 | |
| 427 | #ifdef ANI_MANF_DIAG |
| 428 | WDI_ProcessFTMCommandRsp, /* WDI_FTM_CMD_RESP */ |
| 429 | #else |
| 430 | NULL, |
| 431 | #endif /* ANI_MANF_DIAG */ |
| 432 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 433 | WDI_ProcessKeepAliveRsp, /* WDI_KEEP_ALIVE_RESP */ |
| 434 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 435 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 436 | WDI_ProcessSetPreferredNetworkRsp, /* WDI_SET_PREF_NETWORK_RESP */ |
| 437 | WDI_ProcessSetRssiFilterRsp, /* WDI_SET_RSSI_FILTER_RESP */ |
| 438 | WDI_ProcessUpdateScanParamsRsp, /* WDI_UPDATE_SCAN_PARAMS_RESP */ |
| 439 | #else |
| 440 | NULL, |
| 441 | NULL, |
| 442 | NULL, |
| 443 | #endif // FEATURE_WLAN_SCAN_PNO |
| 444 | |
| 445 | WDI_ProcessSetTxPerTrackingRsp, /* WDI_SET_TX_PER_TRACKING_RESP */ |
| 446 | |
| 447 | /*--------------------------------------------------------------------- |
| 448 | Indications |
| 449 | ---------------------------------------------------------------------*/ |
| 450 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 451 | /* WDI_8023_MULTICAST_LIST_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 452 | WDI_Process8023MulticastListRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 453 | /* WDI_RECEIVE_FILTER_SET_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 454 | WDI_ProcessReceiveFilterSetFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 455 | /* WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 456 | WDI_ProcessFilterMatchCountRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 457 | /* WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 458 | WDI_ProcessReceiveFilterClearFilterRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 459 | #else |
| 460 | NULL, |
| 461 | NULL, |
| 462 | NULL, |
| 463 | NULL, |
| 464 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 465 | |
| 466 | WDI_ProcessHALDumpCmdRsp, /* WDI_HAL_DUMP_CMD_RESP */ |
| 467 | WDI_ProcessShutdownRsp, /* WDI_SHUTDOWN_RESP */ |
| 468 | |
| 469 | WDI_ProcessSetPowerParamsRsp, /*WDI_SET_POWER_PARAMS_RESP*/ |
| 470 | #ifdef FEATURE_WLAN_CCX |
| 471 | WDI_ProcessTsmStatsRsp, /* WDI_TSM_STATS_RESP */ |
| 472 | #else |
| 473 | NULL, |
| 474 | #endif |
| 475 | |
| 476 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 477 | WDI_ProcessGtkOffloadRsp, /* WDI_GTK_OFFLOAD_RESP */ |
| 478 | WDI_ProcessGTKOffloadGetInfoRsp, /* WDI_GTK_OFFLOAD_GETINFO_RESP */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 479 | #else |
| 480 | NULL, |
| 481 | NULL, |
| 482 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 483 | WDI_ProcessSetTmLevelRsp, /* WDI_SET_TM_LEVEL_RESP */ |
| 484 | WDI_ProcessFeatureCapsExchangeRsp, /* WDI_FEATURE_CAPS_EXCHANGE_RESP */ |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 485 | #ifdef WLAN_FEATURE_11AC |
| 486 | WDI_ProcessUpdateVHTOpModeRsp, /* WDI_UPDATE_VHT_OP_MODE_RESP */ |
| 487 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 488 | |
| 489 | /*--------------------------------------------------------------------- |
| 490 | Indications |
| 491 | ---------------------------------------------------------------------*/ |
| 492 | WDI_ProcessLowRSSIInd, /* Just threshold crossing not really low WDI_HAL_RSSI_NOTIFICATION_IND */ |
| 493 | WDI_ProcessMissedBeaconInd, /* WDI_HAL_MISSED_BEACON_IND */ |
| 494 | WDI_ProcessUnkAddrFrameInd, /* WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND */ |
| 495 | WDI_ProcessMicFailureInd, /* WDI_HAL_MIC_FAILURE_IND */ |
| 496 | WDI_ProcessFatalErrorInd, /* WDI_HAL_FATAL_ERROR_IND */ |
| 497 | WDI_ProcessDelSTAInd, /* WDI_HAL_DEL_STA_IND */ |
| 498 | |
| 499 | WDI_ProcessCoexInd, /* WDI_HAL_COEX_IND */ |
| 500 | |
| 501 | WDI_ProcessTxCompleteInd, /* WDI_HAL_TX_COMPLETE_IND */ |
| 502 | |
| 503 | #ifdef WLAN_FEATURE_P2P |
| 504 | WDI_ProcessP2pNoaAttrInd, /*WDI_HOST_NOA_ATTR_IND*/ |
| 505 | #else |
| 506 | NULL, |
| 507 | #endif |
| 508 | |
| 509 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 510 | WDI_ProcessPrefNetworkFoundInd, /* WDI_HAL_PREF_NETWORK_FOUND_IND */ |
| 511 | #else |
| 512 | NULL, |
| 513 | #endif // FEATURE_WLAN_SCAN_PNO |
| 514 | |
| 515 | #ifdef WLAN_WAKEUP_EVENTS |
| 516 | WDI_ProcessWakeReasonInd, /* WDI_WAKE_REASON_IND */ |
| 517 | #else // WLAN_WAKEUP_EVENTS |
| 518 | NULL, |
| 519 | #endif // WLAN_WAKEUP_EVENTS |
| 520 | |
| 521 | WDI_ProcessTxPerHitInd, /* WDI_HAL_TX_PER_HIT_IND */ |
| 522 | }; |
| 523 | |
| 524 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 525 | /*--------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 526 | WLAN DAL Global Control Block |
| 527 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 528 | WDI_ControlBlockType gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 529 | static wpt_uint8 gWDIInitialized = eWLAN_PAL_FALSE; |
| 530 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 531 | const wpt_uint8 szTransportChName[] = "WLAN_CTRL"; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 532 | |
| 533 | /*Helper routine for retrieving the PAL Context from WDI*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 534 | WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 535 | void* WDI_GET_PAL_CTX( void ) |
| 536 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 537 | return gWDICb.pPALContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 538 | }/*WDI_GET_PAL_CTX*/ |
| 539 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 540 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 541 | Helper inline converters |
| 542 | ============================================================================*/ |
| 543 | /*Convert WDI driver type into HAL driver type*/ |
| 544 | WPT_STATIC WPT_INLINE WDI_Status |
| 545 | WDI_HAL_2_WDI_STATUS |
| 546 | ( |
| 547 | eHalStatus halStatus |
| 548 | ); |
| 549 | |
| 550 | /*Convert WDI request type into HAL request type*/ |
| 551 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 552 | WDI_2_HAL_REQ_TYPE |
| 553 | ( |
| 554 | WDI_RequestEnumType wdiReqType |
| 555 | ); |
| 556 | |
| 557 | /*Convert WDI response type into HAL response type*/ |
| 558 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 559 | HAL_2_WDI_RSP_TYPE |
| 560 | ( |
| 561 | tHalHostMsgType halMsg |
| 562 | ); |
| 563 | |
| 564 | /*Convert WDI driver type into HAL driver type*/ |
| 565 | WPT_STATIC WPT_INLINE tDriverType |
| 566 | WDI_2_HAL_DRV_TYPE |
| 567 | ( |
| 568 | WDI_DriverType wdiDriverType |
| 569 | ); |
| 570 | |
| 571 | /*Convert WDI stop reason into HAL stop reason*/ |
| 572 | WPT_STATIC WPT_INLINE tHalStopType |
| 573 | WDI_2_HAL_STOP_REASON |
| 574 | ( |
| 575 | WDI_StopType wdiStopType |
| 576 | ); |
| 577 | |
| 578 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 579 | WPT_STATIC WPT_INLINE eHalSysMode |
| 580 | WDI_2_HAL_SCAN_MODE |
| 581 | ( |
| 582 | WDI_ScanMode wdiScanMode |
| 583 | ); |
| 584 | |
| 585 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 586 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 587 | WDI_2_HAL_SEC_CH_OFFSET |
| 588 | ( |
| 589 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 590 | ); |
| 591 | |
| 592 | /*Convert WDI BSS type into HAL BSS type*/ |
| 593 | WPT_STATIC WPT_INLINE tSirBssType |
| 594 | WDI_2_HAL_BSS_TYPE |
| 595 | ( |
| 596 | WDI_BssType wdiBSSType |
| 597 | ); |
| 598 | |
| 599 | /*Convert WDI NW type into HAL NW type*/ |
| 600 | WPT_STATIC WPT_INLINE tSirNwType |
| 601 | WDI_2_HAL_NW_TYPE |
| 602 | ( |
| 603 | WDI_NwType wdiNWType |
| 604 | ); |
| 605 | |
| 606 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 607 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 608 | WDI_2_HAL_CB_STATE |
| 609 | ( |
| 610 | WDI_PhyChanBondState wdiCbState |
| 611 | ); |
| 612 | |
| 613 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 614 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 615 | WDI_2_HAL_HT_OPER_MODE |
| 616 | ( |
| 617 | WDI_HTOperatingMode wdiHTOperMode |
| 618 | ); |
| 619 | |
| 620 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 621 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 622 | WDI_2_HAL_MIMO_PS |
| 623 | ( |
| 624 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 625 | ); |
| 626 | |
| 627 | /*Convert WDI ENC type into HAL ENC type*/ |
| 628 | WPT_STATIC WPT_INLINE tAniEdType |
| 629 | WDI_2_HAL_ENC_TYPE |
| 630 | ( |
| 631 | WDI_EncryptType wdiEncType |
| 632 | ); |
| 633 | |
| 634 | /*Convert WDI WEP type into HAL WEP type*/ |
| 635 | WPT_STATIC WPT_INLINE tAniWepType |
| 636 | WDI_2_HAL_WEP_TYPE |
| 637 | ( |
| 638 | WDI_WepType wdiWEPType |
| 639 | ); |
| 640 | |
| 641 | /*Convert WDI Link State into HAL Link State*/ |
| 642 | WPT_STATIC WPT_INLINE tSirLinkState |
| 643 | WDI_2_HAL_LINK_STATE |
| 644 | ( |
| 645 | WDI_LinkStateType wdiLinkState |
| 646 | ); |
| 647 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 648 | /*Translate a STA Context from WDI into HAL*/ |
| 649 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 650 | void |
| 651 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 652 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 653 | tConfigStaParams* phalConfigSta, |
| 654 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 655 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 656 | |
| 657 | /*Translate a Rate set info from WDI into HAL*/ |
| 658 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 659 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 660 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 661 | tSirMacRateSet* pHalRateSet, |
| 662 | WDI_RateSet* pwdiRateSet |
| 663 | ); |
| 664 | |
| 665 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 666 | WPT_STATIC WPT_INLINE void |
| 667 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 668 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 669 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 670 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 671 | ); |
| 672 | |
| 673 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 674 | WPT_STATIC WPT_INLINE void |
| 675 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 676 | ( |
| 677 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 678 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 679 | ); |
| 680 | |
| 681 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 682 | WPT_STATIC WPT_INLINE void |
| 683 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 684 | ( |
| 685 | tConfigBssParams* phalConfigBSS, |
| 686 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 687 | ); |
| 688 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 689 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 690 | pointed to by user data */ |
| 691 | WPT_STATIC WPT_INLINE void |
| 692 | WDI_ExtractRequestCBFromEvent |
| 693 | ( |
| 694 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 695 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 696 | void** ppUserData |
| 697 | ); |
| 698 | |
| 699 | wpt_uint8 |
| 700 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 701 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | WDI_ControlBlockType* pWDICtx, |
| 703 | WDI_BSSSessionType** ppSession |
| 704 | ); |
| 705 | |
| 706 | void |
| 707 | WDI_AddBcastSTAtoSTATable |
| 708 | ( |
| 709 | WDI_ControlBlockType* pWDICtx, |
| 710 | WDI_AddStaParams * staParams, |
| 711 | wpt_uint16 usBcastStaIdx |
| 712 | ); |
| 713 | |
| 714 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 715 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 716 | WDI_ControlBlockType* pWDICtx, |
| 717 | WDI_EventInfoType* pEventData |
| 718 | ); |
| 719 | |
| 720 | void |
| 721 | WDI_SetPowerStateCb |
| 722 | ( |
| 723 | wpt_status status, |
| 724 | unsigned int dxePhyAddr, |
| 725 | void *pContext |
| 726 | ); |
| 727 | |
| 728 | #define CASE_RETURN_STRING( str ) \ |
| 729 | case ( ( str ) ): return( #str ); break \ |
| 730 | |
| 731 | /** |
| 732 | @brief WDI_getReqMsgString prints the WDI request message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 733 | |
| 734 | @param wdiReqMsgId: WDI Message request Id |
| 735 | |
| 736 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 737 | @return Result of the function call |
| 738 | */ |
| 739 | static char *WDI_getReqMsgString(wpt_uint16 wdiReqMsgId) |
| 740 | { |
| 741 | switch (wdiReqMsgId) |
| 742 | { |
| 743 | CASE_RETURN_STRING( WDI_START_REQ ); |
| 744 | CASE_RETURN_STRING( WDI_STOP_REQ ); |
| 745 | CASE_RETURN_STRING( WDI_CLOSE_REQ ); |
| 746 | CASE_RETURN_STRING( WDI_INIT_SCAN_REQ ); |
| 747 | CASE_RETURN_STRING( WDI_START_SCAN_REQ ); |
| 748 | CASE_RETURN_STRING( WDI_END_SCAN_REQ ); |
| 749 | CASE_RETURN_STRING( WDI_FINISH_SCAN_REQ ); |
| 750 | CASE_RETURN_STRING( WDI_JOIN_REQ ); |
| 751 | CASE_RETURN_STRING( WDI_CONFIG_BSS_REQ ); |
| 752 | CASE_RETURN_STRING( WDI_DEL_BSS_REQ ); |
| 753 | CASE_RETURN_STRING( WDI_POST_ASSOC_REQ ); |
| 754 | CASE_RETURN_STRING( WDI_DEL_STA_REQ ); |
| 755 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_REQ ); |
| 756 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_REQ ); |
| 757 | CASE_RETURN_STRING( WDI_SET_STA_KEY_REQ ); |
| 758 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_REQ ); |
| 759 | CASE_RETURN_STRING( WDI_ADD_TS_REQ ); |
| 760 | CASE_RETURN_STRING( WDI_DEL_TS_REQ ); |
| 761 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_REQ ); |
| 762 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_REQ ); |
| 763 | CASE_RETURN_STRING( WDI_DEL_BA_REQ ); |
| 764 | CASE_RETURN_STRING( WDI_CH_SWITCH_REQ ); |
| 765 | CASE_RETURN_STRING( WDI_CONFIG_STA_REQ ); |
| 766 | CASE_RETURN_STRING( WDI_SET_LINK_ST_REQ ); |
| 767 | CASE_RETURN_STRING( WDI_GET_STATS_REQ ); |
| 768 | CASE_RETURN_STRING( WDI_UPDATE_CFG_REQ ); |
| 769 | CASE_RETURN_STRING( WDI_ADD_BA_REQ ); |
| 770 | CASE_RETURN_STRING( WDI_TRIGGER_BA_REQ ); |
| 771 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_REQ ); |
| 772 | CASE_RETURN_STRING( WDI_SND_BCON_REQ ); |
| 773 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_REQ ); |
| 774 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_REQ ); |
| 775 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_REQ ); |
| 776 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_REQ ); |
| 777 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ ); |
| 778 | CASE_RETURN_STRING( WDI_ENTER_IMPS_REQ ); |
| 779 | CASE_RETURN_STRING( WDI_EXIT_IMPS_REQ ); |
| 780 | CASE_RETURN_STRING( WDI_ENTER_BMPS_REQ ); |
| 781 | CASE_RETURN_STRING( WDI_EXIT_BMPS_REQ ); |
| 782 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_REQ ); |
| 783 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_REQ ); |
| 784 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_REQ ); |
| 785 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_REQ ); |
| 786 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_REQ ); |
| 787 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_REQ); |
| 788 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_REQ ); |
| 789 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_REQ ); |
| 790 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_REQ ); |
| 791 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_REQ ); |
| 792 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_REQ ); |
| 793 | CASE_RETURN_STRING( WDI_WOWL_ENTER_REQ ); |
| 794 | CASE_RETURN_STRING( WDI_WOWL_EXIT_REQ ); |
| 795 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ ); |
| 796 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_REQ ); |
| 797 | CASE_RETURN_STRING( WDI_FLUSH_AC_REQ ); |
| 798 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_REQ ); |
| 799 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_REQ ); |
| 800 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_REQ ); |
| 801 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_REQ ); |
| 802 | CASE_RETURN_STRING( WDI_FTM_CMD_REQ ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 803 | CASE_RETURN_STRING( WDI_START_OEM_DATA_REQ ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 804 | CASE_RETURN_STRING( WDI_HOST_RESUME_REQ ); |
| 805 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_REQ); |
| 806 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 807 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_REQ ); |
| 808 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_REQ ); |
| 809 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_REQ ); |
| 810 | #endif |
| 811 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_REQ ); |
| 812 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_REQ ); |
| 813 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_REQ ); |
| 814 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ ); |
| 815 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ ); |
| 816 | CASE_RETURN_STRING( WDI_INIT_SCAN_CON_REQ ); |
| 817 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_REQ ); |
| 818 | CASE_RETURN_STRING( WDI_SHUTDOWN_REQ ); |
| 819 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_REQ ); |
| 820 | default: |
| 821 | return "Unknown WDI MessageId"; |
| 822 | } |
| 823 | } |
| 824 | |
| 825 | |
| 826 | |
| 827 | /** |
| 828 | @brief WDI_getRespMsgString prints the WDI resonse message in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 829 | |
| 830 | @param wdiRespMsgId: WDI Message response Id |
| 831 | |
| 832 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 833 | @return Result of the function call |
| 834 | */ |
| 835 | static char *WDI_getRespMsgString(wpt_uint16 wdiRespMsgId) |
| 836 | { |
| 837 | switch (wdiRespMsgId) |
| 838 | { |
| 839 | CASE_RETURN_STRING( WDI_START_RESP ); |
| 840 | CASE_RETURN_STRING( WDI_STOP_RESP ); |
| 841 | CASE_RETURN_STRING( WDI_CLOSE_RESP ); |
| 842 | CASE_RETURN_STRING( WDI_INIT_SCAN_RESP ); |
| 843 | CASE_RETURN_STRING( WDI_START_SCAN_RESP ); |
| 844 | CASE_RETURN_STRING( WDI_END_SCAN_RESP ); |
| 845 | CASE_RETURN_STRING( WDI_FINISH_SCAN_RESP ); |
| 846 | CASE_RETURN_STRING( WDI_JOIN_RESP ); |
| 847 | CASE_RETURN_STRING( WDI_CONFIG_BSS_RESP ); |
| 848 | CASE_RETURN_STRING( WDI_DEL_BSS_RESP ); |
| 849 | CASE_RETURN_STRING( WDI_POST_ASSOC_RESP ); |
| 850 | CASE_RETURN_STRING( WDI_DEL_STA_RESP ); |
| 851 | CASE_RETURN_STRING( WDI_SET_BSS_KEY_RESP ); |
| 852 | CASE_RETURN_STRING( WDI_RMV_BSS_KEY_RESP ); |
| 853 | CASE_RETURN_STRING( WDI_SET_STA_KEY_RESP ); |
| 854 | CASE_RETURN_STRING( WDI_RMV_STA_KEY_RESP ); |
| 855 | CASE_RETURN_STRING( WDI_ADD_TS_RESP ); |
| 856 | CASE_RETURN_STRING( WDI_DEL_TS_RESP ); |
| 857 | CASE_RETURN_STRING( WDI_UPD_EDCA_PRMS_RESP ); |
| 858 | CASE_RETURN_STRING( WDI_ADD_BA_SESSION_RESP ); |
| 859 | CASE_RETURN_STRING( WDI_DEL_BA_RESP ); |
| 860 | CASE_RETURN_STRING( WDI_CH_SWITCH_RESP ); |
| 861 | CASE_RETURN_STRING( WDI_CONFIG_STA_RESP ); |
| 862 | CASE_RETURN_STRING( WDI_SET_LINK_ST_RESP ); |
| 863 | CASE_RETURN_STRING( WDI_GET_STATS_RESP ); |
| 864 | CASE_RETURN_STRING( WDI_UPDATE_CFG_RESP ); |
| 865 | CASE_RETURN_STRING( WDI_ADD_BA_RESP ); |
| 866 | CASE_RETURN_STRING( WDI_TRIGGER_BA_RESP ); |
| 867 | CASE_RETURN_STRING( WDI_UPD_BCON_PRMS_RESP ); |
| 868 | CASE_RETURN_STRING( WDI_SND_BCON_RESP ); |
| 869 | CASE_RETURN_STRING( WDI_UPD_PROBE_RSP_TEMPLATE_RESP ); |
| 870 | CASE_RETURN_STRING( WDI_SET_STA_BCAST_KEY_RESP ); |
| 871 | CASE_RETURN_STRING( WDI_RMV_STA_BCAST_KEY_RESP ); |
| 872 | CASE_RETURN_STRING( WDI_SET_MAX_TX_POWER_RESP ); |
| 873 | CASE_RETURN_STRING( WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP ); |
| 874 | CASE_RETURN_STRING( WDI_ENTER_IMPS_RESP ); |
| 875 | CASE_RETURN_STRING( WDI_EXIT_IMPS_RESP ); |
| 876 | CASE_RETURN_STRING( WDI_ENTER_BMPS_RESP ); |
| 877 | CASE_RETURN_STRING( WDI_EXIT_BMPS_RESP ); |
| 878 | CASE_RETURN_STRING( WDI_ENTER_UAPSD_RESP ); |
| 879 | CASE_RETURN_STRING( WDI_EXIT_UAPSD_RESP ); |
| 880 | CASE_RETURN_STRING( WDI_SET_UAPSD_PARAM_RESP ); |
| 881 | CASE_RETURN_STRING( WDI_UPDATE_UAPSD_PARAM_RESP ); |
| 882 | CASE_RETURN_STRING( WDI_CONFIGURE_RXP_FILTER_RESP ); |
| 883 | CASE_RETURN_STRING( WDI_SET_BEACON_FILTER_RESP); |
| 884 | CASE_RETURN_STRING( WDI_REM_BEACON_FILTER_RESP ); |
| 885 | CASE_RETURN_STRING( WDI_SET_RSSI_THRESHOLDS_RESP ); |
| 886 | CASE_RETURN_STRING( WDI_HOST_OFFLOAD_RESP ); |
| 887 | CASE_RETURN_STRING( WDI_WOWL_ADD_BC_PTRN_RESP ); |
| 888 | CASE_RETURN_STRING( WDI_WOWL_DEL_BC_PTRN_RESP ); |
| 889 | CASE_RETURN_STRING( WDI_WOWL_ENTER_RESP ); |
| 890 | CASE_RETURN_STRING( WDI_WOWL_EXIT_RESP ); |
| 891 | CASE_RETURN_STRING( WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP ); |
| 892 | CASE_RETURN_STRING( WDI_NV_DOWNLOAD_RESP ); |
| 893 | CASE_RETURN_STRING( WDI_FLUSH_AC_RESP ); |
| 894 | CASE_RETURN_STRING( WDI_BTAMP_EVENT_RESP ); |
| 895 | CASE_RETURN_STRING( WDI_AGGR_ADD_TS_RESP ); |
| 896 | CASE_RETURN_STRING( WDI_ADD_STA_SELF_RESP ); |
| 897 | CASE_RETURN_STRING( WDI_DEL_STA_SELF_RESP ); |
| 898 | CASE_RETURN_STRING( WDI_FTM_CMD_RESP ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 899 | CASE_RETURN_STRING( WDI_START_OEM_DATA_RESP ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 900 | CASE_RETURN_STRING( WDI_HOST_RESUME_RESP ); |
| 901 | CASE_RETURN_STRING( WDI_KEEP_ALIVE_RESP); |
| 902 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 903 | CASE_RETURN_STRING( WDI_SET_PREF_NETWORK_RESP ); |
| 904 | CASE_RETURN_STRING( WDI_SET_RSSI_FILTER_RESP ); |
| 905 | CASE_RETURN_STRING( WDI_UPDATE_SCAN_PARAMS_RESP ); |
| 906 | #endif |
| 907 | CASE_RETURN_STRING( WDI_SET_TX_PER_TRACKING_RESP ); |
| 908 | CASE_RETURN_STRING( WDI_8023_MULTICAST_LIST_RESP ); |
| 909 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_SET_FILTER_RESP ); |
| 910 | CASE_RETURN_STRING( WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP ); |
| 911 | CASE_RETURN_STRING( WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP ); |
| 912 | CASE_RETURN_STRING( WDI_HAL_DUMP_CMD_RESP ); |
| 913 | CASE_RETURN_STRING( WDI_SHUTDOWN_RESP ); |
| 914 | CASE_RETURN_STRING( WDI_SET_POWER_PARAMS_RESP ); |
| 915 | default: |
| 916 | return "Unknown WDI MessageId"; |
| 917 | } |
| 918 | } |
| 919 | |
| 920 | /** |
| 921 | @brief WDI_getHALStatusMsgString prints the HAL status in string. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 922 | |
| 923 | @param halStatusId: HAL status Id |
| 924 | |
| 925 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 926 | @return Result of the function call |
| 927 | */ |
| 928 | static char *WDI_getHALStatusMsgString(wpt_uint16 halStatusId) |
| 929 | { |
| 930 | switch (halStatusId) |
| 931 | { |
| 932 | CASE_RETURN_STRING( eHAL_STATUS_SUCCESS ); |
| 933 | CASE_RETURN_STRING( PAL_STATUS_INVAL ); |
| 934 | CASE_RETURN_STRING( PAL_STATUS_ALREADY ); |
| 935 | CASE_RETURN_STRING( PAL_STATUS_EMPTY ); |
| 936 | CASE_RETURN_STRING( PAL_STATUS_FAILURE ); |
| 937 | CASE_RETURN_STRING( eHAL_STATUS_FAILURE ); |
| 938 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_PARAMETER ); |
| 939 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_STAIDX ); |
| 940 | CASE_RETURN_STRING( eHAL_STATUS_DPU_DESCRIPTOR_TABLE_FULL ); |
| 941 | CASE_RETURN_STRING( eHAL_STATUS_NO_INTERRUPTS ); |
| 942 | CASE_RETURN_STRING( eHAL_STATUS_INTERRUPT_PRESENT ); |
| 943 | CASE_RETURN_STRING( eHAL_STATUS_STA_TABLE_FULL ); |
| 944 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_STA ); |
| 945 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_INVALID ); |
| 946 | CASE_RETURN_STRING( eHAL_STATUS_STA_INVALID ); |
| 947 | CASE_RETURN_STRING( eHAL_STATUS_DUPLICATE_BSSID ); |
| 948 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_BSSIDX ); |
| 949 | CASE_RETURN_STRING( eHAL_STATUS_BSSID_TABLE_FULL ); |
| 950 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_SIGNATURE ); |
| 951 | CASE_RETURN_STRING( eHAL_STATUS_INVALID_KEYID ); |
| 952 | CASE_RETURN_STRING( eHAL_STATUS_SET_CHAN_ALREADY_ON_REQUESTED_CHAN ); |
| 953 | CASE_RETURN_STRING( eHAL_STATUS_UMA_DESCRIPTOR_TABLE_FULL ); |
| 954 | CASE_RETURN_STRING( eHAL_STATUS_DPU_MICKEY_TABLE_FULL ); |
| 955 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_BUFFERS_FULL ); |
| 956 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_MAX_SESSIONS_REACHED ); |
| 957 | CASE_RETURN_STRING( eHAL_STATUS_BA_RX_INVALID_SESSION_ID ); |
| 958 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_START_FAILED ); |
| 959 | CASE_RETURN_STRING( eHAL_STATUS_TIMER_STOP_FAILED ); |
| 960 | CASE_RETURN_STRING( eHAL_STATUS_FAILED_ALLOC ); |
| 961 | CASE_RETURN_STRING( eHAL_STATUS_NOTIFY_BSS_FAIL ); |
| 962 | CASE_RETURN_STRING( eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 963 | CASE_RETURN_STRING( eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO ); |
| 964 | CASE_RETURN_STRING( eHAL_STATUS_FW_SEND_MSG_FAILED ); |
| 965 | default: |
| 966 | return "Unknown HAL status"; |
| 967 | } |
| 968 | } |
| 969 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 970 | /*======================================================================== |
| 971 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 972 | INITIALIZATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 973 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 974 | ==========================================================================*/ |
| 975 | |
| 976 | /** |
| 977 | @brief WDI_Init is used to initialize the DAL. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 978 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 979 | DAL will allocate all the resources it needs. It will open PAL, it will also |
| 980 | 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] | 981 | DXE/SMD or any other drivers that they need. |
| 982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 983 | @param pOSContext: pointer to the OS context provided by the UMAC |
| 984 | will be passed on to PAL on Open |
| 985 | ppWDIGlobalCtx: output pointer of Global Context |
| 986 | pWdiDevCapability: output pointer of device capability |
| 987 | |
| 988 | @return Result of the function call |
| 989 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 990 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | WDI_Init |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 992 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 993 | void* pOSContext, |
| 994 | void** ppWDIGlobalCtx, |
| 995 | WDI_DeviceCapabilityType* pWdiDevCapability, |
| 996 | unsigned int driverType |
| 997 | ) |
| 998 | { |
| 999 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1000 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1001 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1002 | WCTS_TransportCBsType wctsCBs; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1003 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 1004 | |
| 1005 | /*--------------------------------------------------------------------- |
| 1006 | Sanity check |
| 1007 | ---------------------------------------------------------------------*/ |
| 1008 | if (( NULL == ppWDIGlobalCtx ) || ( NULL == pWdiDevCapability )) |
| 1009 | { |
| 1010 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1011 | "Invalid input parameters in WDI_Init"); |
| 1012 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1013 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1014 | } |
| 1015 | |
| 1016 | /*--------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1017 | Check to see if the module has already been initialized or not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1018 | ---------------------------------------------------------------------*/ |
| 1019 | if ( eWLAN_PAL_FALSE != gWDIInitialized ) |
| 1020 | { |
| 1021 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1022 | "WDI module already initialized - return"); |
| 1023 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1024 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1025 | } |
| 1026 | |
| 1027 | /*Module is now initialized - this flag is to ensure the fact that multiple |
| 1028 | init will not happen on WDI |
| 1029 | !! - potential race does exist because read and set are not atomic, |
| 1030 | however an atomic operation would be closely here - reanalyze if necessary*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1031 | gWDIInitialized = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1032 | |
| 1033 | /*Setup the control block */ |
| 1034 | WDI_CleanCB(&gWDICb); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1035 | gWDICb.pOSContext = pOSContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1036 | |
| 1037 | /*Setup the STA Table*/ |
| 1038 | wdiStatus = WDI_STATableInit(&gWDICb); |
| 1039 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1040 | { |
| 1041 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1042 | "%s: Failure while initializing STA Table, status %d", |
| 1043 | __FUNCTION__, wdiStatus); |
| 1044 | goto fail_STATableInit; |
| 1045 | } |
| 1046 | |
| 1047 | /*------------------------------------------------------------------------ |
| 1048 | Open the PAL |
| 1049 | ------------------------------------------------------------------------*/ |
| 1050 | wptStatus = wpalOpen(&gWDICb.pPALContext, pOSContext); |
| 1051 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1052 | { |
| 1053 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1054 | "%s: Failed to open PAL, status %d", |
| 1055 | __FUNCTION__, wptStatus); |
| 1056 | goto fail_wpalOpen; |
| 1057 | } |
| 1058 | |
| 1059 | /*Initialize main synchro mutex - it will be used to ensure integrity of |
| 1060 | the main WDI Control Block*/ |
| 1061 | wptStatus = wpalMutexInit(&gWDICb.wptMutex); |
| 1062 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1063 | { |
| 1064 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1065 | "%s: Failed to init mutex, status %d", |
| 1066 | __FUNCTION__, wptStatus); |
| 1067 | goto fail_mutex; |
| 1068 | } |
| 1069 | |
| 1070 | /*Initialize the response timer - it will be used to time all messages |
| 1071 | expected as response from device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1072 | wptStatus = wpalTimerInit( &gWDICb.wptResponseTimer, |
| 1073 | WDI_ResponseTimerCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1074 | &gWDICb); |
| 1075 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1076 | { |
| 1077 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1078 | "%s: Failed to init response timer, status %d", |
| 1079 | __FUNCTION__, wptStatus); |
| 1080 | goto fail_timer; |
| 1081 | } |
| 1082 | |
| 1083 | /* Initialize the WDI Pending Request Queue*/ |
| 1084 | wptStatus = wpal_list_init(&(gWDICb.wptPendingQueue)); |
| 1085 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1086 | { |
| 1087 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1088 | "%s: Failed to init pending request queue, status %d", |
| 1089 | __FUNCTION__, wptStatus); |
| 1090 | goto fail_pend_queue; |
| 1091 | } |
| 1092 | |
| 1093 | /*Init WDI Pending Assoc Id Queue */ |
| 1094 | wptStatus = wpal_list_init(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1095 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1096 | { |
| 1097 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1098 | "%s: Failed to init assoc session queue, status %d", |
| 1099 | __FUNCTION__, wptStatus); |
| 1100 | goto fail_assoc_queue; |
| 1101 | } |
| 1102 | |
| 1103 | /*Initialize the BSS sessions pending Queue */ |
| 1104 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1105 | { |
| 1106 | wptStatus = wpal_list_init(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1107 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1108 | { |
| 1109 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1110 | "%s: Failed to init BSS %d pending queue, status %d", |
| 1111 | __FUNCTION__, i, wptStatus); |
| 1112 | goto fail_bss_queue; |
| 1113 | } |
| 1114 | } |
| 1115 | |
| 1116 | /*Indicate the control block is sufficiently initialized for callbacks*/ |
| 1117 | gWDICb.magic = WDI_CONTROL_BLOCK_MAGIC; |
| 1118 | |
| 1119 | /*------------------------------------------------------------------------ |
| 1120 | Initialize the Data Path Utility Module |
| 1121 | ------------------------------------------------------------------------*/ |
| 1122 | wdiStatus = WDI_DP_UtilsInit(&gWDICb); |
| 1123 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 1124 | { |
| 1125 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1126 | "%s: Failed to initialize the DP Util Module, status %d", |
| 1127 | __FUNCTION__, wdiStatus); |
| 1128 | goto fail_dp_util_init; |
| 1129 | } |
| 1130 | |
| 1131 | /* Init Set power state event */ |
| 1132 | wptStatus = wpalEventInit(&gWDICb.setPowerStateEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1133 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1134 | { |
| 1135 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1136 | "%s: Failed to initialize power state event, status %d", |
| 1137 | __FUNCTION__, wptStatus); |
| 1138 | goto fail_power_event; |
| 1139 | } |
| 1140 | |
| 1141 | /* Init WCTS action event */ |
| 1142 | wptStatus = wpalEventInit(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1143 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1144 | { |
| 1145 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1146 | "%s: Failed to initialize WCTS action event, status %d", |
| 1147 | __FUNCTION__, wptStatus); |
| 1148 | goto fail_wcts_event; |
| 1149 | } |
| 1150 | |
| 1151 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1152 | Open the Transport Services for Control and Data |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | ------------------------------------------------------------------------*/ |
| 1154 | wctsCBs.wctsNotifyCB = WDI_NotifyMsgCTSCB; |
| 1155 | wctsCBs.wctsNotifyCBData = &gWDICb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1156 | wctsCBs.wctsRxMsgCB = WDI_RXMsgCTSCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1157 | wctsCBs.wctsRxMsgCBData = &gWDICb; |
| 1158 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1159 | gWDICb.bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1160 | gWDICb.wctsHandle = WCTS_OpenTransport( szTransportChName , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1161 | WDI_CT_CHANNEL_SIZE, |
| 1162 | &wctsCBs ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1163 | |
| 1164 | if ( NULL == gWDICb.wctsHandle ) |
| 1165 | { |
| 1166 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1167 | "%s: Failed to open WCTS transport", __FUNCTION__); |
| 1168 | goto fail_wcts_open; |
| 1169 | } |
| 1170 | |
| 1171 | gWDICb.driverMode = (tDriverType)driverType; |
| 1172 | /* FTM mode not need to open Transport Driver */ |
| 1173 | if(eDRIVER_TYPE_MFG != (tDriverType)driverType) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1174 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1175 | /*------------------------------------------------------------------------ |
| 1176 | Open the Data Transport |
| 1177 | ------------------------------------------------------------------------*/ |
| 1178 | if(eWLAN_PAL_STATUS_SUCCESS != WDTS_openTransport(&gWDICb)) |
| 1179 | { |
| 1180 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1181 | "%s: Failed to open the DT Transport", __FUNCTION__); |
| 1182 | goto fail_wdts_open; |
| 1183 | } |
| 1184 | } |
| 1185 | |
| 1186 | /*The WDI is initialized - set state to init */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1187 | gWDICb.uGlobalState = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1188 | |
| 1189 | /*Send the context as a ptr to the global WDI Control Block*/ |
| 1190 | *ppWDIGlobalCtx = &gWDICb; |
| 1191 | |
| 1192 | /*Fill in the device capabilities*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1193 | pWdiDevCapability->bFrameXtlSupported = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1194 | pWdiDevCapability->ucMaxSTASupported = gWDICb.ucMaxStations; |
| 1195 | pWdiDevCapability->ucMaxBSSSupported = gWDICb.ucMaxBssids; |
| 1196 | return WDI_STATUS_SUCCESS; |
| 1197 | |
| 1198 | /* ERROR handlers |
| 1199 | Undo everything that completed successfully */ |
| 1200 | |
| 1201 | fail_wdts_open: |
| 1202 | { |
| 1203 | wpt_status eventStatus; |
| 1204 | |
| 1205 | /* Closing WCTS in this scenario is tricky since it has to close |
| 1206 | the SMD channel and then we get notified asynchronously when |
| 1207 | the channel has been closed. So we take some of the logic from |
| 1208 | the "normal" close procedure in WDI_Close() |
| 1209 | */ |
| 1210 | |
| 1211 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1212 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1213 | { |
| 1214 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1215 | "%s: Failed to reset WCTS action event", __FUNCTION__); |
| 1216 | } |
| 1217 | |
| 1218 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1219 | |
| 1220 | /* Wait for WCTS to close the control transport. If we were able |
| 1221 | to reset the event flag, then we'll wait for the event, |
| 1222 | otherwise we'll wait for a maximum amount of time required for |
| 1223 | the channel to be closed */ |
| 1224 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1225 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1226 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1227 | WDI_WCTS_ACTION_TIMEOUT); |
| 1228 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1229 | { |
| 1230 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1231 | "%s: Failed to wait on WCTS action event", __FUNCTION__); |
| 1232 | } |
| 1233 | } |
| 1234 | else |
| 1235 | { |
| 1236 | wpalSleep(WDI_WCTS_ACTION_TIMEOUT); |
| 1237 | } |
| 1238 | } |
| 1239 | fail_wcts_open: |
| 1240 | wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1241 | fail_wcts_event: |
| 1242 | wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1243 | fail_power_event: |
| 1244 | WDI_DP_UtilsExit(&gWDICb); |
| 1245 | fail_dp_util_init: |
| 1246 | gWDICb.magic = 0; |
| 1247 | fail_bss_queue: |
| 1248 | /* entries 0 thru i-1 were successfully initialized */ |
| 1249 | while (0 < i) |
| 1250 | { |
| 1251 | i--; |
| 1252 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1253 | } |
| 1254 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1255 | fail_assoc_queue: |
| 1256 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1257 | fail_pend_queue: |
| 1258 | wpalTimerDelete(&gWDICb.wptResponseTimer); |
| 1259 | fail_timer: |
| 1260 | wpalMutexDelete(&gWDICb.wptMutex); |
| 1261 | fail_mutex: |
| 1262 | wpalClose(gWDICb.pPALContext); |
| 1263 | fail_wpalOpen: |
| 1264 | WDI_STATableClose(&gWDICb); |
| 1265 | fail_STATableInit: |
| 1266 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1267 | |
| 1268 | return WDI_STATUS_E_FAILURE; |
| 1269 | |
| 1270 | }/*WDI_Init*/; |
| 1271 | |
| 1272 | /** |
| 1273 | @brief WDI_Start will be called when the upper MAC is ready to |
| 1274 | commence operation with the WLAN Device. Upon the call |
| 1275 | of this API the WLAN DAL will pack and send a HAL Start |
| 1276 | message to the lower RIVA sub-system if the SMD channel |
| 1277 | has been fully opened and the RIVA subsystem is up. |
| 1278 | |
| 1279 | If the RIVA sub-system is not yet up and running DAL |
| 1280 | will queue the request for Open and will wait for the |
| 1281 | SMD notification before attempting to send down the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1282 | message to HAL. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1283 | |
| 1284 | WDI_Init must have been called. |
| 1285 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1286 | @param wdiStartParams: the start parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1287 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1288 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1289 | wdiStartRspCb: callback for passing back the response of |
| 1290 | the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1292 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1293 | callback |
| 1294 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1295 | @see WDI_Start |
| 1296 | @return Result of the function call |
| 1297 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1298 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1299 | WDI_Start |
| 1300 | ( |
| 1301 | WDI_StartReqParamsType* pwdiStartParams, |
| 1302 | WDI_StartRspCb wdiStartRspCb, |
| 1303 | void* pUserData |
| 1304 | ) |
| 1305 | { |
| 1306 | WDI_EventInfoType wdiEventData; |
| 1307 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1308 | |
| 1309 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1310 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1311 | ------------------------------------------------------------------------*/ |
| 1312 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1313 | { |
| 1314 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1315 | "WDI API call before module is initialized - Fail request"); |
| 1316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1317 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1318 | } |
| 1319 | |
| 1320 | /*------------------------------------------------------------------------ |
| 1321 | Fill in Event data and post to the Main FSM |
| 1322 | ------------------------------------------------------------------------*/ |
| 1323 | wdiEventData.wdiRequest = WDI_START_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1324 | wdiEventData.pEventData = pwdiStartParams; |
| 1325 | wdiEventData.uEventDataSize = sizeof(*pwdiStartParams); |
| 1326 | wdiEventData.pCBfnc = wdiStartRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1327 | wdiEventData.pUserData = pUserData; |
| 1328 | |
| 1329 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1330 | |
| 1331 | }/*WDI_Start*/ |
| 1332 | |
| 1333 | /** |
| 1334 | @brief WDI_Stop will be called when the upper MAC is ready to |
| 1335 | stop any operation with the WLAN Device. Upon the call |
| 1336 | of this API the WLAN DAL will pack and send a HAL Stop |
| 1337 | message to the lower RIVA sub-system if the DAL Core is |
| 1338 | in started state. |
| 1339 | |
| 1340 | In state BUSY this request will be queued. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1341 | |
| 1342 | Request will not be accepted in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1343 | |
| 1344 | WDI_Start must have been called. |
| 1345 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1346 | @param wdiStopParams: the stop parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1347 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1348 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1349 | wdiStopRspCb: callback for passing back the response of |
| 1350 | the stop operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1351 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1352 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1353 | callback |
| 1354 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1355 | @see WDI_Start |
| 1356 | @return Result of the function call |
| 1357 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1358 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1359 | WDI_Stop |
| 1360 | ( |
| 1361 | WDI_StopReqParamsType* pwdiStopParams, |
| 1362 | WDI_StopRspCb wdiStopRspCb, |
| 1363 | void* pUserData |
| 1364 | ) |
| 1365 | { |
| 1366 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1367 | WDI_ControlBlockType* pWDICtx = &gWDICb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1368 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1369 | |
| 1370 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1371 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1372 | ------------------------------------------------------------------------*/ |
| 1373 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1374 | { |
| 1375 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1376 | "WDI API call before module is initialized - Fail request"); |
| 1377 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1378 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | } |
| 1380 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 1381 | /*Access to the global state must be locked before cleaning */ |
| 1382 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 1383 | |
| 1384 | /*Clear all pending request*/ |
| 1385 | WDI_ClearPendingRequests(pWDICtx); |
| 1386 | |
| 1387 | /*We have completed cleaning unlock now*/ |
| 1388 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 1389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1390 | /* Free the global variables */ |
| 1391 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1392 | wpalMemoryFree(gpFwWlanFeatCaps); |
| 1393 | |
| 1394 | /*------------------------------------------------------------------------ |
| 1395 | Fill in Event data and post to the Main FSM |
| 1396 | ------------------------------------------------------------------------*/ |
| 1397 | wdiEventData.wdiRequest = WDI_STOP_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1398 | wdiEventData.pEventData = pwdiStopParams; |
| 1399 | wdiEventData.uEventDataSize = sizeof(*pwdiStopParams); |
| 1400 | wdiEventData.pCBfnc = wdiStopRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1401 | wdiEventData.pUserData = pUserData; |
| 1402 | |
| 1403 | return WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, &wdiEventData); |
| 1404 | |
| 1405 | }/*WDI_Stop*/ |
| 1406 | |
| 1407 | |
| 1408 | |
| 1409 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1410 | @brief WDI_Close will be called when the upper MAC no longer |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1411 | needs to interact with DAL. DAL will free its control |
| 1412 | block. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1413 | |
| 1414 | It is only accepted in state STOPPED. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1415 | |
| 1416 | WDI_Stop must have been called. |
| 1417 | |
| 1418 | @param none |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1419 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1420 | @see WDI_Stop |
| 1421 | @return Result of the function call |
| 1422 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1423 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1424 | WDI_Close |
| 1425 | ( |
| 1426 | void |
| 1427 | ) |
| 1428 | { |
| 1429 | wpt_uint8 i; |
| 1430 | WDI_EventInfoType wdiEventData; |
| 1431 | wpt_status wptStatus; |
| 1432 | wpt_status eventStatus; |
| 1433 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1434 | |
| 1435 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1436 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1437 | ------------------------------------------------------------------------*/ |
| 1438 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1439 | { |
| 1440 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1441 | "WDI API call before module is initialized - Fail request"); |
| 1442 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1443 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1444 | } |
| 1445 | |
| 1446 | /*Reset WCTS action event prior to posting the WDI_CLOSE_REQ |
| 1447 | (the control transport will be closed by the FSM and we'll want |
| 1448 | to wait until that completes)*/ |
| 1449 | eventStatus = wpalEventReset(&gWDICb.wctsActionEvent); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1450 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1451 | { |
| 1452 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1453 | "%s: Failed to reset WCTS action event", __FUNCTION__); |
| 1454 | /* fall through and try to finish closing via the FSM */ |
| 1455 | } |
| 1456 | |
| 1457 | /*------------------------------------------------------------------------ |
| 1458 | Fill in Event data and post to the Main FSM |
| 1459 | ------------------------------------------------------------------------*/ |
| 1460 | wdiEventData.wdiRequest = WDI_CLOSE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1461 | wdiEventData.pEventData = NULL; |
| 1462 | wdiEventData.uEventDataSize = 0; |
| 1463 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1464 | wdiEventData.pUserData = NULL; |
| 1465 | |
| 1466 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 1467 | |
| 1468 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_CLOSE_EVENT, &wdiEventData); |
| 1469 | |
| 1470 | /*Wait for WCTS to close the control transport |
| 1471 | (but only if we were able to reset the event flag*/ |
| 1472 | if ( eWLAN_PAL_STATUS_SUCCESS == eventStatus ) |
| 1473 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1474 | eventStatus = wpalEventWait(&gWDICb.wctsActionEvent, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1475 | WDI_WCTS_ACTION_TIMEOUT); |
| 1476 | if ( eWLAN_PAL_STATUS_SUCCESS != eventStatus ) |
| 1477 | { |
| 1478 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1479 | "%s: Failed to wait on WCTS action event", __FUNCTION__); |
| 1480 | } |
| 1481 | } |
| 1482 | |
| 1483 | /* Destroy the WCTS action event */ |
| 1484 | wptStatus = wpalEventDelete(&gWDICb.wctsActionEvent); |
| 1485 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1486 | { |
| 1487 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1488 | "WDI Close failed to destroy an event"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1489 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1490 | } |
| 1491 | |
| 1492 | /* Destroy the Set Power State event */ |
| 1493 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1494 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1495 | { |
| 1496 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1497 | "WDI Close failed to destroy an event"); |
| 1498 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1499 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1500 | } |
| 1501 | |
| 1502 | /*------------------------------------------------------------------------ |
| 1503 | Closes the Data Path Utility Module |
| 1504 | ------------------------------------------------------------------------*/ |
| 1505 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1506 | { |
| 1507 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1508 | "WDI Init failed to close the DP Util Module"); |
| 1509 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1510 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1511 | } |
| 1512 | |
| 1513 | /*destroy the BSS sessions pending Queue */ |
| 1514 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1515 | { |
| 1516 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1517 | } |
| 1518 | |
| 1519 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1520 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1521 | |
| 1522 | /* destroy the WDI Pending Request Queue*/ |
| 1523 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1524 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1525 | /*destroy the response timer */ |
| 1526 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
| 1527 | |
| 1528 | /*invalidate the main synchro mutex */ |
| 1529 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1530 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1531 | { |
| 1532 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1533 | "Failed to delete mutex %d", wptStatus); |
| 1534 | WDI_ASSERT(0); |
| 1535 | } |
| 1536 | |
| 1537 | /*Clear control block. note that this will clear the "magic" |
| 1538 | which will inhibit all asynchronous callbacks*/ |
| 1539 | WDI_CleanCB(&gWDICb); |
| 1540 | |
| 1541 | return wptStatus; |
| 1542 | |
| 1543 | }/*WDI_Close*/ |
| 1544 | |
| 1545 | /** |
| 1546 | @brief WDI_Shutdown will be called during 'SSR shutdown' operation. |
| 1547 | This will do most of the WDI stop & close |
| 1548 | operations without doing any handshake with Riva |
| 1549 | |
| 1550 | This will also make sure that the control transport |
| 1551 | will NOT be closed. |
| 1552 | |
| 1553 | This request will not be queued. |
| 1554 | |
| 1555 | |
| 1556 | WDI_Start must have been called. |
| 1557 | |
| 1558 | @param closeTransport: Close control channel if this is set |
| 1559 | |
| 1560 | @return Result of the function call |
| 1561 | */ |
| 1562 | WDI_Status |
| 1563 | WDI_Shutdown |
| 1564 | ( |
| 1565 | wpt_boolean closeTransport |
| 1566 | ) |
| 1567 | { |
| 1568 | WDI_EventInfoType wdiEventData; |
| 1569 | wpt_status wptStatus; |
| 1570 | int i = 0; |
| 1571 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1572 | |
| 1573 | /*------------------------------------------------------------------------ |
| 1574 | Sanity Check |
| 1575 | ------------------------------------------------------------------------*/ |
| 1576 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1577 | { |
| 1578 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1579 | "WDI API call before module is initialized - Fail request"); |
| 1580 | |
| 1581 | return WDI_STATUS_E_NOT_ALLOWED; |
| 1582 | } |
| 1583 | |
| 1584 | /*------------------------------------------------------------------------ |
| 1585 | Fill in Event data and post to the Main FSM |
| 1586 | ------------------------------------------------------------------------*/ |
| 1587 | wdiEventData.wdiRequest = WDI_SHUTDOWN_REQ; |
| 1588 | wdiEventData.pEventData = NULL; |
| 1589 | wdiEventData.uEventDataSize = 0; |
| 1590 | |
| 1591 | /* Shutdown will not be queued, if the state is busy timer will be |
| 1592 | * stopped & this message will be processed.*/ |
| 1593 | wptStatus = WDI_PostMainEvent(&gWDICb, WDI_SHUTDOWN_EVENT, &wdiEventData); |
| 1594 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1595 | { |
| 1596 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 1597 | "%s: Failed to process shutdown event", __FUNCTION__); |
| 1598 | } |
| 1599 | /* Destroy the Set Power State event */ |
| 1600 | wptStatus = wpalEventDelete(&gWDICb.setPowerStateEvent); |
| 1601 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1602 | { |
| 1603 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1604 | "WDI Close failed to destroy an event"); |
| 1605 | |
| 1606 | WDI_ASSERT(0); |
| 1607 | } |
| 1608 | /*------------------------------------------------------------------------ |
| 1609 | Closes the Data Path Utility Module |
| 1610 | ------------------------------------------------------------------------*/ |
| 1611 | if ( WDI_STATUS_SUCCESS != WDI_DP_UtilsExit(&gWDICb)) |
| 1612 | { |
| 1613 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 1614 | "WDI Init failed to close the DP Util Module"); |
| 1615 | |
| 1616 | WDI_ASSERT(0); |
| 1617 | } |
| 1618 | if ( closeTransport ) |
| 1619 | { |
| 1620 | /* Close control transport, called from module unload */ |
| 1621 | WCTS_CloseTransport(gWDICb.wctsHandle); |
| 1622 | } |
| 1623 | |
| 1624 | /*destroy the BSS sessions pending Queue */ |
| 1625 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 1626 | { |
| 1627 | wpal_list_destroy(&(gWDICb.aBSSSessions[i].wptPendingQueue)); |
| 1628 | } |
| 1629 | |
| 1630 | /* destroy the WDI Pending Assoc Id Request Queue*/ |
| 1631 | wpal_list_destroy(&(gWDICb.wptPendingAssocSessionIdQueue)); |
| 1632 | /* destroy the WDI Pending Request Queue*/ |
| 1633 | wpal_list_destroy(&(gWDICb.wptPendingQueue)); |
| 1634 | /*destroy the response timer */ |
| 1635 | wptStatus = wpalTimerDelete( &gWDICb.wptResponseTimer); |
| 1636 | |
| 1637 | /*invalidate the main synchro mutex */ |
| 1638 | wptStatus = wpalMutexDelete(&gWDICb.wptMutex); |
| 1639 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 1640 | { |
| 1641 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1642 | "%s: Failed to delete mutex %d", __FUNCTION__, wptStatus); |
| 1643 | WDI_ASSERT(0); |
| 1644 | } |
Madan Mohan Koyyalamudi | 3513bf5 | 2012-09-18 17:35:53 -0700 | [diff] [blame] | 1645 | /* Free the global variables */ |
| 1646 | wpalMemoryFree(gpHostWlanFeatCaps); |
| 1647 | wpalMemoryFree(gpFwWlanFeatCaps); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1648 | /*Clear control block. note that this will clear the "magic" |
| 1649 | which will inhibit all asynchronous callbacks*/ |
| 1650 | WDI_CleanCB(&gWDICb); |
| 1651 | return wptStatus; |
| 1652 | |
| 1653 | }/*WDI_Shutdown*/ |
| 1654 | |
| 1655 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1656 | /*======================================================================== |
| 1657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1658 | SCAN APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1660 | ==========================================================================*/ |
| 1661 | |
| 1662 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1663 | @brief WDI_InitScanReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1664 | the WLAN Device to get ready for a scan procedure. Upon |
| 1665 | the call of this API the WLAN DAL will pack and send a |
| 1666 | HAL Init Scan request message to the lower RIVA |
| 1667 | sub-system if DAL is in state STARTED. |
| 1668 | |
| 1669 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1670 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1671 | |
| 1672 | WDI_Start must have been called. |
| 1673 | |
| 1674 | @param wdiInitScanParams: the init scan parameters as specified |
| 1675 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1677 | wdiInitScanRspCb: callback for passing back the response |
| 1678 | of the init scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1679 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1680 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1681 | callback |
| 1682 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1683 | @see WDI_Start |
| 1684 | @return Result of the function call |
| 1685 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1686 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1687 | WDI_InitScanReq |
| 1688 | ( |
| 1689 | WDI_InitScanReqParamsType* pwdiInitScanParams, |
| 1690 | WDI_InitScanRspCb wdiInitScanRspCb, |
| 1691 | void* pUserData |
| 1692 | ) |
| 1693 | { |
| 1694 | WDI_EventInfoType wdiEventData; |
| 1695 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1696 | |
| 1697 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1698 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1699 | ------------------------------------------------------------------------*/ |
| 1700 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1701 | { |
| 1702 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1703 | "WDI API call before module is initialized - Fail request"); |
| 1704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1705 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1706 | } |
| 1707 | |
| 1708 | /*------------------------------------------------------------------------ |
| 1709 | Fill in Event data and post to the Main FSM |
| 1710 | ------------------------------------------------------------------------*/ |
| 1711 | wdiEventData.wdiRequest = WDI_INIT_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1712 | wdiEventData.pEventData = pwdiInitScanParams; |
| 1713 | wdiEventData.uEventDataSize = sizeof(*pwdiInitScanParams); |
| 1714 | wdiEventData.pCBfnc = wdiInitScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1715 | wdiEventData.pUserData = pUserData; |
| 1716 | |
| 1717 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1718 | |
| 1719 | }/*WDI_InitScanReq*/ |
| 1720 | |
| 1721 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1722 | @brief WDI_StartScanReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1723 | wishes to change the Scan channel on the WLAN Device. |
| 1724 | Upon the call of this API the WLAN DAL will pack and |
| 1725 | send a HAL Start Scan request message to the lower RIVA |
| 1726 | sub-system if DAL is in state STARTED. |
| 1727 | |
| 1728 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1729 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1730 | |
| 1731 | WDI_InitScanReq must have been called. |
| 1732 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1733 | @param wdiStartScanParams: the start scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1734 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1735 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1736 | wdiStartScanRspCb: callback for passing back the |
| 1737 | response of the start scan operation received from the |
| 1738 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1739 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1740 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1741 | callback |
| 1742 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1743 | @see WDI_InitScanReq |
| 1744 | @return Result of the function call |
| 1745 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1746 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1747 | WDI_StartScanReq |
| 1748 | ( |
| 1749 | WDI_StartScanReqParamsType* pwdiStartScanParams, |
| 1750 | WDI_StartScanRspCb wdiStartScanRspCb, |
| 1751 | void* pUserData |
| 1752 | ) |
| 1753 | { |
| 1754 | WDI_EventInfoType wdiEventData; |
| 1755 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1756 | |
| 1757 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1758 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1759 | ------------------------------------------------------------------------*/ |
| 1760 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1761 | { |
| 1762 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1763 | "WDI API call before module is initialized - Fail request"); |
| 1764 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1765 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1766 | } |
| 1767 | |
| 1768 | /*------------------------------------------------------------------------ |
| 1769 | Fill in Event data and post to the Main FSM |
| 1770 | ------------------------------------------------------------------------*/ |
| 1771 | wdiEventData.wdiRequest = WDI_START_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1772 | wdiEventData.pEventData = pwdiStartScanParams; |
| 1773 | wdiEventData.uEventDataSize = sizeof(*pwdiStartScanParams); |
| 1774 | wdiEventData.pCBfnc = wdiStartScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1775 | wdiEventData.pUserData = pUserData; |
| 1776 | |
| 1777 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1778 | |
| 1779 | }/*WDI_StartScanReq*/ |
| 1780 | |
| 1781 | |
| 1782 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1783 | @brief WDI_EndScanReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1784 | wants to end scanning for a particular channel that it |
| 1785 | had set before by calling Scan Start on the WLAN Device. |
| 1786 | Upon the call of this API the WLAN DAL will pack and |
| 1787 | send a HAL End Scan request message to the lower RIVA |
| 1788 | sub-system if DAL is in state STARTED. |
| 1789 | |
| 1790 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1791 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1792 | |
| 1793 | WDI_StartScanReq must have been called. |
| 1794 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1795 | @param wdiEndScanParams: the end scan parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1796 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1797 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1798 | wdiEndScanRspCb: callback for passing back the response |
| 1799 | of the end scan operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1801 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1802 | callback |
| 1803 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1804 | @see WDI_StartScanReq |
| 1805 | @return Result of the function call |
| 1806 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1807 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1808 | WDI_EndScanReq |
| 1809 | ( |
| 1810 | WDI_EndScanReqParamsType* pwdiEndScanParams, |
| 1811 | WDI_EndScanRspCb wdiEndScanRspCb, |
| 1812 | void* pUserData |
| 1813 | ) |
| 1814 | { |
| 1815 | WDI_EventInfoType wdiEventData; |
| 1816 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1817 | |
| 1818 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1819 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1820 | ------------------------------------------------------------------------*/ |
| 1821 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1822 | { |
| 1823 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1824 | "WDI API call before module is initialized - Fail request"); |
| 1825 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1826 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1827 | } |
| 1828 | |
| 1829 | /*------------------------------------------------------------------------ |
| 1830 | Fill in Event data and post to the Main FSM |
| 1831 | ------------------------------------------------------------------------*/ |
| 1832 | wdiEventData.wdiRequest = WDI_END_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1833 | wdiEventData.pEventData = pwdiEndScanParams; |
| 1834 | wdiEventData.uEventDataSize = sizeof(*pwdiEndScanParams); |
| 1835 | wdiEventData.pCBfnc = wdiEndScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1836 | wdiEventData.pUserData = pUserData; |
| 1837 | |
| 1838 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1839 | |
| 1840 | }/*WDI_EndScanReq*/ |
| 1841 | |
| 1842 | |
| 1843 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1844 | @brief WDI_FinishScanReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1845 | completed the scan process on the WLAN Device. Upon the |
| 1846 | call of this API the WLAN DAL will pack and send a HAL |
| 1847 | Finish Scan Request request message to the lower RIVA |
| 1848 | sub-system if DAL is in state STARTED. |
| 1849 | |
| 1850 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1851 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1852 | |
| 1853 | WDI_InitScanReq must have been called. |
| 1854 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1855 | @param wdiFinishScanParams: the finish scan parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1856 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1857 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1858 | wdiFinishScanRspCb: callback for passing back the |
| 1859 | response of the finish scan operation received from the |
| 1860 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1861 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1862 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1863 | callback |
| 1864 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1865 | @see WDI_InitScanReq |
| 1866 | @return Result of the function call |
| 1867 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1868 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1869 | WDI_FinishScanReq |
| 1870 | ( |
| 1871 | WDI_FinishScanReqParamsType* pwdiFinishScanParams, |
| 1872 | WDI_FinishScanRspCb wdiFinishScanRspCb, |
| 1873 | void* pUserData |
| 1874 | ) |
| 1875 | { |
| 1876 | WDI_EventInfoType wdiEventData; |
| 1877 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1878 | |
| 1879 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1880 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1881 | ------------------------------------------------------------------------*/ |
| 1882 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1883 | { |
| 1884 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1885 | "WDI API call before module is initialized - Fail request"); |
| 1886 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1887 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1888 | } |
| 1889 | |
| 1890 | /*------------------------------------------------------------------------ |
| 1891 | Fill in Event data and post to the Main FSM |
| 1892 | ------------------------------------------------------------------------*/ |
| 1893 | wdiEventData.wdiRequest = WDI_FINISH_SCAN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1894 | wdiEventData.pEventData = pwdiFinishScanParams; |
| 1895 | wdiEventData.uEventDataSize = sizeof(*pwdiFinishScanParams); |
| 1896 | wdiEventData.pCBfnc = wdiFinishScanRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1897 | wdiEventData.pUserData = pUserData; |
| 1898 | |
| 1899 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1900 | |
| 1901 | }/*WDI_FinishScanReq*/ |
| 1902 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1903 | /*======================================================================== |
| 1904 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1905 | ASSOCIATION APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1906 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1907 | ==========================================================================*/ |
| 1908 | |
| 1909 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1910 | @brief WDI_JoinReq will be called when the upper MAC is ready |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1911 | to start an association procedure to a BSS. Upon the |
| 1912 | call of this API the WLAN DAL will pack and send a HAL |
| 1913 | Join request message to the lower RIVA sub-system if |
| 1914 | DAL is in state STARTED. |
| 1915 | |
| 1916 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1917 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1918 | |
| 1919 | WDI_Start must have been called. |
| 1920 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1921 | @param wdiJoinParams: the join parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1922 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1923 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1924 | wdiJoinRspCb: callback for passing back the response of |
| 1925 | the join operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1926 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1927 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1928 | callback |
| 1929 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1930 | @see WDI_Start |
| 1931 | @return Result of the function call |
| 1932 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1933 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1934 | WDI_JoinReq |
| 1935 | ( |
| 1936 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 1937 | WDI_JoinRspCb wdiJoinRspCb, |
| 1938 | void* pUserData |
| 1939 | ) |
| 1940 | { |
| 1941 | WDI_EventInfoType wdiEventData; |
| 1942 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 1943 | |
| 1944 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1945 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1946 | ------------------------------------------------------------------------*/ |
| 1947 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 1948 | { |
| 1949 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 1950 | "WDI API call before module is initialized - Fail request"); |
| 1951 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1952 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1953 | } |
| 1954 | |
| 1955 | /*------------------------------------------------------------------------ |
| 1956 | Fill in Event data and post to the Main FSM |
| 1957 | ------------------------------------------------------------------------*/ |
| 1958 | wdiEventData.wdiRequest = WDI_JOIN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1959 | wdiEventData.pEventData = pwdiJoinParams; |
| 1960 | wdiEventData.uEventDataSize = sizeof(*pwdiJoinParams); |
| 1961 | wdiEventData.pCBfnc = wdiJoinRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1962 | wdiEventData.pUserData = pUserData; |
| 1963 | |
| 1964 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 1965 | |
| 1966 | }/*WDI_JoinReq*/ |
| 1967 | |
| 1968 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1969 | @brief WDI_ConfigBSSReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1970 | wishes to configure the newly acquired or in process of |
| 1971 | being acquired BSS to the HW . Upon the call of this API |
| 1972 | the WLAN DAL will pack and send a HAL Config BSS request |
| 1973 | message to the lower RIVA sub-system if DAL is in state |
| 1974 | STARTED. |
| 1975 | |
| 1976 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1977 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1978 | |
| 1979 | WDI_JoinReq must have been called. |
| 1980 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1981 | @param wdiConfigBSSParams: the config BSS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1982 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1983 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1984 | wdiConfigBSSRspCb: callback for passing back the |
| 1985 | response of the config BSS operation received from the |
| 1986 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1987 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1988 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1989 | callback |
| 1990 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1991 | @see WDI_JoinReq |
| 1992 | @return Result of the function call |
| 1993 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1994 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1995 | WDI_ConfigBSSReq |
| 1996 | ( |
| 1997 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams, |
| 1998 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb, |
| 1999 | void* pUserData |
| 2000 | ) |
| 2001 | { |
| 2002 | WDI_EventInfoType wdiEventData; |
| 2003 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2004 | |
| 2005 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2006 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2007 | ------------------------------------------------------------------------*/ |
| 2008 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2009 | { |
| 2010 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2011 | "WDI API call before module is initialized - Fail request"); |
| 2012 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2013 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2014 | } |
| 2015 | |
| 2016 | /*------------------------------------------------------------------------ |
| 2017 | Fill in Event data and post to the Main FSM |
| 2018 | ------------------------------------------------------------------------*/ |
| 2019 | wdiEventData.wdiRequest = WDI_CONFIG_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2020 | wdiEventData.pEventData = pwdiConfigBSSParams; |
| 2021 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigBSSParams); |
| 2022 | wdiEventData.pCBfnc = wdiConfigBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2023 | wdiEventData.pUserData = pUserData; |
| 2024 | |
| 2025 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2026 | |
| 2027 | }/*WDI_ConfigBSSReq*/ |
| 2028 | |
| 2029 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2030 | @brief WDI_DelBSSReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2031 | disassociating from the BSS and wishes to notify HW. |
| 2032 | Upon the call of this API the WLAN DAL will pack and |
| 2033 | send a HAL Del BSS request message to the lower RIVA |
| 2034 | sub-system if DAL is in state STARTED. |
| 2035 | |
| 2036 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2037 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2038 | |
| 2039 | WDI_ConfigBSSReq or WDI_PostAssocReq must have been called. |
| 2040 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2041 | @param wdiDelBSSParams: the del BSS parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2042 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2043 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2044 | wdiDelBSSRspCb: callback for passing back the response |
| 2045 | of the del bss operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2046 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2047 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2048 | callback |
| 2049 | |
| 2050 | @see WDI_ConfigBSSReq, WDI_PostAssocReq |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2051 | @return Result of the function call |
| 2052 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2053 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2054 | WDI_DelBSSReq |
| 2055 | ( |
| 2056 | WDI_DelBSSReqParamsType* pwdiDelBSSParams, |
| 2057 | WDI_DelBSSRspCb wdiDelBSSRspCb, |
| 2058 | void* pUserData |
| 2059 | ) |
| 2060 | { |
| 2061 | WDI_EventInfoType wdiEventData; |
| 2062 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2063 | |
| 2064 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2065 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2066 | ------------------------------------------------------------------------*/ |
| 2067 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2068 | { |
| 2069 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2070 | "WDI API call before module is initialized - Fail request"); |
| 2071 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2072 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2073 | } |
| 2074 | |
| 2075 | /*------------------------------------------------------------------------ |
| 2076 | Fill in Event data and post to the Main FSM |
| 2077 | ------------------------------------------------------------------------*/ |
| 2078 | wdiEventData.wdiRequest = WDI_DEL_BSS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2079 | wdiEventData.pEventData = pwdiDelBSSParams; |
| 2080 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBSSParams); |
| 2081 | wdiEventData.pCBfnc = wdiDelBSSRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2082 | wdiEventData.pUserData = pUserData; |
| 2083 | |
| 2084 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2085 | |
| 2086 | }/*WDI_DelBSSReq*/ |
| 2087 | |
| 2088 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2089 | @brief WDI_PostAssocReq will be called when the upper MAC has |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2090 | associated to a BSS and wishes to configure HW for |
| 2091 | associated state. Upon the call of this API the WLAN DAL |
| 2092 | will pack and send a HAL Post Assoc request message to |
| 2093 | the lower RIVA sub-system if DAL is in state STARTED. |
| 2094 | |
| 2095 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2096 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2097 | |
| 2098 | WDI_JoinReq must have been called. |
| 2099 | |
| 2100 | @param wdiPostAssocReqParams: the assoc parameters as specified |
| 2101 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2102 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2103 | wdiPostAssocRspCb: callback for passing back the |
| 2104 | response of the post assoc operation received from the |
| 2105 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2107 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2108 | callback |
| 2109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2110 | @see WDI_JoinReq |
| 2111 | @return Result of the function call |
| 2112 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2113 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2114 | WDI_PostAssocReq |
| 2115 | ( |
| 2116 | WDI_PostAssocReqParamsType* pwdiPostAssocReqParams, |
| 2117 | WDI_PostAssocRspCb wdiPostAssocRspCb, |
| 2118 | void* pUserData |
| 2119 | ) |
| 2120 | { |
| 2121 | WDI_EventInfoType wdiEventData; |
| 2122 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2123 | |
| 2124 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2125 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2126 | ------------------------------------------------------------------------*/ |
| 2127 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2128 | { |
| 2129 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2130 | "WDI API call before module is initialized - Fail request"); |
| 2131 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2132 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2133 | } |
| 2134 | |
| 2135 | /*------------------------------------------------------------------------ |
| 2136 | Fill in Event data and post to the Main FSM |
| 2137 | ------------------------------------------------------------------------*/ |
| 2138 | wdiEventData.wdiRequest = WDI_POST_ASSOC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2139 | wdiEventData.pEventData = pwdiPostAssocReqParams; |
| 2140 | wdiEventData.uEventDataSize = sizeof(*pwdiPostAssocReqParams); |
| 2141 | wdiEventData.pCBfnc = wdiPostAssocRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2142 | wdiEventData.pUserData = pUserData; |
| 2143 | |
| 2144 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2145 | |
| 2146 | }/*WDI_PostAssocReq*/ |
| 2147 | |
| 2148 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2149 | @brief WDI_DelSTAReq will be called when the upper MAC when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2150 | association with another STA has ended and the station |
| 2151 | must be deleted from HW. Upon the call of this API the |
| 2152 | WLAN DAL will pack and send a HAL Del STA request |
| 2153 | message to the lower RIVA sub-system if DAL is in state |
| 2154 | STARTED. |
| 2155 | |
| 2156 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2157 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2158 | |
| 2159 | WDI_PostAssocReq must have been called. |
| 2160 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2161 | @param wdiDelSTAParams: the Del STA parameters as specified by |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2162 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2163 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2164 | wdiDelSTARspCb: callback for passing back the response |
| 2165 | of the del STA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2166 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2167 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2168 | callback |
| 2169 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2170 | @see WDI_PostAssocReq |
| 2171 | @return Result of the function call |
| 2172 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2173 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2174 | WDI_DelSTAReq |
| 2175 | ( |
| 2176 | WDI_DelSTAReqParamsType* pwdiDelSTAParams, |
| 2177 | WDI_DelSTARspCb wdiDelSTARspCb, |
| 2178 | void* pUserData |
| 2179 | ) |
| 2180 | { |
| 2181 | WDI_EventInfoType wdiEventData; |
| 2182 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2183 | |
| 2184 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2185 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2186 | ------------------------------------------------------------------------*/ |
| 2187 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2188 | { |
| 2189 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2190 | "WDI API call before module is initialized - Fail request"); |
| 2191 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2192 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2193 | } |
| 2194 | |
| 2195 | /*------------------------------------------------------------------------ |
| 2196 | Fill in Event data and post to the Main FSM |
| 2197 | ------------------------------------------------------------------------*/ |
| 2198 | wdiEventData.wdiRequest = WDI_DEL_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2199 | wdiEventData.pEventData = pwdiDelSTAParams; |
| 2200 | wdiEventData.uEventDataSize = sizeof(*pwdiDelSTAParams); |
| 2201 | wdiEventData.pCBfnc = wdiDelSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2202 | wdiEventData.pUserData = pUserData; |
| 2203 | |
| 2204 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2205 | |
| 2206 | }/*WDI_DelSTAReq*/ |
| 2207 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2208 | /*======================================================================== |
| 2209 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2210 | SECURITY APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2211 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2212 | ==========================================================================*/ |
| 2213 | |
| 2214 | /** |
| 2215 | @brief WDI_SetBSSKeyReq will be called when the upper MAC wants to |
| 2216 | install a BSS encryption key on the HW. Upon the call of this |
| 2217 | API the WLAN DAL will pack and send a Set BSS Key request |
| 2218 | message to the lower RIVA sub-system if DAL is in state |
| 2219 | STARTED. |
| 2220 | |
| 2221 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2222 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2223 | |
| 2224 | WDI_PostAssocReq must have been called. |
| 2225 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2226 | @param wdiSetBSSKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2227 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2228 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2229 | wdiSetBSSKeyRspCb: callback for passing back the |
| 2230 | response of the set BSS Key operation received from the |
| 2231 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2232 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2233 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2234 | callback |
| 2235 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | @see WDI_PostAssocReq |
| 2237 | @return Result of the function call |
| 2238 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2239 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2240 | WDI_SetBSSKeyReq |
| 2241 | ( |
| 2242 | WDI_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams, |
| 2243 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb, |
| 2244 | void* pUserData |
| 2245 | ) |
| 2246 | { |
| 2247 | WDI_EventInfoType wdiEventData; |
| 2248 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2249 | |
| 2250 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2251 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2252 | ------------------------------------------------------------------------*/ |
| 2253 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2254 | { |
| 2255 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2256 | "WDI API call before module is initialized - Fail request"); |
| 2257 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2258 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2259 | } |
| 2260 | |
| 2261 | /*------------------------------------------------------------------------ |
| 2262 | Fill in Event data and post to the Main FSM |
| 2263 | ------------------------------------------------------------------------*/ |
| 2264 | wdiEventData.wdiRequest = WDI_SET_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2265 | wdiEventData.pEventData = pwdiSetBSSKeyParams; |
| 2266 | wdiEventData.uEventDataSize = sizeof(*pwdiSetBSSKeyParams); |
| 2267 | wdiEventData.pCBfnc = wdiSetBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2268 | wdiEventData.pUserData = pUserData; |
| 2269 | |
| 2270 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2271 | |
| 2272 | }/*WDI_SetBSSKeyReq*/ |
| 2273 | |
| 2274 | /** |
| 2275 | @brief WDI_RemoveBSSKeyReq will be called when the upper MAC wants to |
| 2276 | uninstall a BSS key from HW. Upon the call of this API the |
| 2277 | WLAN DAL will pack and send a HAL Remove BSS Key request |
| 2278 | message to the lower RIVA sub-system if DAL is in state |
| 2279 | STARTED. |
| 2280 | |
| 2281 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2282 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | |
| 2284 | WDI_SetBSSKeyReq must have been called. |
| 2285 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2286 | @param wdiRemoveBSSKeyParams: the remove BSS key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2287 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2288 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2289 | wdiRemoveBSSKeyRspCb: callback for passing back the |
| 2290 | response of the remove BSS key operation received from |
| 2291 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2292 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2293 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2294 | callback |
| 2295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2296 | @see WDI_SetBSSKeyReq |
| 2297 | @return Result of the function call |
| 2298 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2299 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2300 | WDI_RemoveBSSKeyReq |
| 2301 | ( |
| 2302 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams, |
| 2303 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb, |
| 2304 | void* pUserData |
| 2305 | ) |
| 2306 | { |
| 2307 | WDI_EventInfoType wdiEventData; |
| 2308 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2309 | |
| 2310 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2311 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2312 | ------------------------------------------------------------------------*/ |
| 2313 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2314 | { |
| 2315 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2316 | "WDI API call before module is initialized - Fail request"); |
| 2317 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2318 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2319 | } |
| 2320 | |
| 2321 | /*------------------------------------------------------------------------ |
| 2322 | Fill in Event data and post to the Main FSM |
| 2323 | ------------------------------------------------------------------------*/ |
| 2324 | wdiEventData.wdiRequest = WDI_RMV_BSS_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2325 | wdiEventData.pEventData = pwdiRemoveBSSKeyParams; |
| 2326 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveBSSKeyParams); |
| 2327 | wdiEventData.pCBfnc = wdiRemoveBSSKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2328 | wdiEventData.pUserData = pUserData; |
| 2329 | |
| 2330 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2331 | |
| 2332 | }/*WDI_RemoveBSSKeyReq*/ |
| 2333 | |
| 2334 | |
| 2335 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2336 | @brief WDI_SetSTAKeyReq will be called when the upper MAC is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2337 | ready to install a STA(ast) encryption key in HW. Upon |
| 2338 | the call of this API the WLAN DAL will pack and send a |
| 2339 | HAL Set STA Key request message to the lower RIVA |
| 2340 | sub-system if DAL is in state STARTED. |
| 2341 | |
| 2342 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2343 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2344 | |
| 2345 | WDI_PostAssocReq must have been called. |
| 2346 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2347 | @param wdiSetSTAKeyParams: the set STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2348 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2349 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2350 | wdiSetSTAKeyRspCb: callback for passing back the |
| 2351 | response of the set STA key operation received from the |
| 2352 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2354 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2355 | callback |
| 2356 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2357 | @see WDI_PostAssocReq |
| 2358 | @return Result of the function call |
| 2359 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2360 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2361 | WDI_SetSTAKeyReq |
| 2362 | ( |
| 2363 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams, |
| 2364 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb, |
| 2365 | void* pUserData |
| 2366 | ) |
| 2367 | { |
| 2368 | WDI_EventInfoType wdiEventData; |
| 2369 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2370 | |
| 2371 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2372 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2373 | ------------------------------------------------------------------------*/ |
| 2374 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2375 | { |
| 2376 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2377 | "WDI API call before module is initialized - Fail request"); |
| 2378 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2379 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2380 | } |
| 2381 | |
| 2382 | /*------------------------------------------------------------------------ |
| 2383 | Fill in Event data and post to the Main FSM |
| 2384 | ------------------------------------------------------------------------*/ |
| 2385 | wdiEventData.wdiRequest = WDI_SET_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2386 | wdiEventData.pEventData = pwdiSetSTAKeyParams; |
| 2387 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTAKeyParams); |
| 2388 | wdiEventData.pCBfnc = wdiSetSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2389 | wdiEventData.pUserData = pUserData; |
| 2390 | |
| 2391 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2392 | |
| 2393 | }/*WDI_SetSTAKeyReq*/ |
| 2394 | |
| 2395 | |
| 2396 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2397 | @brief WDI_RemoveSTAKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2398 | wants to uninstall a previously set STA key in HW. Upon |
| 2399 | the call of this API the WLAN DAL will pack and send a |
| 2400 | HAL Remove STA Key request message to the lower RIVA |
| 2401 | sub-system if DAL is in state STARTED. |
| 2402 | |
| 2403 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2404 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2405 | |
| 2406 | WDI_SetSTAKeyReq must have been called. |
| 2407 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2408 | @param wdiRemoveSTAKeyParams: the remove STA key parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2409 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2410 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2411 | wdiRemoveSTAKeyRspCb: callback for passing back the |
| 2412 | response of the remove STA key operation received from |
| 2413 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2414 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2415 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2416 | callback |
| 2417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2418 | @see WDI_SetSTAKeyReq |
| 2419 | @return Result of the function call |
| 2420 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2421 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2422 | WDI_RemoveSTAKeyReq |
| 2423 | ( |
| 2424 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams, |
| 2425 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb, |
| 2426 | void* pUserData |
| 2427 | ) |
| 2428 | { |
| 2429 | WDI_EventInfoType wdiEventData; |
| 2430 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2431 | |
| 2432 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2433 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2434 | ------------------------------------------------------------------------*/ |
| 2435 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2436 | { |
| 2437 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2438 | "WDI API call before module is initialized - Fail request"); |
| 2439 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2440 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2441 | } |
| 2442 | |
| 2443 | /*------------------------------------------------------------------------ |
| 2444 | Fill in Event data and post to the Main FSM |
| 2445 | ------------------------------------------------------------------------*/ |
| 2446 | wdiEventData.wdiRequest = WDI_RMV_STA_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2447 | wdiEventData.pEventData = pwdiRemoveSTAKeyParams; |
| 2448 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTAKeyParams); |
| 2449 | wdiEventData.pCBfnc = wdiRemoveSTAKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2450 | wdiEventData.pUserData = pUserData; |
| 2451 | |
| 2452 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2453 | |
| 2454 | }/*WDI_RemoveSTAKeyReq*/ |
| 2455 | |
| 2456 | |
| 2457 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2458 | @brief WDI_SetSTABcastKeyReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2459 | wants to install a STA Bcast encryption key on the HW. |
| 2460 | Upon the call of this API the WLAN DAL will pack and |
| 2461 | send a HAL Start request message to the lower RIVA |
| 2462 | sub-system if DAL is in state STARTED. |
| 2463 | |
| 2464 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2465 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2466 | |
| 2467 | WDI_PostAssocReq must have been called. |
| 2468 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2469 | @param pwdiSetSTABcastKeyParams: the BSS Key set parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2470 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2471 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2472 | wdiSetSTABcastKeyRspCb: callback for passing back the |
| 2473 | response of the set BSS Key operation received from the |
| 2474 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2475 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2476 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2477 | callback |
| 2478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2479 | @see WDI_PostAssocReq |
| 2480 | @return Result of the function call |
| 2481 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2482 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2483 | WDI_SetSTABcastKeyReq |
| 2484 | ( |
| 2485 | WDI_SetSTAKeyReqParamsType* pwdiSetSTABcastKeyParams, |
| 2486 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb, |
| 2487 | void* pUserData |
| 2488 | ) |
| 2489 | |
| 2490 | { |
| 2491 | WDI_EventInfoType wdiEventData; |
| 2492 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2493 | |
| 2494 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2495 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | ------------------------------------------------------------------------*/ |
| 2497 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2498 | { |
| 2499 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2500 | "WDI API call before module is initialized - Fail request"); |
| 2501 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2502 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2503 | } |
| 2504 | |
| 2505 | /*------------------------------------------------------------------------ |
| 2506 | Fill in Event data and post to the Main FSM |
| 2507 | ------------------------------------------------------------------------*/ |
| 2508 | wdiEventData.wdiRequest = WDI_SET_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2509 | wdiEventData.pEventData = pwdiSetSTABcastKeyParams; |
| 2510 | wdiEventData.uEventDataSize = sizeof(*pwdiSetSTABcastKeyParams); |
| 2511 | wdiEventData.pCBfnc = wdiSetSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2512 | wdiEventData.pUserData = pUserData; |
| 2513 | |
| 2514 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2515 | |
| 2516 | }/*WDI_SetSTABcastKeyReq*/ |
| 2517 | |
| 2518 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2519 | @brief WDI_RemoveSTABcastKeyReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | MAC wants to uninstall a STA Bcast key from HW. Upon the |
| 2521 | call of this API the WLAN DAL will pack and send a HAL |
| 2522 | Remove STA Bcast Key request message to the lower RIVA |
| 2523 | sub-system if DAL is in state STARTED. |
| 2524 | |
| 2525 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2526 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2527 | |
| 2528 | WDI_SetSTABcastKeyReq must have been called. |
| 2529 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2530 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2531 | parameters as specified by the Device |
| 2532 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2533 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2534 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2535 | response of the remove STA Bcast key operation received |
| 2536 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2537 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2538 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2539 | callback |
| 2540 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2541 | @see WDI_SetSTABcastKeyReq |
| 2542 | @return Result of the function call |
| 2543 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2544 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2545 | WDI_RemoveSTABcastKeyReq |
| 2546 | ( |
| 2547 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams, |
| 2548 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb, |
| 2549 | void* pUserData |
| 2550 | ) |
| 2551 | { |
| 2552 | WDI_EventInfoType wdiEventData; |
| 2553 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2554 | |
| 2555 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2556 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2557 | ------------------------------------------------------------------------*/ |
| 2558 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2559 | { |
| 2560 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2561 | "WDI API call before module is initialized - Fail request"); |
| 2562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2563 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2564 | } |
| 2565 | |
| 2566 | /*------------------------------------------------------------------------ |
| 2567 | Fill in Event data and post to the Main FSM |
| 2568 | ------------------------------------------------------------------------*/ |
| 2569 | wdiEventData.wdiRequest = WDI_RMV_STA_BCAST_KEY_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2570 | wdiEventData.pEventData = pwdiRemoveSTABcastKeyParams; |
| 2571 | wdiEventData.uEventDataSize = sizeof(*pwdiRemoveSTABcastKeyParams); |
| 2572 | wdiEventData.pCBfnc = wdiRemoveSTABcastKeyRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2573 | wdiEventData.pUserData = pUserData; |
| 2574 | |
| 2575 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2576 | |
| 2577 | }/*WDI_RemoveSTABcastKeyReq*/ |
| 2578 | |
| 2579 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2580 | @brief WDI_SetMaxTxPowerReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2581 | MAC wants to set Max Tx Power to HW. Upon the |
| 2582 | call of this API the WLAN DAL will pack and send a HAL |
| 2583 | Remove STA Bcast Key request message to the lower RIVA |
| 2584 | sub-system if DAL is in state STARTED. |
| 2585 | |
| 2586 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2587 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2588 | |
| 2589 | WDI_SetSTABcastKeyReq must have been called. |
| 2590 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2591 | @param pwdiRemoveSTABcastKeyParams: the remove BSS key |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2592 | parameters as specified by the Device |
| 2593 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2594 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2595 | wdiRemoveSTABcastKeyRspCb: callback for passing back the |
| 2596 | response of the remove STA Bcast key operation received |
| 2597 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2598 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2599 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2600 | callback |
| 2601 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2602 | @see WDI_SetMaxTxPowerReq |
| 2603 | @return Result of the function call |
| 2604 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2605 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2606 | WDI_SetMaxTxPowerReq |
| 2607 | ( |
| 2608 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams, |
| 2609 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb, |
| 2610 | void* pUserData |
| 2611 | ) |
| 2612 | { |
| 2613 | WDI_EventInfoType wdiEventData; |
| 2614 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2615 | |
| 2616 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2617 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2618 | ------------------------------------------------------------------------*/ |
| 2619 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2620 | { |
| 2621 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2622 | "WDI API call before module is initialized - Fail request"); |
| 2623 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2624 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | } |
| 2626 | |
| 2627 | /*------------------------------------------------------------------------ |
| 2628 | Fill in Event data and post to the Main FSM |
| 2629 | ------------------------------------------------------------------------*/ |
| 2630 | wdiEventData.wdiRequest = WDI_SET_MAX_TX_POWER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2631 | wdiEventData.pEventData = pwdiSetMaxTxPowerParams; |
| 2632 | wdiEventData.uEventDataSize = sizeof(*pwdiSetMaxTxPowerParams); |
| 2633 | wdiEventData.pCBfnc = wdiReqStatusCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2634 | wdiEventData.pUserData = pUserData; |
| 2635 | |
| 2636 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2637 | } |
| 2638 | |
| 2639 | #ifdef FEATURE_WLAN_CCX |
| 2640 | WDI_Status |
| 2641 | WDI_TSMStatsReq |
| 2642 | ( |
| 2643 | WDI_TSMStatsReqParamsType* pwdiTsmReqParams, |
| 2644 | WDI_TsmRspCb wdiReqStatusCb, |
| 2645 | void* pUserData |
| 2646 | ) |
| 2647 | { |
| 2648 | WDI_EventInfoType wdiEventData; |
| 2649 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2650 | /*------------------------------------------------------------------------ |
| 2651 | Sanity Check |
| 2652 | ------------------------------------------------------------------------*/ |
| 2653 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2654 | { |
| 2655 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2656 | "WDI API call before module is initialized - Fail request"); |
| 2657 | |
| 2658 | return WDI_STATUS_E_NOT_ALLOWED; |
| 2659 | } |
| 2660 | |
| 2661 | /*------------------------------------------------------------------------ |
| 2662 | Fill in Event data and post to the Main FSM |
| 2663 | ------------------------------------------------------------------------*/ |
| 2664 | wdiEventData.wdiRequest = WDI_TSM_STATS_REQ; |
| 2665 | wdiEventData.pEventData = pwdiTsmReqParams; |
| 2666 | wdiEventData.uEventDataSize = sizeof(*pwdiTsmReqParams); |
| 2667 | wdiEventData.pCBfnc = wdiReqStatusCb; |
| 2668 | wdiEventData.pUserData = pUserData; |
| 2669 | |
| 2670 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2671 | |
| 2672 | } |
| 2673 | #endif |
| 2674 | |
| 2675 | /*======================================================================== |
| 2676 | |
| 2677 | QoS and BA APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2678 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2679 | ==========================================================================*/ |
| 2680 | |
| 2681 | /** |
| 2682 | @brief WDI_AddTSReq will be called when the upper MAC to inform |
| 2683 | the device of a successful add TSpec negotiation. HW |
| 2684 | needs to receive the TSpec Info from the UMAC in order |
| 2685 | to configure properly the QoS data traffic. Upon the |
| 2686 | call of this API the WLAN DAL will pack and send a HAL |
| 2687 | Add TS request message to the lower RIVA sub-system if |
| 2688 | DAL is in state STARTED. |
| 2689 | |
| 2690 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2691 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2692 | |
| 2693 | WDI_PostAssocReq must have been called. |
| 2694 | |
| 2695 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 2696 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2698 | wdiAddTsRspCb: callback for passing back the response of |
| 2699 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2700 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2701 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2702 | callback |
| 2703 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2704 | @see WDI_PostAssocReq |
| 2705 | @return Result of the function call |
| 2706 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2707 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2708 | WDI_AddTSReq |
| 2709 | ( |
| 2710 | WDI_AddTSReqParamsType* pwdiAddTsReqParams, |
| 2711 | WDI_AddTsRspCb wdiAddTsRspCb, |
| 2712 | void* pUserData |
| 2713 | ) |
| 2714 | { |
| 2715 | WDI_EventInfoType wdiEventData; |
| 2716 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2717 | |
| 2718 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2719 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2720 | ------------------------------------------------------------------------*/ |
| 2721 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2722 | { |
| 2723 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2724 | "WDI API call before module is initialized - Fail request"); |
| 2725 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2726 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2727 | } |
| 2728 | |
| 2729 | /*------------------------------------------------------------------------ |
| 2730 | Fill in Event data and post to the Main FSM |
| 2731 | ------------------------------------------------------------------------*/ |
| 2732 | wdiEventData.wdiRequest = WDI_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2733 | wdiEventData.pEventData = pwdiAddTsReqParams; |
| 2734 | wdiEventData.uEventDataSize = sizeof(*pwdiAddTsReqParams); |
| 2735 | wdiEventData.pCBfnc = wdiAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2736 | wdiEventData.pUserData = pUserData; |
| 2737 | |
| 2738 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2739 | |
| 2740 | }/*WDI_AddTSReq*/ |
| 2741 | |
| 2742 | |
| 2743 | |
| 2744 | /** |
| 2745 | @brief WDI_DelTSReq will be called when the upper MAC has ended |
| 2746 | admission on a specific AC. This is to inform HW that |
| 2747 | QoS traffic parameters must be rest. Upon the call of |
| 2748 | this API the WLAN DAL will pack and send a HAL Del TS |
| 2749 | request message to the lower RIVA sub-system if DAL is |
| 2750 | in state STARTED. |
| 2751 | |
| 2752 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2753 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2754 | |
| 2755 | WDI_AddTSReq must have been called. |
| 2756 | |
| 2757 | @param wdiDelTsReqParams: the del TS parameters as specified by |
| 2758 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2759 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2760 | wdiDelTsRspCb: callback for passing back the response of |
| 2761 | the del TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2762 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2763 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2764 | callback |
| 2765 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2766 | @see WDI_AddTSReq |
| 2767 | @return Result of the function call |
| 2768 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2769 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2770 | WDI_DelTSReq |
| 2771 | ( |
| 2772 | WDI_DelTSReqParamsType* pwdiDelTsReqParams, |
| 2773 | WDI_DelTsRspCb wdiDelTsRspCb, |
| 2774 | void* pUserData |
| 2775 | ) |
| 2776 | { |
| 2777 | WDI_EventInfoType wdiEventData; |
| 2778 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2779 | |
| 2780 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2781 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2782 | ------------------------------------------------------------------------*/ |
| 2783 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2784 | { |
| 2785 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2786 | "WDI API call before module is initialized - Fail request"); |
| 2787 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2788 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2789 | } |
| 2790 | |
| 2791 | /*------------------------------------------------------------------------ |
| 2792 | Fill in Event data and post to the Main FSM |
| 2793 | ------------------------------------------------------------------------*/ |
| 2794 | wdiEventData.wdiRequest = WDI_DEL_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2795 | wdiEventData.pEventData = pwdiDelTsReqParams; |
| 2796 | wdiEventData.uEventDataSize = sizeof(*pwdiDelTsReqParams); |
| 2797 | wdiEventData.pCBfnc = wdiDelTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2798 | wdiEventData.pUserData = pUserData; |
| 2799 | |
| 2800 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2801 | |
| 2802 | }/*WDI_DelTSReq*/ |
| 2803 | |
| 2804 | |
| 2805 | |
| 2806 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2807 | @brief WDI_UpdateEDCAParams will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2808 | wishes to update the EDCA parameters used by HW for QoS |
| 2809 | data traffic. Upon the call of this API the WLAN DAL |
| 2810 | will pack and send a HAL Update EDCA Params request |
| 2811 | message to the lower RIVA sub-system if DAL is in state |
| 2812 | STARTED. |
| 2813 | |
| 2814 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2815 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2816 | |
| 2817 | WDI_PostAssocReq must have been called. |
| 2818 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2819 | @param wdiUpdateEDCAParams: the start parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2820 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2821 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2822 | wdiUpdateEDCAParamsRspCb: callback for passing back the |
| 2823 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2825 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2826 | callback |
| 2827 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2828 | @see WDI_PostAssocReq |
| 2829 | @return Result of the function call |
| 2830 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2831 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2832 | WDI_UpdateEDCAParams |
| 2833 | ( |
| 2834 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams, |
| 2835 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb, |
| 2836 | void* pUserData |
| 2837 | ) |
| 2838 | { |
| 2839 | WDI_EventInfoType wdiEventData; |
| 2840 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2841 | |
| 2842 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2843 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2844 | ------------------------------------------------------------------------*/ |
| 2845 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2846 | { |
| 2847 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2848 | "WDI API call before module is initialized - Fail request"); |
| 2849 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2850 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2851 | } |
| 2852 | |
| 2853 | /*------------------------------------------------------------------------ |
| 2854 | Fill in Event data and post to the Main FSM |
| 2855 | ------------------------------------------------------------------------*/ |
| 2856 | wdiEventData.wdiRequest = WDI_UPD_EDCA_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2857 | wdiEventData.pEventData = pwdiUpdateEDCAParams; |
| 2858 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateEDCAParams); |
| 2859 | wdiEventData.pCBfnc = wdiUpdateEDCAParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2860 | wdiEventData.pUserData = pUserData; |
| 2861 | |
| 2862 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2863 | |
| 2864 | }/*WDI_UpdateEDCAParams*/ |
| 2865 | |
| 2866 | |
| 2867 | /** |
| 2868 | @brief WDI_AddBASessionReq will be called when the upper MAC has setup |
| 2869 | successfully a BA session and needs to notify the HW for |
| 2870 | the appropriate settings to take place. Upon the call of |
| 2871 | this API the WLAN DAL will pack and send a HAL Add BA |
| 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_PostAssocReq must have been called. |
| 2879 | |
| 2880 | @param wdiAddBAReqParams: the add BA 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 | wdiAddBARspCb: callback for passing back the response of |
| 2884 | the add BA 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_PostAssocReq |
| 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_AddBASessionReq |
| 2894 | ( |
| 2895 | WDI_AddBASessionReqParamsType* pwdiAddBASessionReqParams, |
| 2896 | WDI_AddBASessionRspCb wdiAddBASessionRspCb, |
| 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_ADD_BA_SESSION_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2918 | wdiEventData.pEventData = pwdiAddBASessionReqParams; |
| 2919 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBASessionReqParams); |
| 2920 | wdiEventData.pCBfnc = wdiAddBASessionRspCb; |
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_AddBASessionReq*/ |
| 2926 | |
| 2927 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2928 | @brief WDI_DelBAReq will be called when the upper MAC wants to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2929 | inform HW that it has deleted a previously created BA |
| 2930 | session. Upon the call of this API the WLAN DAL will |
| 2931 | pack and send a HAL Del BA request message to the lower |
| 2932 | RIVA sub-system if DAL is in state STARTED. |
| 2933 | |
| 2934 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2935 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2936 | |
| 2937 | WDI_AddBAReq must have been called. |
| 2938 | |
| 2939 | @param wdiDelBAReqParams: the del BA parameters as specified by |
| 2940 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2941 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2942 | wdiDelBARspCb: callback for passing back the response of |
| 2943 | the del BA operation received from the device |
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 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2946 | callback |
| 2947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2948 | @see WDI_AddBAReq |
| 2949 | @return Result of the function call |
| 2950 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2951 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2952 | WDI_DelBAReq |
| 2953 | ( |
| 2954 | WDI_DelBAReqParamsType* pwdiDelBAReqParams, |
| 2955 | WDI_DelBARspCb wdiDelBARspCb, |
| 2956 | void* pUserData |
| 2957 | ) |
| 2958 | { |
| 2959 | WDI_EventInfoType wdiEventData; |
| 2960 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 2961 | |
| 2962 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2963 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2964 | ------------------------------------------------------------------------*/ |
| 2965 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 2966 | { |
| 2967 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 2968 | "WDI API call before module is initialized - Fail request"); |
| 2969 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2970 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2971 | } |
| 2972 | |
| 2973 | /*------------------------------------------------------------------------ |
| 2974 | Fill in Event data and post to the Main FSM |
| 2975 | ------------------------------------------------------------------------*/ |
| 2976 | wdiEventData.wdiRequest = WDI_DEL_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2977 | wdiEventData.pEventData = pwdiDelBAReqParams; |
| 2978 | wdiEventData.uEventDataSize = sizeof(*pwdiDelBAReqParams); |
| 2979 | wdiEventData.pCBfnc = wdiDelBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2980 | wdiEventData.pUserData = pUserData; |
| 2981 | |
| 2982 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 2983 | |
| 2984 | }/*WDI_DelBAReq*/ |
| 2985 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2986 | /*======================================================================== |
| 2987 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2988 | Power Save APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2989 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2990 | ==========================================================================*/ |
| 2991 | |
| 2992 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2993 | @brief WDI_SetPwrSaveCfgReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2994 | wants to set the power save related configurations of |
| 2995 | the WLAN Device. Upon the call of this API the WLAN DAL |
| 2996 | will pack and send a HAL Update CFG request message to |
| 2997 | the lower RIVA sub-system if DAL is in state STARTED. |
| 2998 | |
| 2999 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3000 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3001 | |
| 3002 | WDI_Start must have been called. |
| 3003 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3004 | @param pwdiPowerSaveCfg: the power save cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3005 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3006 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3007 | wdiSetPwrSaveCfgCb: callback for passing back the |
| 3008 | response of the set power save cfg operation received |
| 3009 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3010 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3011 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3012 | callback |
| 3013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3014 | @see WDI_Start |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3015 | @return Result of the function call |
| 3016 | */ |
| 3017 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3018 | WDI_SetPwrSaveCfgReq |
| 3019 | ( |
| 3020 | WDI_UpdateCfgReqParamsType* pwdiPowerSaveCfg, |
| 3021 | WDI_SetPwrSaveCfgCb wdiSetPwrSaveCfgCb, |
| 3022 | void* pUserData |
| 3023 | ) |
| 3024 | { |
| 3025 | WDI_EventInfoType wdiEventData; |
| 3026 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3027 | |
| 3028 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3029 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3030 | ------------------------------------------------------------------------*/ |
| 3031 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3032 | { |
| 3033 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3034 | "WDI API call before module is initialized - Fail request"); |
| 3035 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3036 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3037 | } |
| 3038 | |
| 3039 | /*------------------------------------------------------------------------ |
| 3040 | Fill in Event data and post to the Main FSM |
| 3041 | ------------------------------------------------------------------------*/ |
| 3042 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3043 | wdiEventData.pEventData = pwdiPowerSaveCfg; |
| 3044 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerSaveCfg); |
| 3045 | wdiEventData.pCBfnc = wdiSetPwrSaveCfgCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3046 | wdiEventData.pUserData = pUserData; |
| 3047 | |
| 3048 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3049 | |
| 3050 | }/*WDI_SetPwrSaveCfgReq*/ |
| 3051 | |
| 3052 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3053 | @brief WDI_EnterImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3054 | request the device to get into IMPS power state. Upon |
| 3055 | the call of this API the WLAN DAL will send a HAL Enter |
| 3056 | IMPS request message to the lower RIVA sub-system if DAL |
| 3057 | is in state STARTED. |
| 3058 | |
| 3059 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3060 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3061 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3062 | |
| 3063 | @param wdiEnterImpsRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3064 | response of the Enter IMPS operation received from the |
| 3065 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3066 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3067 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3068 | callback |
| 3069 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3070 | @see WDI_Start |
| 3071 | @return Result of the function call |
| 3072 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3073 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3074 | WDI_EnterImpsReq |
| 3075 | ( |
| 3076 | WDI_EnterImpsRspCb wdiEnterImpsRspCb, |
| 3077 | void* pUserData |
| 3078 | ) |
| 3079 | { |
| 3080 | WDI_EventInfoType wdiEventData; |
| 3081 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3082 | |
| 3083 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3084 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3085 | ------------------------------------------------------------------------*/ |
| 3086 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3087 | { |
| 3088 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3089 | "WDI API call before module is initialized - Fail request"); |
| 3090 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3091 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3092 | } |
| 3093 | |
| 3094 | /*------------------------------------------------------------------------ |
| 3095 | Fill in Event data and post to the Main FSM |
| 3096 | ------------------------------------------------------------------------*/ |
| 3097 | wdiEventData.wdiRequest = WDI_ENTER_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3098 | wdiEventData.pEventData = NULL; |
| 3099 | wdiEventData.uEventDataSize = 0; |
| 3100 | wdiEventData.pCBfnc = wdiEnterImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3101 | wdiEventData.pUserData = pUserData; |
| 3102 | |
| 3103 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3104 | |
| 3105 | }/*WDI_EnterImpsReq*/ |
| 3106 | |
| 3107 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3108 | @brief WDI_ExitImpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3109 | request the device to get out of IMPS power state. Upon |
| 3110 | the call of this API the WLAN DAL will send a HAL Exit |
| 3111 | IMPS request message to the lower RIVA sub-system if DAL |
| 3112 | is in state STARTED. |
| 3113 | |
| 3114 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3115 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3116 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3117 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3118 | |
| 3119 | @param wdiExitImpsRspCb: callback for passing back the response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3120 | of the Exit IMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3121 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3122 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3123 | callback |
| 3124 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3125 | @see WDI_Start |
| 3126 | @return Result of the function call |
| 3127 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3128 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3129 | WDI_ExitImpsReq |
| 3130 | ( |
| 3131 | WDI_ExitImpsRspCb wdiExitImpsRspCb, |
| 3132 | void* pUserData |
| 3133 | ) |
| 3134 | { |
| 3135 | WDI_EventInfoType wdiEventData; |
| 3136 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3137 | |
| 3138 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3139 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3140 | ------------------------------------------------------------------------*/ |
| 3141 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3142 | { |
| 3143 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3144 | "WDI API call before module is initialized - Fail request"); |
| 3145 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3146 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3147 | } |
| 3148 | |
| 3149 | /*------------------------------------------------------------------------ |
| 3150 | Fill in Event data and post to the Main FSM |
| 3151 | ------------------------------------------------------------------------*/ |
| 3152 | wdiEventData.wdiRequest = WDI_EXIT_IMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3153 | wdiEventData.pEventData = NULL; |
| 3154 | wdiEventData.uEventDataSize = 0; |
| 3155 | wdiEventData.pCBfnc = wdiExitImpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3156 | wdiEventData.pUserData = pUserData; |
| 3157 | |
| 3158 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3159 | |
| 3160 | }/*WDI_ExitImpsReq*/ |
| 3161 | |
| 3162 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3163 | @brief WDI_EnterBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3164 | request the device to get into BMPS power state. Upon |
| 3165 | the call of this API the WLAN DAL will pack and send a |
| 3166 | HAL Enter BMPS request message to the lower RIVA |
| 3167 | sub-system if DAL is in state STARTED. |
| 3168 | |
| 3169 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3170 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3171 | |
| 3172 | WDI_PostAssocReq must have been called. |
| 3173 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3174 | @param pwdiEnterBmpsReqParams: the Enter BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3175 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3177 | wdiEnterBmpsRspCb: callback for passing back the |
| 3178 | response of the Enter BMPS operation received from the |
| 3179 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3181 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3182 | callback |
| 3183 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3184 | @see WDI_PostAssocReq |
| 3185 | @return Result of the function call |
| 3186 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3187 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3188 | WDI_EnterBmpsReq |
| 3189 | ( |
| 3190 | WDI_EnterBmpsReqParamsType *pwdiEnterBmpsReqParams, |
| 3191 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb, |
| 3192 | void* pUserData |
| 3193 | ) |
| 3194 | { |
| 3195 | WDI_EventInfoType wdiEventData; |
| 3196 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3197 | |
| 3198 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3199 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3200 | ------------------------------------------------------------------------*/ |
| 3201 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3202 | { |
| 3203 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3204 | "WDI API call before module is initialized - Fail request"); |
| 3205 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3206 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3207 | } |
| 3208 | |
| 3209 | /*------------------------------------------------------------------------ |
| 3210 | Fill in Event data and post to the Main FSM |
| 3211 | ------------------------------------------------------------------------*/ |
| 3212 | wdiEventData.wdiRequest = WDI_ENTER_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3213 | wdiEventData.pEventData = pwdiEnterBmpsReqParams; |
| 3214 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterBmpsReqParams); |
| 3215 | wdiEventData.pCBfnc = wdiEnterBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3216 | wdiEventData.pUserData = pUserData; |
| 3217 | |
| 3218 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3219 | |
| 3220 | }/*WDI_EnterBmpsReq*/ |
| 3221 | |
| 3222 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3223 | @brief WDI_ExitBmpsReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3224 | request the device to get out of BMPS power state. Upon |
| 3225 | the call of this API the WLAN DAL will pack and send a |
| 3226 | HAL Exit BMPS request message to the lower RIVA |
| 3227 | sub-system if DAL is in state STARTED. |
| 3228 | |
| 3229 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3230 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3231 | |
| 3232 | WDI_PostAssocReq must have been called. |
| 3233 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3234 | @param pwdiExitBmpsReqParams: the Exit BMPS parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3235 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3236 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3237 | wdiExitBmpsRspCb: callback for passing back the response |
| 3238 | of the Exit BMPS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3240 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3241 | callback |
| 3242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3243 | @see WDI_PostAssocReq |
| 3244 | @return Result of the function call |
| 3245 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3246 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3247 | WDI_ExitBmpsReq |
| 3248 | ( |
| 3249 | WDI_ExitBmpsReqParamsType *pwdiExitBmpsReqParams, |
| 3250 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb, |
| 3251 | void* pUserData |
| 3252 | ) |
| 3253 | { |
| 3254 | WDI_EventInfoType wdiEventData; |
| 3255 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3256 | |
| 3257 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3258 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3259 | ------------------------------------------------------------------------*/ |
| 3260 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3261 | { |
| 3262 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3263 | "WDI API call before module is initialized - Fail request"); |
| 3264 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3265 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3266 | } |
| 3267 | |
| 3268 | /*------------------------------------------------------------------------ |
| 3269 | Fill in Event data and post to the Main FSM |
| 3270 | ------------------------------------------------------------------------*/ |
| 3271 | wdiEventData.wdiRequest = WDI_EXIT_BMPS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3272 | wdiEventData.pEventData = pwdiExitBmpsReqParams; |
| 3273 | wdiEventData.uEventDataSize = sizeof(*pwdiExitBmpsReqParams); |
| 3274 | wdiEventData.pCBfnc = wdiExitBmpsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3275 | wdiEventData.pUserData = pUserData; |
| 3276 | |
| 3277 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3278 | |
| 3279 | }/*WDI_ExitBmpsReq*/ |
| 3280 | |
| 3281 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3282 | @brief WDI_EnterUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3283 | request the device to get into UAPSD power state. Upon |
| 3284 | the call of this API the WLAN DAL will pack and send a |
| 3285 | HAL Enter UAPSD request message to the lower RIVA |
| 3286 | sub-system if DAL is in state STARTED. |
| 3287 | |
| 3288 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3289 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3290 | |
| 3291 | WDI_PostAssocReq must have been called. |
| 3292 | WDI_SetUapsdAcParamsReq must have been called. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3293 | |
| 3294 | @param pwdiEnterUapsdReqParams: the Enter UAPSD parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3295 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3296 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3297 | wdiEnterUapsdRspCb: callback for passing back the |
| 3298 | response of the Enter UAPSD operation received from the |
| 3299 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3300 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3301 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3302 | callback |
| 3303 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3304 | @see WDI_PostAssocReq, WDI_SetUapsdAcParamsReq |
| 3305 | @return Result of the function call |
| 3306 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3307 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3308 | WDI_EnterUapsdReq |
| 3309 | ( |
| 3310 | WDI_EnterUapsdReqParamsType *pwdiEnterUapsdReqParams, |
| 3311 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb, |
| 3312 | void* pUserData |
| 3313 | ) |
| 3314 | { |
| 3315 | WDI_EventInfoType wdiEventData; |
| 3316 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3317 | |
| 3318 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3319 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3320 | ------------------------------------------------------------------------*/ |
| 3321 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3322 | { |
| 3323 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3324 | "WDI API call before module is initialized - Fail request"); |
| 3325 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3326 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3327 | } |
| 3328 | |
| 3329 | /*------------------------------------------------------------------------ |
| 3330 | Fill in Event data and post to the Main FSM |
| 3331 | ------------------------------------------------------------------------*/ |
| 3332 | wdiEventData.wdiRequest = WDI_ENTER_UAPSD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3333 | wdiEventData.pEventData = pwdiEnterUapsdReqParams; |
| 3334 | wdiEventData.uEventDataSize = sizeof(*pwdiEnterUapsdReqParams); |
| 3335 | wdiEventData.pCBfnc = wdiEnterUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3336 | wdiEventData.pUserData = pUserData; |
| 3337 | |
| 3338 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3339 | |
| 3340 | }/*WDI_EnterUapsdReq*/ |
| 3341 | |
| 3342 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3343 | @brief WDI_ExitUapsdReq will be called when the upper MAC to |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | request the device to get out of UAPSD power state. Upon |
| 3345 | the call of this API the WLAN DAL will send a HAL Exit |
| 3346 | UAPSD request message to the lower RIVA sub-system if |
| 3347 | DAL is in state STARTED. |
| 3348 | |
| 3349 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3350 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3351 | |
| 3352 | WDI_PostAssocReq must have been called. |
| 3353 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3354 | @param wdiExitUapsdRspCb: callback for passing back the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3355 | response of the Exit UAPSD operation received from the |
| 3356 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3357 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3358 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3359 | callback |
| 3360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3361 | @see WDI_PostAssocReq |
| 3362 | @return Result of the function call |
| 3363 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3364 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3365 | WDI_ExitUapsdReq |
| 3366 | ( |
| 3367 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb, |
| 3368 | void* pUserData |
| 3369 | ) |
| 3370 | { |
| 3371 | WDI_EventInfoType wdiEventData; |
| 3372 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3373 | |
| 3374 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3375 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3376 | ------------------------------------------------------------------------*/ |
| 3377 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3378 | { |
| 3379 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3380 | "WDI API call before module is initialized - Fail request"); |
| 3381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3382 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3383 | } |
| 3384 | |
| 3385 | /*------------------------------------------------------------------------ |
| 3386 | Fill in Event data and post to the Main FSM |
| 3387 | ------------------------------------------------------------------------*/ |
| 3388 | wdiEventData.wdiRequest = WDI_EXIT_UAPSD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3389 | wdiEventData.pEventData = NULL; |
| 3390 | wdiEventData.uEventDataSize = 0; |
| 3391 | wdiEventData.pCBfnc = wdiExitUapsdRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3392 | wdiEventData.pUserData = pUserData; |
| 3393 | |
| 3394 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3395 | |
| 3396 | }/*WDI_ExitUapsdReq*/ |
| 3397 | |
| 3398 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3399 | @brief WDI_UpdateUapsdParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3400 | MAC wants to set the UAPSD related configurations |
| 3401 | of an associated STA (while acting as an AP) to the WLAN |
| 3402 | Device. Upon the call of this API the WLAN DAL will pack |
| 3403 | and send a HAL Update UAPSD params request message to |
| 3404 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3405 | |
| 3406 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3407 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3408 | |
| 3409 | WDI_ConfigBSSReq must have been called. |
| 3410 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3411 | @param pwdiUpdateUapsdReqParams: the UAPSD parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3412 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3413 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3414 | wdiUpdateUapsdParamsCb: callback for passing back the |
| 3415 | response of the update UAPSD params operation received |
| 3416 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3418 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3419 | callback |
| 3420 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3421 | @see WDI_ConfigBSSReq |
| 3422 | @return Result of the function call |
| 3423 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3424 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3425 | WDI_UpdateUapsdParamsReq |
| 3426 | ( |
| 3427 | WDI_UpdateUapsdReqParamsType *pwdiUpdateUapsdReqParams, |
| 3428 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb, |
| 3429 | void* pUserData |
| 3430 | ) |
| 3431 | { |
| 3432 | WDI_EventInfoType wdiEventData; |
| 3433 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3434 | |
| 3435 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3436 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3437 | ------------------------------------------------------------------------*/ |
| 3438 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3439 | { |
| 3440 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3441 | "WDI API call before module is initialized - Fail request"); |
| 3442 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3443 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3444 | } |
| 3445 | |
| 3446 | /*------------------------------------------------------------------------ |
| 3447 | Fill in Event data and post to the Main FSM |
| 3448 | ------------------------------------------------------------------------*/ |
| 3449 | wdiEventData.wdiRequest = WDI_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3450 | wdiEventData.pEventData = pwdiUpdateUapsdReqParams; |
| 3451 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateUapsdReqParams);; |
| 3452 | wdiEventData.pCBfnc = wdiUpdateUapsdParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3453 | wdiEventData.pUserData = pUserData; |
| 3454 | |
| 3455 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3456 | |
| 3457 | }/*WDI_UpdateUapsdParamsReq*/ |
| 3458 | |
| 3459 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3460 | @brief WDI_SetUapsdAcParamsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3461 | MAC wants to set the UAPSD related configurations before |
| 3462 | requesting for enter UAPSD power state to the WLAN |
| 3463 | Device. Upon the call of this API the WLAN DAL will pack |
| 3464 | and send a HAL Set UAPSD params request message to |
| 3465 | the lower RIVA sub-system if DAL is in state STARTED. |
| 3466 | |
| 3467 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3468 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3469 | |
| 3470 | WDI_PostAssocReq must have been called. |
| 3471 | |
| 3472 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3473 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3474 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3475 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3476 | response of the set UAPSD params operation received from |
| 3477 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3478 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3479 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3480 | callback |
| 3481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3482 | @see WDI_PostAssocReq |
| 3483 | @return Result of the function call |
| 3484 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3485 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3486 | WDI_SetUapsdAcParamsReq |
| 3487 | ( |
| 3488 | WDI_SetUapsdAcParamsReqParamsType* pwdiUapsdInfo, |
| 3489 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb, |
| 3490 | void* pUserData |
| 3491 | ) |
| 3492 | { |
| 3493 | WDI_EventInfoType wdiEventData; |
| 3494 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3495 | |
| 3496 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3497 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3498 | ------------------------------------------------------------------------*/ |
| 3499 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3500 | { |
| 3501 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3502 | "WDI API call before module is initialized - Fail request"); |
| 3503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3504 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3505 | } |
| 3506 | |
| 3507 | /*------------------------------------------------------------------------ |
| 3508 | Fill in Event data and post to the Main FSM |
| 3509 | ------------------------------------------------------------------------*/ |
| 3510 | wdiEventData.wdiRequest = WDI_SET_UAPSD_PARAM_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3511 | wdiEventData.pEventData = pwdiUapsdInfo; |
| 3512 | wdiEventData.uEventDataSize = sizeof(*pwdiUapsdInfo); |
| 3513 | wdiEventData.pCBfnc = wdiSetUapsdAcParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3514 | wdiEventData.pUserData = pUserData; |
| 3515 | |
| 3516 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3517 | |
| 3518 | }/*WDI_SetUapsdAcParamsReq*/ |
| 3519 | |
| 3520 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3521 | @brief WDI_ConfigureRxpFilterReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3522 | MAC wants to set/reset the RXP filters for received pkts |
| 3523 | (MC, BC etc.). Upon the call of this API the WLAN DAL will pack |
| 3524 | and send a HAL configure RXP filter request message to |
| 3525 | the lower RIVA sub-system. |
| 3526 | |
| 3527 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3528 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3529 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3530 | |
| 3531 | @param pwdiConfigureRxpFilterReqParams: the RXP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3532 | filter as specified by the Device |
| 3533 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3535 | wdiConfigureRxpFilterCb: callback for passing back the |
| 3536 | response of the configure RXP filter operation received |
| 3537 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3538 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3539 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3540 | callback |
| 3541 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3542 | @return Result of the function call |
| 3543 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3544 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3545 | WDI_ConfigureRxpFilterReq |
| 3546 | ( |
| 3547 | WDI_ConfigureRxpFilterReqParamsType *pwdiConfigureRxpFilterReqParams, |
| 3548 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb, |
| 3549 | void* pUserData |
| 3550 | ) |
| 3551 | { |
| 3552 | WDI_EventInfoType wdiEventData; |
| 3553 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3554 | |
| 3555 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3556 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3557 | ------------------------------------------------------------------------*/ |
| 3558 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3559 | { |
| 3560 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3561 | "WDI API call before module is initialized - Fail request"); |
| 3562 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3563 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3564 | } |
| 3565 | |
| 3566 | /*------------------------------------------------------------------------ |
| 3567 | Fill in Event data and post to the Main FSM |
| 3568 | ------------------------------------------------------------------------*/ |
| 3569 | wdiEventData.wdiRequest = WDI_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3570 | wdiEventData.pEventData = pwdiConfigureRxpFilterReqParams; |
| 3571 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureRxpFilterReqParams); |
| 3572 | wdiEventData.pCBfnc = wdiConfigureRxpFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3573 | wdiEventData.pUserData = pUserData; |
| 3574 | |
| 3575 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3576 | }/*WDI_ConfigureRxpFilterReq*/ |
| 3577 | |
| 3578 | /** |
| 3579 | @brief WDI_SetBeaconFilterReq will be called when the upper MAC |
| 3580 | wants to set the beacon filters while in power save. |
| 3581 | Upon the call of this API the WLAN DAL will pack and |
| 3582 | send a Beacon filter request message to the |
| 3583 | lower RIVA sub-system. |
| 3584 | |
| 3585 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3586 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3588 | |
| 3589 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3590 | filter as specified by the Device |
| 3591 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3593 | wdiBeaconFilterCb: callback for passing back the |
| 3594 | response of the set beacon filter operation received |
| 3595 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3596 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3597 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3598 | callback |
| 3599 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3600 | @return Result of the function call |
| 3601 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3602 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3603 | WDI_SetBeaconFilterReq |
| 3604 | ( |
| 3605 | WDI_BeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3606 | WDI_SetBeaconFilterCb wdiBeaconFilterCb, |
| 3607 | void* pUserData |
| 3608 | ) |
| 3609 | { |
| 3610 | WDI_EventInfoType wdiEventData; |
| 3611 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3612 | |
| 3613 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3614 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3615 | ------------------------------------------------------------------------*/ |
| 3616 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3617 | { |
| 3618 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3619 | "WDI API call before module is initialized - Fail request"); |
| 3620 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3621 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3622 | } |
| 3623 | |
| 3624 | /*------------------------------------------------------------------------ |
| 3625 | Fill in Event data and post to the Main FSM |
| 3626 | ------------------------------------------------------------------------*/ |
| 3627 | wdiEventData.wdiRequest = WDI_SET_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3628 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
| 3629 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);; |
| 3630 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3631 | wdiEventData.pUserData = pUserData; |
| 3632 | |
| 3633 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3634 | }/*WDI_SetBeaconFilterReq*/ |
| 3635 | |
| 3636 | /** |
| 3637 | @brief WDI_RemBeaconFilterReq will be called when the upper MAC |
| 3638 | wants to remove the beacon filter for particular IE |
| 3639 | while in power save. Upon the call of this API the WLAN |
| 3640 | DAL will pack and send a remove Beacon filter request |
| 3641 | message to the lower RIVA sub-system. |
| 3642 | |
| 3643 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3644 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3645 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3646 | |
| 3647 | @param pwdiBeaconFilterReqParams: the beacon |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3648 | filter as specified by the Device |
| 3649 | Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3650 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3651 | wdiBeaconFilterCb: callback for passing back the |
| 3652 | response of the remove beacon filter operation received |
| 3653 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3654 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3655 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3656 | callback |
| 3657 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3658 | @return Result of the function call |
| 3659 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3660 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3661 | WDI_RemBeaconFilterReq |
| 3662 | ( |
| 3663 | WDI_RemBeaconFilterReqParamsType *pwdiBeaconFilterReqParams, |
| 3664 | WDI_RemBeaconFilterCb wdiBeaconFilterCb, |
| 3665 | void* pUserData |
| 3666 | ) |
| 3667 | { |
| 3668 | WDI_EventInfoType wdiEventData; |
| 3669 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3670 | |
| 3671 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3672 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3673 | ------------------------------------------------------------------------*/ |
| 3674 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3675 | { |
| 3676 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3677 | "WDI API call before module is initialized - Fail request"); |
| 3678 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3679 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3680 | } |
| 3681 | |
| 3682 | /*------------------------------------------------------------------------ |
| 3683 | Fill in Event data and post to the Main FSM |
| 3684 | ------------------------------------------------------------------------*/ |
| 3685 | wdiEventData.wdiRequest = WDI_REM_BEACON_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3686 | wdiEventData.pEventData = pwdiBeaconFilterReqParams; |
| 3687 | wdiEventData.uEventDataSize = sizeof(*pwdiBeaconFilterReqParams);; |
| 3688 | wdiEventData.pCBfnc = wdiBeaconFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3689 | wdiEventData.pUserData = pUserData; |
| 3690 | |
| 3691 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3692 | }/*WDI_RemBeaconFilterReq*/ |
| 3693 | |
| 3694 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3695 | @brief WDI_SetRSSIThresholdsReq will be called when the upper |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3696 | MAC wants to set the RSSI thresholds related |
| 3697 | configurations while in power save. Upon the call of |
| 3698 | this API the WLAN DAL will pack and send a HAL Set RSSI |
| 3699 | thresholds request message to the lower RIVA |
| 3700 | sub-system if DAL is in state STARTED. |
| 3701 | |
| 3702 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3703 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3704 | |
| 3705 | WDI_PostAssocReq must have been called. |
| 3706 | |
| 3707 | @param pwdiUapsdInfo: the UAPSD parameters as specified by |
| 3708 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3709 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3710 | wdiSetUapsdAcParamsCb: callback for passing back the |
| 3711 | response of the set UAPSD params operation received from |
| 3712 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3713 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3714 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3715 | callback |
| 3716 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3717 | @see WDI_PostAssocReq |
| 3718 | @return Result of the function call |
| 3719 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3720 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3721 | WDI_SetRSSIThresholdsReq |
| 3722 | ( |
| 3723 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams, |
| 3724 | WDI_SetRSSIThresholdsCb wdiSetRSSIThresholdsCb, |
| 3725 | void* pUserData |
| 3726 | ) |
| 3727 | { |
| 3728 | WDI_EventInfoType wdiEventData; |
| 3729 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3730 | |
| 3731 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3732 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3733 | ------------------------------------------------------------------------*/ |
| 3734 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3735 | { |
| 3736 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3737 | "WDI API call before module is initialized - Fail request"); |
| 3738 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3739 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3740 | } |
| 3741 | |
| 3742 | /*------------------------------------------------------------------------ |
| 3743 | Fill in Event data and post to the Main FSM |
| 3744 | ------------------------------------------------------------------------*/ |
| 3745 | wdiEventData.wdiRequest = WDI_SET_RSSI_THRESHOLDS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3746 | wdiEventData.pEventData = pwdiRSSIThresholdsParams; |
| 3747 | wdiEventData.uEventDataSize = sizeof(*pwdiRSSIThresholdsParams);; |
| 3748 | wdiEventData.pCBfnc = wdiSetRSSIThresholdsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3749 | wdiEventData.pUserData = pUserData; |
| 3750 | |
| 3751 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3752 | }/* WDI_SetRSSIThresholdsReq*/ |
| 3753 | |
| 3754 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3755 | @brief WDI_HostOffloadReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3756 | wants to set the filter to minimize unnecessary host |
| 3757 | wakeup due to broadcast traffic while in power save. |
| 3758 | Upon the call of this API the WLAN DAL will pack and |
| 3759 | send a HAL host offload request message to the |
| 3760 | lower RIVA sub-system if DAL is in state STARTED. |
| 3761 | |
| 3762 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3763 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3764 | |
| 3765 | WDI_PostAssocReq must have been called. |
| 3766 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3767 | @param pwdiHostOffloadParams: the host offload as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3768 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3769 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3770 | wdiHostOffloadCb: callback for passing back the response |
| 3771 | of the host offload operation received from the |
| 3772 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3773 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3774 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3775 | callback |
| 3776 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3777 | @see WDI_PostAssocReq |
| 3778 | @return Result of the function call |
| 3779 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3780 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3781 | WDI_HostOffloadReq |
| 3782 | ( |
| 3783 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams, |
| 3784 | WDI_HostOffloadCb wdiHostOffloadCb, |
| 3785 | void* pUserData |
| 3786 | ) |
| 3787 | { |
| 3788 | WDI_EventInfoType wdiEventData; |
| 3789 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3790 | |
| 3791 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3792 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3793 | ------------------------------------------------------------------------*/ |
| 3794 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3795 | { |
| 3796 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3797 | "WDI API call before module is initialized - Fail request"); |
| 3798 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3799 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3800 | } |
| 3801 | |
| 3802 | /*------------------------------------------------------------------------ |
| 3803 | Fill in Event data and post to the Main FSM |
| 3804 | ------------------------------------------------------------------------*/ |
| 3805 | wdiEventData.wdiRequest = WDI_HOST_OFFLOAD_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3806 | wdiEventData.pEventData = pwdiHostOffloadParams; |
| 3807 | wdiEventData.uEventDataSize = sizeof(*pwdiHostOffloadParams);; |
| 3808 | wdiEventData.pCBfnc = wdiHostOffloadCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3809 | wdiEventData.pUserData = pUserData; |
| 3810 | |
| 3811 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3812 | }/*WDI_HostOffloadReq*/ |
| 3813 | |
| 3814 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3815 | @brief WDI_KeepAliveReq will be called when the upper MAC |
| 3816 | wants to set the filter to send NULL or unsolicited ARP responses |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3817 | and minimize unnecessary host wakeups due to while in power save. |
| 3818 | Upon the call of this API the WLAN DAL will pack and |
| 3819 | send a HAL Keep Alive request message to the |
| 3820 | lower RIVA sub-system if DAL is in state STARTED. |
| 3821 | |
| 3822 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3823 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3824 | |
| 3825 | WDI_PostAssocReq must have been called. |
| 3826 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3827 | @param pwdiKeepAliveParams: the Keep Alive as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3828 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3830 | wdiKeepAliveCb: callback for passing back the response |
| 3831 | of the Keep Alive operation received from the |
| 3832 | device |
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 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3835 | callback |
| 3836 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3837 | @see WDI_PostAssocReq |
| 3838 | @return Result of the function call |
| 3839 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3840 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3841 | WDI_KeepAliveReq |
| 3842 | ( |
| 3843 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams, |
| 3844 | WDI_KeepAliveCb wdiKeepAliveCb, |
| 3845 | void* pUserData |
| 3846 | ) |
| 3847 | { |
| 3848 | WDI_EventInfoType wdiEventData; |
| 3849 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3850 | |
| 3851 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3852 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3853 | ------------------------------------------------------------------------*/ |
| 3854 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3855 | { |
| 3856 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3857 | "WDI_KeepAliveReq: WDI API call before module " |
| 3858 | "is initialized - Fail request"); |
| 3859 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3860 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3861 | } |
| 3862 | |
| 3863 | /*------------------------------------------------------------------------ |
| 3864 | Fill in Event data and post to the Main FSM |
| 3865 | ------------------------------------------------------------------------*/ |
| 3866 | wdiEventData.wdiRequest = WDI_KEEP_ALIVE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3867 | wdiEventData.pEventData = pwdiKeepAliveParams; |
| 3868 | wdiEventData.uEventDataSize = sizeof(*pwdiKeepAliveParams); |
| 3869 | wdiEventData.pCBfnc = wdiKeepAliveCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3870 | wdiEventData.pUserData = pUserData; |
| 3871 | |
| 3872 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3873 | }/*WDI_KeepAliveReq*/ |
| 3874 | |
| 3875 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3876 | @brief WDI_WowlAddBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3877 | wants to set the Wowl Bcast ptrn to minimize unnecessary |
| 3878 | host wakeup due to broadcast traffic while in power |
| 3879 | save. Upon the call of this API the WLAN DAL will pack |
| 3880 | and send a HAL Wowl Bcast ptrn request message to the |
| 3881 | lower RIVA sub-system if DAL is in state STARTED. |
| 3882 | |
| 3883 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3884 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3885 | |
| 3886 | WDI_PostAssocReq must have been called. |
| 3887 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3888 | @param pwdiWowlAddBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3889 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3890 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3891 | wdiWowlAddBcPtrnCb: callback for passing back the |
| 3892 | response of the add Wowl bcast ptrn operation received |
| 3893 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3894 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3895 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3896 | callback |
| 3897 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3898 | @see WDI_PostAssocReq |
| 3899 | @return Result of the function call |
| 3900 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3901 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3902 | WDI_WowlAddBcPtrnReq |
| 3903 | ( |
| 3904 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams, |
| 3905 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb, |
| 3906 | void* pUserData |
| 3907 | ) |
| 3908 | { |
| 3909 | WDI_EventInfoType wdiEventData; |
| 3910 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3911 | |
| 3912 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3913 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3914 | ------------------------------------------------------------------------*/ |
| 3915 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3916 | { |
| 3917 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3918 | "WDI API call before module is initialized - Fail request"); |
| 3919 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3920 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3921 | } |
| 3922 | |
| 3923 | /*------------------------------------------------------------------------ |
| 3924 | Fill in Event data and post to the Main FSM |
| 3925 | ------------------------------------------------------------------------*/ |
| 3926 | wdiEventData.wdiRequest = WDI_WOWL_ADD_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3927 | wdiEventData.pEventData = pwdiWowlAddBcPtrnParams; |
| 3928 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlAddBcPtrnParams);; |
| 3929 | wdiEventData.pCBfnc = wdiWowlAddBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3930 | wdiEventData.pUserData = pUserData; |
| 3931 | |
| 3932 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3933 | }/*WDI_WowlAddBcPtrnReq*/ |
| 3934 | |
| 3935 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3936 | @brief WDI_WowlDelBcPtrnReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3937 | wants to clear the Wowl Bcast ptrn. Upon the call of |
| 3938 | this API the WLAN DAL will pack and send a HAL delete |
| 3939 | Wowl Bcast ptrn request message to the lower RIVA |
| 3940 | sub-system if DAL is in state STARTED. |
| 3941 | |
| 3942 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3943 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3944 | |
| 3945 | WDI_WowlAddBcPtrnReq must have been called. |
| 3946 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3947 | @param pwdiWowlDelBcPtrnParams: the Wowl bcast ptrn as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3948 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3949 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3950 | wdiWowlDelBcPtrnCb: callback for passing back the |
| 3951 | response of the del Wowl bcast ptrn operation received |
| 3952 | from the device |
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 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3955 | callback |
| 3956 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3957 | @see WDI_WowlAddBcPtrnReq |
| 3958 | @return Result of the function call |
| 3959 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3960 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3961 | WDI_WowlDelBcPtrnReq |
| 3962 | ( |
| 3963 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams, |
| 3964 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb, |
| 3965 | void* pUserData |
| 3966 | ) |
| 3967 | { |
| 3968 | WDI_EventInfoType wdiEventData; |
| 3969 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 3970 | |
| 3971 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3972 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3973 | ------------------------------------------------------------------------*/ |
| 3974 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 3975 | { |
| 3976 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 3977 | "WDI API call before module is initialized - Fail request"); |
| 3978 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3979 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3980 | } |
| 3981 | |
| 3982 | /*------------------------------------------------------------------------ |
| 3983 | Fill in Event data and post to the Main FSM |
| 3984 | ------------------------------------------------------------------------*/ |
| 3985 | wdiEventData.wdiRequest = WDI_WOWL_DEL_BC_PTRN_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3986 | wdiEventData.pEventData = pwdiWowlDelBcPtrnParams; |
| 3987 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlDelBcPtrnParams);; |
| 3988 | wdiEventData.pCBfnc = wdiWowlDelBcPtrnCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3989 | wdiEventData.pUserData = pUserData; |
| 3990 | |
| 3991 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 3992 | }/*WDI_WowlDelBcPtrnReq*/ |
| 3993 | |
| 3994 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 3995 | @brief WDI_WowlEnterReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3996 | wants to enter the Wowl state to minimize unnecessary |
| 3997 | host wakeup while in power save. Upon the call of this |
| 3998 | API the WLAN DAL will pack and send a HAL Wowl enter |
| 3999 | request message to the lower RIVA sub-system if DAL is |
| 4000 | in state STARTED. |
| 4001 | |
| 4002 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4003 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4004 | |
| 4005 | WDI_PostAssocReq must have been called. |
| 4006 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4007 | @param pwdiWowlEnterReqParams: the Wowl enter info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4008 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4009 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4010 | wdiWowlEnterReqCb: callback for passing back the |
| 4011 | response of the enter Wowl operation received from the |
| 4012 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4014 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4015 | callback |
| 4016 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4017 | @see WDI_PostAssocReq |
| 4018 | @return Result of the function call |
| 4019 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4020 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4021 | WDI_WowlEnterReq |
| 4022 | ( |
| 4023 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams, |
| 4024 | WDI_WowlEnterReqCb wdiWowlEnterCb, |
| 4025 | void* pUserData |
| 4026 | ) |
| 4027 | { |
| 4028 | WDI_EventInfoType wdiEventData; |
| 4029 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4030 | |
| 4031 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4032 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4033 | ------------------------------------------------------------------------*/ |
| 4034 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4035 | { |
| 4036 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4037 | "WDI API call before module is initialized - Fail request"); |
| 4038 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4039 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4040 | } |
| 4041 | |
| 4042 | /*------------------------------------------------------------------------ |
| 4043 | Fill in Event data and post to the Main FSM |
| 4044 | ------------------------------------------------------------------------*/ |
| 4045 | wdiEventData.wdiRequest = WDI_WOWL_ENTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4046 | wdiEventData.pEventData = pwdiWowlEnterParams; |
| 4047 | wdiEventData.uEventDataSize = sizeof(*pwdiWowlEnterParams);; |
| 4048 | wdiEventData.pCBfnc = wdiWowlEnterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4049 | wdiEventData.pUserData = pUserData; |
| 4050 | |
| 4051 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4052 | }/*WDI_WowlEnterReq*/ |
| 4053 | |
| 4054 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4055 | @brief WDI_WowlExitReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4056 | wants to exit the Wowl state. Upon the call of this API |
| 4057 | the WLAN DAL will pack and send a HAL Wowl exit request |
| 4058 | message to the lower RIVA sub-system if DAL is in state |
| 4059 | STARTED. |
| 4060 | |
| 4061 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4062 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4063 | |
| 4064 | WDI_WowlEnterReq must have been called. |
| 4065 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4066 | @param pwdiWowlExitReqParams: the Wowl exit info as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4067 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4068 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4069 | wdiWowlExitReqCb: callback for passing back the response |
| 4070 | of the exit Wowl operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4071 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4072 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4073 | callback |
| 4074 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4075 | @see WDI_WowlEnterReq |
| 4076 | @return Result of the function call |
| 4077 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4078 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4079 | WDI_WowlExitReq |
| 4080 | ( |
| 4081 | WDI_WowlExitReqCb wdiWowlExitCb, |
| 4082 | void* pUserData |
| 4083 | ) |
| 4084 | { |
| 4085 | WDI_EventInfoType wdiEventData; |
| 4086 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4087 | |
| 4088 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4089 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4090 | ------------------------------------------------------------------------*/ |
| 4091 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4092 | { |
| 4093 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4094 | "WDI API call before module is initialized - Fail request"); |
| 4095 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4096 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4097 | } |
| 4098 | |
| 4099 | /*------------------------------------------------------------------------ |
| 4100 | Fill in Event data and post to the Main FSM |
| 4101 | ------------------------------------------------------------------------*/ |
| 4102 | wdiEventData.wdiRequest = WDI_WOWL_EXIT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4103 | wdiEventData.pEventData = NULL; |
| 4104 | wdiEventData.uEventDataSize = 0; |
| 4105 | wdiEventData.pCBfnc = wdiWowlExitCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4106 | wdiEventData.pUserData = pUserData; |
| 4107 | |
| 4108 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4109 | }/*WDI_WowlExitReq*/ |
| 4110 | |
| 4111 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4112 | @brief WDI_ConfigureAppsCpuWakeupStateReq will be called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4113 | the upper MAC wants to dynamically adjusts the listen |
| 4114 | interval based on the WLAN/MSM activity. Upon the call |
| 4115 | of this API the WLAN DAL will pack and send a HAL |
| 4116 | configure Apps Cpu Wakeup State request message to the |
| 4117 | lower RIVA sub-system. |
| 4118 | |
| 4119 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4120 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4121 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4122 | |
| 4123 | @param pwdiConfigureAppsCpuWakeupStateReqParams: the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4124 | Apps Cpu Wakeup State as specified by the |
| 4125 | Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4126 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4127 | wdiConfigureAppsCpuWakeupStateCb: callback for passing |
| 4128 | back the response of the configure Apps Cpu Wakeup State |
| 4129 | operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4130 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4131 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4132 | callback |
| 4133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4134 | @return Result of the function call |
| 4135 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4136 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4137 | WDI_ConfigureAppsCpuWakeupStateReq |
| 4138 | ( |
| 4139 | WDI_ConfigureAppsCpuWakeupStateReqParamsType *pwdiConfigureAppsCpuWakeupStateReqParams, |
| 4140 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb, |
| 4141 | void* pUserData |
| 4142 | ) |
| 4143 | { |
| 4144 | WDI_EventInfoType wdiEventData; |
| 4145 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4146 | |
| 4147 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4148 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4149 | ------------------------------------------------------------------------*/ |
| 4150 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4151 | { |
| 4152 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4153 | "WDI API call before module is initialized - Fail request"); |
| 4154 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4155 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4156 | } |
| 4157 | |
| 4158 | /*------------------------------------------------------------------------ |
| 4159 | Fill in Event data and post to the Main FSM |
| 4160 | ------------------------------------------------------------------------*/ |
| 4161 | wdiEventData.wdiRequest = WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4162 | wdiEventData.pEventData = pwdiConfigureAppsCpuWakeupStateReqParams; |
| 4163 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigureAppsCpuWakeupStateReqParams); |
| 4164 | wdiEventData.pCBfnc = wdiConfigureAppsCpuWakeupStateCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4165 | wdiEventData.pUserData = pUserData; |
| 4166 | |
| 4167 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4168 | }/*WDI_ConfigureAppsCpuWakeupStateReq*/ |
| 4169 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4170 | @brief WDI_FlushAcReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4171 | to to perform a flush operation on a given AC. Upon the |
| 4172 | call of this API the WLAN DAL will pack and send a HAL |
| 4173 | Flush AC request message to the lower RIVA sub-system if |
| 4174 | DAL is in state STARTED. |
| 4175 | |
| 4176 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4177 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4178 | |
| 4179 | WDI_AddBAReq must have been called. |
| 4180 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4181 | @param pwdiFlushAcReqParams: the Flush AC parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4182 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4183 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4184 | wdiFlushAcRspCb: callback for passing back the response |
| 4185 | of the Flush AC operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4186 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4187 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4188 | callback |
| 4189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4190 | @see WDI_AddBAReq |
| 4191 | @return Result of the function call |
| 4192 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4193 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4194 | WDI_FlushAcReq |
| 4195 | ( |
| 4196 | WDI_FlushAcReqParamsType* pwdiFlushAcReqParams, |
| 4197 | WDI_FlushAcRspCb wdiFlushAcRspCb, |
| 4198 | void* pUserData |
| 4199 | ) |
| 4200 | { |
| 4201 | WDI_EventInfoType wdiEventData; |
| 4202 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4203 | |
| 4204 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4205 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4206 | ------------------------------------------------------------------------*/ |
| 4207 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4208 | { |
| 4209 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4210 | "WDI API call before module is initialized - Fail request"); |
| 4211 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4212 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4213 | } |
| 4214 | |
| 4215 | /*------------------------------------------------------------------------ |
| 4216 | Fill in Event data and post to the Main FSM |
| 4217 | ------------------------------------------------------------------------*/ |
| 4218 | wdiEventData.wdiRequest = WDI_FLUSH_AC_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4219 | wdiEventData.pEventData = pwdiFlushAcReqParams; |
| 4220 | wdiEventData.uEventDataSize = sizeof(*pwdiFlushAcReqParams); |
| 4221 | wdiEventData.pCBfnc = wdiFlushAcRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4222 | wdiEventData.pUserData = pUserData; |
| 4223 | |
| 4224 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4225 | |
| 4226 | }/*WDI_FlushAcReq*/ |
| 4227 | |
| 4228 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4229 | @brief WDI_BtAmpEventReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4230 | wants to notify the lower mac on a BT AMP event. This is |
| 4231 | to inform BTC-SLM that some BT AMP event occurred. Upon |
| 4232 | the call of this API the WLAN DAL will pack and send a |
| 4233 | HAL BT AMP event request message to the lower RIVA |
| 4234 | sub-system if DAL is in state STARTED. |
| 4235 | |
| 4236 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4237 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4238 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4239 | |
| 4240 | @param wdiBtAmpEventReqParams: the BT AMP event parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4241 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4243 | wdiBtAmpEventRspCb: callback for passing back the |
| 4244 | response of the BT AMP event operation received from the |
| 4245 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4246 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4247 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4248 | callback |
| 4249 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4250 | @return Result of the function call |
| 4251 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4252 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4253 | WDI_BtAmpEventReq |
| 4254 | ( |
| 4255 | WDI_BtAmpEventParamsType* pwdiBtAmpEventReqParams, |
| 4256 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb, |
| 4257 | void* pUserData |
| 4258 | ) |
| 4259 | { |
| 4260 | WDI_EventInfoType wdiEventData; |
| 4261 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4262 | |
| 4263 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4264 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4265 | ------------------------------------------------------------------------*/ |
| 4266 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4267 | { |
| 4268 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4269 | "WDI API call before module is initialized - Fail request"); |
| 4270 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4271 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4272 | } |
| 4273 | |
| 4274 | /*------------------------------------------------------------------------ |
| 4275 | Fill in Event data and post to the Main FSM |
| 4276 | ------------------------------------------------------------------------*/ |
| 4277 | wdiEventData.wdiRequest = WDI_BTAMP_EVENT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4278 | wdiEventData.pEventData = pwdiBtAmpEventReqParams; |
| 4279 | wdiEventData.uEventDataSize = sizeof(*pwdiBtAmpEventReqParams); |
| 4280 | wdiEventData.pCBfnc = wdiBtAmpEventRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4281 | wdiEventData.pUserData = pUserData; |
| 4282 | |
| 4283 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4284 | |
| 4285 | }/*WDI_BtAmpEventReq*/ |
| 4286 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4287 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 4288 | /** |
| 4289 | @brief WDI_Start Oem Data Req will be called when the upper MAC |
| 4290 | wants to notify the lower mac on a oem data Req event.Upon |
| 4291 | the call of this API the WLAN DAL will pack and send a |
| 4292 | HAL OEM Data Req event request message to the lower RIVA |
| 4293 | sub-system if DAL is in state STARTED. |
| 4294 | |
| 4295 | In state BUSY this request will be queued. Request won't |
| 4296 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4297 | |
| 4298 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4299 | |
| 4300 | @param pwdiOemDataReqParams: the Oem Data Req as |
| 4301 | specified by the Device Interface |
| 4302 | |
| 4303 | wdiStartOemDataRspCb: callback for passing back the |
| 4304 | response of the Oem Data Req received from the |
| 4305 | device |
| 4306 | |
| 4307 | pUserData: user data will be passed back with the |
| 4308 | callback |
| 4309 | |
| 4310 | @return Result of the function call |
| 4311 | */ |
| 4312 | WDI_Status |
| 4313 | WDI_StartOemDataReq |
| 4314 | ( |
| 4315 | WDI_oemDataReqParamsType* pwdiOemDataReqParams, |
| 4316 | WDI_oemDataRspCb wdiOemDataRspCb, |
| 4317 | void* pUserData |
| 4318 | ) |
| 4319 | { |
| 4320 | WDI_EventInfoType wdiEventData; |
| 4321 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4322 | |
| 4323 | /*------------------------------------------------------------------------ |
| 4324 | Sanity Check |
| 4325 | ------------------------------------------------------------------------*/ |
| 4326 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4327 | { |
| 4328 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4329 | "WDI API call before module is initialized - Fail request"); |
| 4330 | |
| 4331 | return WDI_STATUS_E_NOT_ALLOWED; |
| 4332 | } |
| 4333 | |
| 4334 | /*------------------------------------------------------------------------ |
| 4335 | Fill in Event data and post to the Main FSM |
| 4336 | ------------------------------------------------------------------------*/ |
| 4337 | wdiEventData.wdiRequest = WDI_START_OEM_DATA_REQ; |
| 4338 | wdiEventData.pEventData = pwdiOemDataReqParams; |
| 4339 | wdiEventData.uEventDataSize = sizeof(*pwdiOemDataReqParams); |
| 4340 | wdiEventData.pCBfnc = wdiOemDataRspCb; |
| 4341 | wdiEventData.pUserData = pUserData; |
| 4342 | |
| 4343 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4344 | |
| 4345 | |
| 4346 | } |
| 4347 | |
| 4348 | #endif |
| 4349 | |
| 4350 | |
| 4351 | /*======================================================================== |
| 4352 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4353 | CONTROL APIs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4354 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4355 | ==========================================================================*/ |
| 4356 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4357 | @brief WDI_SwitchChReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4358 | the WLAN HW to change the current channel of operation. |
| 4359 | Upon the call of this API the WLAN DAL will pack and |
| 4360 | send a HAL Start request message to the lower RIVA |
| 4361 | sub-system if DAL is in state STARTED. |
| 4362 | |
| 4363 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4364 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4365 | |
| 4366 | WDI_Start must have been called. |
| 4367 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4368 | @param wdiSwitchChReqParams: the switch ch parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4369 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4370 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4371 | wdiSwitchChRspCb: callback for passing back the response |
| 4372 | of the switch ch operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4374 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4375 | callback |
| 4376 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4377 | @see WDI_Start |
| 4378 | @return Result of the function call |
| 4379 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4380 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4381 | WDI_SwitchChReq |
| 4382 | ( |
| 4383 | WDI_SwitchChReqParamsType* pwdiSwitchChReqParams, |
| 4384 | WDI_SwitchChRspCb wdiSwitchChRspCb, |
| 4385 | void* pUserData |
| 4386 | ) |
| 4387 | { |
| 4388 | WDI_EventInfoType wdiEventData; |
| 4389 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4390 | |
| 4391 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4392 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4393 | ------------------------------------------------------------------------*/ |
| 4394 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4395 | { |
| 4396 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4397 | "WDI API call before module is initialized - Fail request"); |
| 4398 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4399 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4400 | } |
| 4401 | |
| 4402 | /*------------------------------------------------------------------------ |
| 4403 | Fill in Event data and post to the Main FSM |
| 4404 | ------------------------------------------------------------------------*/ |
| 4405 | wdiEventData.wdiRequest = WDI_CH_SWITCH_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4406 | wdiEventData.pEventData = pwdiSwitchChReqParams; |
| 4407 | wdiEventData.uEventDataSize = sizeof(*pwdiSwitchChReqParams); |
| 4408 | wdiEventData.pCBfnc = wdiSwitchChRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4409 | wdiEventData.pUserData = pUserData; |
| 4410 | |
| 4411 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4412 | |
| 4413 | }/*WDI_SwitchChReq*/ |
| 4414 | |
| 4415 | |
| 4416 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4417 | @brief WDI_ConfigSTAReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4418 | wishes to add or update a STA in HW. Upon the call of |
| 4419 | this API the WLAN DAL will pack and send a HAL Start |
| 4420 | message request message to the lower RIVA sub-system if |
| 4421 | DAL is in state STARTED. |
| 4422 | |
| 4423 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4424 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4425 | |
| 4426 | WDI_Start must have been called. |
| 4427 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4428 | @param wdiConfigSTAReqParams: the config STA parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4429 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4430 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4431 | wdiConfigSTARspCb: callback for passing back the |
| 4432 | response of the config STA operation received from the |
| 4433 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4434 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4435 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4436 | callback |
| 4437 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4438 | @see WDI_Start |
| 4439 | @return Result of the function call |
| 4440 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4441 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4442 | WDI_ConfigSTAReq |
| 4443 | ( |
| 4444 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAReqParams, |
| 4445 | WDI_ConfigSTARspCb wdiConfigSTARspCb, |
| 4446 | void* pUserData |
| 4447 | ) |
| 4448 | { |
| 4449 | WDI_EventInfoType wdiEventData; |
| 4450 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4451 | |
| 4452 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4453 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4454 | ------------------------------------------------------------------------*/ |
| 4455 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4456 | { |
| 4457 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4458 | "WDI API call before module is initialized - Fail request"); |
| 4459 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4460 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4461 | } |
| 4462 | |
| 4463 | /*------------------------------------------------------------------------ |
| 4464 | Fill in Event data and post to the Main FSM |
| 4465 | ------------------------------------------------------------------------*/ |
| 4466 | wdiEventData.wdiRequest = WDI_CONFIG_STA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4467 | wdiEventData.pEventData = pwdiConfigSTAReqParams; |
| 4468 | wdiEventData.uEventDataSize = sizeof(*pwdiConfigSTAReqParams); |
| 4469 | wdiEventData.pCBfnc = wdiConfigSTARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4470 | wdiEventData.pUserData = pUserData; |
| 4471 | |
| 4472 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4473 | |
| 4474 | }/*WDI_ConfigSTAReq*/ |
| 4475 | |
| 4476 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4477 | @brief WDI_SetLinkStateReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4478 | wants to change the state of an ongoing link. Upon the |
| 4479 | call of this API the WLAN DAL will pack and send a HAL |
| 4480 | Start message request message to the lower RIVA |
| 4481 | sub-system if DAL is in state STARTED. |
| 4482 | |
| 4483 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4484 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4485 | |
| 4486 | WDI_JoinStartReq must have been called. |
| 4487 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4488 | @param wdiSetLinkStateReqParams: the set link state parameters |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4489 | as specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4490 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4491 | wdiSetLinkStateRspCb: callback for passing back the |
| 4492 | response of the set link state operation received from |
| 4493 | the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4494 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4495 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4496 | callback |
| 4497 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4498 | @see WDI_JoinStartReq |
| 4499 | @return Result of the function call |
| 4500 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4501 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4502 | WDI_SetLinkStateReq |
| 4503 | ( |
| 4504 | WDI_SetLinkReqParamsType* pwdiSetLinkStateReqParams, |
| 4505 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb, |
| 4506 | void* pUserData |
| 4507 | ) |
| 4508 | { |
| 4509 | WDI_EventInfoType wdiEventData; |
| 4510 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4511 | |
| 4512 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4513 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4514 | ------------------------------------------------------------------------*/ |
| 4515 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4516 | { |
| 4517 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4518 | "WDI API call before module is initialized - Fail request"); |
| 4519 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4520 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4521 | } |
| 4522 | |
| 4523 | /*------------------------------------------------------------------------ |
| 4524 | Fill in Event data and post to the Main FSM |
| 4525 | ------------------------------------------------------------------------*/ |
| 4526 | wdiEventData.wdiRequest = WDI_SET_LINK_ST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4527 | wdiEventData.pEventData = pwdiSetLinkStateReqParams; |
| 4528 | wdiEventData.uEventDataSize = sizeof(*pwdiSetLinkStateReqParams); |
| 4529 | wdiEventData.pCBfnc = wdiSetLinkStateRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4530 | wdiEventData.pUserData = pUserData; |
| 4531 | |
| 4532 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4533 | |
| 4534 | }/*WDI_SetLinkStateReq*/ |
| 4535 | |
| 4536 | |
| 4537 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4538 | @brief WDI_GetStatsReq will be called when the upper MAC wants |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4539 | to get statistics (MIB counters) from the device. Upon |
| 4540 | the call of this API the WLAN DAL will pack and send a |
| 4541 | HAL Start request message to the lower RIVA sub-system |
| 4542 | if DAL is in state STARTED. |
| 4543 | |
| 4544 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4545 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4546 | |
| 4547 | WDI_Start must have been called. |
| 4548 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4549 | @param wdiGetStatsReqParams: the stats parameters to get as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4550 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4551 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4552 | wdiGetStatsRspCb: callback for passing back the response |
| 4553 | of the get stats operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4554 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4555 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4556 | callback |
| 4557 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4558 | @see WDI_Start |
| 4559 | @return Result of the function call |
| 4560 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4561 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4562 | WDI_GetStatsReq |
| 4563 | ( |
| 4564 | WDI_GetStatsReqParamsType* pwdiGetStatsReqParams, |
| 4565 | WDI_GetStatsRspCb wdiGetStatsRspCb, |
| 4566 | void* pUserData |
| 4567 | ) |
| 4568 | { |
| 4569 | WDI_EventInfoType wdiEventData; |
| 4570 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4571 | |
| 4572 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4573 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4574 | ------------------------------------------------------------------------*/ |
| 4575 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4576 | { |
| 4577 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4578 | "WDI API call before module is initialized - Fail request"); |
| 4579 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4580 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4581 | } |
| 4582 | |
| 4583 | /*------------------------------------------------------------------------ |
| 4584 | Fill in Event data and post to the Main FSM |
| 4585 | ------------------------------------------------------------------------*/ |
| 4586 | wdiEventData.wdiRequest = WDI_GET_STATS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4587 | wdiEventData.pEventData = pwdiGetStatsReqParams; |
| 4588 | wdiEventData.uEventDataSize = sizeof(*pwdiGetStatsReqParams); |
| 4589 | wdiEventData.pCBfnc = wdiGetStatsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4590 | wdiEventData.pUserData = pUserData; |
| 4591 | |
| 4592 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4593 | |
| 4594 | }/*WDI_GetStatsReq*/ |
| 4595 | |
| 4596 | |
| 4597 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4598 | @brief WDI_UpdateCfgReq will be called when the upper MAC when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4599 | it wishes to change the configuration of the WLAN |
| 4600 | Device. Upon the call of this API the WLAN DAL will pack |
| 4601 | and send a HAL Update CFG request message to the lower |
| 4602 | RIVA sub-system if DAL is in state STARTED. |
| 4603 | |
| 4604 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4605 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4606 | |
| 4607 | WDI_Start must have been called. |
| 4608 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4609 | @param wdiUpdateCfgReqParams: the update cfg parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4610 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4611 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4612 | wdiUpdateCfgsRspCb: callback for passing back the |
| 4613 | response of the update cfg operation received from the |
| 4614 | device |
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 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4617 | callback |
| 4618 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4619 | @see WDI_Start |
| 4620 | @return Result of the function call |
| 4621 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4622 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4623 | WDI_UpdateCfgReq |
| 4624 | ( |
| 4625 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgReqParams, |
| 4626 | WDI_UpdateCfgRspCb wdiUpdateCfgsRspCb, |
| 4627 | void* pUserData |
| 4628 | ) |
| 4629 | { |
| 4630 | WDI_EventInfoType wdiEventData; |
| 4631 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4632 | |
| 4633 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4634 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4635 | ------------------------------------------------------------------------*/ |
| 4636 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4637 | { |
| 4638 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4639 | "WDI API call before module is initialized - Fail request"); |
| 4640 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4641 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4642 | } |
| 4643 | |
| 4644 | /*------------------------------------------------------------------------ |
| 4645 | Fill in Event data and post to the Main FSM |
| 4646 | ------------------------------------------------------------------------*/ |
| 4647 | wdiEventData.wdiRequest = WDI_UPDATE_CFG_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4648 | wdiEventData.pEventData = pwdiUpdateCfgReqParams; |
| 4649 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateCfgReqParams); |
| 4650 | wdiEventData.pCBfnc = wdiUpdateCfgsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4651 | wdiEventData.pUserData = pUserData; |
| 4652 | |
| 4653 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4654 | |
| 4655 | }/*WDI_UpdateCfgReq*/ |
| 4656 | |
| 4657 | |
| 4658 | |
| 4659 | /** |
| 4660 | @brief WDI_AddBAReq will be called when the upper MAC has setup |
| 4661 | successfully a BA session and needs to notify the HW for |
| 4662 | the appropriate settings to take place. Upon the call of |
| 4663 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4664 | request message to the lower RIVA sub-system if DAL is |
| 4665 | in state STARTED. |
| 4666 | |
| 4667 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4668 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4669 | |
| 4670 | WDI_PostAssocReq must have been called. |
| 4671 | |
| 4672 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4673 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4674 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4675 | wdiAddBARspCb: callback for passing back the response of |
| 4676 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4677 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4678 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4679 | callback |
| 4680 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4681 | @see WDI_PostAssocReq |
| 4682 | @return Result of the function call |
| 4683 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4684 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4685 | WDI_AddBAReq |
| 4686 | ( |
| 4687 | WDI_AddBAReqParamsType* pwdiAddBAReqParams, |
| 4688 | WDI_AddBARspCb wdiAddBARspCb, |
| 4689 | void* pUserData |
| 4690 | ) |
| 4691 | { |
| 4692 | WDI_EventInfoType wdiEventData; |
| 4693 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4694 | |
| 4695 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4696 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4697 | ------------------------------------------------------------------------*/ |
| 4698 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4699 | { |
| 4700 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4701 | "WDI API call before module is initialized - Fail request"); |
| 4702 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4703 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4704 | } |
| 4705 | |
| 4706 | /*------------------------------------------------------------------------ |
| 4707 | Fill in Event data and post to the Main FSM |
| 4708 | ------------------------------------------------------------------------*/ |
| 4709 | wdiEventData.wdiRequest = WDI_ADD_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4710 | wdiEventData.pEventData = pwdiAddBAReqParams; |
| 4711 | wdiEventData.uEventDataSize = sizeof(*pwdiAddBAReqParams); |
| 4712 | wdiEventData.pCBfnc = wdiAddBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4713 | wdiEventData.pUserData = pUserData; |
| 4714 | |
| 4715 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4716 | |
| 4717 | }/*WDI_AddBAReq*/ |
| 4718 | |
| 4719 | |
| 4720 | /** |
| 4721 | @brief WDI_TriggerBAReq will be called when the upper MAC has setup |
| 4722 | successfully a BA session and needs to notify the HW for |
| 4723 | the appropriate settings to take place. Upon the call of |
| 4724 | this API the WLAN DAL will pack and send a HAL Add BA |
| 4725 | request message to the lower RIVA sub-system if DAL is |
| 4726 | in state STARTED. |
| 4727 | |
| 4728 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4729 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4730 | |
| 4731 | WDI_PostAssocReq must have been called. |
| 4732 | |
| 4733 | @param wdiAddBAReqParams: the add BA parameters as specified by |
| 4734 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4735 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4736 | wdiAddBARspCb: callback for passing back the response of |
| 4737 | the add BA operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4738 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4739 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4740 | callback |
| 4741 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4742 | @see WDI_PostAssocReq |
| 4743 | @return Result of the function call |
| 4744 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4745 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4746 | WDI_TriggerBAReq |
| 4747 | ( |
| 4748 | WDI_TriggerBAReqParamsType* pwdiTriggerBAReqParams, |
| 4749 | WDI_TriggerBARspCb wdiTriggerBARspCb, |
| 4750 | void* pUserData |
| 4751 | ) |
| 4752 | { |
| 4753 | WDI_EventInfoType wdiEventData; |
| 4754 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4755 | |
| 4756 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4757 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4758 | ------------------------------------------------------------------------*/ |
| 4759 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4760 | { |
| 4761 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4762 | "WDI API call before module is initialized - Fail request"); |
| 4763 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4764 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4765 | } |
| 4766 | |
| 4767 | /*------------------------------------------------------------------------ |
| 4768 | Fill in Event data and post to the Main FSM |
| 4769 | ------------------------------------------------------------------------*/ |
| 4770 | wdiEventData.wdiRequest = WDI_TRIGGER_BA_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4771 | wdiEventData.pEventData = pwdiTriggerBAReqParams; |
| 4772 | wdiEventData.uEventDataSize = sizeof(*pwdiTriggerBAReqParams); |
| 4773 | wdiEventData.pCBfnc = wdiTriggerBARspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4774 | wdiEventData.pUserData = pUserData; |
| 4775 | |
| 4776 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4777 | |
| 4778 | }/*WDI_AddBAReq*/ |
| 4779 | |
| 4780 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4781 | @brief WDI_UpdateBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4782 | wishes to update any of the Beacon parameters used by HW. |
| 4783 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon Params request |
| 4784 | message to the lower RIVA sub-system if DAL is in state |
| 4785 | STARTED. |
| 4786 | |
| 4787 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4788 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4789 | |
| 4790 | WDI_PostAssocReq must have been called. |
| 4791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4792 | @param wdiUpdateBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4793 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4794 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4795 | wdiUpdateBeaconParamsRspCb: callback for passing back the |
| 4796 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4797 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4798 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4799 | callback |
| 4800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4801 | @see WDI_PostAssocReq |
| 4802 | @return Result of the function call |
| 4803 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4804 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4805 | WDI_UpdateBeaconParamsReq |
| 4806 | ( |
| 4807 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams, |
| 4808 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb, |
| 4809 | void* pUserData |
| 4810 | ) |
| 4811 | { |
| 4812 | WDI_EventInfoType wdiEventData; |
| 4813 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4814 | |
| 4815 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4816 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4817 | ------------------------------------------------------------------------*/ |
| 4818 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4819 | { |
| 4820 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4821 | "WDI API call before module is initialized - Fail request"); |
| 4822 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4823 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4824 | } |
| 4825 | |
| 4826 | /*------------------------------------------------------------------------ |
| 4827 | Fill in Event data and post to the Main FSM |
| 4828 | ------------------------------------------------------------------------*/ |
| 4829 | wdiEventData.wdiRequest = WDI_UPD_BCON_PRMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4830 | wdiEventData.pEventData = pwdiUpdateBeaconParams; |
| 4831 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateBeaconParams); |
| 4832 | wdiEventData.pCBfnc = wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4833 | wdiEventData.pUserData = pUserData; |
| 4834 | |
| 4835 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4836 | |
| 4837 | }/*WDI_UpdateBeaconParamsReq*/ |
| 4838 | |
| 4839 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4840 | @brief WDI_SendBeaconParamsReq will be called when the upper MAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4841 | wishes to update the Beacon template used by HW. |
| 4842 | Upon the call of this API the WLAN DAL will pack and send a HAL Update Beacon template request |
| 4843 | message to the lower RIVA sub-system if DAL is in state |
| 4844 | STARTED. |
| 4845 | |
| 4846 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4847 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4848 | |
| 4849 | WDI_PostAssocReq must have been called. |
| 4850 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4851 | @param wdiSendBeaconParams: the Beacon parameters as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4852 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4853 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4854 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 4855 | response of the start operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4856 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4857 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4858 | callback |
| 4859 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4860 | @see WDI_PostAssocReq |
| 4861 | @return Result of the function call |
| 4862 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4863 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4864 | WDI_SendBeaconParamsReq |
| 4865 | ( |
| 4866 | WDI_SendBeaconParamsType* pwdiSendBeaconParams, |
| 4867 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb, |
| 4868 | void* pUserData |
| 4869 | ) |
| 4870 | { |
| 4871 | WDI_EventInfoType wdiEventData; |
| 4872 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4873 | |
| 4874 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4875 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4876 | ------------------------------------------------------------------------*/ |
| 4877 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4878 | { |
| 4879 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4880 | "WDI API call before module is initialized - Fail request"); |
| 4881 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4882 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4883 | } |
| 4884 | |
| 4885 | /*------------------------------------------------------------------------ |
| 4886 | Fill in Event data and post to the Main FSM |
| 4887 | ------------------------------------------------------------------------*/ |
| 4888 | wdiEventData.wdiRequest = WDI_SND_BCON_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4889 | wdiEventData.pEventData = pwdiSendBeaconParams; |
| 4890 | wdiEventData.uEventDataSize = sizeof(*pwdiSendBeaconParams); |
| 4891 | wdiEventData.pCBfnc = wdiSendBeaconParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4892 | wdiEventData.pUserData = pUserData; |
| 4893 | |
| 4894 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4895 | |
| 4896 | }/*WDI_SendBeaconParamsReq*/ |
| 4897 | |
| 4898 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4899 | @brief WDI_UpdateProbeRspTemplateReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4900 | upper MAC wants to update the probe response template to |
| 4901 | be transmitted as Soft AP |
| 4902 | Upon the call of this API the WLAN DAL will |
| 4903 | pack and send the probe rsp template message to the |
| 4904 | lower RIVA sub-system if DAL is in state STARTED. |
| 4905 | |
| 4906 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4907 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4908 | |
| 4909 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4910 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4911 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4912 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4913 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 4914 | response of the Send Beacon Params operation received |
| 4915 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4916 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4917 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4918 | callback |
| 4919 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4920 | @see WDI_AddBAReq |
| 4921 | @return Result of the function call |
| 4922 | */ |
| 4923 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4924 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4925 | WDI_UpdateProbeRspTemplateReq |
| 4926 | ( |
| 4927 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRspParams, |
| 4928 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRspParamsRspCb, |
| 4929 | void* pUserData |
| 4930 | ) |
| 4931 | { |
| 4932 | WDI_EventInfoType wdiEventData; |
| 4933 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 4934 | |
| 4935 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4936 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4937 | ------------------------------------------------------------------------*/ |
| 4938 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4939 | { |
| 4940 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4941 | "WDI API call before module is initialized - Fail request"); |
| 4942 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4943 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4944 | } |
| 4945 | |
| 4946 | /*------------------------------------------------------------------------ |
| 4947 | Fill in Event data and post to the Main FSM |
| 4948 | ------------------------------------------------------------------------*/ |
| 4949 | wdiEventData.wdiRequest = WDI_UPD_PROBE_RSP_TEMPLATE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4950 | wdiEventData.pEventData = pwdiUpdateProbeRspParams; |
| 4951 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateProbeRspParams); |
| 4952 | wdiEventData.pCBfnc = wdiUpdateProbeRspParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4953 | wdiEventData.pUserData = pUserData; |
| 4954 | |
| 4955 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 4956 | |
| 4957 | }/*WDI_UpdateProbeRspTemplateReq*/ |
| 4958 | |
| 4959 | /** |
| 4960 | @brief WDI_NvDownloadReq will be called by the UMAC to download the NV blob |
| 4961 | to the NV memory. |
| 4962 | |
| 4963 | |
| 4964 | @param wdiNvDownloadReqParams: the NV Download parameters as specified by |
| 4965 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4966 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4967 | wdiNvDownloadRspCb: callback for passing back the response of |
| 4968 | the NV Download operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4969 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4970 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4971 | callback |
| 4972 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4973 | @see WDI_PostAssocReq |
| 4974 | @return Result of the function call |
| 4975 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4976 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4977 | WDI_NvDownloadReq |
| 4978 | ( |
| 4979 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams, |
| 4980 | WDI_NvDownloadRspCb wdiNvDownloadRspCb, |
| 4981 | void* pUserData |
| 4982 | ) |
| 4983 | { |
| 4984 | WDI_EventInfoType wdiEventData; |
| 4985 | |
| 4986 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4987 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4988 | ------------------------------------------------------------------------*/ |
| 4989 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 4990 | { |
| 4991 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 4992 | "WDI API call before module is initialized - Fail request"); |
| 4993 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 4994 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4995 | } |
| 4996 | |
| 4997 | /*------------------------------------------------------------------------ |
| 4998 | Fill in Event data and post to the Main FSM |
| 4999 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5000 | wdiEventData.wdiRequest = WDI_NV_DOWNLOAD_REQ; |
| 5001 | wdiEventData.pEventData = (void *)pwdiNvDownloadReqParams; |
| 5002 | wdiEventData.uEventDataSize = sizeof(*pwdiNvDownloadReqParams); |
| 5003 | wdiEventData.pCBfnc = wdiNvDownloadRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5004 | wdiEventData.pUserData = pUserData; |
| 5005 | |
| 5006 | return WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, &wdiEventData); |
| 5007 | |
| 5008 | }/*WDI_NVDownloadReq*/ |
| 5009 | |
| 5010 | #ifdef WLAN_FEATURE_P2P |
| 5011 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5012 | @brief WDI_SetP2PGONOAReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5013 | upper MAC wants to send Notice of Absence |
| 5014 | Upon the call of this API the WLAN DAL will |
| 5015 | pack and send the probe rsp template message to the |
| 5016 | lower RIVA sub-system if DAL is in state STARTED. |
| 5017 | |
| 5018 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5019 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5020 | |
| 5021 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5022 | @param pwdiUpdateProbeRspParams: the Update Beacon parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5023 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5025 | wdiSendBeaconParamsRspCb: callback for passing back the |
| 5026 | response of the Send Beacon Params operation received |
| 5027 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5028 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5029 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5030 | callback |
| 5031 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5032 | @see WDI_AddBAReq |
| 5033 | @return Result of the function call |
| 5034 | */ |
| 5035 | WDI_Status |
| 5036 | WDI_SetP2PGONOAReq |
| 5037 | ( |
| 5038 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams, |
| 5039 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb, |
| 5040 | void* pUserData |
| 5041 | ) |
| 5042 | { |
| 5043 | WDI_EventInfoType wdiEventData; |
| 5044 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5045 | |
| 5046 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5047 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5048 | ------------------------------------------------------------------------*/ |
| 5049 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5050 | { |
| 5051 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5052 | "WDI API call before module is initialized - Fail request"); |
| 5053 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5054 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5055 | } |
| 5056 | |
| 5057 | /*------------------------------------------------------------------------ |
| 5058 | Fill in Event data and post to the Main FSM |
| 5059 | ------------------------------------------------------------------------*/ |
| 5060 | wdiEventData.wdiRequest = WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5061 | wdiEventData.pEventData = pwdiP2PGONOAReqParams; |
| 5062 | wdiEventData.uEventDataSize = sizeof(*pwdiP2PGONOAReqParams); |
| 5063 | wdiEventData.pCBfnc = wdiP2PGONOAReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5064 | wdiEventData.pUserData = pUserData; |
| 5065 | |
| 5066 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5067 | |
| 5068 | }/*WDI_SetP2PGONOAReq*/ |
| 5069 | #endif |
| 5070 | |
| 5071 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5072 | @brief WDI_AddSTASelfReq will be called when the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5073 | UMAC wanted to add STA self while opening any new session |
| 5074 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5075 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5076 | |
| 5077 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5078 | @param pwdiAddSTASelfParams: the add sta self parameters as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5079 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5080 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5081 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5082 | callback |
| 5083 | |
| 5084 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5085 | @return Result of the function call |
| 5086 | */ |
| 5087 | WDI_Status |
| 5088 | WDI_AddSTASelfReq |
| 5089 | ( |
| 5090 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams, |
| 5091 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb, |
| 5092 | void* pUserData |
| 5093 | ) |
| 5094 | { |
| 5095 | WDI_EventInfoType wdiEventData; |
| 5096 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5097 | |
| 5098 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5099 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5100 | ------------------------------------------------------------------------*/ |
| 5101 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5102 | { |
| 5103 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5104 | "WDI API call before module is initialized - Fail request"); |
| 5105 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5106 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5107 | } |
| 5108 | |
| 5109 | /*------------------------------------------------------------------------ |
| 5110 | Fill in Event data and post to the Main FSM |
| 5111 | ------------------------------------------------------------------------*/ |
| 5112 | wdiEventData.wdiRequest = WDI_ADD_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5113 | wdiEventData.pEventData = pwdiAddSTASelfReqParams; |
| 5114 | wdiEventData.uEventDataSize = sizeof(*pwdiAddSTASelfReqParams); |
| 5115 | wdiEventData.pCBfnc = wdiAddSTASelfReqParamsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5116 | wdiEventData.pUserData = pUserData; |
| 5117 | |
| 5118 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5119 | |
| 5120 | }/*WDI_AddSTASelfReq*/ |
| 5121 | |
| 5122 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5123 | #ifdef WLAN_FEATURE_VOWIFI_11R |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5124 | /** |
| 5125 | @brief WDI_AggrAddTSReq will be called when the upper MAC to inform |
| 5126 | the device of a successful add TSpec negotiation. HW |
| 5127 | needs to receive the TSpec Info from the UMAC in order |
| 5128 | to configure properly the QoS data traffic. Upon the |
| 5129 | call of this API the WLAN DAL will pack and send a HAL |
| 5130 | Add TS request message to the lower RIVA sub-system if |
| 5131 | DAL is in state STARTED. |
| 5132 | |
| 5133 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5134 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5135 | |
| 5136 | WDI_PostAssocReq must have been called. |
| 5137 | |
| 5138 | @param wdiAddTsReqParams: the add TS parameters as specified by |
| 5139 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5141 | wdiAddTsRspCb: callback for passing back the response of |
| 5142 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5144 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5145 | callback |
| 5146 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5147 | @see WDI_PostAssocReq |
| 5148 | @return Result of the function call |
| 5149 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5150 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5151 | WDI_AggrAddTSReq |
| 5152 | ( |
| 5153 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTsReqParams, |
| 5154 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb, |
| 5155 | void* pUserData |
| 5156 | ) |
| 5157 | { |
| 5158 | WDI_EventInfoType wdiEventData; |
| 5159 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5160 | |
| 5161 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5162 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5163 | ------------------------------------------------------------------------*/ |
| 5164 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5165 | { |
| 5166 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5167 | "WDI API call before module is initialized - Fail request"); |
| 5168 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5169 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5170 | } |
| 5171 | |
| 5172 | /*------------------------------------------------------------------------ |
| 5173 | Fill in Event data and post to the Main FSM |
| 5174 | ------------------------------------------------------------------------*/ |
| 5175 | wdiEventData.wdiRequest = WDI_AGGR_ADD_TS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5176 | wdiEventData.pEventData = pwdiAggrAddTsReqParams; |
| 5177 | wdiEventData.uEventDataSize = sizeof(*pwdiAggrAddTsReqParams); |
| 5178 | wdiEventData.pCBfnc = wdiAggrAddTsRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5179 | wdiEventData.pUserData = pUserData; |
| 5180 | |
| 5181 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5182 | |
| 5183 | }/*WDI_AggrAddTSReq*/ |
| 5184 | |
| 5185 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 5186 | |
| 5187 | #ifdef ANI_MANF_DIAG |
| 5188 | /** |
| 5189 | @brief WDI_FTMCommandReq |
| 5190 | Post FTM Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5191 | |
| 5192 | @param ftmCommandReq: FTM Command Body |
| 5193 | @param ftmCommandRspCb: FTM Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5194 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5195 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5196 | @see |
| 5197 | @return Result of the function call |
| 5198 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5199 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5200 | WDI_FTMCommandReq |
| 5201 | ( |
| 5202 | WDI_FTMCommandReqType *ftmCommandReq, |
| 5203 | WDI_FTMCommandRspCb ftmCommandRspCb, |
| 5204 | void *pUserData |
| 5205 | ) |
| 5206 | { |
| 5207 | WDI_EventInfoType wdiEventData; |
| 5208 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5209 | |
| 5210 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5211 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5212 | ------------------------------------------------------------------------*/ |
| 5213 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5214 | { |
| 5215 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5216 | "WDI API call before module is initialized - Fail request"); |
| 5217 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5218 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5219 | } |
| 5220 | |
| 5221 | /*------------------------------------------------------------------------ |
| 5222 | Fill in Event data and post to the Main FSM |
| 5223 | ------------------------------------------------------------------------*/ |
| 5224 | wdiEventData.wdiRequest = WDI_FTM_CMD_REQ; |
| 5225 | wdiEventData.pEventData = (void *)ftmCommandReq; |
| 5226 | wdiEventData.uEventDataSize = ftmCommandReq->bodyLength + sizeof(wpt_uint32); |
| 5227 | wdiEventData.pCBfnc = ftmCommandRspCb; |
| 5228 | wdiEventData.pUserData = pUserData; |
| 5229 | |
| 5230 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5231 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5232 | #endif /* ANI_MANF_DIAG */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5233 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5234 | @brief WDI_HostResumeReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5235 | |
| 5236 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5237 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5238 | |
| 5239 | |
| 5240 | @param pwdiResumeReqParams: as specified by |
| 5241 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5243 | wdiResumeReqRspCb: callback for passing back the response of |
| 5244 | the Resume Req received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5245 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5246 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5247 | callback |
| 5248 | |
| 5249 | @see |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5250 | @return Result of the function call |
| 5251 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5252 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5253 | WDI_HostResumeReq |
| 5254 | ( |
| 5255 | WDI_ResumeParamsType* pwdiResumeReqParams, |
| 5256 | WDI_HostResumeEventRspCb wdiResumeReqRspCb, |
| 5257 | void* pUserData |
| 5258 | ) |
| 5259 | { |
| 5260 | WDI_EventInfoType wdiEventData; |
| 5261 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5262 | |
| 5263 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5264 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5265 | ------------------------------------------------------------------------*/ |
| 5266 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5267 | { |
| 5268 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5269 | "WDI API call before module is initialized - Fail request"); |
| 5270 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5271 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5272 | } |
| 5273 | |
| 5274 | /*------------------------------------------------------------------------ |
| 5275 | Fill in Event data and post to the Main FSM |
| 5276 | ------------------------------------------------------------------------*/ |
| 5277 | wdiEventData.wdiRequest = WDI_HOST_RESUME_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5278 | wdiEventData.pEventData = pwdiResumeReqParams; |
| 5279 | wdiEventData.uEventDataSize = sizeof(*pwdiResumeReqParams); |
| 5280 | wdiEventData.pCBfnc = wdiResumeReqRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5281 | wdiEventData.pUserData = pUserData; |
| 5282 | |
| 5283 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5284 | |
| 5285 | }/*WDI_HostResumeReq*/ |
| 5286 | |
| 5287 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5288 | @brief WDI_DelSTASelfReq will be called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5289 | |
| 5290 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5291 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5292 | |
| 5293 | |
| 5294 | @param pwdiDelStaSelfReqParams: as specified by |
| 5295 | the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5296 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5297 | wdiDelStaSelfRspCb: callback for passing back the response of |
| 5298 | the add TS operation received from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5300 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5301 | callback |
| 5302 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5303 | @see WDI_PostAssocReq |
| 5304 | @return Result of the function call |
| 5305 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5306 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5307 | WDI_DelSTASelfReq |
| 5308 | ( |
| 5309 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams, |
| 5310 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb, |
| 5311 | void* pUserData |
| 5312 | ) |
| 5313 | { |
| 5314 | WDI_EventInfoType wdiEventData; |
| 5315 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5316 | |
| 5317 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5318 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5319 | ------------------------------------------------------------------------*/ |
| 5320 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5321 | { |
| 5322 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5323 | "WDI API call before module is initialized - Fail request"); |
| 5324 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5325 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5326 | } |
| 5327 | |
| 5328 | /*------------------------------------------------------------------------ |
| 5329 | Fill in Event data and post to the Main FSM |
| 5330 | ------------------------------------------------------------------------*/ |
| 5331 | wdiEventData.wdiRequest = WDI_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5332 | wdiEventData.pEventData = pwdiDelStaSelfReqParams; |
| 5333 | wdiEventData.uEventDataSize = sizeof(*pwdiDelStaSelfReqParams); |
| 5334 | wdiEventData.pCBfnc = wdiDelStaSelfRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5335 | wdiEventData.pUserData = pUserData; |
| 5336 | |
| 5337 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5338 | |
| 5339 | }/*WDI_AggrAddTSReq*/ |
| 5340 | |
| 5341 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5342 | @brief WDI_SetTxPerTrackingReq will be called when the upper MAC |
| 5343 | wants to set the Tx Per Tracking configurations. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5344 | Upon the call of this API the WLAN DAL will pack |
| 5345 | and send a HAL Set Tx Per Tracking request message to the |
| 5346 | lower RIVA sub-system if DAL is in state STARTED. |
| 5347 | |
| 5348 | In state BUSY this request will be queued. Request won't |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5349 | be allowed in any other state. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5350 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5351 | @param pwdiSetTxPerTrackingReqParams: the Set Tx PER Tracking configurations as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5352 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5354 | pwdiSetTxPerTrackingRspCb: callback for passing back the |
| 5355 | response of the set Tx PER Tracking configurations operation received |
| 5356 | from the device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5357 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5358 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5359 | callback |
| 5360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5361 | @return Result of the function call |
| 5362 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5363 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5364 | WDI_SetTxPerTrackingReq |
| 5365 | ( |
| 5366 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams, |
| 5367 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb, |
| 5368 | void* pUserData |
| 5369 | ) |
| 5370 | { |
| 5371 | WDI_EventInfoType wdiEventData; |
| 5372 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5373 | |
| 5374 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5375 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5376 | ------------------------------------------------------------------------*/ |
| 5377 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5378 | { |
| 5379 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5380 | "WDI API call before module is initialized - Fail request"); |
| 5381 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5382 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5383 | } |
| 5384 | |
| 5385 | /*------------------------------------------------------------------------ |
| 5386 | Fill in Event data and post to the Main FSM |
| 5387 | ------------------------------------------------------------------------*/ |
| 5388 | wdiEventData.wdiRequest = WDI_SET_TX_PER_TRACKING_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5389 | wdiEventData.pEventData = pwdiSetTxPerTrackingReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5390 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTxPerTrackingReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5391 | wdiEventData.pCBfnc = pwdiSetTxPerTrackingRspCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5392 | wdiEventData.pUserData = pUserData; |
| 5393 | |
| 5394 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5395 | |
| 5396 | }/*WDI_SetTxPerTrackingReq*/ |
| 5397 | |
| 5398 | /** |
| 5399 | @brief WDI_SetTmLevelReq |
| 5400 | If HW Thermal condition changed, driver should react based on new |
| 5401 | HW thermal condition. |
| 5402 | |
| 5403 | @param pwdiSetTmLevelReq: New thermal condition information |
| 5404 | |
| 5405 | pwdiSetTmLevelRspCb: callback |
| 5406 | |
| 5407 | usrData: user data will be passed back with the |
| 5408 | callback |
| 5409 | |
| 5410 | @return Result of the function call |
| 5411 | */ |
| 5412 | WDI_Status |
| 5413 | WDI_SetTmLevelReq |
| 5414 | ( |
| 5415 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq, |
| 5416 | WDI_SetTmLevelCb pwdiSetTmLevelRspCb, |
| 5417 | void *usrData |
| 5418 | ) |
| 5419 | { |
| 5420 | WDI_EventInfoType wdiEventData; |
| 5421 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5422 | |
| 5423 | /*------------------------------------------------------------------------ |
| 5424 | Sanity Check |
| 5425 | ------------------------------------------------------------------------*/ |
| 5426 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5427 | { |
| 5428 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5429 | "WDI API call before module is initialized - Fail request"); |
| 5430 | |
| 5431 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5432 | } |
| 5433 | |
| 5434 | /*------------------------------------------------------------------------ |
| 5435 | Fill in Event data and post to the Main FSM |
| 5436 | ------------------------------------------------------------------------*/ |
| 5437 | wdiEventData.wdiRequest = WDI_SET_TM_LEVEL_REQ; |
| 5438 | wdiEventData.pEventData = pwdiSetTmLevelReq; |
| 5439 | wdiEventData.uEventDataSize = sizeof(*pwdiSetTmLevelReq); |
| 5440 | wdiEventData.pCBfnc = pwdiSetTmLevelRspCb; |
| 5441 | wdiEventData.pUserData = usrData; |
| 5442 | |
| 5443 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5444 | } |
| 5445 | |
| 5446 | /** |
| 5447 | @brief WDI_HostSuspendInd |
| 5448 | |
| 5449 | Suspend Indication from the upper layer will be sent |
| 5450 | down to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5451 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5452 | @param WDI_SuspendResumeIndParamsType |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5453 | |
| 5454 | @see |
| 5455 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5456 | @return Status of the request |
| 5457 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5458 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5459 | WDI_HostSuspendInd |
| 5460 | ( |
| 5461 | WDI_SuspendParamsType* pwdiSuspendIndParams |
| 5462 | ) |
| 5463 | { |
| 5464 | |
| 5465 | WDI_EventInfoType wdiEventData; |
| 5466 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5467 | |
| 5468 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5469 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5470 | ------------------------------------------------------------------------*/ |
| 5471 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5472 | { |
| 5473 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5474 | "WDI API call before module is initialized - Fail request"); |
| 5475 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5476 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5477 | } |
| 5478 | |
| 5479 | /*------------------------------------------------------------------------ |
| 5480 | Fill in Event data and post to the Main FSM |
| 5481 | ------------------------------------------------------------------------*/ |
| 5482 | wdiEventData.wdiRequest = WDI_HOST_SUSPEND_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5483 | wdiEventData.pEventData = pwdiSuspendIndParams; |
| 5484 | wdiEventData.uEventDataSize = sizeof(*pwdiSuspendIndParams); |
| 5485 | wdiEventData.pCBfnc = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5486 | wdiEventData.pUserData = NULL; |
| 5487 | |
| 5488 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5489 | |
| 5490 | }/*WDI_HostSuspendInd*/ |
| 5491 | |
| 5492 | /** |
| 5493 | @brief WDI_HALDumpCmdReq |
| 5494 | Post HAL DUMP Command Event |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5495 | |
| 5496 | @param halDumpCmdReqParams: Hal Dump Command Body |
| 5497 | @param halDumpCmdRspCb: HAL DUMP Response from HAL CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5498 | @param pUserData: Client Data |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5499 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5500 | @see |
| 5501 | @return Result of the function call |
| 5502 | */ |
| 5503 | WDI_Status WDI_HALDumpCmdReq |
| 5504 | ( |
| 5505 | WDI_HALDumpCmdReqParamsType *halDumpCmdReqParams, |
| 5506 | WDI_HALDumpCmdRspCb halDumpCmdRspCb, |
| 5507 | void *pUserData |
| 5508 | ) |
| 5509 | { |
| 5510 | WDI_EventInfoType wdiEventData; |
| 5511 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5512 | |
| 5513 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5514 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5515 | ------------------------------------------------------------------------*/ |
| 5516 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 5517 | { |
| 5518 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5519 | "WDI API call before module is initialized - Fail request"); |
| 5520 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5521 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5522 | } |
| 5523 | |
| 5524 | /*------------------------------------------------------------------------ |
| 5525 | Fill in Event data and post to the Main FSM |
| 5526 | ------------------------------------------------------------------------*/ |
| 5527 | wdiEventData.wdiRequest = WDI_HAL_DUMP_CMD_REQ; |
| 5528 | wdiEventData.pEventData = (void *)halDumpCmdReqParams; |
| 5529 | wdiEventData.uEventDataSize = sizeof(WDI_HALDumpCmdReqParamsType); |
| 5530 | wdiEventData.pCBfnc = halDumpCmdRspCb; |
| 5531 | wdiEventData.pUserData = pUserData; |
| 5532 | |
| 5533 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 5534 | } |
| 5535 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5536 | /*============================================================================ |
| 5537 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5538 | DAL Control Path Main FSM Function Implementation |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5539 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5540 | ============================================================================*/ |
| 5541 | |
| 5542 | /** |
| 5543 | @brief Main FSM Start function for all states except BUSY |
| 5544 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5545 | |
| 5546 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5547 | wdiEV: event posted to the main DAL FSM |
| 5548 | pEventData: pointer to the event information |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5549 | structure |
| 5550 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5551 | @see |
| 5552 | @return Result of the function call |
| 5553 | */ |
| 5554 | WDI_Status |
| 5555 | WDI_PostMainEvent |
| 5556 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5557 | WDI_ControlBlockType* pWDICtx, |
| 5558 | WDI_MainEventType wdiEV, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5559 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5560 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5561 | ) |
| 5562 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5563 | WDI_Status wdiStatus; |
| 5564 | WDI_MainFuncType pfnWDIMainEvHdlr; |
| 5565 | WDI_MainStateType wdiOldState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5566 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5567 | |
| 5568 | /*------------------------------------------------------------------------- |
| 5569 | Sanity check |
| 5570 | -------------------------------------------------------------------------*/ |
| 5571 | if (( pWDICtx->uGlobalState >= WDI_MAX_ST ) || |
| 5572 | ( wdiEV >= WDI_MAX_EVENT )) |
| 5573 | { |
| 5574 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 5575 | "Invalid state or event in Post Main Ev function ST: %d EV: %d", |
| 5576 | pWDICtx->uGlobalState, wdiEV); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5577 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5578 | } |
| 5579 | |
| 5580 | /*Access to the global state must be locked */ |
| 5581 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5582 | |
| 5583 | /*Fetch event handler for state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5584 | pfnWDIMainEvHdlr = wdiMainFSM[pWDICtx->uGlobalState].pfnMainTbl[wdiEV]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5585 | |
| 5586 | wdiOldState = pWDICtx->uGlobalState; |
| 5587 | |
| 5588 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5589 | --Incase of WDI event is WDI_RESPONSE_EVENT and this is called when a |
| 5590 | response comes from CCPU for the request sent by host: |
| 5591 | 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] | 5592 | 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] | 5593 | --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] | 5594 | CCPU: |
| 5595 | don't change the state */ |
| 5596 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5597 | { |
| 5598 | /*Transition to BUSY State - the request is now being processed by the FSM, |
| 5599 | if the request fails we shall transition back to the old state, if not |
| 5600 | the request will manage its own state transition*/ |
| 5601 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
| 5602 | } |
| 5603 | /* If the state function associated with the EV is NULL it means that this |
| 5604 | event is not allowed in this state*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5605 | if ( NULL != pfnWDIMainEvHdlr ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5606 | { |
| 5607 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5608 | "Posting event %d in state: %d to the Main FSM", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5609 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5610 | wdiStatus = pfnWDIMainEvHdlr( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5611 | } |
| 5612 | else |
| 5613 | { |
| 5614 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5615 | "Unexpected event %d in state: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5616 | wdiEV, wdiOldState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5617 | wdiStatus = WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5618 | } |
| 5619 | |
| 5620 | /* If a request handles itself well it will end up in a success or in a |
| 5621 | pending |
| 5622 | Success - means that the request was processed and the proper state |
| 5623 | transition already occurred or will occur when the resp is received |
| 5624 | - NO other state transition or dequeueing is required |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5626 | Pending - means the request could not be processed at this moment in time |
| 5627 | because the FSM was already busy so no state transition or dequeueing |
| 5628 | is necessary anymore |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5630 | Success for synchronous case means that the transition may occur and |
| 5631 | processing of pending requests may continue - so it should go through |
| 5632 | and restores the state and continue processing queued requests*/ |
| 5633 | if (( WDI_STATUS_SUCCESS != wdiStatus )&& |
| 5634 | ( WDI_STATUS_PENDING != wdiStatus )) |
| 5635 | { |
| 5636 | if ( WDI_RESPONSE_EVENT != wdiEV) |
| 5637 | { |
| 5638 | /*The request has failed or could not be processed - transition back to |
| 5639 | the old state - check to see if anything was queued and try to execute |
| 5640 | The dequeue logic should post a message to a thread and return - no |
| 5641 | actual processing can occur */ |
| 5642 | WDI_STATE_TRANSITION( pWDICtx, wdiOldState); |
| 5643 | } |
| 5644 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5645 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5646 | } |
| 5647 | |
| 5648 | /* we have completed processing the event */ |
| 5649 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5650 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5651 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5652 | |
| 5653 | }/*WDI_PostMainEvent*/ |
| 5654 | |
| 5655 | |
| 5656 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5657 | INIT State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5658 | --------------------------------------------------------------------------*/ |
| 5659 | /** |
| 5660 | @brief Main FSM Start function for all states except BUSY |
| 5661 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5662 | |
| 5663 | @param pWDICtx: pointer to the WLAN DAL context |
| 5664 | pEventData: pointer to the event information structure |
| 5665 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5666 | @see |
| 5667 | @return Result of the function call |
| 5668 | */ |
| 5669 | WDI_Status |
| 5670 | WDI_MainStart |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5671 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5672 | WDI_ControlBlockType* pWDICtx, |
| 5673 | WDI_EventInfoType* pEventData |
| 5674 | ) |
| 5675 | { |
| 5676 | |
| 5677 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5678 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5679 | ----------------------------------------------------------------------*/ |
| 5680 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5681 | { |
| 5682 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5683 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5684 | pWDICtx, pEventData); |
| 5685 | return WDI_STATUS_E_FAILURE; |
| 5686 | } |
| 5687 | |
| 5688 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5689 | |
| 5690 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5691 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5692 | ----------------------------------------------------------------------*/ |
| 5693 | if ( eWLAN_PAL_FALSE == pWDICtx->bCTOpened ) |
| 5694 | { |
| 5695 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 5696 | "Control Transport not yet Open - queueing the request"); |
| 5697 | |
| 5698 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5699 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5700 | |
| 5701 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5702 | return WDI_STATUS_PENDING; |
| 5703 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5705 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5706 | |
| 5707 | /*Return Success*/ |
| 5708 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5709 | |
| 5710 | }/*WDI_MainStart*/ |
| 5711 | |
| 5712 | /** |
| 5713 | @brief Main FSM Response function for state INIT |
| 5714 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5715 | |
| 5716 | @param pWDICtx: pointer to the WLAN DAL context |
| 5717 | pEventData: pointer to the event information structure |
| 5718 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5719 | @see |
| 5720 | @return Result of the function call |
| 5721 | */ |
| 5722 | WDI_Status |
| 5723 | WDI_MainRspInit |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5724 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5725 | WDI_ControlBlockType* pWDICtx, |
| 5726 | WDI_EventInfoType* pEventData |
| 5727 | ) |
| 5728 | { |
| 5729 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5730 | Not expecting a response from the device before it is started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5731 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5732 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5733 | |
| 5734 | /*Return Success*/ |
| 5735 | return WDI_STATUS_E_NOT_ALLOWED; |
| 5736 | }/* WDI_MainRspInit */ |
| 5737 | |
| 5738 | /** |
| 5739 | @brief Main FSM Close function for all states except BUSY |
| 5740 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5741 | |
| 5742 | @param pWDICtx: pointer to the WLAN DAL context |
| 5743 | pEventData: pointer to the event information structure |
| 5744 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5745 | @see |
| 5746 | @return Result of the function call |
| 5747 | */ |
| 5748 | WDI_Status |
| 5749 | WDI_MainClose |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5750 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5751 | WDI_ControlBlockType* pWDICtx, |
| 5752 | WDI_EventInfoType* pEventData |
| 5753 | ) |
| 5754 | { |
| 5755 | |
| 5756 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5757 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5758 | ----------------------------------------------------------------------*/ |
| 5759 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5760 | { |
| 5761 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5762 | "Invalid parameters on Main Close %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5763 | pWDICtx, pEventData); |
| 5764 | return WDI_STATUS_E_FAILURE; |
| 5765 | } |
| 5766 | |
| 5767 | /*Return Success*/ |
| 5768 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5769 | |
| 5770 | }/*WDI_MainClose*/ |
| 5771 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5772 | STARTED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5773 | --------------------------------------------------------------------------*/ |
| 5774 | /** |
| 5775 | @brief Main FSM Start function for state STARTED |
| 5776 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5777 | |
| 5778 | @param pWDICtx: pointer to the WLAN DAL context |
| 5779 | pEventData: pointer to the event information structure |
| 5780 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5781 | @see |
| 5782 | @return Result of the function call |
| 5783 | */ |
| 5784 | WDI_Status |
| 5785 | WDI_MainStartStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5786 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5787 | WDI_ControlBlockType* pWDICtx, |
| 5788 | WDI_EventInfoType* pEventData |
| 5789 | ) |
| 5790 | { |
| 5791 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 5792 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 5793 | |
| 5794 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5795 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5796 | ----------------------------------------------------------------------*/ |
| 5797 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5798 | { |
| 5799 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5800 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5801 | pWDICtx, pEventData); |
| 5802 | return WDI_STATUS_E_FAILURE; |
| 5803 | } |
| 5804 | |
| 5805 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5806 | Nothing to do transport was already started |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5807 | ----------------------------------------------------------------------*/ |
| 5808 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5809 | "Received start while transport was already started - nothing to do"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5810 | |
| 5811 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5812 | |
| 5813 | /*Transition back to started because the post function transitioned us to |
| 5814 | busy*/ |
| 5815 | WDI_STATE_TRANSITION( pWDICtx, WDI_STARTED_ST); |
| 5816 | |
| 5817 | /*Check to see if any request is pending*/ |
| 5818 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5819 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5820 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5821 | |
| 5822 | /*Tell UMAC Success*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5823 | wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc; |
| 5824 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5825 | /*Notify UMAC*/ |
| 5826 | wdiStartRspCb( &pWDICtx->wdiCachedStartRspParams, pWDICtx->pRspCBUserData); |
| 5827 | |
| 5828 | /*Return Success*/ |
| 5829 | return WDI_STATUS_SUCCESS; |
| 5830 | |
| 5831 | }/*WDI_MainStartStarted*/ |
| 5832 | |
| 5833 | /** |
| 5834 | @brief Main FSM Stop function for state STARTED |
| 5835 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5836 | |
| 5837 | @param pWDICtx: pointer to the WLAN DAL context |
| 5838 | pEventData: pointer to the event information structure |
| 5839 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5840 | @see |
| 5841 | @return Result of the function call |
| 5842 | */ |
| 5843 | WDI_Status |
| 5844 | WDI_MainStopStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5845 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5846 | WDI_ControlBlockType* pWDICtx, |
| 5847 | WDI_EventInfoType* pEventData |
| 5848 | ) |
| 5849 | { |
| 5850 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5851 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5852 | ----------------------------------------------------------------------*/ |
| 5853 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5854 | { |
| 5855 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5856 | "Invalid parameters on Main Start %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5857 | pWDICtx, pEventData); |
| 5858 | return WDI_STATUS_E_FAILURE; |
| 5859 | } |
| 5860 | |
| 5861 | /*State at this point is BUSY - because we enter this state before posting |
| 5862 | an event to the FSM in order to prevent potential race conditions*/ |
| 5863 | |
| 5864 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 5865 | "Processing stop request in FSM"); |
| 5866 | |
| 5867 | /*Return Success*/ |
| 5868 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5869 | |
| 5870 | }/*WDI_MainStopStarted*/ |
| 5871 | /** |
| 5872 | @brief Main FSM Request function for state started |
| 5873 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5874 | |
| 5875 | @param pWDICtx: pointer to the WLAN DAL context |
| 5876 | pEventData: pointer to the event information structure |
| 5877 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5878 | @see |
| 5879 | @return Result of the function call |
| 5880 | */ |
| 5881 | WDI_Status |
| 5882 | WDI_MainReqStarted |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5883 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5884 | WDI_ControlBlockType* pWDICtx, |
| 5885 | WDI_EventInfoType* pEventData |
| 5886 | ) |
| 5887 | { |
| 5888 | |
| 5889 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5890 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5891 | ----------------------------------------------------------------------*/ |
| 5892 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5893 | { |
| 5894 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5895 | "Invalid parameters on Main Req Started %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5896 | pWDICtx, pEventData); |
| 5897 | return WDI_STATUS_E_FAILURE; |
| 5898 | } |
| 5899 | |
| 5900 | /*State at this point is BUSY - because we enter this state before posting |
| 5901 | an event to the FSM in order to prevent potential race conditions*/ |
| 5902 | |
| 5903 | /*Return Success*/ |
| 5904 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 5905 | |
| 5906 | }/*WDI_MainReqStarted*/ |
| 5907 | |
| 5908 | /** |
| 5909 | @brief Main FSM Response function for all states except INIT |
| 5910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5911 | |
| 5912 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5913 | pEventData: pointer to the event information structure |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5915 | @see |
| 5916 | @return Result of the function call |
| 5917 | */ |
| 5918 | WDI_Status |
| 5919 | WDI_MainRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5920 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5921 | WDI_ControlBlockType* pWDICtx, |
| 5922 | WDI_EventInfoType* pEventData |
| 5923 | ) |
| 5924 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5925 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5926 | wpt_boolean expectedResponse; |
| 5927 | |
| 5928 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5929 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5930 | ----------------------------------------------------------------------*/ |
| 5931 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 5932 | { |
| 5933 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5934 | "Invalid parameters on Main Response %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5935 | pWDICtx, pEventData); |
| 5936 | return WDI_STATUS_E_FAILURE; |
| 5937 | } |
| 5938 | |
| 5939 | if ( pEventData->wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 5940 | { |
| 5941 | /* we received an expected response */ |
| 5942 | expectedResponse = eWLAN_PAL_TRUE; |
| 5943 | |
| 5944 | /*We expect that we will transition to started after this processing*/ |
| 5945 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 5946 | |
| 5947 | /* we are no longer expecting a response */ |
| 5948 | pWDICtx->wdiExpectedResponse = WDI_MAX_RESP; |
| 5949 | } |
| 5950 | else |
| 5951 | { |
| 5952 | /* we received an indication or unexpected response */ |
| 5953 | expectedResponse = eWLAN_PAL_FALSE; |
| 5954 | /* for indications no need to update state from what it is right |
| 5955 | now, unless it explicitly does it in the indication handler (say |
| 5956 | for device failure ind) */ |
| 5957 | pWDICtx->ucExpectedStateTransition = pWDICtx->uGlobalState; |
| 5958 | } |
| 5959 | |
| 5960 | /*Process the response and indication */ |
| 5961 | wdiStatus = WDI_ProcessResponse( pWDICtx, pEventData ); |
| 5962 | |
| 5963 | /*Lock the CB as we are about to do a state transition*/ |
| 5964 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 5965 | |
| 5966 | /*Transition to the expected state after the response processing |
| 5967 | - this should always be started state with the following exceptions: |
| 5968 | 1. processing of a failed start response |
| 5969 | 2. device failure detected while processing response |
| 5970 | 3. stop response received*/ |
| 5971 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5972 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5973 | /*Dequeue request that may have been queued while we were waiting for the |
| 5974 | response */ |
| 5975 | if ( expectedResponse ) |
| 5976 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5977 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5978 | } |
| 5979 | |
| 5980 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 5981 | |
| 5982 | /*Return Success - always */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5983 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5984 | |
| 5985 | }/*WDI_MainRsp*/ |
| 5986 | |
| 5987 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5988 | STOPPED State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5989 | --------------------------------------------------------------------------*/ |
| 5990 | /** |
| 5991 | @brief Main FSM Stop function for state STOPPED |
| 5992 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5993 | |
| 5994 | @param pWDICtx: pointer to the WLAN DAL context |
| 5995 | pEventData: pointer to the event information structure |
| 5996 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5997 | @see |
| 5998 | @return Result of the function call |
| 5999 | */ |
| 6000 | WDI_Status |
| 6001 | WDI_MainStopStopped |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6002 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6003 | WDI_ControlBlockType* pWDICtx, |
| 6004 | WDI_EventInfoType* pEventData |
| 6005 | ) |
| 6006 | { |
| 6007 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6008 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6009 | ----------------------------------------------------------------------*/ |
| 6010 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6011 | { |
| 6012 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6013 | "Invalid parameters on Main Stop Stopped %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6014 | pWDICtx, pEventData); |
| 6015 | return WDI_STATUS_E_FAILURE; |
| 6016 | } |
| 6017 | |
| 6018 | /*We should normally not get a STOP request if we are already stopped |
| 6019 | since we should normally be stopped by the UMAC. However in some |
| 6020 | error situations we put ourselves in the stopped state without the |
| 6021 | UMAC knowing, so when we get a STOP request in this state we still |
| 6022 | process it since we need to clean up the underlying state */ |
| 6023 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6024 | "Processing stop request while stopped in FSM"); |
| 6025 | |
| 6026 | /*Return Success*/ |
| 6027 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6028 | |
| 6029 | }/*WDI_MainStopStopped*/ |
| 6030 | |
| 6031 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6032 | BUSY State Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6033 | --------------------------------------------------------------------------*/ |
| 6034 | /** |
| 6035 | @brief Main FSM Start function for state BUSY |
| 6036 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6037 | |
| 6038 | @param pWDICtx: pointer to the WLAN DAL context |
| 6039 | pEventData: pointer to the event information structure |
| 6040 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6041 | @see |
| 6042 | @return Result of the function call |
| 6043 | */ |
| 6044 | WDI_Status |
| 6045 | WDI_MainStartBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6046 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6047 | WDI_ControlBlockType* pWDICtx, |
| 6048 | WDI_EventInfoType* pEventData |
| 6049 | ) |
| 6050 | { |
| 6051 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6052 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6053 | ----------------------------------------------------------------------*/ |
| 6054 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6055 | { |
| 6056 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6057 | "Invalid parameters on Main Start in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6058 | pWDICtx, pEventData); |
| 6059 | return WDI_STATUS_E_FAILURE; |
| 6060 | } |
| 6061 | |
| 6062 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6063 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6064 | ----------------------------------------------------------------------*/ |
| 6065 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6066 | "WDI Busy state - queue start request"); |
| 6067 | |
| 6068 | /*Queue the start request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6069 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6070 | |
| 6071 | /*Return Success*/ |
| 6072 | return WDI_STATUS_PENDING; |
| 6073 | }/*WDI_MainStartBusy*/ |
| 6074 | |
| 6075 | /** |
| 6076 | @brief Main FSM Stop function for state BUSY |
| 6077 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6078 | |
| 6079 | @param pWDICtx: pointer to the WLAN DAL context |
| 6080 | pEventData: pointer to the event information structure |
| 6081 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6082 | @see |
| 6083 | @return Result of the function call |
| 6084 | */ |
| 6085 | WDI_Status |
| 6086 | WDI_MainStopBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6087 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6088 | WDI_ControlBlockType* pWDICtx, |
| 6089 | WDI_EventInfoType* pEventData |
| 6090 | ) |
| 6091 | { |
| 6092 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6093 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6094 | ----------------------------------------------------------------------*/ |
| 6095 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6096 | { |
| 6097 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6098 | "Invalid parameters on Main Stop in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6099 | pWDICtx, pEventData); |
| 6100 | return WDI_STATUS_E_FAILURE; |
| 6101 | } |
| 6102 | |
| 6103 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6104 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6105 | ----------------------------------------------------------------------*/ |
| 6106 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6107 | "WDI Busy state - queue stop request"); |
| 6108 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6109 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6110 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6111 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6112 | }/*WDI_MainStopBusy*/ |
| 6113 | |
| 6114 | /** |
| 6115 | @brief Main FSM Request function for state BUSY |
| 6116 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6117 | |
| 6118 | @param pWDICtx: pointer to the WLAN DAL context |
| 6119 | pEventData: pointer to the event information structure |
| 6120 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6121 | @see |
| 6122 | @return Result of the function call |
| 6123 | */ |
| 6124 | WDI_Status |
| 6125 | WDI_MainReqBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6126 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6127 | WDI_ControlBlockType* pWDICtx, |
| 6128 | WDI_EventInfoType* pEventData |
| 6129 | ) |
| 6130 | { |
| 6131 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6132 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6133 | ----------------------------------------------------------------------*/ |
| 6134 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6135 | { |
| 6136 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6137 | "Invalid parameters on Main Request in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6138 | pWDICtx, pEventData); |
| 6139 | return WDI_STATUS_E_FAILURE; |
| 6140 | } |
| 6141 | |
| 6142 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6143 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6144 | ----------------------------------------------------------------------*/ |
| 6145 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6146 | "WDI Busy state - queue request %d because waiting for response %d", |
| 6147 | pEventData->wdiRequest, pWDICtx->wdiExpectedResponse); |
| 6148 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6149 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6150 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6152 | }/*WDI_MainReqBusy*/ |
| 6153 | /** |
| 6154 | @brief Main FSM Close function for state BUSY |
| 6155 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6156 | |
| 6157 | @param pWDICtx: pointer to the WLAN DAL context |
| 6158 | pEventData: pointer to the event information structure |
| 6159 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6160 | @see |
| 6161 | @return Result of the function call |
| 6162 | */ |
| 6163 | WDI_Status |
| 6164 | WDI_MainCloseBusy |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6165 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6166 | WDI_ControlBlockType* pWDICtx, |
| 6167 | WDI_EventInfoType* pEventData |
| 6168 | ) |
| 6169 | { |
| 6170 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6171 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6172 | ----------------------------------------------------------------------*/ |
| 6173 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6174 | { |
| 6175 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6176 | "Invalid parameters on Main Close in BUSY %x %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6177 | pWDICtx, pEventData); |
| 6178 | return WDI_STATUS_E_FAILURE; |
| 6179 | } |
| 6180 | |
| 6181 | /*-------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6182 | Check if the Control Transport has been opened |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6183 | ----------------------------------------------------------------------*/ |
| 6184 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6185 | "WDI Busy state - queue close request"); |
| 6186 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6187 | WDI_QueuePendingReq( pWDICtx, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6188 | return WDI_STATUS_PENDING; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6189 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6190 | }/*WDI_MainCloseBusy*/ |
| 6191 | |
| 6192 | /** |
| 6193 | @brief Main FSM Shutdown function for INIT & STARTED states |
| 6194 | |
| 6195 | |
| 6196 | @param pWDICtx: pointer to the WLAN DAL context |
| 6197 | pEventData: pointer to the event information structure |
| 6198 | |
| 6199 | @see |
| 6200 | @return Result of the function call |
| 6201 | */ |
| 6202 | WDI_Status |
| 6203 | WDI_MainShutdown |
| 6204 | ( |
| 6205 | WDI_ControlBlockType* pWDICtx, |
| 6206 | WDI_EventInfoType* pEventData |
| 6207 | ) |
| 6208 | { |
| 6209 | /*-------------------------------------------------------------------- |
| 6210 | Sanity Check |
| 6211 | ----------------------------------------------------------------------*/ |
| 6212 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6213 | { |
| 6214 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6215 | "Invalid parameters on Main Start %x %x", |
| 6216 | pWDICtx, pEventData); |
| 6217 | return WDI_STATUS_E_FAILURE; |
| 6218 | } |
| 6219 | |
| 6220 | /*State at this point is BUSY - because we enter this state before posting |
| 6221 | an event to the FSM in order to prevent potential race conditions*/ |
| 6222 | |
| 6223 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6224 | "Processing shutdown request in FSM"); |
| 6225 | |
| 6226 | /*Return Success*/ |
| 6227 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6228 | |
| 6229 | }/*WDI_MainShutdown*/ |
| 6230 | |
| 6231 | /** |
| 6232 | @brief Main FSM Shutdown function for BUSY state |
| 6233 | |
| 6234 | |
| 6235 | @param pWDICtx: pointer to the WLAN DAL context |
| 6236 | pEventData: pointer to the event information structure |
| 6237 | |
| 6238 | @see |
| 6239 | @return Result of the function call |
| 6240 | */ |
| 6241 | WDI_Status |
| 6242 | WDI_MainShutdownBusy |
| 6243 | ( |
| 6244 | WDI_ControlBlockType* pWDICtx, |
| 6245 | WDI_EventInfoType* pEventData |
| 6246 | ) |
| 6247 | { |
| 6248 | /*-------------------------------------------------------------------- |
| 6249 | Sanity Check |
| 6250 | ----------------------------------------------------------------------*/ |
| 6251 | if (( NULL == pWDICtx ) || ( NULL == pEventData )) |
| 6252 | { |
| 6253 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6254 | "Invalid parameters on Main Start %x %x", |
| 6255 | pWDICtx, pEventData); |
| 6256 | return WDI_STATUS_E_FAILURE; |
| 6257 | } |
| 6258 | |
| 6259 | /* If you are waiting for a HAL response at this stage, you are not |
| 6260 | * going to get it. Riva is already shutdown/crashed. |
| 6261 | */ |
| 6262 | wpalTimerStop(&gWDICb.wptResponseTimer); |
| 6263 | |
| 6264 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6265 | "Processing shutdown request in FSM: Busy state "); |
| 6266 | |
| 6267 | return WDI_ProcessRequest( pWDICtx, pEventData ); |
| 6268 | |
| 6269 | }/*WDI_MainShutdownBusy*/ |
| 6270 | |
| 6271 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6272 | /*======================================================================= |
| 6273 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6274 | WLAN DAL Control Path Main Processing Functions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6275 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6276 | *=======================================================================*/ |
| 6277 | |
| 6278 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6279 | Main DAL Control Path Request Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6280 | ========================================================================*/ |
| 6281 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6282 | @brief Process Start Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6283 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6284 | |
| 6285 | @param pWDICtx: pointer to the WLAN DAL context |
| 6286 | pEventData: pointer to the event information structure |
| 6287 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6288 | @see |
| 6289 | @return Result of the function call |
| 6290 | */ |
| 6291 | WDI_Status |
| 6292 | WDI_ProcessStartReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6293 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6294 | WDI_ControlBlockType* pWDICtx, |
| 6295 | WDI_EventInfoType* pEventData |
| 6296 | ) |
| 6297 | { |
| 6298 | WDI_StartReqParamsType* pwdiStartParams = NULL; |
| 6299 | WDI_StartRspCb wdiStartRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6300 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6301 | wpt_uint16 usDataOffset = 0; |
| 6302 | wpt_uint16 usSendSize = 0; |
| 6303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6304 | tHalMacStartReqMsg halStartReq; |
| 6305 | wpt_uint16 usLen = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6306 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6307 | |
| 6308 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6309 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6310 | -------------------------------------------------------------------------*/ |
| 6311 | if (( NULL == pEventData ) || |
| 6312 | ( NULL == (pwdiStartParams = (WDI_StartReqParamsType*)pEventData->pEventData)) || |
| 6313 | ( NULL == (wdiStartRspCb = (WDI_StartRspCb)pEventData->pCBfnc))) |
| 6314 | { |
| 6315 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6316 | "%s: Invalid parameters", __FUNCTION__); |
| 6317 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6318 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6319 | } |
| 6320 | |
| 6321 | /*----------------------------------------------------------------------- |
| 6322 | Get message buffer |
| 6323 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6324 | usLen = sizeof(halStartReq.startReqParams) + |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6325 | pwdiStartParams->usConfigBufferLen; |
| 6326 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6327 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6328 | usLen, |
| 6329 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6330 | ( usSendSize < (usDataOffset + usLen ))) |
| 6331 | { |
| 6332 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 6333 | "Unable to get send buffer in start req %x %x %x", |
| 6334 | pEventData, pwdiStartParams, wdiStartRspCb); |
| 6335 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6336 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6337 | } |
| 6338 | |
| 6339 | /*----------------------------------------------------------------------- |
| 6340 | Fill in the message |
| 6341 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6342 | halStartReq.startReqParams.driverType = |
| 6343 | WDI_2_HAL_DRV_TYPE(pwdiStartParams->wdiDriverType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6344 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6345 | halStartReq.startReqParams.uConfigBufferLen = |
| 6346 | pwdiStartParams->usConfigBufferLen; |
| 6347 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6348 | &halStartReq.startReqParams, |
| 6349 | sizeof(halStartReq.startReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6350 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6351 | usDataOffset += sizeof(halStartReq.startReqParams); |
| 6352 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6353 | pwdiStartParams->pConfigBuffer, |
| 6354 | pwdiStartParams->usConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6355 | |
| 6356 | pWDICtx->wdiReqStatusCB = pwdiStartParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6357 | pWDICtx->pReqStatusUserData = pwdiStartParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6358 | |
| 6359 | /*Save Low Level Ind CB and associated user data - it will be used further |
| 6360 | on when an indication is coming from the lower MAC*/ |
| 6361 | pWDICtx->wdiLowLevelIndCB = pwdiStartParams->wdiLowLevelIndCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6362 | pWDICtx->pIndUserData = pwdiStartParams->pIndUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6363 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6364 | pWDICtx->bFrameTransEnabled = pwdiStartParams->bFrameTransEnabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6365 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6366 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6367 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6368 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6369 | wdiStartRspCb, pEventData->pUserData, WDI_START_RESP); |
| 6370 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6371 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6372 | }/*WDI_ProcessStartReq*/ |
| 6373 | |
| 6374 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6375 | @brief Process Stop Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6376 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6377 | |
| 6378 | @param pWDICtx: pointer to the WLAN DAL context |
| 6379 | pEventData: pointer to the event information structure |
| 6380 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6381 | @see |
| 6382 | @return Result of the function call |
| 6383 | */ |
| 6384 | WDI_Status |
| 6385 | WDI_ProcessStopReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6386 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6387 | WDI_ControlBlockType* pWDICtx, |
| 6388 | WDI_EventInfoType* pEventData |
| 6389 | ) |
| 6390 | { |
| 6391 | WDI_StopReqParamsType* pwdiStopParams = NULL; |
| 6392 | WDI_StopRspCb wdiStopRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6393 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6394 | wpt_uint16 usDataOffset = 0; |
| 6395 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6396 | wpt_status status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6397 | tHalMacStopReqMsg halStopReq; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6398 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6399 | |
| 6400 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6401 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6402 | -------------------------------------------------------------------------*/ |
| 6403 | if (( NULL == pEventData ) || |
| 6404 | ( NULL == (pwdiStopParams = (WDI_StopReqParamsType*)pEventData->pEventData)) || |
| 6405 | ( NULL == (wdiStopRspCb = (WDI_StopRspCb)pEventData->pCBfnc))) |
| 6406 | { |
| 6407 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6408 | "%s: Invalid parameters", __FUNCTION__); |
| 6409 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6410 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6411 | } |
| 6412 | |
| 6413 | /*----------------------------------------------------------------------- |
| 6414 | Get message buffer |
| 6415 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6416 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_STOP_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6417 | sizeof(halStopReq.stopReqParams), |
| 6418 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6419 | ( usSendSize < (usDataOffset + sizeof(halStopReq.stopReqParams) ))) |
| 6420 | { |
| 6421 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6422 | "Unable to get send buffer in stop req %x %x %x", |
| 6423 | pEventData, pwdiStopParams, wdiStopRspCb); |
| 6424 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6425 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6426 | } |
| 6427 | |
| 6428 | /*----------------------------------------------------------------------- |
| 6429 | Fill in the message |
| 6430 | -----------------------------------------------------------------------*/ |
| 6431 | halStopReq.stopReqParams.reason = WDI_2_HAL_STOP_REASON( |
| 6432 | pwdiStopParams->wdiStopReason); |
| 6433 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6434 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6435 | &halStopReq.stopReqParams, |
| 6436 | sizeof(halStopReq.stopReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6437 | |
| 6438 | pWDICtx->wdiReqStatusCB = pwdiStopParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6439 | pWDICtx->pReqStatusUserData = pwdiStopParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6440 | |
| 6441 | /*! TO DO: stop the data services */ |
| 6442 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6443 | { |
| 6444 | /*Stop the STA Table !UT- check this logic again |
| 6445 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 6446 | WDI_STATableStop(pWDICtx); |
| 6447 | |
| 6448 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6449 | status = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 6450 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6451 | { |
| 6452 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6453 | "WDI Init failed to reset power state event"); |
| 6454 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6455 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6456 | return VOS_STATUS_E_FAILURE; |
| 6457 | } |
| 6458 | /* Stop Transport Driver, DXE */ |
| 6459 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_DOWN, WDI_SetPowerStateCb); |
| 6460 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6461 | * 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] | 6462 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 6463 | status = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 6464 | WDI_SET_POWER_STATE_TIMEOUT); |
| 6465 | if (eWLAN_PAL_STATUS_SUCCESS != status) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6466 | { |
| 6467 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6468 | "WDI Init failed to wait on an event"); |
| 6469 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6470 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6471 | return VOS_STATUS_E_FAILURE; |
| 6472 | } |
| 6473 | } |
| 6474 | |
| 6475 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6476 | Send Stop Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6477 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6478 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6479 | wdiStopRspCb, pEventData->pUserData, WDI_STOP_RESP); |
| 6480 | |
| 6481 | }/*WDI_ProcessStopReq*/ |
| 6482 | |
| 6483 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6484 | @brief Process Close Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6485 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6486 | |
| 6487 | @param pWDICtx: pointer to the WLAN DAL context |
| 6488 | pEventData: pointer to the event information structure |
| 6489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6490 | @see |
| 6491 | @return Result of the function call |
| 6492 | */ |
| 6493 | WDI_Status |
| 6494 | WDI_ProcessCloseReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6495 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6496 | WDI_ControlBlockType* pWDICtx, |
| 6497 | WDI_EventInfoType* pEventData |
| 6498 | ) |
| 6499 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6500 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6501 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6502 | |
| 6503 | /*Lock control block for cleanup*/ |
| 6504 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6505 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6506 | /*Clear all pending request*/ |
| 6507 | WDI_ClearPendingRequests(pWDICtx); |
| 6508 | |
| 6509 | /* Close Control transport*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6510 | WCTS_CloseTransport(pWDICtx->wctsHandle); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6511 | |
| 6512 | /* Close Data transport*/ |
| 6513 | /* FTM mode does not open Data Path */ |
| 6514 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 6515 | { |
| 6516 | WDTS_Close(pWDICtx); |
| 6517 | } |
| 6518 | |
| 6519 | /*Close the STA Table !UT- check this logic again*/ |
| 6520 | WDI_STATableClose(pWDICtx); |
| 6521 | |
| 6522 | /*close the PAL */ |
| 6523 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 6524 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 6525 | { |
| 6526 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6527 | "Failed to wpal Close %d", wptStatus); |
| 6528 | WDI_ASSERT(0); |
| 6529 | } |
| 6530 | |
| 6531 | /*Transition back to init state*/ |
| 6532 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 6533 | |
| 6534 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6535 | |
| 6536 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6537 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6538 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6539 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6540 | }/*WDI_ProcessCloseReq*/ |
| 6541 | |
| 6542 | |
| 6543 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6544 | SCANING REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6545 | ===========================================================================*/ |
| 6546 | |
| 6547 | /** |
| 6548 | @brief Process Init Scan Request function (called when Main FSM |
| 6549 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6550 | |
| 6551 | @param pWDICtx: pointer to the WLAN DAL context |
| 6552 | pEventData: pointer to the event information structure |
| 6553 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6554 | @see |
| 6555 | @return Result of the function call |
| 6556 | */ |
| 6557 | WDI_Status |
| 6558 | WDI_ProcessInitScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6559 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6560 | WDI_ControlBlockType* pWDICtx, |
| 6561 | WDI_EventInfoType* pEventData |
| 6562 | ) |
| 6563 | { |
| 6564 | WDI_InitScanReqParamsType* pwdiInitScanParams = NULL; |
| 6565 | WDI_InitScanRspCb wdiInitScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6566 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6567 | wpt_uint16 usDataOffset = 0; |
| 6568 | wpt_uint16 usSendSize = 0; |
| 6569 | wpt_uint8 i = 0; |
| 6570 | |
| 6571 | tHalInitScanReqMsg halInitScanReqMsg; |
| 6572 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6573 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6574 | * It shold be removed once host and riva changes are in sync*/ |
| 6575 | tHalInitScanConReqMsg halInitScanConReqMsg; |
| 6576 | |
| 6577 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6578 | |
| 6579 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6580 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6581 | -------------------------------------------------------------------------*/ |
| 6582 | if (( NULL == pEventData ) || |
| 6583 | ( NULL == (pwdiInitScanParams = (WDI_InitScanReqParamsType*)pEventData->pEventData)) || |
| 6584 | ( NULL == (wdiInitScanRspCb = (WDI_InitScanRspCb)pEventData->pCBfnc))) |
| 6585 | { |
| 6586 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6587 | "%s: Invalid parameters", __FUNCTION__); |
| 6588 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6589 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6590 | } |
| 6591 | |
| 6592 | #if 0 |
| 6593 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6594 | /*----------------------------------------------------------------------- |
| 6595 | Check to see if SCAN is already in progress - if so reject the req |
| 6596 | We only allow one scan at a time |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6597 | ! TO DO: - revisit this constraint |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6598 | -----------------------------------------------------------------------*/ |
| 6599 | if ( pWDICtx->bScanInProgress ) |
| 6600 | { |
| 6601 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6602 | "Scan is already in progress - subsequent scan is not allowed" |
| 6603 | " until the first scan completes"); |
| 6604 | |
| 6605 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6606 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6607 | } |
| 6608 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6609 | pWDICtx->bScanInProgress = eWLAN_PAL_TRUE; |
| 6610 | pWDICtx->uScanState = WDI_SCAN_INITIALIZED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6611 | |
| 6612 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6613 | #endif |
| 6614 | |
| 6615 | if (pwdiInitScanParams->wdiReqInfo.bUseNOA) |
| 6616 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6617 | /*This is temporary fix. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6618 | * It shold be removed once host and riva changes are in sync*/ |
| 6619 | /*----------------------------------------------------------------------- |
| 6620 | Get message buffer |
| 6621 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6622 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_CON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6623 | sizeof(halInitScanConReqMsg.initScanParams), |
| 6624 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6625 | ( usSendSize < (usDataOffset + sizeof(halInitScanConReqMsg.initScanParams) ))) |
| 6626 | { |
| 6627 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6628 | "Unable to get send buffer in init scan req %x %x %x", |
| 6629 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6630 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6631 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6632 | } |
| 6633 | |
| 6634 | |
| 6635 | /*----------------------------------------------------------------------- |
| 6636 | Fill in the message |
| 6637 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6638 | halInitScanConReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6639 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6640 | |
| 6641 | wpalMemoryCopy(halInitScanConReqMsg.initScanParams.bssid, |
| 6642 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6643 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6644 | halInitScanConReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6645 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6646 | halInitScanConReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6647 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6648 | halInitScanConReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6649 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6650 | |
| 6651 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanConReqMsg.initScanParams.macMgmtHdr, |
| 6652 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6653 | |
| 6654 | #ifdef WLAN_FEATURE_P2P |
| 6655 | halInitScanConReqMsg.initScanParams.useNoA = pwdiInitScanParams->wdiReqInfo.bUseNOA; |
| 6656 | halInitScanConReqMsg.initScanParams.scanDuration = pwdiInitScanParams->wdiReqInfo.scanDuration; |
| 6657 | #endif |
| 6658 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6659 | halInitScanConReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6660 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6661 | |
| 6662 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6663 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6664 | halInitScanConReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6665 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6666 | } |
| 6667 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6668 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6669 | &halInitScanConReqMsg.initScanParams, |
| 6670 | sizeof(halInitScanConReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6671 | } |
| 6672 | else |
| 6673 | { |
| 6674 | /*----------------------------------------------------------------------- |
| 6675 | Get message buffer |
| 6676 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6677 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_INIT_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6678 | sizeof(halInitScanReqMsg.initScanParams), |
| 6679 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6680 | ( usSendSize < (usDataOffset + sizeof(halInitScanReqMsg.initScanParams) ))) |
| 6681 | { |
| 6682 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6683 | "Unable to get send buffer in init scan req %x %x %x", |
| 6684 | pEventData, pwdiInitScanParams, wdiInitScanRspCb); |
| 6685 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6686 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6687 | } |
| 6688 | |
| 6689 | |
| 6690 | /*----------------------------------------------------------------------- |
| 6691 | Fill in the message |
| 6692 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6693 | halInitScanReqMsg.initScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6694 | WDI_2_HAL_SCAN_MODE(pwdiInitScanParams->wdiReqInfo.wdiScanMode); |
| 6695 | |
| 6696 | wpalMemoryCopy(halInitScanReqMsg.initScanParams.bssid, |
| 6697 | pwdiInitScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 6698 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6699 | halInitScanReqMsg.initScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6700 | pwdiInitScanParams->wdiReqInfo.bNotifyBSS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6701 | halInitScanReqMsg.initScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6702 | pwdiInitScanParams->wdiReqInfo.ucFrameType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6703 | halInitScanReqMsg.initScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6704 | pwdiInitScanParams->wdiReqInfo.ucFrameLength; |
| 6705 | |
| 6706 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halInitScanReqMsg.initScanParams.macMgmtHdr, |
| 6707 | &pwdiInitScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 6708 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6709 | halInitScanReqMsg.initScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6710 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; |
| 6711 | |
| 6712 | for (i=0; i < pwdiInitScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 6713 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6714 | halInitScanReqMsg.initScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6715 | pwdiInitScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i]; |
| 6716 | } |
| 6717 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6718 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6719 | &halInitScanReqMsg.initScanParams, |
| 6720 | sizeof(halInitScanReqMsg.initScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6721 | } |
| 6722 | |
| 6723 | pWDICtx->wdiReqStatusCB = pwdiInitScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6724 | pWDICtx->pReqStatusUserData = pwdiInitScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6725 | |
| 6726 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6727 | Send Init Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6728 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6729 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6730 | wdiInitScanRspCb, pEventData->pUserData, WDI_INIT_SCAN_RESP); |
| 6731 | |
| 6732 | }/*WDI_ProcessInitScanReq*/ |
| 6733 | |
| 6734 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6735 | @brief Process Start Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6736 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6737 | |
| 6738 | @param pWDICtx: pointer to the WLAN DAL context |
| 6739 | pEventData: pointer to the event information structure |
| 6740 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6741 | @see |
| 6742 | @return Result of the function call |
| 6743 | */ |
| 6744 | WDI_Status |
| 6745 | WDI_ProcessStartScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6746 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6747 | WDI_ControlBlockType* pWDICtx, |
| 6748 | WDI_EventInfoType* pEventData |
| 6749 | ) |
| 6750 | { |
| 6751 | WDI_StartScanReqParamsType* pwdiStartScanParams = NULL; |
| 6752 | WDI_StartScanRspCb wdiStartScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6753 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6754 | wpt_uint16 usDataOffset = 0; |
| 6755 | wpt_uint16 usSendSize = 0; |
| 6756 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6757 | tHalStartScanReqMsg halStartScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6758 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6759 | |
| 6760 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6761 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6762 | -------------------------------------------------------------------------*/ |
| 6763 | if (( NULL == pEventData ) || |
| 6764 | ( NULL == (pwdiStartScanParams = (WDI_StartScanReqParamsType*)pEventData->pEventData)) || |
| 6765 | ( NULL == (wdiStartScanRspCb = (WDI_StartScanRspCb)pEventData->pCBfnc))) |
| 6766 | { |
| 6767 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6768 | "%s: Invalid parameters", __FUNCTION__); |
| 6769 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6770 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6771 | } |
| 6772 | |
| 6773 | #if 0 |
| 6774 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6775 | /*----------------------------------------------------------------------- |
| 6776 | Check to see if SCAN is already in progress - start scan is only |
| 6777 | 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] | 6778 | is either init or end |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6779 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6780 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6781 | (( WDI_SCAN_INITIALIZED_ST != pWDICtx->uScanState ) && |
| 6782 | ( WDI_SCAN_ENDED_ST != pWDICtx->uScanState ))) |
| 6783 | { |
| 6784 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 6785 | "Scan start not allowed in this state %d %d", |
| 6786 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6787 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6788 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6789 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6790 | } |
| 6791 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6792 | pWDICtx->uScanState = WDI_SCAN_STARTED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6793 | |
| 6794 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6795 | #endif |
| 6796 | |
| 6797 | /*----------------------------------------------------------------------- |
| 6798 | Get message buffer |
| 6799 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6800 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_START_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6801 | sizeof(halStartScanReqMsg.startScanParams), |
| 6802 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6803 | ( usSendSize < (usDataOffset + sizeof(halStartScanReqMsg.startScanParams) ))) |
| 6804 | { |
| 6805 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6806 | "Unable to get send buffer in start scan req %x %x %x", |
| 6807 | pEventData, pwdiStartScanParams, wdiStartScanRspCb); |
| 6808 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6809 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6810 | } |
| 6811 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6812 | halStartScanReqMsg.startScanParams.scanChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6813 | pwdiStartScanParams->ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6814 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6815 | &halStartScanReqMsg.startScanParams, |
| 6816 | sizeof(halStartScanReqMsg.startScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6817 | |
| 6818 | pWDICtx->wdiReqStatusCB = pwdiStartScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6819 | pWDICtx->pReqStatusUserData = pwdiStartScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6820 | |
| 6821 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6822 | Send Start Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6823 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6824 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6825 | wdiStartScanRspCb, pEventData->pUserData, WDI_START_SCAN_RESP); |
| 6826 | }/*WDI_ProcessStartScanReq*/ |
| 6827 | |
| 6828 | |
| 6829 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6830 | @brief Process End Scan Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6831 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6832 | |
| 6833 | @param pWDICtx: pointer to the WLAN DAL context |
| 6834 | pEventData: pointer to the event information structure |
| 6835 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6836 | @see |
| 6837 | @return Result of the function call |
| 6838 | */ |
| 6839 | WDI_Status |
| 6840 | WDI_ProcessEndScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6841 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6842 | WDI_ControlBlockType* pWDICtx, |
| 6843 | WDI_EventInfoType* pEventData |
| 6844 | ) |
| 6845 | { |
| 6846 | WDI_EndScanReqParamsType* pwdiEndScanParams = NULL; |
| 6847 | WDI_EndScanRspCb wdiEndScanRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6848 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6849 | wpt_uint16 usDataOffset = 0; |
| 6850 | wpt_uint16 usSendSize = 0; |
| 6851 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6852 | tHalEndScanReqMsg halEndScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6853 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6854 | |
| 6855 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6856 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6857 | -------------------------------------------------------------------------*/ |
| 6858 | if (( NULL == pEventData ) || |
| 6859 | ( NULL == (pwdiEndScanParams = (WDI_EndScanReqParamsType*)pEventData->pEventData)) || |
| 6860 | ( NULL == (wdiEndScanRspCb = (WDI_EndScanRspCb)pEventData->pCBfnc))) |
| 6861 | { |
| 6862 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6863 | "%s: Invalid parameters", __FUNCTION__); |
| 6864 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6865 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6866 | } |
| 6867 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6868 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 6869 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6870 | * forwarded to HAL and result in hang*/ |
| 6871 | #if 0 |
| 6872 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6873 | /*----------------------------------------------------------------------- |
| 6874 | Check to see if SCAN is already in progress - end scan is only |
| 6875 | allowed when a scan is ongoing and the state of the scan procedure |
| 6876 | is started |
| 6877 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6878 | if (( !pWDICtx->bScanInProgress ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6879 | ( WDI_SCAN_STARTED_ST != pWDICtx->uScanState )) |
| 6880 | { |
| 6881 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6882 | "End start not allowed in this state %d %d", |
| 6883 | pWDICtx->bScanInProgress, pWDICtx->uScanState); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6884 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6885 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6886 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6887 | } |
| 6888 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6889 | pWDICtx->uScanState = WDI_SCAN_ENDED_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6890 | |
| 6891 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6892 | #endif |
| 6893 | |
| 6894 | /*----------------------------------------------------------------------- |
| 6895 | Get message buffer |
| 6896 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6897 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_END_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6898 | sizeof(halEndScanReqMsg.endScanParams), |
| 6899 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 6900 | ( usSendSize < (usDataOffset + sizeof(halEndScanReqMsg.endScanParams) ))) |
| 6901 | { |
| 6902 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6903 | "Unable to get send buffer in start scan req %x %x %x", |
| 6904 | pEventData, pwdiEndScanParams, wdiEndScanRspCb); |
| 6905 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6906 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6907 | } |
| 6908 | |
| 6909 | halEndScanReqMsg.endScanParams.scanChannel = pwdiEndScanParams->ucChannel; |
| 6910 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6911 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 6912 | &halEndScanReqMsg.endScanParams, |
| 6913 | sizeof(halEndScanReqMsg.endScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6914 | |
| 6915 | pWDICtx->wdiReqStatusCB = pwdiEndScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6916 | pWDICtx->pReqStatusUserData = pwdiEndScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6917 | |
| 6918 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6919 | Send End Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6920 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6921 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6922 | wdiEndScanRspCb, pEventData->pUserData, WDI_END_SCAN_RESP); |
| 6923 | }/*WDI_ProcessEndScanReq*/ |
| 6924 | |
| 6925 | |
| 6926 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6927 | @brief Process Finish Scan Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6928 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6929 | |
| 6930 | @param pWDICtx: pointer to the WLAN DAL context |
| 6931 | pEventData: pointer to the event information structure |
| 6932 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6933 | @see |
| 6934 | @return Result of the function call |
| 6935 | */ |
| 6936 | WDI_Status |
| 6937 | WDI_ProcessFinishScanReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6938 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6939 | WDI_ControlBlockType* pWDICtx, |
| 6940 | WDI_EventInfoType* pEventData |
| 6941 | ) |
| 6942 | { |
| 6943 | WDI_FinishScanReqParamsType* pwdiFinishScanParams; |
| 6944 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6945 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6946 | wpt_uint16 usDataOffset = 0; |
| 6947 | wpt_uint16 usSendSize = 0; |
| 6948 | wpt_uint8 i = 0; |
| 6949 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6950 | tHalFinishScanReqMsg halFinishScanReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6951 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 6952 | |
| 6953 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6954 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6955 | -------------------------------------------------------------------------*/ |
| 6956 | if (( NULL == pEventData ) || |
| 6957 | ( NULL == pEventData->pEventData) || |
| 6958 | ( NULL == pEventData->pCBfnc)) |
| 6959 | { |
| 6960 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6961 | "%s: Invalid parameters", __FUNCTION__); |
| 6962 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6963 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6964 | } |
| 6965 | |
| 6966 | pwdiFinishScanParams = (WDI_FinishScanReqParamsType*)pEventData->pEventData; |
| 6967 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6968 | /* commenting this check as UMAC is sending END_SCAN_REQ after FINISH_SCAN |
| 6969 | * sometimes because of this check the scan request is not being |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6970 | * forwarded to HAL and result in hang*/ |
| 6971 | #if 0 |
| 6972 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 6973 | /*----------------------------------------------------------------------- |
| 6974 | Check to see if SCAN is already in progress |
| 6975 | Finish scan gets invoked any scan states. ie. abort scan |
| 6976 | It should be allowed in any states. |
| 6977 | -----------------------------------------------------------------------*/ |
| 6978 | if ( !pWDICtx->bScanInProgress ) |
| 6979 | { |
| 6980 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 6981 | "Finish start not allowed in this state %d", |
| 6982 | pWDICtx->bScanInProgress ); |
| 6983 | |
| 6984 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6985 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6986 | } |
| 6987 | |
| 6988 | /*----------------------------------------------------------------------- |
| 6989 | 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] | 6990 | back all subsequent requests will be blocked at BUSY state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6991 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6992 | pWDICtx->uScanState = WDI_SCAN_FINISHED_ST; |
| 6993 | pWDICtx->bScanInProgress = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6994 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 6995 | #endif |
| 6996 | |
| 6997 | if ( pWDICtx->bInBmps ) |
| 6998 | { |
| 6999 | // notify DTS that we are entering BMPS |
| 7000 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, NULL); |
| 7001 | } |
| 7002 | |
| 7003 | /*----------------------------------------------------------------------- |
| 7004 | Get message buffer |
| 7005 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7006 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FINISH_SCAN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7007 | sizeof(halFinishScanReqMsg.finishScanParams), |
| 7008 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7009 | ( usSendSize < (usDataOffset + sizeof(halFinishScanReqMsg.finishScanParams) ))) |
| 7010 | { |
| 7011 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7012 | "Unable to get send buffer in start scan req %x %x %x", |
| 7013 | pEventData, pwdiFinishScanParams, wdiFinishScanRspCb); |
| 7014 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7015 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7016 | } |
| 7017 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7018 | halFinishScanReqMsg.finishScanParams.scanMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7019 | WDI_2_HAL_SCAN_MODE(pwdiFinishScanParams->wdiReqInfo.wdiScanMode); |
| 7020 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7021 | halFinishScanReqMsg.finishScanParams.currentOperChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7022 | pwdiFinishScanParams->wdiReqInfo.ucCurrentOperatingChannel; |
| 7023 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7024 | halFinishScanReqMsg.finishScanParams.cbState = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7025 | WDI_2_HAL_CB_STATE(pwdiFinishScanParams->wdiReqInfo.wdiCBState); |
| 7026 | |
| 7027 | wpalMemoryCopy(halFinishScanReqMsg.finishScanParams.bssid, |
| 7028 | pwdiFinishScanParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 7029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7030 | halFinishScanReqMsg.finishScanParams.notifyBss = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7031 | pwdiFinishScanParams->wdiReqInfo.bNotifyBSS ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7032 | halFinishScanReqMsg.finishScanParams.frameType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7033 | pwdiFinishScanParams->wdiReqInfo.ucFrameType ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7034 | halFinishScanReqMsg.finishScanParams.frameLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7035 | pwdiFinishScanParams->wdiReqInfo.ucFrameLength ; |
| 7036 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7037 | halFinishScanReqMsg.finishScanParams.scanEntry.activeBSScnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7038 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt ; |
| 7039 | |
| 7040 | for (i = 0; i < pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.activeBSScnt; i++) |
| 7041 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7042 | halFinishScanReqMsg.finishScanParams.scanEntry.bssIdx[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7043 | pwdiFinishScanParams->wdiReqInfo.wdiScanEntry.bssIdx[i] ; |
| 7044 | } |
| 7045 | |
| 7046 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr( &halFinishScanReqMsg.finishScanParams.macMgmtHdr, |
| 7047 | &pwdiFinishScanParams->wdiReqInfo.wdiMACMgmtHdr); |
| 7048 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7049 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7050 | &halFinishScanReqMsg.finishScanParams, |
| 7051 | sizeof(halFinishScanReqMsg.finishScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7052 | |
| 7053 | pWDICtx->wdiReqStatusCB = pwdiFinishScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7054 | pWDICtx->pReqStatusUserData = pwdiFinishScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7055 | |
| 7056 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7057 | Send Finish Scan Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7058 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7059 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7060 | wdiFinishScanRspCb, pEventData->pUserData, WDI_FINISH_SCAN_RESP); |
| 7061 | }/*WDI_ProcessFinishScanReq*/ |
| 7062 | |
| 7063 | |
| 7064 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7065 | ASSOCIATION REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7066 | ==========================================================================*/ |
| 7067 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7068 | @brief Process BSS Join for a given Session |
| 7069 | |
| 7070 | @param pWDICtx: pointer to the WLAN DAL context |
| 7071 | pEventData: pointer to the event information structure |
| 7072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7073 | @see |
| 7074 | @return Result of the function call |
| 7075 | */ |
| 7076 | WDI_Status |
| 7077 | WDI_ProcessBSSSessionJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7078 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7079 | WDI_ControlBlockType* pWDICtx, |
| 7080 | WDI_JoinReqParamsType* pwdiJoinParams, |
| 7081 | WDI_JoinRspCb wdiJoinRspCb, |
| 7082 | void* pUserData |
| 7083 | ) |
| 7084 | { |
| 7085 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7086 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7087 | wpt_uint16 usDataOffset = 0; |
| 7088 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7089 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7090 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7091 | tHalJoinReqMsg halJoinReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7092 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7093 | |
| 7094 | /*------------------------------------------------------------------------ |
| 7095 | Check to see if we have any session with this BSSID already stored, we |
| 7096 | should not |
| 7097 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7098 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7099 | pwdiJoinParams->wdiReqInfo.macBSSID, |
| 7100 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7101 | |
| 7102 | if ( NULL != pBSSSes ) |
| 7103 | { |
| 7104 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7105 | "Association for this BSSID is already in place"); |
| 7106 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7107 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7108 | } |
| 7109 | |
| 7110 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7111 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7112 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7113 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7114 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7115 | if ( NULL == pBSSSes ) |
| 7116 | { |
| 7117 | |
| 7118 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7119 | "DAL has no free sessions - cannot run another join"); |
| 7120 | |
| 7121 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7122 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7123 | } |
| 7124 | |
| 7125 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7126 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7127 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiJoinParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7128 | WDI_MAC_ADDR_LEN); |
| 7129 | |
| 7130 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7131 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7132 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7133 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7134 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7135 | |
| 7136 | /*----------------------------------------------------------------------- |
| 7137 | Get message buffer |
| 7138 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7139 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_JOIN_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7140 | sizeof(halJoinReqMsg.joinReqParams), |
| 7141 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7142 | ( usSendSize < (usDataOffset + sizeof(halJoinReqMsg.joinReqParams) ))) |
| 7143 | { |
| 7144 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7145 | "Unable to get send buffer in join req %x %x %x", |
| 7146 | pUserData, pwdiJoinParams, wdiJoinRspCb); |
| 7147 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7148 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7149 | } |
| 7150 | |
| 7151 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7152 | pwdiJoinParams->wdiReqInfo.macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7153 | |
| 7154 | wpalMemoryCopy(halJoinReqMsg.joinReqParams.selfStaMacAddr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7155 | pwdiJoinParams->wdiReqInfo.macSTASelf, |
| 7156 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7157 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7158 | halJoinReqMsg.joinReqParams.ucChannel = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7159 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucChannel; |
| 7160 | |
| 7161 | halJoinReqMsg.joinReqParams.linkState = pwdiJoinParams->wdiReqInfo.linkState; |
| 7162 | |
| 7163 | #ifndef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7164 | halJoinReqMsg.joinReqParams.ucLocalPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7165 | pwdiJoinParams->wdiReqInfo.wdiChannelInfo.ucLocalPowerConstraint; |
| 7166 | #endif |
| 7167 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7168 | halJoinReqMsg.joinReqParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7169 | WDI_2_HAL_SEC_CH_OFFSET(pwdiJoinParams->wdiReqInfo.wdiChannelInfo. |
| 7170 | wdiSecondaryChannelOffset); |
| 7171 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7172 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7173 | &halJoinReqMsg.joinReqParams, |
| 7174 | sizeof(halJoinReqMsg.joinReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7175 | |
| 7176 | pWDICtx->wdiReqStatusCB = pwdiJoinParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7177 | pWDICtx->pReqStatusUserData = pwdiJoinParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7178 | |
| 7179 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7180 | Send Join Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7181 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7182 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7183 | wdiJoinRspCb, pUserData, WDI_JOIN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7184 | |
| 7185 | }/*WDI_ProcessBSSSessionJoinReq*/ |
| 7186 | |
| 7187 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7188 | @brief Process Join Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7189 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7190 | |
| 7191 | @param pWDICtx: pointer to the WLAN DAL context |
| 7192 | pEventData: pointer to the event information structure |
| 7193 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7194 | @see |
| 7195 | @return Result of the function call |
| 7196 | */ |
| 7197 | WDI_Status |
| 7198 | WDI_ProcessJoinReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7199 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7200 | WDI_ControlBlockType* pWDICtx, |
| 7201 | WDI_EventInfoType* pEventData |
| 7202 | ) |
| 7203 | { |
| 7204 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7205 | WDI_JoinReqParamsType* pwdiJoinParams = NULL; |
| 7206 | WDI_JoinRspCb wdiJoinRspCb = NULL; |
| 7207 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7208 | |
| 7209 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7210 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7211 | -------------------------------------------------------------------------*/ |
| 7212 | if (( NULL == pEventData ) || |
| 7213 | ( NULL == (pwdiJoinParams = (WDI_JoinReqParamsType*)pEventData->pEventData)) || |
| 7214 | ( NULL == (wdiJoinRspCb = (WDI_JoinRspCb)pEventData->pCBfnc))) |
| 7215 | { |
| 7216 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7217 | "%s: Invalid parameters", __FUNCTION__); |
| 7218 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7219 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7220 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7221 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7222 | /*------------------------------------------------------------------------- |
| 7223 | 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] | 7224 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7225 | -------------------------------------------------------------------------*/ |
| 7226 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7227 | |
| 7228 | if ( eWLAN_PAL_FALSE != pWDICtx->bAssociationInProgress ) |
| 7229 | { |
| 7230 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7231 | "Association is currently in progress, queueing new join req"); |
| 7232 | |
| 7233 | /*Association is in progress - queue current one*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7234 | wdiStatus = WDI_QueueNewAssocRequest(pWDICtx, pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7235 | pwdiJoinParams->wdiReqInfo.macBSSID); |
| 7236 | |
| 7237 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7238 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7239 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7240 | } |
| 7241 | |
| 7242 | /*Starting a new association */ |
| 7243 | pWDICtx->bAssociationInProgress = eWLAN_PAL_TRUE; |
| 7244 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7245 | |
| 7246 | /*Process the Join Request*/ |
| 7247 | return WDI_ProcessBSSSessionJoinReq( pWDICtx, pwdiJoinParams, |
| 7248 | wdiJoinRspCb,pEventData->pUserData); |
| 7249 | |
| 7250 | }/*WDI_ProcessJoinReq*/ |
| 7251 | |
| 7252 | |
| 7253 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7254 | @brief Process Config BSS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7255 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7256 | |
| 7257 | @param pWDICtx: pointer to the WLAN DAL context |
| 7258 | pEventData: pointer to the event information structure |
| 7259 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7260 | @see |
| 7261 | @return Result of the function call |
| 7262 | */ |
| 7263 | WDI_Status |
| 7264 | WDI_ProcessConfigBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7265 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7266 | WDI_ControlBlockType* pWDICtx, |
| 7267 | WDI_EventInfoType* pEventData |
| 7268 | ) |
| 7269 | { |
| 7270 | WDI_ConfigBSSReqParamsType* pwdiConfigBSSParams; |
| 7271 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7272 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7273 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7274 | wpt_uint16 uMsgSize = 0; |
| 7275 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7276 | wpt_uint16 usDataOffset = 0; |
| 7277 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7278 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7280 | tConfigBssReqMsg halConfigBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7281 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7282 | |
| 7283 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7284 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7285 | -------------------------------------------------------------------------*/ |
| 7286 | if (( NULL == pEventData ) || |
| 7287 | ( NULL == pEventData->pEventData ) || |
| 7288 | ( NULL == pEventData->pCBfnc )) |
| 7289 | { |
| 7290 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7291 | "%s: Invalid parameters", __FUNCTION__); |
| 7292 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7293 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7294 | } |
| 7295 | |
| 7296 | pwdiConfigBSSParams = (WDI_ConfigBSSReqParamsType*)pEventData->pEventData; |
| 7297 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pEventData->pCBfnc; |
| 7298 | /*------------------------------------------------------------------------- |
| 7299 | 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] | 7300 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7301 | -------------------------------------------------------------------------*/ |
| 7302 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7303 | |
| 7304 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7305 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7306 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7307 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7308 | pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
| 7309 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7310 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7311 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7312 | { |
| 7313 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 7314 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7315 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7316 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7317 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7318 | if ( NULL == pBSSSes ) |
| 7319 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7320 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7321 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7322 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7323 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7324 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7325 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7326 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7328 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7329 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7330 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7331 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7333 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7334 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7335 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7336 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7337 | /* 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] | 7338 | * Request in case of IBSS*/ |
| 7339 | if((pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_IBSS_MODE) || |
| 7340 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_INFRA_AP_MODE) || |
| 7341 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_AP_MODE) || |
| 7342 | (pwdiConfigBSSParams->wdiReqInfo.wdiBSSType == WDI_BTAMP_STA_MODE)) |
| 7343 | { |
| 7344 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7345 | Fetch an empty session block |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7346 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7347 | ucCurrentBSSSesIdx = WDI_FindEmptySession( pWDICtx, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7348 | if ( NULL == pBSSSes ) |
| 7349 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7350 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7351 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7352 | "DAL has no free sessions - cannot run another join"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7353 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7354 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7355 | return WDI_STATUS_RES_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7356 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7357 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7358 | /*Save BSS Session Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7359 | pBSSSes->bInUse = eWLAN_PAL_TRUE; |
| 7360 | wpalMemoryCopy( pBSSSes->macBSSID, pwdiConfigBSSParams->wdiReqInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7361 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7362 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7363 | /*Transition to state Joining*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7364 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7365 | pWDICtx->ucCurrentBSSSesIdx = ucCurrentBSSSesIdx; |
| 7366 | } |
| 7367 | else |
| 7368 | { |
| 7369 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7370 | "%s: Association sequence for this BSS does not yet exist." MAC_ADDRESS_STR "wdiBssType %d", |
| 7371 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7372 | pwdiConfigBSSParams->wdiReqInfo.wdiBSSType); |
| 7373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7374 | /* for IBSS testing */ |
| 7375 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7376 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7377 | } |
| 7378 | #endif |
| 7379 | } |
| 7380 | |
| 7381 | /*------------------------------------------------------------------------ |
| 7382 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7383 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7384 | ------------------------------------------------------------------------*/ |
| 7385 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7386 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7387 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7388 | "%s: Association sequence for this BSS exists but currently queued. " MAC_ADDRESS_STR " bssIdx %d", |
| 7389 | __func__, MAC_ADDR_ARRAY(pwdiConfigBSSParams->wdiReqInfo.macBSSID), |
| 7390 | ucCurrentBSSSesIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7391 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7392 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7393 | |
| 7394 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7395 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7396 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7397 | } |
| 7398 | |
| 7399 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7400 | wpalMemoryCopy(&pWDICtx->wdiCachedConfigBssReq, |
| 7401 | pwdiConfigBSSParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7402 | sizeof(pWDICtx->wdiCachedConfigBssReq)); |
| 7403 | |
| 7404 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7405 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7406 | /* Allocation of BssReqMsg Memory Based on Firmware Capabilities */ |
| 7407 | #ifdef WLAN_FEATURE_11AC |
| 7408 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 7409 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams_V1); // Version - 1 For 11AC |
| 7410 | else |
| 7411 | #endif |
| 7412 | uMsgSize = sizeof(halConfigBssReqMsg.uBssParams.configBssParams); // default Version - 0 Structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7413 | |
| 7414 | /*----------------------------------------------------------------------- |
| 7415 | Get message buffer |
| 7416 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7417 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7418 | uMsgSize, &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7419 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7420 | { |
| 7421 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7422 | "Unable to get send buffer in config bss req %x %x %x", |
| 7423 | pEventData, pwdiConfigBSSParams, wdiConfigBSSRspCb); |
| 7424 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7425 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7426 | } |
| 7427 | |
| 7428 | /*Copy the BSS request */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7429 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halConfigBssReqMsg.uBssParams.configBssParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7430 | &pwdiConfigBSSParams->wdiReqInfo); |
| 7431 | |
| 7432 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 7433 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7434 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7435 | |
| 7436 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7437 | halConfigBssReqMsg.uBssParams.configBssParams.staContext.bssIdx = pBSSSes->ucBSSIdx; |
| 7438 | |
| 7439 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7440 | &halConfigBssReqMsg.uBssParams.configBssParams, |
| 7441 | uMsgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7442 | |
| 7443 | pWDICtx->wdiReqStatusCB = pwdiConfigBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7444 | pWDICtx->pReqStatusUserData = pwdiConfigBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7445 | |
| 7446 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7447 | Send Config BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7448 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7449 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 7450 | wdiConfigBSSRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7451 | WDI_CONFIG_BSS_RESP); |
| 7452 | |
| 7453 | }/*WDI_ProcessConfigBSSReq*/ |
| 7454 | |
| 7455 | |
| 7456 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7457 | @brief Process Del BSS Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7458 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7459 | |
| 7460 | @param pWDICtx: pointer to the WLAN DAL context |
| 7461 | pEventData: pointer to the event information structure |
| 7462 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7463 | @see |
| 7464 | @return Result of the function call |
| 7465 | */ |
| 7466 | WDI_Status |
| 7467 | WDI_ProcessDelBSSReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7468 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7469 | WDI_ControlBlockType* pWDICtx, |
| 7470 | WDI_EventInfoType* pEventData |
| 7471 | ) |
| 7472 | { |
| 7473 | WDI_DelBSSReqParamsType* pwdiDelBSSParams = NULL; |
| 7474 | WDI_DelBSSRspCb wdiDelBSSRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7475 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7476 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7477 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7478 | wpt_uint16 usDataOffset = 0; |
| 7479 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7480 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7481 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7482 | tDeleteBssReqMsg halBssReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7483 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7484 | |
| 7485 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7486 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7487 | -------------------------------------------------------------------------*/ |
| 7488 | if (( NULL == pEventData ) || |
| 7489 | ( NULL == (pwdiDelBSSParams = (WDI_DelBSSReqParamsType*)pEventData->pEventData)) || |
| 7490 | ( NULL == (wdiDelBSSRspCb = (WDI_DelBSSRspCb)pEventData->pCBfnc))) |
| 7491 | { |
| 7492 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7493 | "%s: Invalid parameters", __FUNCTION__); |
| 7494 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7495 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7496 | } |
| 7497 | |
| 7498 | /*------------------------------------------------------------------------- |
| 7499 | 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] | 7500 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7501 | -------------------------------------------------------------------------*/ |
| 7502 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7503 | |
| 7504 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7505 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7506 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7507 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 7508 | pwdiDelBSSParams->ucBssIdx, |
| 7509 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7510 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7511 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7512 | { |
| 7513 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7514 | "%s: BSS does not yet exist. ucBssIdx %d", |
| 7515 | __func__, pwdiDelBSSParams->ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7516 | |
| 7517 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7518 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7519 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7520 | } |
| 7521 | |
| 7522 | /*------------------------------------------------------------------------ |
| 7523 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7524 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7525 | ------------------------------------------------------------------------*/ |
| 7526 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7527 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7528 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7529 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 7530 | __func__, pwdiDelBSSParams->ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7531 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7532 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7533 | |
| 7534 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7535 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7536 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7537 | } |
| 7538 | |
| 7539 | /*----------------------------------------------------------------------- |
| 7540 | If we receive a Del BSS request for an association that is already in |
| 7541 | progress, it indicates that the assoc has failed => we no longer have |
| 7542 | an association in progress => we must check for pending associations |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7543 | 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] | 7544 | -----------------------------------------------------------------------*/ |
| 7545 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
| 7546 | { |
| 7547 | /*We can switch to false here because even if a subsequent Join comes in |
| 7548 | it will only be processed when DAL transitions out of BUSY state which |
| 7549 | happens when the Del BSS request comes */ |
| 7550 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 7551 | |
| 7552 | /*Former association is complete - prepare next pending assoc for |
| 7553 | processing */ |
| 7554 | WDI_DequeueAssocRequest(pWDICtx); |
| 7555 | } |
| 7556 | |
| 7557 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7558 | /*----------------------------------------------------------------------- |
| 7559 | Get message buffer |
| 7560 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7561 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BSS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7562 | sizeof(halBssReqMsg.deleteBssParams), |
| 7563 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7564 | ( usSendSize < (usDataOffset + sizeof(halBssReqMsg.deleteBssParams) ))) |
| 7565 | { |
| 7566 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7567 | "Unable to get send buffer in start req %x %x %x", |
| 7568 | pEventData, pwdiDelBSSParams, wdiDelBSSRspCb); |
| 7569 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7570 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7571 | } |
| 7572 | |
| 7573 | /*Fill in the message request structure*/ |
| 7574 | |
| 7575 | /*BSS Index is saved on config BSS response and Post Assoc Response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7576 | halBssReqMsg.deleteBssParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7577 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7578 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7579 | &halBssReqMsg.deleteBssParams, |
| 7580 | sizeof(halBssReqMsg.deleteBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7581 | |
| 7582 | pWDICtx->wdiReqStatusCB = pwdiDelBSSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7583 | pWDICtx->pReqStatusUserData = pwdiDelBSSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7585 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7586 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7587 | Send Del BSS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7588 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7589 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7590 | wdiDelBSSRspCb, pEventData->pUserData, WDI_DEL_BSS_RESP); |
| 7591 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7592 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7593 | }/*WDI_ProcessDelBSSReq*/ |
| 7594 | |
| 7595 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7596 | @brief Process Post Assoc Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7597 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7598 | |
| 7599 | @param pWDICtx: pointer to the WLAN DAL context |
| 7600 | pEventData: pointer to the event information structure |
| 7601 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7602 | @see |
| 7603 | @return Result of the function call |
| 7604 | */ |
| 7605 | WDI_Status |
| 7606 | WDI_ProcessPostAssocReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7607 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7608 | WDI_ControlBlockType* pWDICtx, |
| 7609 | WDI_EventInfoType* pEventData |
| 7610 | ) |
| 7611 | { |
| 7612 | WDI_PostAssocReqParamsType* pwdiPostAssocParams = NULL; |
| 7613 | WDI_PostAssocRspCb wdiPostAssocRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7614 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7615 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7616 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7617 | wpt_uint16 usDataOffset = 0; |
| 7618 | wpt_uint16 usSendSize = 0; |
| 7619 | wpt_uint16 uMsgSize = 0; |
| 7620 | wpt_uint16 uOffset = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7621 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7622 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7623 | tPostAssocReqMsg halPostAssocReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7624 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7625 | |
| 7626 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7627 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7628 | -------------------------------------------------------------------------*/ |
| 7629 | if (( NULL == pEventData ) || |
| 7630 | ( NULL == (pwdiPostAssocParams = (WDI_PostAssocReqParamsType*)pEventData->pEventData)) || |
| 7631 | ( NULL == (wdiPostAssocRspCb = (WDI_PostAssocRspCb)pEventData->pCBfnc))) |
| 7632 | { |
| 7633 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7634 | "%s: Invalid parameters", __FUNCTION__); |
| 7635 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7636 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7637 | } |
| 7638 | |
| 7639 | /*------------------------------------------------------------------------- |
| 7640 | 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] | 7641 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7642 | -------------------------------------------------------------------------*/ |
| 7643 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7644 | |
| 7645 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7646 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7647 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7648 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 7649 | pwdiPostAssocParams->wdiBSSParams.macBSSID, |
| 7650 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7651 | |
| 7652 | if ( NULL == pBSSSes ) |
| 7653 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7654 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7655 | "%s: Association sequence for this BSS does not yet exist - " |
| 7656 | "operation not allowed. macBSSID " MAC_ADDRESS_STR, |
| 7657 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7658 | |
| 7659 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7660 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7661 | } |
| 7662 | |
| 7663 | /*------------------------------------------------------------------------ |
| 7664 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7665 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7666 | ------------------------------------------------------------------------*/ |
| 7667 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7668 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7669 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7670 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7671 | __func__, MAC_ADDR_ARRAY(pwdiPostAssocParams->wdiBSSParams.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7672 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7673 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7674 | |
| 7675 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7676 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7677 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7678 | } |
| 7679 | |
| 7680 | /*----------------------------------------------------------------------- |
| 7681 | If Post Assoc was not yet received - the current association must |
| 7682 | be in progress |
| 7683 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7684 | if (( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7685 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 7686 | { |
| 7687 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7688 | "Association sequence for this BSS association no longer in " |
| 7689 | "progress - not allowed"); |
| 7690 | |
| 7691 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7692 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7693 | } |
| 7694 | |
| 7695 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7696 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7697 | -----------------------------------------------------------------------*/ |
| 7698 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 7699 | { |
| 7700 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7701 | "Post Assoc not allowed before JOIN - failing request"); |
| 7702 | |
| 7703 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7704 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7705 | } |
| 7706 | |
| 7707 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7708 | |
| 7709 | uMsgSize = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams) + |
| 7710 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams) ; |
| 7711 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7712 | Fill message for tx over the bus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7713 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7714 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_POST_ASSOC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7715 | uMsgSize,&pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7716 | ( usSendSize < (usDataOffset + uMsgSize ))) |
| 7717 | { |
| 7718 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7719 | "Unable to get send buffer in start req %x %x %x", |
| 7720 | pEventData, pwdiPostAssocParams, wdiPostAssocRspCb); |
| 7721 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7722 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7723 | } |
| 7724 | |
| 7725 | /*Copy the STA parameters */ |
| 7726 | WDI_CopyWDIStaCtxToHALStaCtx(&halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 7727 | &pwdiPostAssocParams->wdiSTAParams ); |
| 7728 | |
| 7729 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7730 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7731 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 7732 | pwdiPostAssocParams->wdiSTAParams.macSTA, |
| 7733 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configStaParams.staIdx )) |
| 7734 | { |
| 7735 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7736 | "This station does not exist in the WDI Station Table %d"); |
| 7737 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7738 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7739 | } |
| 7740 | |
| 7741 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7742 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7743 | pBSSSes->ucBSSIdx; |
| 7744 | |
| 7745 | /*Copy the BSS parameters */ |
| 7746 | WDI_CopyWDIConfigBSSToHALConfigBSS( &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 7747 | &pwdiPostAssocParams->wdiBSSParams); |
| 7748 | |
| 7749 | /* Need to fill in the STA index of the peer */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7750 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7751 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 7752 | pwdiPostAssocParams->wdiBSSParams.wdiSTAContext.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7753 | (wpt_uint8*)&halPostAssocReqMsg.postAssocReqParams.configBssParams.staContext.staIdx)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7754 | { |
| 7755 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7756 | "This station does not exist in the WDI Station Table %d"); |
| 7757 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7758 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7759 | } |
| 7760 | |
| 7761 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7762 | halPostAssocReqMsg.postAssocReqParams.configStaParams.bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7763 | pBSSSes->ucBSSIdx; |
| 7764 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7765 | |
| 7766 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7767 | &halPostAssocReqMsg.postAssocReqParams.configStaParams, |
| 7768 | sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7769 | |
| 7770 | uOffset = sizeof(halPostAssocReqMsg.postAssocReqParams.configStaParams); |
| 7771 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7772 | wpalMemoryCopy( pSendBuffer+usDataOffset + uOffset, |
| 7773 | &halPostAssocReqMsg.postAssocReqParams.configBssParams, |
| 7774 | sizeof(halPostAssocReqMsg.postAssocReqParams.configBssParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7775 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7776 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7777 | pWDICtx->wdiReqStatusCB = pwdiPostAssocParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7778 | pWDICtx->pReqStatusUserData = pwdiPostAssocParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7779 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7780 | |
| 7781 | wpalMemoryCopy( &pWDICtx->wdiCachedPostAssocReq, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7782 | pwdiPostAssocParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7783 | sizeof(pWDICtx->wdiCachedPostAssocReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7784 | |
| 7785 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7786 | Send Post Assoc Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7787 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7788 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7789 | wdiPostAssocRspCb, pEventData->pUserData, WDI_POST_ASSOC_RESP); |
| 7790 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7791 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7792 | }/*WDI_ProcessPostAssocReq*/ |
| 7793 | |
| 7794 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7795 | @brief Process Del STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7796 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7797 | |
| 7798 | @param pWDICtx: pointer to the WLAN DAL context |
| 7799 | pEventData: pointer to the event information structure |
| 7800 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7801 | @see |
| 7802 | @return Result of the function call |
| 7803 | */ |
| 7804 | WDI_Status |
| 7805 | WDI_ProcessDelSTAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7806 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7807 | WDI_ControlBlockType* pWDICtx, |
| 7808 | WDI_EventInfoType* pEventData |
| 7809 | ) |
| 7810 | { |
| 7811 | WDI_DelSTAReqParamsType* pwdiDelSTAParams; |
| 7812 | WDI_DelSTARspCb wdiDelSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7813 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7814 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7815 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7816 | wpt_uint16 usDataOffset = 0; |
| 7817 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7818 | wpt_macAddr macBSSID; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7819 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 7820 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7821 | tDeleteStaReqMsg halDelStaReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7822 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7823 | |
| 7824 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7825 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7826 | -------------------------------------------------------------------------*/ |
| 7827 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 7828 | ( NULL == pEventData->pCBfnc )) |
| 7829 | { |
| 7830 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7831 | "%s: Invalid parameters", __FUNCTION__); |
| 7832 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7833 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7834 | } |
| 7835 | |
| 7836 | pwdiDelSTAParams = (WDI_DelSTAReqParamsType*)pEventData->pEventData; |
| 7837 | wdiDelSTARspCb = (WDI_DelSTARspCb)pEventData->pCBfnc; |
| 7838 | /*------------------------------------------------------------------------- |
| 7839 | 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] | 7840 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7841 | -------------------------------------------------------------------------*/ |
| 7842 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 7843 | |
| 7844 | /*------------------------------------------------------------------------ |
| 7845 | Find the BSS for which the request is made and identify WDI session |
| 7846 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7847 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 7848 | pwdiDelSTAParams->ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7849 | &macBSSID)) |
| 7850 | { |
| 7851 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7852 | "This station does not exist in the WDI Station Table %d"); |
| 7853 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7854 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7855 | } |
| 7856 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7857 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 7858 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7859 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7860 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 7861 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 7862 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7863 | |
| 7864 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7865 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7866 | } |
| 7867 | |
| 7868 | /*------------------------------------------------------------------------ |
| 7869 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7870 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7871 | ------------------------------------------------------------------------*/ |
| 7872 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7873 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7874 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7875 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 7876 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7877 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7878 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7879 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7880 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7881 | } |
| 7882 | |
| 7883 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 7884 | /*----------------------------------------------------------------------- |
| 7885 | Get message buffer |
| 7886 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7887 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7888 | sizeof(halDelStaReqMsg.delStaParams), |
| 7889 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 7890 | ( usSendSize < (usDataOffset + sizeof(halDelStaReqMsg.delStaParams) ))) |
| 7891 | { |
| 7892 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7893 | "Unable to get send buffer in start req %x %x %x", |
| 7894 | pEventData, pwdiDelSTAParams, wdiDelSTARspCb); |
| 7895 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7896 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7897 | } |
| 7898 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7899 | halDelStaReqMsg.delStaParams.staIdx = pwdiDelSTAParams->ucSTAIdx; |
| 7900 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 7901 | &halDelStaReqMsg.delStaParams, |
| 7902 | sizeof(halDelStaReqMsg.delStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7903 | |
| 7904 | pWDICtx->wdiReqStatusCB = pwdiDelSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7905 | pWDICtx->pReqStatusUserData = pwdiDelSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7906 | |
| 7907 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7908 | Send Del STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7909 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7910 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7911 | wdiDelSTARspCb, pEventData->pUserData, WDI_DEL_STA_RESP); |
| 7912 | |
| 7913 | }/*WDI_ProcessDelSTAReq*/ |
| 7914 | |
| 7915 | |
| 7916 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7917 | SECURITY REQUEST PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7918 | ==========================================================================*/ |
| 7919 | /** |
| 7920 | @brief Process Set BSS Key Request function (called when Main FSM |
| 7921 | 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_ProcessSetBssKeyReq |
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_SetBSSKeyReqParamsType* pwdiSetBSSKeyParams; |
| 7937 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
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; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7943 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7944 | tSetBssKeyReqMsg halSetBssKeyReqMsg = {{0}}; |
| 7945 | wpt_uint8 keyIndex = 0; |
| 7946 | |
| 7947 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 7948 | |
| 7949 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7950 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7951 | -------------------------------------------------------------------------*/ |
| 7952 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 7953 | ( NULL == pEventData->pCBfnc )) |
| 7954 | { |
| 7955 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7956 | "%s: Invalid parameters", __FUNCTION__); |
| 7957 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7958 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7959 | } |
| 7960 | |
| 7961 | pwdiSetBSSKeyParams = (WDI_SetBSSKeyReqParamsType*)pEventData->pEventData; |
| 7962 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pEventData->pCBfnc; |
| 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_FindAssocSessionByBSSIdx( pWDICtx, |
| 7973 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx, |
| 7974 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7975 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7976 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7977 | { |
| 7978 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7979 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 7980 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7981 | |
| 7982 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7983 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7984 | } |
| 7985 | |
| 7986 | /*------------------------------------------------------------------------ |
| 7987 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7988 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7989 | ------------------------------------------------------------------------*/ |
| 7990 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 7991 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7992 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 7993 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 7994 | __func__, pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7995 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7996 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7997 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7998 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7999 | } |
| 8000 | |
| 8001 | |
| 8002 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8003 | /*----------------------------------------------------------------------- |
| 8004 | Get message buffer |
| 8005 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8006 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8007 | sizeof(halSetBssKeyReqMsg.setBssKeyParams), |
| 8008 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8009 | ( usSendSize < (usDataOffset + sizeof(halSetBssKeyReqMsg.setBssKeyParams) ))) |
| 8010 | { |
| 8011 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8012 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8013 | pEventData, pwdiSetBSSKeyParams, wdiSetBSSKeyRspCb); |
| 8014 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8015 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8016 | } |
| 8017 | |
| 8018 | /*----------------------------------------------------------------------- |
| 8019 | Copy the Key parameters into the HAL message |
| 8020 | -----------------------------------------------------------------------*/ |
| 8021 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8022 | halSetBssKeyReqMsg.setBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8023 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8024 | halSetBssKeyReqMsg.setBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8025 | WDI_2_HAL_ENC_TYPE (pwdiSetBSSKeyParams->wdiBSSKeyInfo.wdiEncType); |
| 8026 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8027 | halSetBssKeyReqMsg.setBssKeyParams.numKeys = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8028 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys; |
| 8029 | |
| 8030 | for(keyIndex = 0; keyIndex < pwdiSetBSSKeyParams->wdiBSSKeyInfo.ucNumKeys ; |
| 8031 | keyIndex++) |
| 8032 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8033 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8034 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyId; |
| 8035 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].unicast = |
| 8036 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].unicast; |
| 8037 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyDirection = |
| 8038 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyDirection; |
| 8039 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8040 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8041 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8042 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8043 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8044 | halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8045 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].keyLength; |
| 8046 | wpalMemoryCopy(halSetBssKeyReqMsg.setBssKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8047 | pwdiSetBSSKeyParams->wdiBSSKeyInfo.aKeys[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8048 | WDI_MAX_KEY_LENGTH); |
| 8049 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8050 | |
| 8051 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8052 | &halSetBssKeyReqMsg.setBssKeyParams, |
| 8053 | sizeof(halSetBssKeyReqMsg.setBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8054 | |
| 8055 | pWDICtx->wdiReqStatusCB = pwdiSetBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8056 | pWDICtx->pReqStatusUserData = pwdiSetBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8057 | |
| 8058 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8059 | Send Set BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8060 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8061 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8062 | wdiSetBSSKeyRspCb, pEventData->pUserData, |
| 8063 | WDI_SET_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8064 | |
| 8065 | }/*WDI_ProcessSetBssKeyReq*/ |
| 8066 | |
| 8067 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8068 | @brief Process Remove BSS Key Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8069 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8070 | |
| 8071 | @param pWDICtx: pointer to the WLAN DAL context |
| 8072 | pEventData: pointer to the event information structure |
| 8073 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8074 | @see |
| 8075 | @return Result of the function call |
| 8076 | */ |
| 8077 | WDI_Status |
| 8078 | WDI_ProcessRemoveBssKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8079 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8080 | WDI_ControlBlockType* pWDICtx, |
| 8081 | WDI_EventInfoType* pEventData |
| 8082 | ) |
| 8083 | { |
| 8084 | WDI_RemoveBSSKeyReqParamsType* pwdiRemoveBSSKeyParams; |
| 8085 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8086 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8087 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8088 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8089 | wpt_uint16 usDataOffset = 0; |
| 8090 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8091 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8092 | tRemoveBssKeyReqMsg halRemoveBssKeyReqMsg = {{0}}; |
| 8093 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8094 | |
| 8095 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8096 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8097 | -------------------------------------------------------------------------*/ |
| 8098 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8099 | ( NULL == pEventData->pCBfnc )) |
| 8100 | { |
| 8101 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8102 | "%s: Invalid parameters", __FUNCTION__); |
| 8103 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8104 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8105 | } |
| 8106 | |
| 8107 | pwdiRemoveBSSKeyParams = (WDI_RemoveBSSKeyReqParamsType*)pEventData->pEventData; |
| 8108 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pEventData->pCBfnc; |
| 8109 | /*------------------------------------------------------------------------- |
| 8110 | 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] | 8111 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8112 | -------------------------------------------------------------------------*/ |
| 8113 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8114 | |
| 8115 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8116 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8117 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8118 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 8119 | pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx, |
| 8120 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8121 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8122 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8123 | { |
| 8124 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8125 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 8126 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8127 | |
| 8128 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8129 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8130 | } |
| 8131 | |
| 8132 | /*------------------------------------------------------------------------ |
| 8133 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8134 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8135 | ------------------------------------------------------------------------*/ |
| 8136 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8137 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8138 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8139 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 8140 | __func__, pwdiRemoveBSSKeyParams->wdiKeyInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8141 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8142 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8143 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8144 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8145 | } |
| 8146 | |
| 8147 | |
| 8148 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8149 | |
| 8150 | /*----------------------------------------------------------------------- |
| 8151 | Get message buffer |
| 8152 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8153 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_BSS_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8154 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams), |
| 8155 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8156 | ( usSendSize < (usDataOffset + sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams) ))) |
| 8157 | { |
| 8158 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8159 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8160 | pEventData, pwdiRemoveBSSKeyParams, wdiRemoveBSSKeyRspCb); |
| 8161 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8162 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8163 | } |
| 8164 | /*----------------------------------------------------------------------- |
| 8165 | Copy the Key parameters into the HAL message |
| 8166 | -----------------------------------------------------------------------*/ |
| 8167 | halRemoveBssKeyReqMsg.removeBssKeyParams.bssIdx = ucCurrentBSSSesIdx; |
| 8168 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8169 | halRemoveBssKeyReqMsg.removeBssKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8170 | WDI_2_HAL_ENC_TYPE (pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiEncType); |
| 8171 | |
| 8172 | halRemoveBssKeyReqMsg.removeBssKeyParams.keyId = pwdiRemoveBSSKeyParams->wdiKeyInfo.ucKeyId; |
| 8173 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8174 | halRemoveBssKeyReqMsg.removeBssKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8175 | WDI_2_HAL_WEP_TYPE(pwdiRemoveBSSKeyParams->wdiKeyInfo.wdiWEPType); |
| 8176 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8177 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8178 | &halRemoveBssKeyReqMsg.removeBssKeyParams, |
| 8179 | sizeof(halRemoveBssKeyReqMsg.removeBssKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8180 | |
| 8181 | pWDICtx->wdiReqStatusCB = pwdiRemoveBSSKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8182 | pWDICtx->pReqStatusUserData = pwdiRemoveBSSKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8183 | |
| 8184 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8185 | Send Remove BSS Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8186 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8187 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8188 | wdiRemoveBSSKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8189 | WDI_RMV_BSS_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8190 | }/*WDI_ProcessRemoveBssKeyReq*/ |
| 8191 | |
| 8192 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8193 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8194 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8195 | |
| 8196 | @param pWDICtx: pointer to the WLAN DAL context |
| 8197 | pEventData: pointer to the event information structure |
| 8198 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8199 | @see |
| 8200 | @return Result of the function call |
| 8201 | */ |
| 8202 | WDI_Status |
| 8203 | WDI_ProcessSetStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8204 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8205 | WDI_ControlBlockType* pWDICtx, |
| 8206 | WDI_EventInfoType* pEventData |
| 8207 | ) |
| 8208 | { |
| 8209 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8210 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8211 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8212 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8213 | wpt_uint16 usDataOffset = 0; |
| 8214 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8215 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8216 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8217 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8218 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8219 | wpt_uint8 keyIndex = 0; |
| 8220 | |
| 8221 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8222 | |
| 8223 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8224 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8225 | -------------------------------------------------------------------------*/ |
| 8226 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8227 | ( NULL == pEventData->pCBfnc )) |
| 8228 | { |
| 8229 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8230 | "%s: Invalid parameters", __FUNCTION__); |
| 8231 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8232 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8233 | } |
| 8234 | |
| 8235 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8236 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8237 | /*------------------------------------------------------------------------- |
| 8238 | 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] | 8239 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8240 | -------------------------------------------------------------------------*/ |
| 8241 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8242 | |
| 8243 | /*------------------------------------------------------------------------ |
| 8244 | Find the BSS for which the request is made and identify WDI session |
| 8245 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8246 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8247 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8248 | &macBSSID)) |
| 8249 | { |
| 8250 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8251 | "This station does not exist in the WDI Station Table %d"); |
| 8252 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8253 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8254 | } |
| 8255 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8256 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8257 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8258 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8259 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8260 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8261 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8262 | |
| 8263 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8264 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8265 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8266 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8267 | /*------------------------------------------------------------------------ |
| 8268 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8269 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8270 | ------------------------------------------------------------------------*/ |
| 8271 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8272 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8273 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8274 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8275 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8276 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8277 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8278 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8279 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8280 | } |
| 8281 | |
| 8282 | |
| 8283 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8284 | /*----------------------------------------------------------------------- |
| 8285 | Get message buffer |
| 8286 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8287 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8288 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8289 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8290 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8291 | { |
| 8292 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8293 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8294 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8295 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8296 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8297 | } |
| 8298 | /*----------------------------------------------------------------------- |
| 8299 | Copy the STA Key parameters into the HAL message |
| 8300 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8301 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8302 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8303 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8304 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8305 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8306 | |
| 8307 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8308 | |
| 8309 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8310 | |
| 8311 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8312 | |
| 8313 | #ifdef WLAN_SOFTAP_FEATURE |
| 8314 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8315 | keyIndex++) |
| 8316 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8317 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8318 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8319 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8320 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8321 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8322 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8323 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8324 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8325 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8326 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8327 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8328 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8329 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8330 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8331 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8332 | WDI_MAX_KEY_LENGTH); |
| 8333 | } |
| 8334 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8335 | halSetStaKeyReqMsg.setStaKeyParams.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8336 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId; |
| 8337 | halSetStaKeyReqMsg.setStaKeyParams.key.unicast = |
| 8338 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast; |
| 8339 | halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection = |
| 8340 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection; |
| 8341 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8342 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8343 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8344 | halSetStaKeyReqMsg.setStaKeyParams.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8345 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8346 | halSetStaKeyReqMsg.setStaKeyParams.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8347 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength; |
| 8348 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8349 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8350 | WDI_MAX_KEY_LENGTH); |
| 8351 | #endif |
| 8352 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8353 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8354 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8355 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8356 | |
| 8357 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8358 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8359 | |
| 8360 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8361 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8362 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8363 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8364 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8365 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8366 | |
| 8367 | }/*WDI_ProcessSetSTAKeyReq*/ |
| 8368 | |
| 8369 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8370 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8371 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8372 | |
| 8373 | @param pWDICtx: pointer to the WLAN DAL context |
| 8374 | pEventData: pointer to the event information structure |
| 8375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8376 | @see |
| 8377 | @return Result of the function call |
| 8378 | */ |
| 8379 | WDI_Status |
| 8380 | WDI_ProcessRemoveStaKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8381 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8382 | WDI_ControlBlockType* pWDICtx, |
| 8383 | WDI_EventInfoType* pEventData |
| 8384 | ) |
| 8385 | { |
| 8386 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTAKeyParams; |
| 8387 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8388 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8389 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8390 | wpt_uint16 usDataOffset = 0; |
| 8391 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8392 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8393 | wpt_macAddr macBSSID; |
| 8394 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8395 | tRemoveStaKeyReqMsg halRemoveStaKeyReqMsg = {{0}}; |
| 8396 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8397 | |
| 8398 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8399 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8400 | -------------------------------------------------------------------------*/ |
| 8401 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8402 | ( NULL == pEventData->pCBfnc )) |
| 8403 | { |
| 8404 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8405 | "%s: Invalid parameters", __FUNCTION__); |
| 8406 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8407 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8408 | } |
| 8409 | |
| 8410 | pwdiRemoveSTAKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8411 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8412 | /*------------------------------------------------------------------------- |
| 8413 | 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] | 8414 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8415 | -------------------------------------------------------------------------*/ |
| 8416 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8417 | |
| 8418 | /*------------------------------------------------------------------------ |
| 8419 | Find the BSS for which the request is made and identify WDI session |
| 8420 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8421 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8422 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8423 | &macBSSID)) |
| 8424 | { |
| 8425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8426 | "This station does not exist in the WDI Station Table %d"); |
| 8427 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8428 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8429 | } |
| 8430 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8431 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8432 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8433 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8434 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8435 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8436 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8437 | |
| 8438 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8439 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8440 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8441 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8442 | /*------------------------------------------------------------------------ |
| 8443 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8444 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8445 | ------------------------------------------------------------------------*/ |
| 8446 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8447 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8448 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8449 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8450 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8451 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8452 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8453 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8454 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8455 | } |
| 8456 | |
| 8457 | |
| 8458 | |
| 8459 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8460 | /*----------------------------------------------------------------------- |
| 8461 | Get message buffer |
| 8462 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8463 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_RMV_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8464 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams), |
| 8465 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8466 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams) ))) |
| 8467 | { |
| 8468 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8469 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8470 | pEventData, pwdiRemoveSTAKeyParams, wdiRemoveSTAKeyRspCb); |
| 8471 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8472 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8473 | } |
| 8474 | |
| 8475 | /*----------------------------------------------------------------------- |
| 8476 | Copy the Key parameters into the HAL message |
| 8477 | -----------------------------------------------------------------------*/ |
| 8478 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8479 | halRemoveStaKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8480 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8481 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8482 | halRemoveStaKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8483 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8484 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8485 | halRemoveStaKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8486 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucKeyId; |
| 8487 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8488 | halRemoveStaKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8489 | pwdiRemoveSTAKeyParams->wdiKeyInfo.ucUnicast; |
| 8490 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8491 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8492 | &halRemoveStaKeyReqMsg.removeStaKeyParams, |
| 8493 | sizeof(halRemoveStaKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8494 | |
| 8495 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8496 | pWDICtx->pReqStatusUserData = pwdiRemoveSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8497 | |
| 8498 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8499 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8500 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8501 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8502 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8503 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8504 | |
| 8505 | }/*WDI_ProcessRemoveSTAKeyReq*/ |
| 8506 | |
| 8507 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8508 | @brief Process Set STA KeyRequest function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8509 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8510 | |
| 8511 | @param pWDICtx: pointer to the WLAN DAL context |
| 8512 | pEventData: pointer to the event information structure |
| 8513 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8514 | @see |
| 8515 | @return Result of the function call |
| 8516 | */ |
| 8517 | WDI_Status |
| 8518 | WDI_ProcessSetStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8519 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8520 | WDI_ControlBlockType* pWDICtx, |
| 8521 | WDI_EventInfoType* pEventData |
| 8522 | ) |
| 8523 | { |
| 8524 | WDI_SetSTAKeyReqParamsType* pwdiSetSTAKeyParams; |
| 8525 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 8526 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8527 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8528 | wpt_uint16 usDataOffset = 0; |
| 8529 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8530 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8531 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8532 | wpt_uint8 ucCurrentBSSSesIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8533 | tSetStaKeyReqMsg halSetStaKeyReqMsg = {{0}}; |
| 8534 | wpt_uint8 keyIndex = 0; |
| 8535 | |
| 8536 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8537 | |
| 8538 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8539 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8540 | -------------------------------------------------------------------------*/ |
| 8541 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8542 | ( NULL == pEventData->pCBfnc )) |
| 8543 | { |
| 8544 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8545 | "%s: Invalid parameters", __FUNCTION__); |
| 8546 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8547 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8548 | } |
| 8549 | |
| 8550 | pwdiSetSTAKeyParams = (WDI_SetSTAKeyReqParamsType*)pEventData->pEventData; |
| 8551 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pEventData->pCBfnc; |
| 8552 | /*------------------------------------------------------------------------- |
| 8553 | 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] | 8554 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8555 | -------------------------------------------------------------------------*/ |
| 8556 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8557 | |
| 8558 | /*------------------------------------------------------------------------ |
| 8559 | Find the BSS for which the request is made and identify WDI session |
| 8560 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8561 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8562 | pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8563 | &macBSSID)) |
| 8564 | { |
| 8565 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8566 | "This station does not exist in the WDI Station Table %d"); |
| 8567 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8568 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8569 | } |
| 8570 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8571 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8572 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8573 | { |
| 8574 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8575 | "Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8576 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8577 | |
| 8578 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8579 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8580 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8581 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8582 | /*------------------------------------------------------------------------ |
| 8583 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8584 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8585 | ------------------------------------------------------------------------*/ |
| 8586 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8587 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8588 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8589 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8590 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
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 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8593 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8594 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8595 | } |
| 8596 | |
| 8597 | |
| 8598 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8599 | /*----------------------------------------------------------------------- |
| 8600 | Get message buffer |
| 8601 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8602 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_STA_KEY_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8603 | sizeof(halSetStaKeyReqMsg.setStaKeyParams), |
| 8604 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8605 | ( usSendSize < (usDataOffset + sizeof(halSetStaKeyReqMsg.setStaKeyParams) ))) |
| 8606 | { |
| 8607 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8608 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8609 | pEventData, pwdiSetSTAKeyParams, wdiSetSTAKeyRspCb); |
| 8610 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8611 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8612 | } |
| 8613 | /*----------------------------------------------------------------------- |
| 8614 | Copy the STA Key parameters into the HAL message |
| 8615 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8616 | halSetStaKeyReqMsg.setStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8617 | WDI_2_HAL_ENC_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiEncType); |
| 8618 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8619 | halSetStaKeyReqMsg.setStaKeyParams.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8620 | WDI_2_HAL_WEP_TYPE (pwdiSetSTAKeyParams->wdiKeyInfo.wdiWEPType ); |
| 8621 | |
| 8622 | halSetStaKeyReqMsg.setStaKeyParams.staIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8623 | |
| 8624 | halSetStaKeyReqMsg.setStaKeyParams.defWEPIdx = pwdiSetSTAKeyParams->wdiKeyInfo.ucDefWEPIdx; |
| 8625 | |
| 8626 | halSetStaKeyReqMsg.setStaKeyParams.singleTidRc = pwdiSetSTAKeyParams->wdiKeyInfo.ucSingleTidRc; |
| 8627 | |
| 8628 | #ifdef WLAN_SOFTAP_FEATURE |
| 8629 | for(keyIndex = 0; keyIndex < pwdiSetSTAKeyParams->wdiKeyInfo.ucNumKeys ; |
| 8630 | keyIndex++) |
| 8631 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8632 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8633 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyId; |
| 8634 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].unicast = |
| 8635 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].unicast; |
| 8636 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyDirection = |
| 8637 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyDirection; |
| 8638 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8639 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8640 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8641 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8642 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8643 | halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8644 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].keyLength; |
| 8645 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8646 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8647 | WDI_MAX_KEY_LENGTH); |
| 8648 | } |
| 8649 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8650 | halSetStaKeyReqMsg.setStaKeyParams.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8651 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyId; |
| 8652 | halSetStaKeyReqMsg.setStaKeyParams.key.unicast = |
| 8653 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].unicast; |
| 8654 | halSetStaKeyReqMsg.setStaKeyParams.key.keyDirection = |
| 8655 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyDirection; |
| 8656 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8657 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8658 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8659 | halSetStaKeyReqMsg.setStaKeyParams.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8660 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8661 | halSetStaKeyReqMsg.setStaKeyParams.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8662 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].keyLength; |
| 8663 | wpalMemoryCopy(halSetStaKeyReqMsg.setStaKeyParams.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8664 | pwdiSetSTAKeyParams->wdiKeyInfo.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8665 | WDI_MAX_KEY_LENGTH); |
| 8666 | #endif |
| 8667 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8668 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8669 | &halSetStaKeyReqMsg.setStaKeyParams, |
| 8670 | sizeof(halSetStaKeyReqMsg.setStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8671 | |
| 8672 | pWDICtx->wdiReqStatusCB = pwdiSetSTAKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8673 | pWDICtx->pReqStatusUserData = pwdiSetSTAKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8674 | |
| 8675 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8676 | Send Set STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8677 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8678 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 8679 | wdiSetSTAKeyRspCb, pEventData->pUserData, |
| 8680 | WDI_SET_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8681 | |
| 8682 | }/*WDI_ProcessSetSTABcastKeyReq*/ |
| 8683 | |
| 8684 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8685 | @brief Process Remove STA Key Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8686 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8687 | |
| 8688 | @param pWDICtx: pointer to the WLAN DAL context |
| 8689 | pEventData: pointer to the event information structure |
| 8690 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8691 | @see |
| 8692 | @return Result of the function call |
| 8693 | */ |
| 8694 | WDI_Status |
| 8695 | WDI_ProcessRemoveStaBcastKeyReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8696 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8697 | WDI_ControlBlockType* pWDICtx, |
| 8698 | WDI_EventInfoType* pEventData |
| 8699 | ) |
| 8700 | { |
| 8701 | WDI_RemoveSTAKeyReqParamsType* pwdiRemoveSTABcastKeyParams; |
| 8702 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 8703 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8704 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8705 | wpt_uint16 usDataOffset = 0; |
| 8706 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8707 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8708 | wpt_macAddr macBSSID; |
| 8709 | wpt_uint8 ucCurrentBSSSesIdx; |
| 8710 | tRemoveStaKeyReqMsg halRemoveStaBcastKeyReqMsg = {{0}}; |
| 8711 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8712 | |
| 8713 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8714 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8715 | -------------------------------------------------------------------------*/ |
| 8716 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8717 | ( NULL == pEventData->pCBfnc )) |
| 8718 | { |
| 8719 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8720 | "%s: Invalid parameters", __FUNCTION__); |
| 8721 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8722 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8723 | } |
| 8724 | |
| 8725 | pwdiRemoveSTABcastKeyParams = (WDI_RemoveSTAKeyReqParamsType*)pEventData->pEventData; |
| 8726 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pEventData->pCBfnc; |
| 8727 | /*------------------------------------------------------------------------- |
| 8728 | 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] | 8729 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8730 | -------------------------------------------------------------------------*/ |
| 8731 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8732 | |
| 8733 | /*------------------------------------------------------------------------ |
| 8734 | Find the BSS for which the request is made and identify WDI session |
| 8735 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8736 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8737 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8738 | &macBSSID)) |
| 8739 | { |
| 8740 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8741 | "This station does not exist in the WDI Station Table %d"); |
| 8742 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8743 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8744 | } |
| 8745 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8746 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8747 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8748 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8749 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8750 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8751 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8752 | |
| 8753 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8754 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8755 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8756 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8757 | /*------------------------------------------------------------------------ |
| 8758 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8759 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8760 | ------------------------------------------------------------------------*/ |
| 8761 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8762 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8763 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8764 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8765 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8766 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8767 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8768 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8769 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8770 | } |
| 8771 | |
| 8772 | |
| 8773 | |
| 8774 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8775 | /*----------------------------------------------------------------------- |
| 8776 | Get message buffer |
| 8777 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8778 | 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] | 8779 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams), |
| 8780 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 8781 | ( usSendSize < (usDataOffset + sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams) ))) |
| 8782 | { |
| 8783 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8784 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8785 | pEventData, pwdiRemoveSTABcastKeyParams, wdiRemoveSTAKeyRspCb); |
| 8786 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8787 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8788 | } |
| 8789 | |
| 8790 | /*----------------------------------------------------------------------- |
| 8791 | Copy the Key parameters into the HAL message |
| 8792 | -----------------------------------------------------------------------*/ |
| 8793 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8794 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8795 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucSTAIdx; |
| 8796 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8797 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8798 | WDI_2_HAL_ENC_TYPE (pwdiRemoveSTABcastKeyParams->wdiKeyInfo.wdiEncType); |
| 8799 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8800 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8801 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucKeyId; |
| 8802 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8803 | halRemoveStaBcastKeyReqMsg.removeStaKeyParams.unicast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8804 | pwdiRemoveSTABcastKeyParams->wdiKeyInfo.ucUnicast; |
| 8805 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8806 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8807 | &halRemoveStaBcastKeyReqMsg.removeStaKeyParams, |
| 8808 | sizeof(halRemoveStaBcastKeyReqMsg.removeStaKeyParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8809 | |
| 8810 | pWDICtx->wdiReqStatusCB = pwdiRemoveSTABcastKeyParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8811 | pWDICtx->pReqStatusUserData = pwdiRemoveSTABcastKeyParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8812 | |
| 8813 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8814 | Send Remove STA Key Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8815 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8816 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8817 | wdiRemoveSTAKeyRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8818 | WDI_RMV_STA_KEY_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8819 | |
| 8820 | }/*WDI_ProcessRemoveSTABcastKeyReq*/ |
| 8821 | |
| 8822 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8823 | QOS and BA PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8824 | ==========================================================================*/ |
| 8825 | /** |
| 8826 | @brief Process Add TSpec Request function (called when Main FSM |
| 8827 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8828 | |
| 8829 | @param pWDICtx: pointer to the WLAN DAL context |
| 8830 | pEventData: pointer to the event information structure |
| 8831 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8832 | @see |
| 8833 | @return Result of the function call |
| 8834 | */ |
| 8835 | WDI_Status |
| 8836 | WDI_ProcessAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8837 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8838 | WDI_ControlBlockType* pWDICtx, |
| 8839 | WDI_EventInfoType* pEventData |
| 8840 | ) |
| 8841 | { |
| 8842 | WDI_AddTSReqParamsType* pwdiAddTSParams; |
| 8843 | WDI_AddTsRspCb wdiAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8844 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8845 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8846 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8847 | wpt_uint16 usDataOffset = 0; |
| 8848 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8849 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8850 | wpt_macAddr macBSSID; |
| 8851 | tAddTsParams halAddTsParams = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8852 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8853 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 8854 | |
| 8855 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8856 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8857 | -------------------------------------------------------------------------*/ |
| 8858 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 8859 | ( NULL == pEventData->pCBfnc )) |
| 8860 | { |
| 8861 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8862 | "%s: Invalid parameters", __FUNCTION__); |
| 8863 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8864 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8865 | } |
| 8866 | |
| 8867 | pwdiAddTSParams = (WDI_AddTSReqParamsType*)pEventData->pEventData; |
| 8868 | wdiAddTSRspCb = (WDI_AddTsRspCb)pEventData->pCBfnc; |
| 8869 | /*------------------------------------------------------------------------- |
| 8870 | 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] | 8871 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8872 | -------------------------------------------------------------------------*/ |
| 8873 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 8874 | |
| 8875 | /*------------------------------------------------------------------------ |
| 8876 | Find the BSS for which the request is made and identify WDI session |
| 8877 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8878 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 8879 | pwdiAddTSParams->wdiTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8880 | &macBSSID)) |
| 8881 | { |
| 8882 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8883 | "This station does not exist in the WDI Station Table %d"); |
| 8884 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8885 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8886 | } |
| 8887 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8888 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 8889 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8890 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8891 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 8892 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 8893 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8894 | |
| 8895 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8896 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8897 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8898 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8899 | /*------------------------------------------------------------------------ |
| 8900 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8901 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8902 | ------------------------------------------------------------------------*/ |
| 8903 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 8904 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8905 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8906 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 8907 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8908 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8909 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8910 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8911 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8912 | } |
| 8913 | |
| 8914 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 8915 | /*----------------------------------------------------------------------- |
| 8916 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8917 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8918 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8919 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_TS_REQ, |
| 8920 | sizeof(halAddTsParams), |
| 8921 | &pSendBuffer, &usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8922 | &usSendSize))|| |
| 8923 | ( usSendSize < (usDataOffset + sizeof(halAddTsParams) ))) |
| 8924 | { |
| 8925 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 8926 | "Unable to get send buffer in set bss key req %x %x %x", |
| 8927 | pEventData, pwdiAddTSParams, wdiAddTSRspCb); |
| 8928 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8929 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8930 | } |
| 8931 | |
| 8932 | halAddTsParams.staIdx = pwdiAddTSParams->wdiTsInfo.ucSTAIdx; |
| 8933 | halAddTsParams.tspecIdx = pwdiAddTSParams->wdiTsInfo.ucTspecIdx; |
| 8934 | |
| 8935 | //TSPEC IE |
| 8936 | halAddTsParams.tspec.type = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucType; |
| 8937 | halAddTsParams.tspec.length = pwdiAddTSParams->wdiTsInfo.wdiTspecIE.ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8938 | halAddTsParams.tspec.nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8939 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8940 | halAddTsParams.tspec.maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8941 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8942 | halAddTsParams.tspec.minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8943 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8944 | halAddTsParams.tspec.maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8945 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8946 | halAddTsParams.tspec.inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8947 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8948 | halAddTsParams.tspec.suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8949 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8950 | halAddTsParams.tspec.svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8951 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8952 | halAddTsParams.tspec.minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8953 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8954 | halAddTsParams.tspec.meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8955 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8956 | halAddTsParams.tspec.peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8957 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8958 | halAddTsParams.tspec.maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8959 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8960 | halAddTsParams.tspec.delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8961 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8962 | halAddTsParams.tspec.minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8963 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8964 | halAddTsParams.tspec.surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8965 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8966 | halAddTsParams.tspec.mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8967 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.usMediumTime; |
| 8968 | |
| 8969 | //TSPEC IE : TS INFO : TRAFFIC |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8970 | halAddTsParams.tspec.tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8971 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8972 | halAddTsParams.tspec.tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8973 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8974 | halAddTsParams.tspec.tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8975 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8976 | halAddTsParams.tspec.tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8977 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8978 | halAddTsParams.tspec.tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8979 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8980 | halAddTsParams.tspec.tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8981 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.tsid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8982 | halAddTsParams.tspec.tsinfo.traffic.trafficType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8983 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiTraffic.trafficType; |
| 8984 | |
| 8985 | //TSPEC IE : TS INFO : SCHEDULE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8986 | halAddTsParams.tspec.tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8987 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8988 | halAddTsParams.tspec.tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8989 | pwdiAddTSParams->wdiTsInfo.wdiTspecIE.wdiTSinfo.wdiSchedule.schedule; |
| 8990 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8991 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 8992 | &halAddTsParams, |
| 8993 | sizeof(halAddTsParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8994 | |
| 8995 | pWDICtx->wdiReqStatusCB = pwdiAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8996 | pWDICtx->pReqStatusUserData = pwdiAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8997 | |
| 8998 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8999 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9000 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9001 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9002 | wdiAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9003 | WDI_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9004 | }/*WDI_ProcessAddTSpecReq*/ |
| 9005 | |
| 9006 | |
| 9007 | /** |
| 9008 | @brief Process Del TSpec Request function (called when Main FSM |
| 9009 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9010 | |
| 9011 | @param pWDICtx: pointer to the WLAN DAL context |
| 9012 | pEventData: pointer to the event information structure |
| 9013 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9014 | @see |
| 9015 | @return Result of the function call |
| 9016 | */ |
| 9017 | WDI_Status |
| 9018 | WDI_ProcessDelTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9019 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9020 | WDI_ControlBlockType* pWDICtx, |
| 9021 | WDI_EventInfoType* pEventData |
| 9022 | ) |
| 9023 | { |
| 9024 | WDI_DelTSReqParamsType* pwdiDelTSParams; |
| 9025 | WDI_DelTsRspCb wdiDelTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9026 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9027 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9028 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9029 | wpt_uint16 usDataOffset = 0; |
| 9030 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9031 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9032 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9033 | |
| 9034 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9035 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9036 | -------------------------------------------------------------------------*/ |
| 9037 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9038 | ( NULL == pEventData->pCBfnc )) |
| 9039 | { |
| 9040 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9041 | "%s: Invalid parameters", __FUNCTION__); |
| 9042 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9043 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9044 | } |
| 9045 | |
| 9046 | pwdiDelTSParams = (WDI_DelTSReqParamsType*)pEventData->pEventData; |
| 9047 | wdiDelTSRspCb = (WDI_DelTsRspCb)pEventData->pCBfnc; |
| 9048 | |
| 9049 | /*------------------------------------------------------------------------- |
| 9050 | 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] | 9051 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9052 | -------------------------------------------------------------------------*/ |
| 9053 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9054 | |
| 9055 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9056 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9057 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9058 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 9059 | pwdiDelTSParams->wdiDelTSInfo.macBSSID, |
| 9060 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9061 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9062 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9063 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9064 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9065 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9066 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
| 9067 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9068 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9069 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9070 | } |
| 9071 | |
| 9072 | /*------------------------------------------------------------------------ |
| 9073 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9074 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9075 | ------------------------------------------------------------------------*/ |
| 9076 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9077 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9078 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9079 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9080 | __func__, MAC_ADDR_ARRAY(pwdiDelTSParams->wdiDelTSInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9081 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9082 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9083 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9084 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9085 | } |
| 9086 | |
| 9087 | |
| 9088 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9089 | /*----------------------------------------------------------------------- |
| 9090 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9091 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9092 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9093 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9094 | sizeof(pwdiDelTSParams->wdiDelTSInfo), |
| 9095 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9096 | ( usSendSize < (usDataOffset + sizeof(pwdiDelTSParams->wdiDelTSInfo) ))) |
| 9097 | { |
| 9098 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9099 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9100 | pEventData, pwdiDelTSParams, wdiDelTSRspCb); |
| 9101 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9102 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9103 | } |
| 9104 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9105 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9106 | &pwdiDelTSParams->wdiDelTSInfo, |
| 9107 | sizeof(pwdiDelTSParams->wdiDelTSInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9108 | |
| 9109 | pWDICtx->wdiReqStatusCB = pwdiDelTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9110 | pWDICtx->pReqStatusUserData = pwdiDelTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9111 | |
| 9112 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9113 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9114 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9115 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9116 | wdiDelTSRspCb, pEventData->pUserData, WDI_DEL_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9117 | }/*WDI_ProcessDelTSpecReq*/ |
| 9118 | |
| 9119 | /** |
| 9120 | @brief Process Update EDCA Params Request function (called when |
| 9121 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9122 | |
| 9123 | @param pWDICtx: pointer to the WLAN DAL context |
| 9124 | pEventData: pointer to the event information structure |
| 9125 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9126 | @see |
| 9127 | @return Result of the function call |
| 9128 | */ |
| 9129 | WDI_Status |
| 9130 | WDI_ProcessUpdateEDCAParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9131 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9132 | WDI_ControlBlockType* pWDICtx, |
| 9133 | WDI_EventInfoType* pEventData |
| 9134 | ) |
| 9135 | { |
| 9136 | WDI_UpdateEDCAParamsType* pwdiUpdateEDCAParams; |
| 9137 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9138 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9139 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9140 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9141 | wpt_uint16 usDataOffset = 0; |
| 9142 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9143 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9144 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9145 | |
| 9146 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9147 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9148 | -------------------------------------------------------------------------*/ |
| 9149 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9150 | ( NULL == pEventData->pCBfnc )) |
| 9151 | { |
| 9152 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9153 | "%s: Invalid parameters", __FUNCTION__); |
| 9154 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9155 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9156 | } |
| 9157 | |
| 9158 | pwdiUpdateEDCAParams = (WDI_UpdateEDCAParamsType*)pEventData->pEventData; |
| 9159 | wdiUpdateEDCARspCb = (WDI_UpdateEDCAParamsRspCb)pEventData->pCBfnc; |
| 9160 | /*------------------------------------------------------------------------- |
| 9161 | 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] | 9162 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9163 | -------------------------------------------------------------------------*/ |
| 9164 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9165 | |
| 9166 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9167 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9168 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9169 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 9170 | pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx, |
| 9171 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9172 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9173 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9174 | { |
| 9175 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9176 | "%s: Association sequence for this BSS does not yet exist. ucBssIdx %d", |
| 9177 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9178 | |
| 9179 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9180 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9181 | } |
| 9182 | |
| 9183 | /*------------------------------------------------------------------------ |
| 9184 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9185 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9186 | ------------------------------------------------------------------------*/ |
| 9187 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9188 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9189 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9190 | "%s: Association sequence for this BSS exists but currently queued. ucBssIdx %d", |
| 9191 | __func__, pwdiUpdateEDCAParams->wdiEDCAInfo.ucBssIdx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9193 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9194 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9195 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9196 | } |
| 9197 | |
| 9198 | |
| 9199 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9200 | /*----------------------------------------------------------------------- |
| 9201 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9202 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9203 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9204 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_EDCA_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9205 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo), |
| 9206 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9207 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo) ))) |
| 9208 | { |
| 9209 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9210 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9211 | pEventData, pwdiUpdateEDCAParams, wdiUpdateEDCARspCb); |
| 9212 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9213 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9214 | } |
| 9215 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9216 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9217 | &pwdiUpdateEDCAParams->wdiEDCAInfo, |
| 9218 | sizeof(pwdiUpdateEDCAParams->wdiEDCAInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9219 | |
| 9220 | pWDICtx->wdiReqStatusCB = pwdiUpdateEDCAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9221 | pWDICtx->pReqStatusUserData = pwdiUpdateEDCAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9222 | |
| 9223 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9224 | Send Update EDCA Params Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9225 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9226 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9227 | wdiUpdateEDCARspCb, pEventData->pUserData, |
| 9228 | WDI_UPD_EDCA_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9229 | }/*WDI_ProcessUpdateEDCAParamsReq*/ |
| 9230 | |
| 9231 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9232 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9233 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9234 | |
| 9235 | @param pWDICtx: pointer to the WLAN DAL context |
| 9236 | pEventData: pointer to the event information structure |
| 9237 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9238 | @see |
| 9239 | @return Result of the function call |
| 9240 | */ |
| 9241 | WDI_Status |
| 9242 | WDI_ProcessAddBASessionReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9243 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9244 | WDI_ControlBlockType* pWDICtx, |
| 9245 | WDI_EventInfoType* pEventData |
| 9246 | ) |
| 9247 | { |
| 9248 | WDI_AddBASessionReqParamsType* pwdiAddBASessionParams; |
| 9249 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9250 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9251 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9252 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9253 | wpt_uint16 usDataOffset = 0; |
| 9254 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9255 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9256 | wpt_macAddr macBSSID; |
| 9257 | |
| 9258 | tAddBASessionReqMsg halAddBASessionReq; |
| 9259 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9260 | |
| 9261 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9262 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9263 | -------------------------------------------------------------------------*/ |
| 9264 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9265 | ( NULL == pEventData->pCBfnc )) |
| 9266 | { |
| 9267 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9268 | "%s: Invalid parameters", __FUNCTION__); |
| 9269 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9270 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9271 | } |
| 9272 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9273 | pwdiAddBASessionParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9274 | (WDI_AddBASessionReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9275 | wdiAddBASessionRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9276 | (WDI_AddBASessionRspCb)pEventData->pCBfnc; |
| 9277 | /*------------------------------------------------------------------------- |
| 9278 | 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] | 9279 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9280 | -------------------------------------------------------------------------*/ |
| 9281 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9282 | |
| 9283 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9284 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9285 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9286 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9287 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9288 | &macBSSID)) |
| 9289 | { |
| 9290 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9291 | "This station does not exist in the WDI Station Table %d"); |
| 9292 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9293 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9294 | } |
| 9295 | |
| 9296 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9297 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9298 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9299 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9300 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9301 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9302 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9303 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
| 9304 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9305 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9306 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9307 | } |
| 9308 | |
| 9309 | /*------------------------------------------------------------------------ |
| 9310 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9311 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9312 | ------------------------------------------------------------------------*/ |
| 9313 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9314 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9315 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9316 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9317 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9318 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9319 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9320 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9321 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9322 | } |
| 9323 | |
| 9324 | |
| 9325 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9326 | /*----------------------------------------------------------------------- |
| 9327 | Get message buffer |
| 9328 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9329 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9330 | WDI_ADD_BA_SESSION_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9331 | sizeof(halAddBASessionReq.addBASessionParams), |
| 9332 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9333 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9334 | (usDataOffset + sizeof(halAddBASessionReq.addBASessionParams) ))) |
| 9335 | { |
| 9336 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9337 | "Unable to get send buffer in Add BA session req %x %x %x", |
| 9338 | pEventData, pwdiAddBASessionParams, wdiAddBASessionRspCb); |
| 9339 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9340 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9341 | } |
| 9342 | |
| 9343 | halAddBASessionReq.addBASessionParams.staIdx = |
| 9344 | pwdiAddBASessionParams->wdiBASessionInfoType.ucSTAIdx; |
| 9345 | wpalMemoryCopy(halAddBASessionReq.addBASessionParams.peerMacAddr, |
| 9346 | pwdiAddBASessionParams->wdiBASessionInfoType.macPeerAddr, |
| 9347 | WDI_MAC_ADDR_LEN); |
| 9348 | halAddBASessionReq.addBASessionParams.baTID = |
| 9349 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaTID; |
| 9350 | halAddBASessionReq.addBASessionParams.baPolicy = |
| 9351 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaPolicy; |
| 9352 | halAddBASessionReq.addBASessionParams.baBufferSize = |
| 9353 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaBufferSize; |
| 9354 | halAddBASessionReq.addBASessionParams.baTimeout = |
| 9355 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaTimeout; |
| 9356 | halAddBASessionReq.addBASessionParams.baSSN = |
| 9357 | pwdiAddBASessionParams->wdiBASessionInfoType.usBaSSN; |
| 9358 | halAddBASessionReq.addBASessionParams.baDirection = |
| 9359 | pwdiAddBASessionParams->wdiBASessionInfoType.ucBaDirection; |
| 9360 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9361 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9362 | &halAddBASessionReq.addBASessionParams, |
| 9363 | sizeof(halAddBASessionReq.addBASessionParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9364 | |
| 9365 | pWDICtx->wdiReqStatusCB = pwdiAddBASessionParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9366 | pWDICtx->pReqStatusUserData = pwdiAddBASessionParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9367 | |
| 9368 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9369 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9370 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9371 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9372 | wdiAddBASessionRspCb, pEventData->pUserData, |
| 9373 | WDI_ADD_BA_SESSION_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9374 | }/*WDI_ProcessAddBASessionReq*/ |
| 9375 | |
| 9376 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9377 | @brief Process Del BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9378 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9379 | |
| 9380 | @param pWDICtx: pointer to the WLAN DAL context |
| 9381 | pEventData: pointer to the event information structure |
| 9382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9383 | @see |
| 9384 | @return Result of the function call |
| 9385 | */ |
| 9386 | WDI_Status |
| 9387 | WDI_ProcessDelBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9388 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9389 | WDI_ControlBlockType* pWDICtx, |
| 9390 | WDI_EventInfoType* pEventData |
| 9391 | ) |
| 9392 | { |
| 9393 | WDI_DelBAReqParamsType* pwdiDelBAParams; |
| 9394 | WDI_DelBARspCb wdiDelBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9395 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9396 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9397 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9398 | wpt_uint16 usDataOffset = 0; |
| 9399 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9400 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9401 | wpt_macAddr macBSSID; |
| 9402 | tDelBAParams halDelBAparam; |
| 9403 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9404 | |
| 9405 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9406 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9407 | -------------------------------------------------------------------------*/ |
| 9408 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9409 | ( NULL == pEventData->pCBfnc )) |
| 9410 | { |
| 9411 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9412 | "%s: Invalid parameters", __FUNCTION__); |
| 9413 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9414 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9415 | } |
| 9416 | |
| 9417 | pwdiDelBAParams = (WDI_DelBAReqParamsType*)pEventData->pEventData; |
| 9418 | wdiDelBARspCb = (WDI_DelBARspCb)pEventData->pCBfnc; |
| 9419 | /*------------------------------------------------------------------------- |
| 9420 | 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] | 9421 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9422 | -------------------------------------------------------------------------*/ |
| 9423 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9424 | |
| 9425 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9426 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9427 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9428 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 9429 | pwdiDelBAParams->wdiBAInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9430 | &macBSSID)) |
| 9431 | { |
| 9432 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9433 | "This station does not exist in the WDI Station Table %d"); |
| 9434 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9435 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9436 | } |
| 9437 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9438 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9439 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9440 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9441 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9442 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9443 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9444 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9445 | |
| 9446 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9447 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9448 | } |
| 9449 | |
| 9450 | /*------------------------------------------------------------------------ |
| 9451 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9452 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9453 | ------------------------------------------------------------------------*/ |
| 9454 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9455 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9456 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9457 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9458 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9459 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9460 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9461 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9462 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9463 | } |
| 9464 | |
| 9465 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9466 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9467 | sizeof(halDelBAparam), |
| 9468 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9469 | ( usSendSize < (usDataOffset + sizeof(halDelBAparam) ))) |
| 9470 | { |
| 9471 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9472 | "Unable to get send buffer for DEL BA req %x %x %x", |
| 9473 | pEventData, pwdiDelBAParams, wdiDelBARspCb); |
| 9474 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9475 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9476 | } |
| 9477 | |
| 9478 | halDelBAparam.staIdx = pwdiDelBAParams->wdiBAInfo.ucSTAIdx; |
| 9479 | halDelBAparam.baTID = pwdiDelBAParams->wdiBAInfo.ucBaTID; |
| 9480 | halDelBAparam.baDirection = pwdiDelBAParams->wdiBAInfo.ucBaDirection; |
| 9481 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9482 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9483 | &halDelBAparam, |
| 9484 | sizeof(halDelBAparam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9485 | |
| 9486 | pWDICtx->wdiReqStatusCB = pwdiDelBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9487 | pWDICtx->pReqStatusUserData = pwdiDelBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9488 | |
| 9489 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9490 | Send Start Request to HAL |
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 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9493 | wdiDelBARspCb, pEventData->pUserData, WDI_DEL_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9494 | }/*WDI_ProcessDelBAReq*/ |
| 9495 | |
| 9496 | #ifdef FEATURE_WLAN_CCX |
| 9497 | |
| 9498 | WDI_Status |
| 9499 | WDI_ProcessTSMStatsReq |
| 9500 | ( |
| 9501 | WDI_ControlBlockType* pWDICtx, |
| 9502 | WDI_EventInfoType* pEventData |
| 9503 | ) |
| 9504 | { |
| 9505 | WDI_TSMStatsReqParamsType* pwdiTSMParams; |
| 9506 | WDI_TsmRspCb wdiTSMRspCb; |
| 9507 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 9508 | WDI_BSSSessionType* pBSSSes = NULL; |
| 9509 | wpt_uint8* pSendBuffer = NULL; |
| 9510 | wpt_uint16 usDataOffset = 0; |
| 9511 | wpt_uint16 usSendSize = 0; |
| 9512 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
| 9513 | tTsmStatsParams halTsmStatsReqParams = {0}; |
| 9514 | |
| 9515 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9516 | |
| 9517 | /*------------------------------------------------------------------------- |
| 9518 | Sanity check |
| 9519 | -------------------------------------------------------------------------*/ |
| 9520 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9521 | ( NULL == pEventData->pCBfnc )) |
| 9522 | { |
| 9523 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9524 | "%s: Invalid parameters", __FUNCTION__); |
| 9525 | WDI_ASSERT(0); |
| 9526 | return WDI_STATUS_E_FAILURE; |
| 9527 | } |
| 9528 | |
| 9529 | pwdiTSMParams = (WDI_TSMStatsReqParamsType*)pEventData->pEventData; |
| 9530 | wdiTSMRspCb = (WDI_TsmRspCb)pEventData->pCBfnc; |
| 9531 | /*------------------------------------------------------------------------- |
| 9532 | Check to see if we are in the middle of an association, if so queue, if |
| 9533 | not it means it is free to process request |
| 9534 | -------------------------------------------------------------------------*/ |
| 9535 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 9536 | |
| 9537 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, &pBSSSes); |
| 9538 | if ( NULL == pBSSSes ) |
| 9539 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9540 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9541 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 9542 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9543 | |
| 9544 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9545 | return WDI_STATUS_E_NOT_ALLOWED; |
| 9546 | } |
| 9547 | |
| 9548 | /*------------------------------------------------------------------------ |
| 9549 | Check if this BSS is being currently processed or queued, |
| 9550 | if queued - queue the new request as well |
| 9551 | ------------------------------------------------------------------------*/ |
| 9552 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 9553 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9554 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9555 | "s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 9556 | __func__, MAC_ADDR_ARRAY(pwdiTSMParams->wdiTsmStatsParamsInfo.bssid)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9557 | |
| 9558 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
| 9559 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9560 | return wdiStatus; |
| 9561 | } |
| 9562 | |
| 9563 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 9564 | /*----------------------------------------------------------------------- |
| 9565 | Get message buffer |
| 9566 | ! TO DO : proper conversion into the HAL Message Request Format |
| 9567 | -----------------------------------------------------------------------*/ |
| 9568 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_TSM_STATS_REQ, |
| 9569 | sizeof(halTsmStatsReqParams), |
| 9570 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9571 | ( usSendSize < (usDataOffset + sizeof(halTsmStatsReqParams) ))) |
| 9572 | { |
| 9573 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 9574 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9575 | pEventData, pwdiTSMParams, wdiTSMRspCb); |
| 9576 | WDI_ASSERT(0); |
| 9577 | return WDI_STATUS_E_FAILURE; |
| 9578 | } |
| 9579 | |
| 9580 | halTsmStatsReqParams.tsmTID = pwdiTSMParams->wdiTsmStatsParamsInfo.ucTid; |
| 9581 | wpalMemoryCopy(halTsmStatsReqParams.bssId, |
| 9582 | pwdiTSMParams->wdiTsmStatsParamsInfo.bssid, |
| 9583 | WDI_MAC_ADDR_LEN); |
| 9584 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9585 | &halTsmStatsReqParams, |
| 9586 | sizeof(halTsmStatsReqParams)); |
| 9587 | |
| 9588 | pWDICtx->wdiReqStatusCB = pwdiTSMParams->wdiReqStatusCB; |
| 9589 | pWDICtx->pReqStatusUserData = pwdiTSMParams->pUserData; |
| 9590 | |
| 9591 | /*------------------------------------------------------------------------- |
| 9592 | Send TSM Stats Request to HAL |
| 9593 | -------------------------------------------------------------------------*/ |
| 9594 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9595 | wdiTSMRspCb, pEventData->pUserData, |
| 9596 | WDI_TSM_STATS_RESP); |
| 9597 | }/*WDI_ProcessTSMStatsReq*/ |
| 9598 | |
| 9599 | #endif |
| 9600 | |
| 9601 | |
| 9602 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9603 | @brief Process Flush AC Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9604 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9605 | |
| 9606 | @param pWDICtx: pointer to the WLAN DAL context |
| 9607 | pEventData: pointer to the event information structure |
| 9608 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9609 | @see |
| 9610 | @return Result of the function call |
| 9611 | */ |
| 9612 | WDI_Status |
| 9613 | WDI_ProcessFlushAcReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9614 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9615 | WDI_ControlBlockType* pWDICtx, |
| 9616 | WDI_EventInfoType* pEventData |
| 9617 | ) |
| 9618 | { |
| 9619 | WDI_FlushAcReqParamsType* pwdiFlushAcParams = NULL; |
| 9620 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9621 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9622 | wpt_uint16 usDataOffset = 0; |
| 9623 | wpt_uint16 usSendSize = 0; |
| 9624 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9625 | |
| 9626 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9627 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9628 | -------------------------------------------------------------------------*/ |
| 9629 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9630 | ( NULL == pEventData->pCBfnc )) |
| 9631 | { |
| 9632 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9633 | "%s: Invalid parameters", __FUNCTION__); |
| 9634 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9635 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9636 | } |
| 9637 | |
| 9638 | pwdiFlushAcParams = (WDI_FlushAcReqParamsType*)pEventData->pEventData; |
| 9639 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pEventData->pCBfnc; |
| 9640 | /*----------------------------------------------------------------------- |
| 9641 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9642 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9643 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9644 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_FLUSH_AC_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9645 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo), |
| 9646 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9647 | ( usSendSize < (usDataOffset + sizeof(pwdiFlushAcParams->wdiFlushAcInfo) ))) |
| 9648 | { |
| 9649 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9650 | "Unable to get send buffer in set bss key req %x %x %x", |
| 9651 | pEventData, pwdiFlushAcParams, wdiFlushAcRspCb); |
| 9652 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9653 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9654 | } |
| 9655 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9656 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9657 | &pwdiFlushAcParams->wdiFlushAcInfo, |
| 9658 | sizeof(pwdiFlushAcParams->wdiFlushAcInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9659 | |
| 9660 | pWDICtx->wdiReqStatusCB = pwdiFlushAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9661 | pWDICtx->pReqStatusUserData = pwdiFlushAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9662 | |
| 9663 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9664 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9665 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9666 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9667 | wdiFlushAcRspCb, pEventData->pUserData, WDI_FLUSH_AC_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9668 | }/*WDI_ProcessFlushAcReq*/ |
| 9669 | |
| 9670 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9671 | @brief Process BT AMP event Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9672 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9673 | |
| 9674 | @param pWDICtx: pointer to the WLAN DAL context |
| 9675 | pEventData: pointer to the event information structure |
| 9676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9677 | @see |
| 9678 | @return Result of the function call |
| 9679 | */ |
| 9680 | WDI_Status |
| 9681 | WDI_ProcessBtAmpEventReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9682 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9683 | WDI_ControlBlockType* pWDICtx, |
| 9684 | WDI_EventInfoType* pEventData |
| 9685 | ) |
| 9686 | { |
| 9687 | WDI_BtAmpEventParamsType* pwdiBtAmpEventParams = NULL; |
| 9688 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9689 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9690 | wpt_uint16 usDataOffset = 0; |
| 9691 | wpt_uint16 usSendSize = 0; |
| 9692 | |
| 9693 | tBtAmpEventMsg haltBtAmpEventMsg; |
| 9694 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9695 | |
| 9696 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9697 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9698 | -------------------------------------------------------------------------*/ |
| 9699 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9700 | ( NULL == pEventData->pCBfnc )) |
| 9701 | { |
| 9702 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9703 | "%s: Invalid parameters", __FUNCTION__); |
| 9704 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9705 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9706 | } |
| 9707 | |
| 9708 | pwdiBtAmpEventParams = (WDI_BtAmpEventParamsType*)pEventData->pEventData; |
| 9709 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pEventData->pCBfnc; |
| 9710 | /*----------------------------------------------------------------------- |
| 9711 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9712 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9713 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9714 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_BTAMP_EVENT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9715 | sizeof(haltBtAmpEventMsg.btAmpEventParams), |
| 9716 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9717 | ( usSendSize < (usDataOffset + sizeof(haltBtAmpEventMsg.btAmpEventParams) ))) |
| 9718 | { |
| 9719 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9720 | "Unable to get send buffer in BT AMP event req %x %x %x", |
| 9721 | pEventData, pwdiBtAmpEventParams, wdiBtAmpEventRspCb); |
| 9722 | WDI_ASSERT(0); |
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 | haltBtAmpEventMsg.btAmpEventParams.btAmpEventType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9727 | pwdiBtAmpEventParams->wdiBtAmpEventInfo.ucBtAmpEventType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9728 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 9729 | &haltBtAmpEventMsg.btAmpEventParams, |
| 9730 | sizeof(haltBtAmpEventMsg.btAmpEventParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9731 | |
| 9732 | pWDICtx->wdiReqStatusCB = pwdiBtAmpEventParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9733 | pWDICtx->pReqStatusUserData = pwdiBtAmpEventParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9734 | |
| 9735 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9736 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9737 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9738 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9739 | wdiBtAmpEventRspCb, pEventData->pUserData, WDI_BTAMP_EVENT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9740 | }/*WDI_ProcessBtAmpEventReq*/ |
| 9741 | |
| 9742 | /** |
| 9743 | @brief Process Add STA self Request function (called when Main FSM |
| 9744 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9745 | |
| 9746 | @param pWDICtx: pointer to the WLAN DAL context |
| 9747 | pEventData: pointer to the event information structure |
| 9748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9749 | @see |
| 9750 | @return Result of the function call |
| 9751 | */ |
| 9752 | WDI_Status |
| 9753 | WDI_ProcessAddSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9754 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9755 | WDI_ControlBlockType* pWDICtx, |
| 9756 | WDI_EventInfoType* pEventData |
| 9757 | ) |
| 9758 | { |
| 9759 | WDI_AddSTASelfReqParamsType* pwdiAddSTASelfReqParams; |
| 9760 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9761 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9762 | wpt_uint16 usDataOffset = 0; |
| 9763 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9764 | tAddStaSelfParams halAddSTASelfParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9765 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9766 | |
| 9767 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9768 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9769 | -------------------------------------------------------------------------*/ |
| 9770 | if (( NULL == pEventData ) || |
| 9771 | ( NULL == pEventData->pEventData) || |
| 9772 | ( NULL == pEventData->pCBfnc)) |
| 9773 | { |
| 9774 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9775 | "%s: Invalid parameters", __FUNCTION__); |
| 9776 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9777 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9778 | } |
| 9779 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9780 | pwdiAddSTASelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9781 | (WDI_AddSTASelfReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9782 | wdiAddSTASelfReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9783 | (WDI_AddSTASelfParamsRspCb)pEventData->pCBfnc; |
| 9784 | /*----------------------------------------------------------------------- |
| 9785 | Get message buffer |
| 9786 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9787 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9788 | WDI_ADD_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9789 | sizeof(tAddStaSelfParams), |
| 9790 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9791 | ( usSendSize < (usDataOffset + sizeof(tAddStaSelfParams) ))) |
| 9792 | { |
| 9793 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9794 | "Unable to get send buffer in ADD STA SELF REQ %x %x %x", |
| 9795 | pEventData, pwdiAddSTASelfReqParams, wdiAddSTASelfReqRspCb); |
| 9796 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9797 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9798 | } |
| 9799 | |
| 9800 | /* Cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9801 | wpalMemoryCopy(&pWDICtx->wdiCacheAddSTASelfReq, pwdiAddSTASelfReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9802 | sizeof(pWDICtx->wdiCacheAddSTASelfReq)); |
| 9803 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9804 | wpalMemoryCopy(halAddSTASelfParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9805 | pwdiAddSTASelfReqParams->wdiAddSTASelfInfo.selfMacAddr, 6) ; |
| 9806 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9807 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halAddSTASelfParams, |
| 9808 | sizeof(tAddStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9809 | |
| 9810 | pWDICtx->wdiReqStatusCB = pwdiAddSTASelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9811 | pWDICtx->pReqStatusUserData = pwdiAddSTASelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9812 | |
| 9813 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9814 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9815 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9816 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9817 | wdiAddSTASelfReqRspCb, pEventData->pUserData, |
| 9818 | WDI_ADD_STA_SELF_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9819 | }/*WDI_ProcessAddSTASelfReq*/ |
| 9820 | |
| 9821 | |
| 9822 | |
| 9823 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9824 | @brief Process Del Sta Self Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9825 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9826 | |
| 9827 | @param pWDICtx: pointer to the WLAN DAL context |
| 9828 | pEventData: pointer to the event information structure |
| 9829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9830 | @see |
| 9831 | @return Result of the function call |
| 9832 | */ |
| 9833 | WDI_Status |
| 9834 | WDI_ProcessDelSTASelfReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9835 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9836 | WDI_ControlBlockType* pWDICtx, |
| 9837 | WDI_EventInfoType* pEventData |
| 9838 | ) |
| 9839 | { |
| 9840 | WDI_DelSTASelfReqParamsType* pwdiDelStaSelfReqParams; |
| 9841 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9842 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9843 | wpt_uint16 usDataOffset = 0; |
| 9844 | wpt_uint16 usSendSize = 0; |
| 9845 | tDelStaSelfParams halSetDelSelfSTAParams; |
| 9846 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 9847 | |
| 9848 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9849 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9850 | -------------------------------------------------------------------------*/ |
| 9851 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9852 | ( NULL == pEventData->pCBfnc )) |
| 9853 | { |
| 9854 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9855 | "%s: Invalid parameters", __FUNCTION__); |
| 9856 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9857 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9858 | } |
| 9859 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9860 | pwdiDelStaSelfReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9861 | (WDI_DelSTASelfReqParamsType*)pEventData->pEventData; |
| 9862 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pEventData->pCBfnc; |
| 9863 | |
| 9864 | /*----------------------------------------------------------------------- |
| 9865 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9866 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9867 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9868 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_DEL_STA_SELF_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9869 | sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo), |
| 9870 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9871 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9872 | (usDataOffset + sizeof(pwdiDelStaSelfReqParams->wdiDelStaSelfInfo) ))) |
| 9873 | { |
| 9874 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9875 | "Unable to get send buffer in Del Sta Self req %x %x %x", |
| 9876 | pEventData, pwdiDelStaSelfReqParams, wdiDelStaSelfRspCb); |
| 9877 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9878 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9879 | } |
| 9880 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9881 | wpalMemoryCopy(halSetDelSelfSTAParams.selfMacAddr, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9882 | pwdiDelStaSelfReqParams->wdiDelStaSelfInfo.selfMacAddr, 6) ; |
| 9883 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9884 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halSetDelSelfSTAParams, |
| 9885 | sizeof(tDelStaSelfParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9886 | |
| 9887 | pWDICtx->wdiReqStatusCB = pwdiDelStaSelfReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9888 | pWDICtx->pReqStatusUserData = pwdiDelStaSelfReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9889 | |
| 9890 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9891 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9892 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9893 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9894 | wdiDelStaSelfRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9895 | WDI_DEL_STA_SELF_RESP); |
| 9896 | |
| 9897 | } |
| 9898 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9899 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 9900 | /** |
| 9901 | @brief Process Start Oem Data Request function (called when Main |
| 9902 | FSM allows it) |
| 9903 | |
| 9904 | @param pWDICtx: pointer to the WLAN DAL context |
| 9905 | pEventData: pointer to the event information structure |
| 9906 | |
| 9907 | @see |
| 9908 | @return Result of the function call |
| 9909 | */ |
| 9910 | WDI_Status |
| 9911 | WDI_ProcessStartOemDataReq |
| 9912 | ( |
| 9913 | WDI_ControlBlockType* pWDICtx, |
| 9914 | WDI_EventInfoType* pEventData |
| 9915 | ) |
| 9916 | { |
| 9917 | WDI_oemDataReqParamsType* pwdiOemDataReqParams = NULL; |
| 9918 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 9919 | wpt_uint8* pSendBuffer = NULL; |
| 9920 | wpt_uint16 usDataOffset = 0; |
| 9921 | wpt_uint16 usSendSize = 0; |
| 9922 | wpt_uint16 reqLen; |
| 9923 | tStartOemDataReqParams* halStartOemDataReqParams; |
| 9924 | |
| 9925 | /*------------------------------------------------------------------------- |
| 9926 | Sanity check |
| 9927 | -------------------------------------------------------------------------*/ |
| 9928 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 9929 | ( NULL == pEventData->pCBfnc )) |
| 9930 | { |
| 9931 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9932 | "%s: Invalid parameters", __FUNCTION__); |
| 9933 | WDI_ASSERT(0); |
| 9934 | return WDI_STATUS_E_FAILURE; |
| 9935 | } |
| 9936 | |
| 9937 | pwdiOemDataReqParams = (WDI_oemDataReqParamsType*)pEventData->pEventData; |
| 9938 | wdiOemDataRspCb = (WDI_oemDataRspCb)pEventData->pCBfnc; |
| 9939 | |
| 9940 | /*----------------------------------------------------------------------- |
| 9941 | Get message buffer |
| 9942 | -----------------------------------------------------------------------*/ |
| 9943 | |
| 9944 | reqLen = sizeof(tStartOemDataReqParams); |
| 9945 | |
| 9946 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 9947 | WDI_START_OEM_DATA_REQ, reqLen, |
| 9948 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 9949 | (usSendSize < (usDataOffset + reqLen))) |
| 9950 | { |
| 9951 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 9952 | "Unable to get send buffer in Start Oem Data req %x %x %x", |
| 9953 | pEventData, pwdiOemDataReqParams, wdiOemDataRspCb); |
| 9954 | WDI_ASSERT(0); |
| 9955 | return WDI_STATUS_E_FAILURE; |
| 9956 | } |
| 9957 | |
| 9958 | //copying WDI OEM DATA REQ PARAMS to shared memory |
| 9959 | halStartOemDataReqParams = (tStartOemDataReqParams *)(pSendBuffer + usDataOffset ); |
| 9960 | |
| 9961 | wpalMemoryCopy(&halStartOemDataReqParams->selfMacAddr, &pwdiOemDataReqParams->wdiOemDataReqInfo.selfMacAddr, sizeof(wpt_macAddr)); |
| 9962 | wpalMemoryCopy(&halStartOemDataReqParams->oemDataReq, &pwdiOemDataReqParams->wdiOemDataReqInfo.oemDataReq, OEM_DATA_REQ_SIZE); |
| 9963 | |
| 9964 | pWDICtx->wdiReqStatusCB = pwdiOemDataReqParams->wdiReqStatusCB; |
| 9965 | pWDICtx->pReqStatusUserData = pwdiOemDataReqParams->pUserData; |
| 9966 | |
| 9967 | /*------------------------------------------------------------------------- |
| 9968 | Send Start Request to HAL |
| 9969 | -------------------------------------------------------------------------*/ |
| 9970 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 9971 | wdiOemDataRspCb, pEventData->pUserData, |
| 9972 | WDI_START_OEM_DATA_RESP); |
| 9973 | }/*WDI_ProcessStartOemDataReq*/ |
| 9974 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9975 | |
| 9976 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9977 | @brief Process Host Resume Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9978 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9979 | |
| 9980 | @param pWDICtx: pointer to the WLAN DAL context |
| 9981 | pEventData: pointer to the event information structure |
| 9982 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9983 | @see |
| 9984 | @return Result of the function call |
| 9985 | */ |
| 9986 | WDI_Status |
| 9987 | WDI_ProcessHostResumeReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9988 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9989 | WDI_ControlBlockType* pWDICtx, |
| 9990 | WDI_EventInfoType* pEventData |
| 9991 | ) |
| 9992 | { |
| 9993 | WDI_ResumeParamsType* pwdiHostResumeParams = NULL; |
| 9994 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 9995 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 9996 | wpt_uint16 usDataOffset = 0; |
| 9997 | wpt_uint16 usSendSize = 0; |
| 9998 | tHalWlanHostResumeReqParam halResumeReqParams; |
| 9999 | |
| 10000 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10001 | |
| 10002 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10003 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10004 | -------------------------------------------------------------------------*/ |
| 10005 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10006 | ( NULL == pEventData->pCBfnc )) |
| 10007 | { |
| 10008 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10009 | "%s: Invalid parameters ",__FUNCTION__); |
| 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 | |
| 10014 | pwdiHostResumeParams = (WDI_ResumeParamsType*)pEventData->pEventData; |
| 10015 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pEventData->pCBfnc; |
| 10016 | |
| 10017 | /*----------------------------------------------------------------------- |
| 10018 | Get message buffer |
| 10019 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10020 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10021 | WDI_HOST_RESUME_REQ, sizeof(halResumeReqParams), |
| 10022 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10023 | (usSendSize < (usDataOffset + sizeof(halResumeReqParams)))) |
| 10024 | { |
| 10025 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10026 | "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] | 10027 | pEventData, pwdiHostResumeParams, wdiHostResumeRspCb); |
| 10028 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10029 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10030 | } |
| 10031 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10032 | halResumeReqParams.configuredMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10033 | pwdiHostResumeParams->wdiResumeParams.ucConfiguredMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10034 | |
| 10035 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10036 | &halResumeReqParams, |
| 10037 | sizeof(halResumeReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10038 | |
| 10039 | pWDICtx->wdiReqStatusCB = pwdiHostResumeParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10040 | pWDICtx->pReqStatusUserData = pwdiHostResumeParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10041 | |
| 10042 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10043 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10044 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10045 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10046 | wdiHostResumeRspCb, pEventData->pUserData, |
| 10047 | WDI_HOST_RESUME_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10048 | }/*WDI_ProcessHostResumeReq*/ |
| 10049 | |
| 10050 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10051 | @brief Process set Tx Per Tracking Parameters Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10052 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10053 | |
| 10054 | @param pWDICtx: pointer to the WLAN DAL context |
| 10055 | pEventData: pointer to the event information structure |
| 10056 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10057 | @see |
| 10058 | @return Result of the function call |
| 10059 | */ |
| 10060 | WDI_Status |
| 10061 | WDI_ProcessSetTxPerTrackingReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10062 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10063 | WDI_ControlBlockType* pWDICtx, |
| 10064 | WDI_EventInfoType* pEventData |
| 10065 | ) |
| 10066 | { |
| 10067 | WDI_SetTxPerTrackingReqParamsType* pwdiSetTxPerTrackingReqParams = NULL; |
| 10068 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10069 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10070 | wpt_uint16 usDataOffset = 0; |
| 10071 | wpt_uint16 usSendSize = 0; |
| 10072 | tHalTxPerTrackingReqParam halTxPerTrackingReqParam; |
| 10073 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10074 | |
| 10075 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10076 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10077 | -------------------------------------------------------------------------*/ |
| 10078 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10079 | ( NULL == pEventData->pCBfnc )) |
| 10080 | { |
| 10081 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10082 | "%s: Invalid parameters ",__FUNCTION__); |
| 10083 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10084 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10085 | } |
| 10086 | |
| 10087 | pwdiSetTxPerTrackingReqParams = (WDI_SetTxPerTrackingReqParamsType*)pEventData->pEventData; |
| 10088 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pEventData->pCBfnc; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10090 | /*----------------------------------------------------------------------- |
| 10091 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10092 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10093 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10094 | 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] | 10095 | sizeof(halTxPerTrackingReqParam), |
| 10096 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10097 | ( usSendSize < (usDataOffset + sizeof(halTxPerTrackingReqParam) ))) |
| 10098 | { |
| 10099 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10100 | "Unable to get send buffer in set tx per tracking req %x %x %x", |
| 10101 | pEventData, pwdiSetTxPerTrackingReqParams, pwdiSetTxPerTrackingRspCb); |
| 10102 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10103 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10104 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10105 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10106 | halTxPerTrackingReqParam.ucTxPerTrackingEnable = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingEnable; |
| 10107 | halTxPerTrackingReqParam.ucTxPerTrackingPeriod = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingPeriod; |
| 10108 | halTxPerTrackingReqParam.ucTxPerTrackingRatio = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.ucTxPerTrackingRatio; |
| 10109 | halTxPerTrackingReqParam.uTxPerTrackingWatermark = pwdiSetTxPerTrackingReqParams->wdiTxPerTrackingParam.uTxPerTrackingWatermark; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10110 | |
| 10111 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10112 | &halTxPerTrackingReqParam, |
| 10113 | sizeof(halTxPerTrackingReqParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10114 | |
| 10115 | pWDICtx->wdiReqStatusCB = pwdiSetTxPerTrackingReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10116 | pWDICtx->pReqStatusUserData = pwdiSetTxPerTrackingReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10117 | |
| 10118 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10119 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10120 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10121 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10122 | pwdiSetTxPerTrackingRspCb, pEventData->pUserData, WDI_SET_TX_PER_TRACKING_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10123 | }/*WDI_ProcessSetTxPerTrackingReq*/ |
| 10124 | |
| 10125 | /*========================================================================= |
| 10126 | Indications |
| 10127 | =========================================================================*/ |
| 10128 | |
| 10129 | /** |
| 10130 | @brief Process Suspend Indications function (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10131 | |
| 10132 | @param pWDICtx: pointer to the WLAN DAL context |
| 10133 | pEventData: pointer to the event information structure |
| 10134 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10135 | @see |
| 10136 | @return Result of the function call |
| 10137 | */ |
| 10138 | WDI_Status |
| 10139 | WDI_ProcessHostSuspendInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10140 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10141 | WDI_ControlBlockType* pWDICtx, |
| 10142 | WDI_EventInfoType* pEventData |
| 10143 | ) |
| 10144 | { |
| 10145 | WDI_SuspendParamsType *pSuspendIndParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10146 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10147 | wpt_uint16 usDataOffset = 0; |
| 10148 | wpt_uint16 usSendSize = 0; |
| 10149 | WDI_Status wdiStatus; |
| 10150 | tHalWlanHostSuspendIndParam halWlanSuspendIndparams; |
| 10151 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10152 | |
| 10153 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10154 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10155 | -------------------------------------------------------------------------*/ |
| 10156 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData )) |
| 10157 | { |
| 10158 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10159 | "%s: Invalid parameters in Suspend ind",__FUNCTION__); |
| 10160 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10161 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10162 | } |
| 10163 | |
| 10164 | pSuspendIndParams = (WDI_SuspendParamsType *)pEventData->pEventData; |
| 10165 | |
| 10166 | /*----------------------------------------------------------------------- |
| 10167 | Get message buffer |
| 10168 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10169 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 10170 | WDI_HOST_SUSPEND_IND, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10171 | sizeof(halWlanSuspendIndparams), |
| 10172 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10173 | (usSendSize < (usDataOffset + sizeof(halWlanSuspendIndparams)))) |
| 10174 | { |
| 10175 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10176 | "Unable to get send buffer in Suspend Ind "); |
| 10177 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10178 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10179 | } |
| 10180 | |
| 10181 | halWlanSuspendIndparams.configuredMcstBcstFilterSetting = |
| 10182 | pSuspendIndParams->wdiSuspendParams.ucConfiguredMcstBcstFilterSetting; |
| 10183 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10184 | halWlanSuspendIndparams.activeSessionCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10185 | WDI_GetActiveSessionsCount(pWDICtx); |
| 10186 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10187 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halWlanSuspendIndparams, |
| 10188 | sizeof(tHalWlanHostSuspendIndParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10189 | |
| 10190 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10191 | Send Suspend Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10192 | -------------------------------------------------------------------------*/ |
| 10193 | pWDICtx->wdiReqStatusCB = pSuspendIndParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10194 | pWDICtx->pReqStatusUserData = pSuspendIndParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10196 | wdiStatus = WDI_SendIndication( pWDICtx, pSendBuffer, usSendSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10197 | return ( wdiStatus != WDI_STATUS_SUCCESS )?wdiStatus:WDI_STATUS_SUCCESS_SYNC; |
| 10198 | }/*WDI_ProcessHostSuspendInd*/ |
| 10199 | |
| 10200 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10201 | MISC CONTROL PROCESSING REQUEST API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10202 | ==========================================================================*/ |
| 10203 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10204 | @brief Process Channel Switch Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10205 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10206 | |
| 10207 | @param pWDICtx: pointer to the WLAN DAL context |
| 10208 | pEventData: pointer to the event information structure |
| 10209 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10210 | @see |
| 10211 | @return Result of the function call |
| 10212 | */ |
| 10213 | WDI_Status |
| 10214 | WDI_ProcessChannelSwitchReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10215 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10216 | WDI_ControlBlockType* pWDICtx, |
| 10217 | WDI_EventInfoType* pEventData |
| 10218 | ) |
| 10219 | { |
| 10220 | WDI_SwitchChReqParamsType* pwdiSwitchChParams; |
| 10221 | WDI_SwitchChRspCb wdiSwitchChRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10222 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10223 | wpt_uint16 usDataOffset = 0; |
| 10224 | wpt_uint16 usSendSize = 0; |
| 10225 | tSwitchChannelReqMsg halSwitchChannelReq = {{0}}; |
| 10226 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10227 | |
| 10228 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10229 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10230 | -------------------------------------------------------------------------*/ |
| 10231 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10232 | ( NULL == pEventData->pCBfnc )) |
| 10233 | { |
| 10234 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10235 | "%s: Invalid parameters", __FUNCTION__); |
| 10236 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10237 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10238 | } |
| 10239 | |
| 10240 | pwdiSwitchChParams = (WDI_SwitchChReqParamsType*)pEventData->pEventData; |
| 10241 | wdiSwitchChRspCb = (WDI_SwitchChRspCb)pEventData->pCBfnc; |
| 10242 | /*----------------------------------------------------------------------- |
| 10243 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10244 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10245 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10246 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CH_SWITCH_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10247 | sizeof(halSwitchChannelReq.switchChannelParams), |
| 10248 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10249 | ( usSendSize < (usDataOffset + sizeof(halSwitchChannelReq.switchChannelParams) ))) |
| 10250 | { |
| 10251 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10252 | "Unable to get send buffer in channel switch req %x %x %x", |
| 10253 | pEventData, pwdiSwitchChParams, wdiSwitchChRspCb); |
| 10254 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10255 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10256 | } |
| 10257 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10258 | halSwitchChannelReq.switchChannelParams.channelNumber = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10259 | pwdiSwitchChParams->wdiChInfo.ucChannel; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10260 | #ifndef WLAN_FEATURE_VOWIFI |
| 10261 | halSwitchChannelReq.switchChannelParams.localPowerConstraint = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10262 | pwdiSwitchChParams->wdiChInfo.ucLocalPowerConstraint; |
| 10263 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10264 | halSwitchChannelReq.switchChannelParams.secondaryChannelOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10265 | pwdiSwitchChParams->wdiChInfo.wdiSecondaryChannelOffset; |
| 10266 | |
| 10267 | #ifdef WLAN_FEATURE_VOWIFI |
| 10268 | halSwitchChannelReq.switchChannelParams.maxTxPower |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10269 | = pwdiSwitchChParams->wdiChInfo.cMaxTxPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10270 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.selfStaMacAddr, |
| 10271 | pwdiSwitchChParams->wdiChInfo.macSelfStaMacAddr, |
| 10272 | WDI_MAC_ADDR_LEN); |
| 10273 | wpalMemoryCopy(halSwitchChannelReq.switchChannelParams.bssId, |
| 10274 | pwdiSwitchChParams->wdiChInfo.macBSSId, |
| 10275 | WDI_MAC_ADDR_LEN); |
| 10276 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10277 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10278 | &halSwitchChannelReq.switchChannelParams, |
| 10279 | sizeof(halSwitchChannelReq.switchChannelParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10280 | |
| 10281 | pWDICtx->wdiReqStatusCB = pwdiSwitchChParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10282 | pWDICtx->pReqStatusUserData = pwdiSwitchChParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10283 | |
| 10284 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10285 | Send Switch Channel Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10286 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10287 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10288 | wdiSwitchChRspCb, pEventData->pUserData, WDI_CH_SWITCH_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10289 | }/*WDI_ProcessChannelSwitchReq*/ |
| 10290 | |
| 10291 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10292 | @brief Process Config STA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10293 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10294 | |
| 10295 | @param pWDICtx: pointer to the WLAN DAL context |
| 10296 | pEventData: pointer to the event information structure |
| 10297 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10298 | @see |
| 10299 | @return Result of the function call |
| 10300 | */ |
| 10301 | WDI_Status |
| 10302 | WDI_ProcessConfigStaReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10303 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10304 | WDI_ControlBlockType* pWDICtx, |
| 10305 | WDI_EventInfoType* pEventData |
| 10306 | ) |
| 10307 | { |
| 10308 | WDI_ConfigSTAReqParamsType* pwdiConfigSTAParams; |
| 10309 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10310 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10311 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10312 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10313 | wpt_uint16 usDataOffset = 0; |
| 10314 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10315 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10317 | tConfigStaReqMsg halConfigStaReqMsg; |
| 10318 | wpt_uint16 uMsgSize = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10319 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10320 | |
| 10321 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10322 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10323 | -------------------------------------------------------------------------*/ |
| 10324 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10325 | ( NULL == pEventData->pCBfnc )) |
| 10326 | { |
| 10327 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10328 | "%s: Invalid parameters", __FUNCTION__); |
| 10329 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10330 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10331 | } |
| 10332 | |
| 10333 | pwdiConfigSTAParams = (WDI_ConfigSTAReqParamsType*)pEventData->pEventData; |
| 10334 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pEventData->pCBfnc; |
| 10335 | /*------------------------------------------------------------------------- |
| 10336 | 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] | 10337 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10338 | -------------------------------------------------------------------------*/ |
| 10339 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10340 | |
| 10341 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10342 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10343 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10344 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10345 | pwdiConfigSTAParams->wdiReqInfo.macBSSID, |
| 10346 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10347 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10348 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10349 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10350 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10351 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10352 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10353 | |
| 10354 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10355 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10356 | } |
| 10357 | |
| 10358 | /*------------------------------------------------------------------------ |
| 10359 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10360 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10361 | ------------------------------------------------------------------------*/ |
| 10362 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10363 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10364 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10365 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10366 | __func__, MAC_ADDR_ARRAY(pwdiConfigSTAParams->wdiReqInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10367 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10368 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10369 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10370 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10371 | } |
| 10372 | |
| 10373 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10374 | |
| 10375 | /* Allocation of StaReqMsg Memory Based on Firmware Capabilities */ |
| 10376 | #ifdef WLAN_FEATURE_11AC |
| 10377 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 10378 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams_V1); // Version-1 For 11AC |
| 10379 | else |
| 10380 | #endif |
| 10381 | uMsgSize = sizeof(halConfigStaReqMsg.uStaParams.configStaParams); // Version-0 Default |
| 10382 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10383 | /*----------------------------------------------------------------------- |
| 10384 | Get message buffer |
| 10385 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10386 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIG_STA_REQ, |
| 10387 | uMsgSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10388 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10389 | ( usSendSize < (usDataOffset + uMsgSize ))) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10390 | { |
| 10391 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10392 | "Unable to get send buffer in config sta req %x %x %x", |
| 10393 | pEventData, pwdiConfigSTAParams, wdiConfigSTARspCb); |
| 10394 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10395 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10396 | } |
| 10397 | |
| 10398 | /*Copy the station context*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10399 | WDI_CopyWDIStaCtxToHALStaCtx( &halConfigStaReqMsg.uStaParams.configStaParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10400 | &pwdiConfigSTAParams->wdiReqInfo); |
| 10401 | |
| 10402 | if(pwdiConfigSTAParams->wdiReqInfo.wdiSTAType == WDI_STA_ENTRY_SELF) |
| 10403 | { |
| 10404 | /* Need to fill in the self STA Index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10405 | if ( WDI_STATUS_SUCCESS != |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10406 | WDI_STATableFindStaidByAddr(pWDICtx, |
| 10407 | pwdiConfigSTAParams->wdiReqInfo.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10408 | (wpt_uint8*)&halConfigStaReqMsg.uStaParams.configStaParams.staIdx )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10409 | { |
| 10410 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10411 | "This station does not exist in the WDI Station Table %d"); |
| 10412 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10413 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10414 | } |
| 10415 | } |
| 10416 | else |
| 10417 | { |
| 10418 | /* Need to fill in the STA Index to invalid, since at this point we have not |
| 10419 | yet received it from HAL */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10420 | halConfigStaReqMsg.uStaParams.configStaParams.staIdx = WDI_STA_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10421 | } |
| 10422 | |
| 10423 | /* Need to fill in the BSS index */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10424 | halConfigStaReqMsg.uStaParams.configStaParams.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10425 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10426 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10427 | &halConfigStaReqMsg.uStaParams, |
| 10428 | sizeof(halConfigStaReqMsg.uStaParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10429 | |
| 10430 | pWDICtx->wdiReqStatusCB = pwdiConfigSTAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10431 | pWDICtx->pReqStatusUserData = pwdiConfigSTAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10432 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10433 | wpalMemoryCopy( &pWDICtx->wdiCachedConfigStaReq, |
| 10434 | pwdiConfigSTAParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10435 | sizeof(pWDICtx->wdiCachedConfigStaReq)); |
| 10436 | |
| 10437 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10438 | Send Config STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10439 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10440 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10441 | wdiConfigSTARspCb, pEventData->pUserData, WDI_CONFIG_STA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10442 | }/*WDI_ProcessConfigStaReq*/ |
| 10443 | |
| 10444 | |
| 10445 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10446 | @brief Process Set Link State Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10447 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10448 | |
| 10449 | @param pWDICtx: pointer to the WLAN DAL context |
| 10450 | pEventData: pointer to the event information structure |
| 10451 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10452 | @see |
| 10453 | @return Result of the function call |
| 10454 | */ |
| 10455 | WDI_Status |
| 10456 | WDI_ProcessSetLinkStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10457 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10458 | WDI_ControlBlockType* pWDICtx, |
| 10459 | WDI_EventInfoType* pEventData |
| 10460 | ) |
| 10461 | { |
| 10462 | WDI_SetLinkReqParamsType* pwdiSetLinkParams; |
| 10463 | WDI_SetLinkStateRspCb wdiSetLinkRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10464 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10465 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10466 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10467 | wpt_uint16 usDataOffset = 0; |
| 10468 | wpt_uint16 usSendSize = 0; |
| 10469 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10470 | tLinkStateParams halLinkStateReqMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10471 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10472 | |
| 10473 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10474 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10475 | -------------------------------------------------------------------------*/ |
| 10476 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10477 | ( NULL == pEventData->pCBfnc )) |
| 10478 | { |
| 10479 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10480 | "%s: Invalid parameters", __FUNCTION__); |
| 10481 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10482 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10483 | } |
| 10484 | |
| 10485 | pwdiSetLinkParams = (WDI_SetLinkReqParamsType*)pEventData->pEventData; |
| 10486 | wdiSetLinkRspCb = (WDI_SetLinkStateRspCb)pEventData->pCBfnc; |
| 10487 | /*------------------------------------------------------------------------- |
| 10488 | 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] | 10489 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10490 | -------------------------------------------------------------------------*/ |
| 10491 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10492 | |
| 10493 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10494 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10495 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10496 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 10497 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, |
| 10498 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10499 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10500 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10501 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10502 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10503 | "%s: Set link request received outside association session. macBSSID " MAC_ADDRESS_STR, |
| 10504 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10505 | } |
| 10506 | else |
| 10507 | { |
| 10508 | /*------------------------------------------------------------------------ |
| 10509 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10510 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10511 | ------------------------------------------------------------------------*/ |
| 10512 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10513 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10514 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10515 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10516 | __func__, MAC_ADDR_ARRAY(pwdiSetLinkParams->wdiLinkInfo.macBSSID)); |
| 10517 | |
| 10518 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10519 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10520 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10521 | } |
| 10522 | } |
| 10523 | /* If the link is set to enter IDLE - the Session allocated for this BSS |
| 10524 | will be deleted on the Set Link State response coming from HAL |
| 10525 | - cache the request for response processing */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10526 | wpalMemoryCopy(&pWDICtx->wdiCacheSetLinkStReq, pwdiSetLinkParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10527 | sizeof(pWDICtx->wdiCacheSetLinkStReq)); |
| 10528 | |
| 10529 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10530 | /*----------------------------------------------------------------------- |
| 10531 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10532 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10533 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10534 | |
| 10535 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_LINK_ST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10536 | sizeof(halLinkStateReqMsg), |
| 10537 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10538 | ( usSendSize < (usDataOffset + sizeof(halLinkStateReqMsg) ))) |
| 10539 | { |
| 10540 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10541 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10542 | pEventData, pwdiSetLinkParams, wdiSetLinkRspCb); |
| 10543 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10544 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10545 | } |
| 10546 | |
| 10547 | wpalMemoryCopy(halLinkStateReqMsg.bssid, |
| 10548 | pwdiSetLinkParams->wdiLinkInfo.macBSSID, WDI_MAC_ADDR_LEN); |
| 10549 | |
| 10550 | wpalMemoryCopy(halLinkStateReqMsg.selfMacAddr, |
| 10551 | pwdiSetLinkParams->wdiLinkInfo.macSelfStaMacAddr, WDI_MAC_ADDR_LEN); |
| 10552 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10553 | halLinkStateReqMsg.state = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10554 | WDI_2_HAL_LINK_STATE(pwdiSetLinkParams->wdiLinkInfo.wdiLinkState); |
| 10555 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10556 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10557 | &halLinkStateReqMsg, |
| 10558 | sizeof(halLinkStateReqMsg)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10559 | |
| 10560 | pWDICtx->wdiReqStatusCB = pwdiSetLinkParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10561 | pWDICtx->pReqStatusUserData = pwdiSetLinkParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10562 | |
| 10563 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10564 | Send Set Link State Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10565 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10566 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10567 | wdiSetLinkRspCb, pEventData->pUserData, WDI_SET_LINK_ST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10568 | }/*WDI_ProcessSetLinkStateReq*/ |
| 10569 | |
| 10570 | |
| 10571 | /** |
| 10572 | @brief Process Get Stats Request function (called when Main FSM |
| 10573 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10574 | |
| 10575 | @param pWDICtx: pointer to the WLAN DAL context |
| 10576 | pEventData: pointer to the event information structure |
| 10577 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10578 | @see |
| 10579 | @return Result of the function call |
| 10580 | */ |
| 10581 | WDI_Status |
| 10582 | WDI_ProcessGetStatsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10583 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10584 | WDI_ControlBlockType* pWDICtx, |
| 10585 | WDI_EventInfoType* pEventData |
| 10586 | ) |
| 10587 | { |
| 10588 | WDI_GetStatsReqParamsType* pwdiGetStatsParams; |
| 10589 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10590 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10591 | wpt_uint16 usDataOffset = 0; |
| 10592 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10593 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10594 | WDI_BSSSessionType* pBSSSes = NULL; |
| 10595 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10596 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10597 | tHalStatsReqMsg halStatsReqMsg; |
| 10598 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10599 | |
| 10600 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10601 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10602 | -------------------------------------------------------------------------*/ |
| 10603 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData) || |
| 10604 | ( NULL == pEventData->pCBfnc ) ) |
| 10605 | { |
| 10606 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10607 | "%s: Invalid parameters", __FUNCTION__); |
| 10608 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10609 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10610 | } |
| 10611 | |
| 10612 | pwdiGetStatsParams = (WDI_GetStatsReqParamsType*)pEventData->pEventData; |
| 10613 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pEventData->pCBfnc; |
| 10614 | |
| 10615 | /*------------------------------------------------------------------------- |
| 10616 | 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] | 10617 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10618 | -------------------------------------------------------------------------*/ |
| 10619 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10620 | |
| 10621 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10622 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10623 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10624 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10625 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10626 | &macBSSID)) |
| 10627 | { |
| 10628 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10629 | "This station does not exist in the WDI Station Table %d"); |
| 10630 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10631 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10632 | } |
| 10633 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10634 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10635 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10636 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10637 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10638 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10639 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10640 | |
| 10641 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10642 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10643 | } |
| 10644 | |
| 10645 | /*------------------------------------------------------------------------ |
| 10646 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10647 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10648 | ------------------------------------------------------------------------*/ |
| 10649 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10650 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10651 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10652 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10653 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10654 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10655 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10656 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10657 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10658 | } |
| 10659 | |
| 10660 | |
| 10661 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10662 | |
| 10663 | /*----------------------------------------------------------------------- |
| 10664 | Get message buffer |
| 10665 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10666 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GET_STATS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10667 | sizeof(halStatsReqMsg.statsReqParams), |
| 10668 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10669 | ( usSendSize < (usDataOffset + sizeof(halStatsReqMsg.statsReqParams) ))) |
| 10670 | { |
| 10671 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10672 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10673 | pEventData, pwdiGetStatsParams, wdiGetStatsRspCb); |
| 10674 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10675 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10676 | } |
| 10677 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10678 | halStatsReqMsg.statsReqParams.staId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10679 | pwdiGetStatsParams->wdiGetStatsParamsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10680 | halStatsReqMsg.statsReqParams.statsMask = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10681 | pwdiGetStatsParams->wdiGetStatsParamsInfo.uStatsMask; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10682 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10683 | &halStatsReqMsg.statsReqParams, |
| 10684 | sizeof(halStatsReqMsg.statsReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10685 | |
| 10686 | pWDICtx->wdiReqStatusCB = pwdiGetStatsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10687 | pWDICtx->pReqStatusUserData = pwdiGetStatsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10688 | |
| 10689 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10690 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10691 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10692 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10693 | wdiGetStatsRspCb, pEventData->pUserData, WDI_GET_STATS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10694 | }/*WDI_ProcessGetStatsReq*/ |
| 10695 | |
| 10696 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10697 | @brief Process Update Cfg Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10698 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10699 | |
| 10700 | @param pWDICtx: pointer to the WLAN DAL context |
| 10701 | pEventData: pointer to the event information structure |
| 10702 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10703 | @see |
| 10704 | @return Result of the function call |
| 10705 | */ |
| 10706 | WDI_Status |
| 10707 | WDI_ProcessUpdateCfgReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10708 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10709 | WDI_ControlBlockType* pWDICtx, |
| 10710 | WDI_EventInfoType* pEventData |
| 10711 | ) |
| 10712 | { |
| 10713 | WDI_UpdateCfgReqParamsType* pwdiUpdateCfgParams = NULL; |
| 10714 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb = NULL; |
| 10715 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10716 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10717 | wpt_uint16 usDataOffset = 0; |
| 10718 | wpt_uint16 usSendSize = 0; |
| 10719 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10720 | |
| 10721 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10722 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10723 | -------------------------------------------------------------------------*/ |
| 10724 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 10725 | ( NULL == pEventData->pCBfnc)) |
| 10726 | { |
| 10727 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10728 | "%s: Invalid parameters", __FUNCTION__); |
| 10729 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10730 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10731 | } |
| 10732 | |
| 10733 | pwdiUpdateCfgParams = (WDI_UpdateCfgReqParamsType*)pEventData->pEventData; |
| 10734 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pEventData->pCBfnc; |
| 10735 | |
| 10736 | /*----------------------------------------------------------------------- |
| 10737 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10738 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10739 | -----------------------------------------------------------------------*/ |
| 10740 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10741 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_CFG_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10742 | pwdiUpdateCfgParams->uConfigBufferLen + sizeof(wpt_uint32), |
| 10743 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 10744 | ( usSendSize < (usDataOffset + pwdiUpdateCfgParams->uConfigBufferLen))) |
| 10745 | { |
| 10746 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10747 | "Unable to get send buffer in set bss key req %x %x %x", |
| 10748 | pEventData, pwdiUpdateCfgParams, wdiUpdateCfgRspCb); |
| 10749 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10750 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10751 | } |
| 10752 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10753 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10754 | &pwdiUpdateCfgParams->uConfigBufferLen, |
| 10755 | sizeof(wpt_uint32)); |
| 10756 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(wpt_uint32), |
| 10757 | pwdiUpdateCfgParams->pConfigBuffer, |
| 10758 | pwdiUpdateCfgParams->uConfigBufferLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10759 | |
| 10760 | pWDICtx->wdiReqStatusCB = pwdiUpdateCfgParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10761 | pWDICtx->pReqStatusUserData = pwdiUpdateCfgParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10762 | |
| 10763 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10764 | Send Update Cfg Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10765 | -------------------------------------------------------------------------*/ |
| 10766 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10767 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10768 | wdiUpdateCfgRspCb, pEventData->pUserData, WDI_UPDATE_CFG_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10769 | |
| 10770 | }/*WDI_ProcessUpdateCfgReq*/ |
| 10771 | |
| 10772 | |
| 10773 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10774 | @brief Process Add BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10775 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10776 | |
| 10777 | @param pWDICtx: pointer to the WLAN DAL context |
| 10778 | pEventData: pointer to the event information structure |
| 10779 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10780 | @see |
| 10781 | @return Result of the function call |
| 10782 | */ |
| 10783 | WDI_Status |
| 10784 | WDI_ProcessAddBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10785 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10786 | WDI_ControlBlockType* pWDICtx, |
| 10787 | WDI_EventInfoType* pEventData |
| 10788 | ) |
| 10789 | { |
| 10790 | WDI_AddBAReqParamsType* pwdiAddBAParams; |
| 10791 | WDI_AddBARspCb wdiAddBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10792 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10793 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10794 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10795 | wpt_uint16 usDataOffset = 0; |
| 10796 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10797 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10798 | wpt_macAddr macBSSID; |
| 10799 | |
| 10800 | tAddBAReqMsg halAddBAReq; |
| 10801 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10802 | |
| 10803 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10804 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10805 | -------------------------------------------------------------------------*/ |
| 10806 | if (( NULL == pEventData ) || |
| 10807 | ( NULL == pEventData->pEventData) || |
| 10808 | ( NULL == pEventData->pCBfnc )) |
| 10809 | { |
| 10810 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10811 | "%s: Invalid parameters", __FUNCTION__); |
| 10812 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10813 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10814 | } |
| 10815 | |
| 10816 | pwdiAddBAParams = (WDI_AddBAReqParamsType*)pEventData->pEventData; |
| 10817 | wdiAddBARspCb = (WDI_AddBARspCb)pEventData->pCBfnc; |
| 10818 | |
| 10819 | /*------------------------------------------------------------------------- |
| 10820 | 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] | 10821 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10822 | -------------------------------------------------------------------------*/ |
| 10823 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10824 | |
| 10825 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10826 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10827 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10828 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10829 | pwdiAddBAParams->wdiBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10830 | &macBSSID)) |
| 10831 | { |
| 10832 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10833 | "This station does not exist in the WDI Station Table %d"); |
| 10834 | wpalMutexRelease(&pWDICtx->wptMutex); |
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 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10838 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10839 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10840 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10841 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10842 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10843 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10844 | |
| 10845 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10846 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10847 | } |
| 10848 | |
| 10849 | /*------------------------------------------------------------------------ |
| 10850 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10851 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10852 | ------------------------------------------------------------------------*/ |
| 10853 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10854 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10855 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10856 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10857 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10858 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10859 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10860 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10861 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10862 | } |
| 10863 | |
| 10864 | |
| 10865 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 10866 | /*----------------------------------------------------------------------- |
| 10867 | Get message buffer |
| 10868 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10869 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ADD_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10870 | sizeof(halAddBAReq.addBAParams), |
| 10871 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10872 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10873 | (usDataOffset + sizeof(halAddBAReq.addBAParams) ))) |
| 10874 | { |
| 10875 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10876 | "Unable to get send buffer in Add BA req %x %x %x", |
| 10877 | pEventData, pwdiAddBAParams, wdiAddBARspCb); |
| 10878 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10879 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10880 | } |
| 10881 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10882 | halAddBAReq.addBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10883 | pwdiAddBAParams->wdiBAInfoType.ucBaSessionID; |
| 10884 | halAddBAReq.addBAParams.winSize = pwdiAddBAParams->wdiBAInfoType.ucWinSize; |
| 10885 | #ifdef FEATURE_ON_CHIP_REORDERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10886 | halAddBAReq.addBAParams.isReorderingDoneOnChip = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10887 | pwdiAddBAParams->wdiBAInfoType.bIsReorderingDoneOnChip; |
| 10888 | #endif |
| 10889 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10890 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 10891 | &halAddBAReq.addBAParams, |
| 10892 | sizeof(halAddBAReq.addBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10893 | |
| 10894 | pWDICtx->wdiReqStatusCB = pwdiAddBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10895 | pWDICtx->pReqStatusUserData = pwdiAddBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10896 | |
| 10897 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10898 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10899 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10900 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 10901 | wdiAddBARspCb, pEventData->pUserData, |
| 10902 | WDI_ADD_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10903 | }/*WDI_ProcessAddBAReq*/ |
| 10904 | |
| 10905 | |
| 10906 | |
| 10907 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10908 | @brief Process Trigger BA Request function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10909 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10910 | |
| 10911 | @param pWDICtx: pointer to the WLAN DAL context |
| 10912 | pEventData: pointer to the event information structure |
| 10913 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10914 | @see |
| 10915 | @return Result of the function call |
| 10916 | */ |
| 10917 | WDI_Status |
| 10918 | WDI_ProcessTriggerBAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10919 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10920 | WDI_ControlBlockType* pWDICtx, |
| 10921 | WDI_EventInfoType* pEventData |
| 10922 | ) |
| 10923 | { |
| 10924 | WDI_TriggerBAReqParamsType* pwdiTriggerBAParams; |
| 10925 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10926 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10927 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10928 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10929 | wpt_uint16 usDataOffset = 0; |
| 10930 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10931 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10932 | wpt_uint16 index; |
| 10933 | wpt_macAddr macBSSID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10934 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10935 | tTriggerBAReqMsg halTriggerBAReq; |
| 10936 | tTriggerBaReqCandidate* halTriggerBACandidate; |
| 10937 | WDI_TriggerBAReqCandidateType* wdiTriggerBACandidate; |
| 10938 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 10939 | |
| 10940 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10941 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10942 | -------------------------------------------------------------------------*/ |
| 10943 | if (( NULL == pEventData ) || |
| 10944 | ( NULL == pEventData->pEventData ) || |
| 10945 | ( NULL == pEventData->pCBfnc )) |
| 10946 | { |
| 10947 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10948 | "%s: Invalid parameters", __FUNCTION__); |
| 10949 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10950 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10951 | } |
| 10952 | |
| 10953 | pwdiTriggerBAParams = (WDI_TriggerBAReqParamsType*)pEventData->pEventData; |
| 10954 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pEventData->pCBfnc; |
| 10955 | /*------------------------------------------------------------------------- |
| 10956 | 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] | 10957 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10958 | -------------------------------------------------------------------------*/ |
| 10959 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 10960 | |
| 10961 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10962 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10963 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10964 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 10965 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10966 | &macBSSID)) |
| 10967 | { |
| 10968 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10969 | "This station does not exist in the WDI Station Table %d"); |
| 10970 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10971 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10972 | } |
| 10973 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10974 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 10975 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10976 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10977 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 10978 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 10979 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10980 | |
| 10981 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10982 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10983 | } |
| 10984 | |
| 10985 | /*------------------------------------------------------------------------ |
| 10986 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10987 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10988 | ------------------------------------------------------------------------*/ |
| 10989 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 10990 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10991 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 10992 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 10993 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10994 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10995 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10996 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 10997 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10998 | } |
| 10999 | |
| 11000 | |
| 11001 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 11002 | /*----------------------------------------------------------------------- |
| 11003 | Get message buffer |
| 11004 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11005 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11006 | WDI_TRIGGER_BA_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11007 | sizeof(halTriggerBAReq.triggerBAParams) + |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11008 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11009 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt), |
| 11010 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11011 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11012 | (usDataOffset + sizeof(halTriggerBAReq.triggerBAParams)+ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11013 | (sizeof(tTriggerBaReqCandidate) * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11014 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt) ))) |
| 11015 | { |
| 11016 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11017 | "Unable to get send buffer in Trigger BA req %x %x %x", |
| 11018 | pEventData, pwdiTriggerBAParams, wdiTriggerBARspCb); |
| 11019 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11020 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11021 | } |
| 11022 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11023 | halTriggerBAReq.triggerBAParams.baSessionID = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11024 | pwdiTriggerBAParams->wdiTriggerBAInfoType.ucBASessionID; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11025 | halTriggerBAReq.triggerBAParams.baCandidateCnt = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11026 | pwdiTriggerBAParams->wdiTriggerBAInfoType.usBACandidateCnt; |
| 11027 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11028 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11029 | &halTriggerBAReq.triggerBAParams, |
| 11030 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11031 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11032 | wdiTriggerBACandidate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11033 | (WDI_TriggerBAReqCandidateType*)(pwdiTriggerBAParams + 1); |
| 11034 | halTriggerBACandidate = (tTriggerBaReqCandidate*)(pSendBuffer+usDataOffset+ |
| 11035 | sizeof(halTriggerBAReq.triggerBAParams)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11036 | |
| 11037 | for(index = 0 ; index < halTriggerBAReq.triggerBAParams.baCandidateCnt ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11038 | index++) |
| 11039 | { |
| 11040 | halTriggerBACandidate->staIdx = wdiTriggerBACandidate->ucSTAIdx; |
| 11041 | halTriggerBACandidate->tidBitmap = wdiTriggerBACandidate->ucTidBitmap; |
| 11042 | halTriggerBACandidate++; |
| 11043 | wdiTriggerBACandidate++; |
| 11044 | } |
| 11045 | |
| 11046 | pWDICtx->wdiReqStatusCB = pwdiTriggerBAParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11047 | pWDICtx->pReqStatusUserData = pwdiTriggerBAParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11048 | |
| 11049 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11050 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11051 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11052 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11053 | wdiTriggerBARspCb, pEventData->pUserData, |
| 11054 | WDI_TRIGGER_BA_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11055 | }/*WDI_ProcessTriggerBAReq*/ |
| 11056 | |
| 11057 | |
| 11058 | |
| 11059 | /** |
| 11060 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11061 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11062 | |
| 11063 | @param pWDICtx: pointer to the WLAN DAL context |
| 11064 | pEventData: pointer to the event information structure |
| 11065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11066 | @see |
| 11067 | @return Result of the function call |
| 11068 | */ |
| 11069 | WDI_Status |
| 11070 | WDI_ProcessUpdateBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11071 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11072 | WDI_ControlBlockType* pWDICtx, |
| 11073 | WDI_EventInfoType* pEventData |
| 11074 | ) |
| 11075 | { |
| 11076 | WDI_UpdateBeaconParamsType* pwdiUpdateBeaconParams; |
| 11077 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11078 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11079 | wpt_uint16 usDataOffset = 0; |
| 11080 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11081 | tUpdateBeaconParams halUpdateBeaconParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11082 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11083 | |
| 11084 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11085 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11086 | -------------------------------------------------------------------------*/ |
| 11087 | if (( NULL == pEventData ) || |
| 11088 | ( NULL == pEventData->pEventData) || |
| 11089 | ( NULL == pEventData->pCBfnc)) |
| 11090 | { |
| 11091 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11092 | "%s: Invalid parameters", __FUNCTION__); |
| 11093 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11094 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11095 | } |
| 11096 | |
| 11097 | pwdiUpdateBeaconParams = (WDI_UpdateBeaconParamsType*)pEventData->pEventData; |
| 11098 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pEventData->pCBfnc; |
| 11099 | /*----------------------------------------------------------------------- |
| 11100 | Get message buffer |
| 11101 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11102 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPD_BCON_PRMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11103 | sizeof(halUpdateBeaconParams), |
| 11104 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11105 | ( usSendSize < (usDataOffset + sizeof(halUpdateBeaconParams) ))) |
| 11106 | { |
| 11107 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11108 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11109 | pEventData, pwdiUpdateBeaconParams, wdiUpdateBeaconParamsRspCb); |
| 11110 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11111 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11112 | } |
| 11113 | |
| 11114 | /*BSS Index of the BSS*/ |
| 11115 | halUpdateBeaconParams.bssIdx = |
| 11116 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucBssIdx; |
| 11117 | /*shortPreamble mode. HAL should update all the STA rates when it |
| 11118 | receives this message*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11119 | halUpdateBeaconParams.fShortPreamble = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11120 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortPreamble; |
| 11121 | /* short Slot time.*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11122 | halUpdateBeaconParams.fShortSlotTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11123 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfShortSlotTime; |
| 11124 | /* Beacon Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11125 | halUpdateBeaconParams.beaconInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11126 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usBeaconInterval; |
| 11127 | |
| 11128 | /*Protection related */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11129 | halUpdateBeaconParams.llaCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11130 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllaCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11131 | halUpdateBeaconParams.llbCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11132 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllbCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11133 | halUpdateBeaconParams.llgCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11134 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllgCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11135 | halUpdateBeaconParams.ht20MhzCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11136 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucHt20MhzCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11137 | halUpdateBeaconParams.llnNonGFCoexist = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11138 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11139 | halUpdateBeaconParams.fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11140 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfLsigTXOPProtectionFullSupport; |
| 11141 | halUpdateBeaconParams.fRIFSMode = |
| 11142 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.ucfRIFSMode; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11143 | halUpdateBeaconParams.paramChangeBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11144 | pwdiUpdateBeaconParams->wdiUpdateBeaconParamsInfo.usChangeBitmap; |
| 11145 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11146 | wpalMemoryCopy( pSendBuffer+usDataOffset, &halUpdateBeaconParams, |
| 11147 | sizeof(halUpdateBeaconParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11148 | |
| 11149 | pWDICtx->wdiReqStatusCB = pwdiUpdateBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11150 | pWDICtx->pReqStatusUserData = pwdiUpdateBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11151 | |
| 11152 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11153 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11154 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11155 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11156 | wdiUpdateBeaconParamsRspCb, pEventData->pUserData, WDI_UPD_BCON_PRMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11157 | }/*WDI_ProcessUpdateBeaconParamsReq*/ |
| 11158 | |
| 11159 | |
| 11160 | |
| 11161 | /** |
| 11162 | @brief Process Send Beacon template Request function (called when Main FSM |
| 11163 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11164 | |
| 11165 | @param pWDICtx: pointer to the WLAN DAL context |
| 11166 | pEventData: pointer to the event information structure |
| 11167 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11168 | @see |
| 11169 | @return Result of the function call |
| 11170 | */ |
| 11171 | WDI_Status |
| 11172 | WDI_ProcessSendBeaconParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11173 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11174 | WDI_ControlBlockType* pWDICtx, |
| 11175 | WDI_EventInfoType* pEventData |
| 11176 | ) |
| 11177 | { |
| 11178 | WDI_SendBeaconParamsType* pwdiSendBeaconParams; |
| 11179 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11180 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11181 | wpt_uint16 usDataOffset = 0; |
| 11182 | wpt_uint16 usSendSize = 0; |
| 11183 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11184 | |
| 11185 | tSendBeaconReqMsg halSendBeaconReq; |
| 11186 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11187 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11188 | -------------------------------------------------------------------------*/ |
| 11189 | if (( NULL == pEventData ) || |
| 11190 | ( NULL == pEventData->pEventData ) || |
| 11191 | ( NULL == pEventData->pCBfnc )) |
| 11192 | { |
| 11193 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11194 | "%s: Invalid parameters", __FUNCTION__); |
| 11195 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11196 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11197 | } |
| 11198 | |
| 11199 | pwdiSendBeaconParams = (WDI_SendBeaconParamsType*)pEventData->pEventData; |
| 11200 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pEventData->pCBfnc; |
| 11201 | /*----------------------------------------------------------------------- |
| 11202 | Get message buffer |
| 11203 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11204 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SND_BCON_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11205 | sizeof(halSendBeaconReq.sendBeaconParam), |
| 11206 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11207 | ( usSendSize < (usDataOffset + sizeof(halSendBeaconReq.sendBeaconParam) ))) |
| 11208 | { |
| 11209 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11210 | "Unable to get send buffer in send beacon req %x %x %x", |
| 11211 | pEventData, pwdiSendBeaconParams, wdiSendBeaconParamsRspCb); |
| 11212 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11213 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11214 | } |
| 11215 | |
| 11216 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.bssId, |
| 11217 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.macBSSID, |
| 11218 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11219 | halSendBeaconReq.sendBeaconParam.beaconLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11220 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength; |
| 11221 | wpalMemoryCopy(halSendBeaconReq.sendBeaconParam.beacon, |
| 11222 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beacon, |
| 11223 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.beaconLength); |
| 11224 | #ifdef WLAN_SOFTAP_FEATURE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11225 | halSendBeaconReq.sendBeaconParam.timIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11226 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.timIeOffset; |
| 11227 | #endif |
| 11228 | #ifdef WLAN_FEATURE_P2P |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11229 | halSendBeaconReq.sendBeaconParam.p2pIeOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11230 | pwdiSendBeaconParams->wdiSendBeaconParamsInfo.usP2PIeOffset; |
| 11231 | #endif |
| 11232 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11233 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11234 | &halSendBeaconReq.sendBeaconParam, |
| 11235 | sizeof(halSendBeaconReq.sendBeaconParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11236 | |
| 11237 | pWDICtx->wdiReqStatusCB = pwdiSendBeaconParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11238 | pWDICtx->pReqStatusUserData = pwdiSendBeaconParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11239 | |
| 11240 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11241 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11242 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11243 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11244 | wdiSendBeaconParamsRspCb, pEventData->pUserData, WDI_SND_BCON_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11245 | }/*WDI_ProcessSendBeaconParamsReq*/ |
| 11246 | |
| 11247 | /** |
| 11248 | @brief Process Update Beacon Params Request function (called when Main FSM |
| 11249 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11250 | |
| 11251 | @param pWDICtx: pointer to the WLAN DAL context |
| 11252 | pEventData: pointer to the event information structure |
| 11253 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11254 | @see |
| 11255 | @return Result of the function call |
| 11256 | */ |
| 11257 | WDI_Status |
| 11258 | WDI_ProcessUpdateProbeRspTemplateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11259 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11260 | WDI_ControlBlockType* pWDICtx, |
| 11261 | WDI_EventInfoType* pEventData |
| 11262 | ) |
| 11263 | { |
| 11264 | WDI_UpdateProbeRspTemplateParamsType* pwdiUpdateProbeRespTmplParams; |
| 11265 | WDI_UpdateProbeRspTemplateRspCb wdiUpdateProbeRespTmplRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11266 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11267 | wpt_uint16 usDataOffset = 0; |
| 11268 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11269 | tSendProbeRespReqParams halUpdateProbeRspTmplParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11270 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11271 | |
| 11272 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11273 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11274 | -------------------------------------------------------------------------*/ |
| 11275 | if (( NULL == pEventData ) || |
| 11276 | ( NULL == pEventData->pEventData) || |
| 11277 | ( NULL == pEventData->pCBfnc)) |
| 11278 | { |
| 11279 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11280 | "%s: Invalid parameters", __FUNCTION__); |
| 11281 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11282 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11283 | } |
| 11284 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11285 | pwdiUpdateProbeRespTmplParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11286 | (WDI_UpdateProbeRspTemplateParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11287 | wdiUpdateProbeRespTmplRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11288 | (WDI_UpdateProbeRspTemplateRspCb)pEventData->pCBfnc; |
| 11289 | /*----------------------------------------------------------------------- |
| 11290 | Get message buffer |
| 11291 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11292 | 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] | 11293 | sizeof(halUpdateProbeRspTmplParams), |
| 11294 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11295 | ( usSendSize < (usDataOffset + sizeof(halUpdateProbeRspTmplParams) ))) |
| 11296 | { |
| 11297 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11298 | "Unable to get send buffer in set bss key req %x %x %x", |
| 11299 | pEventData, pwdiUpdateProbeRespTmplParams, wdiUpdateProbeRespTmplRspCb); |
| 11300 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11301 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11302 | } |
| 11303 | |
| 11304 | wpalMemoryCopy(halUpdateProbeRspTmplParams.bssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11305 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11306 | WDI_MAC_ADDR_LEN); |
| 11307 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11308 | halUpdateProbeRspTmplParams.probeRespTemplateLen = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11309 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uProbeRespTemplateLen; |
| 11310 | |
| 11311 | wpalMemoryCopy(halUpdateProbeRspTmplParams.pProbeRespTemplate, |
| 11312 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.pProbeRespTemplate, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11313 | BEACON_TEMPLATE_SIZE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11314 | |
| 11315 | |
| 11316 | wpalMemoryCopy(halUpdateProbeRspTmplParams.ucProxyProbeReqValidIEBmap, |
| 11317 | pwdiUpdateProbeRespTmplParams->wdiProbeRspTemplateInfo.uaProxyProbeReqValidIEBmap, |
| 11318 | WDI_PROBE_REQ_BITMAP_IE_LEN); |
| 11319 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11320 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11321 | &halUpdateProbeRspTmplParams, |
| 11322 | sizeof(halUpdateProbeRspTmplParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11323 | |
| 11324 | pWDICtx->wdiReqStatusCB = pwdiUpdateProbeRespTmplParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11325 | pWDICtx->pReqStatusUserData = pwdiUpdateProbeRespTmplParams->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 Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11329 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11330 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11331 | wdiUpdateProbeRespTmplRspCb, pEventData->pUserData, |
| 11332 | WDI_UPD_PROBE_RSP_TEMPLATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11333 | }/*WDI_ProcessUpdateProbeRspTemplateReq*/ |
| 11334 | |
| 11335 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11336 | @brief Process NV blob download function (called when Main FSM |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11337 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11338 | |
| 11339 | @param pWDICtx: pointer to the WLAN DAL context |
| 11340 | pEventData: pointer to the event information structure |
| 11341 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11342 | @see |
| 11343 | @return Result of the function call |
| 11344 | */ |
| 11345 | WDI_Status |
| 11346 | WDI_ProcessNvDownloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11347 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11348 | WDI_ControlBlockType* pWDICtx, |
| 11349 | WDI_EventInfoType* pEventData |
| 11350 | ) |
| 11351 | { |
| 11352 | |
| 11353 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams = NULL; |
| 11354 | WDI_NvDownloadRspCb wdiNvDownloadRspCb = NULL; |
| 11355 | |
| 11356 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11357 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11358 | -------------------------------------------------------------------------*/ |
| 11359 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11360 | ( NULL == (pwdiNvDownloadReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11361 | (WDI_NvDownloadReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11362 | ( NULL == (wdiNvDownloadRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11363 | (WDI_NvDownloadRspCb)pEventData->pCBfnc))) |
| 11364 | { |
| 11365 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11366 | "%s: Invalid parameters", __FUNCTION__); |
| 11367 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11368 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11369 | } |
| 11370 | |
| 11371 | /*Intialize the Nv Blob Info */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11372 | pWDICtx->wdiNvBlobInfo.usTotalFragment = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11373 | TOTALFRAGMENTS(pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize); |
| 11374 | |
| 11375 | /*cache the wdi nv request message here if the the first fragment |
| 11376 | * To issue the request to HAL for the next fragment */ |
| 11377 | if( 0 == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
| 11378 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11379 | wpalMemoryCopy(&pWDICtx->wdiCachedNvDownloadReq, |
| 11380 | pwdiNvDownloadReqParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11381 | sizeof(pWDICtx->wdiCachedNvDownloadReq)); |
| 11382 | |
| 11383 | pWDICtx->pfncRspCB = pEventData->pCBfnc; |
| 11384 | pWDICtx->pRspCBUserData = pEventData->pUserData; |
| 11385 | } |
| 11386 | |
| 11387 | return WDI_SendNvBlobReq(pWDICtx,pEventData); |
| 11388 | } |
| 11389 | |
| 11390 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11391 | @brief Process Set Max Tx Power Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11392 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11393 | |
| 11394 | @param pWDICtx: pointer to the WLAN DAL context |
| 11395 | pEventData: pointer to the event information structure |
| 11396 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11397 | @see |
| 11398 | @return Result of the function call |
| 11399 | */ |
| 11400 | WDI_Status WDI_ProcessSetMaxTxPowerReq |
| 11401 | ( |
| 11402 | WDI_ControlBlockType* pWDICtx, |
| 11403 | WDI_EventInfoType* pEventData |
| 11404 | ) |
| 11405 | { |
| 11406 | WDI_SetMaxTxPowerParamsType* pwdiSetMaxTxPowerParams = NULL; |
| 11407 | WDA_SetMaxTxPowerRspCb wdiSetMaxTxPowerRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11408 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11409 | wpt_uint16 usDataOffset = 0; |
| 11410 | wpt_uint16 usSendSize = 0; |
| 11411 | tSetMaxTxPwrReq halSetMaxTxPower; |
| 11412 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11413 | |
| 11414 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11415 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11416 | -------------------------------------------------------------------------*/ |
| 11417 | if (( NULL == pEventData ) || |
| 11418 | ( NULL == pEventData->pEventData ) || |
| 11419 | ( NULL == pEventData->pCBfnc )) |
| 11420 | { |
| 11421 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11422 | "%s: Invalid parameters", __FUNCTION__); |
| 11423 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11424 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11425 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11426 | pwdiSetMaxTxPowerParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11427 | (WDI_SetMaxTxPowerParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11428 | wdiSetMaxTxPowerRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11429 | (WDA_SetMaxTxPowerRspCb)pEventData->pCBfnc; |
| 11430 | |
| 11431 | /*----------------------------------------------------------------------- |
| 11432 | Get message buffer |
| 11433 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11434 | 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] | 11435 | sizeof(halSetMaxTxPower.setMaxTxPwrParams), |
| 11436 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11437 | ( usSendSize < (usDataOffset + sizeof(halSetMaxTxPower.setMaxTxPwrParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11438 | ))) |
| 11439 | { |
| 11440 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 11441 | "Unable to get Set Max Tx Power req %x %x %x", |
| 11442 | pEventData, pwdiSetMaxTxPowerParams, wdiSetMaxTxPowerRspCb); |
| 11443 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11444 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11445 | } |
| 11446 | |
| 11447 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.bssId, |
| 11448 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macBSSId, |
| 11449 | WDI_MAC_ADDR_LEN); |
| 11450 | |
| 11451 | wpalMemoryCopy(halSetMaxTxPower.setMaxTxPwrParams.selfStaMacAddr, |
| 11452 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.macSelfStaMacAddr, |
| 11453 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11454 | halSetMaxTxPower.setMaxTxPwrParams.power = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11455 | pwdiSetMaxTxPowerParams->wdiMaxTxPowerInfo.ucPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11456 | |
| 11457 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11458 | &halSetMaxTxPower.setMaxTxPwrParams, |
| 11459 | sizeof(halSetMaxTxPower.setMaxTxPwrParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11460 | |
| 11461 | pWDICtx->wdiReqStatusCB = pwdiSetMaxTxPowerParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11462 | pWDICtx->pReqStatusUserData = pwdiSetMaxTxPowerParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11463 | |
| 11464 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11465 | Send Del TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11466 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11467 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11468 | wdiSetMaxTxPowerRspCb, pEventData->pUserData, |
| 11469 | WDI_SET_MAX_TX_POWER_RESP); |
| 11470 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11471 | } |
| 11472 | |
| 11473 | #ifdef WLAN_FEATURE_P2P |
| 11474 | |
| 11475 | /** |
| 11476 | @brief Process P2P Notice Of Absence Request function (called when Main FSM |
| 11477 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11478 | |
| 11479 | @param pWDICtx: pointer to the WLAN DAL context |
| 11480 | pEventData: pointer to the event information structure |
| 11481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11482 | @see |
| 11483 | @return Result of the function call |
| 11484 | */ |
| 11485 | WDI_Status |
| 11486 | WDI_ProcessP2PGONOAReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11487 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11488 | WDI_ControlBlockType* pWDICtx, |
| 11489 | WDI_EventInfoType* pEventData |
| 11490 | ) |
| 11491 | { |
| 11492 | WDI_SetP2PGONOAReqParamsType* pwdiP2PGONOAReqParams; |
| 11493 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11494 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11495 | wpt_uint16 usDataOffset = 0; |
| 11496 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11497 | tSetP2PGONOAParams halSetP2PGONOAParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11498 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11499 | |
| 11500 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11501 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11502 | -------------------------------------------------------------------------*/ |
| 11503 | if (( NULL == pEventData ) || |
| 11504 | ( NULL == pEventData->pEventData) || |
| 11505 | ( NULL == pEventData->pCBfnc)) |
| 11506 | { |
| 11507 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11508 | "%s: Invalid parameters", __FUNCTION__); |
| 11509 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11510 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11511 | } |
| 11512 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11513 | pwdiP2PGONOAReqParams = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11514 | (WDI_SetP2PGONOAReqParamsType*)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11515 | wdiP2PGONOAReqRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11516 | (WDI_SetP2PGONOAReqParamsRspCb)pEventData->pCBfnc; |
| 11517 | /*----------------------------------------------------------------------- |
| 11518 | Get message buffer |
| 11519 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11520 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 11521 | WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11522 | sizeof(halSetP2PGONOAParams), |
| 11523 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11524 | ( usSendSize < (usDataOffset + sizeof(halSetP2PGONOAParams) ))) |
| 11525 | { |
| 11526 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11527 | "Unable to get send buffer in set P2P GO NOA REQ %x %x %x", |
| 11528 | pEventData, pwdiP2PGONOAReqParams, wdiP2PGONOAReqRspCb); |
| 11529 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11530 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11531 | } |
| 11532 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11533 | halSetP2PGONOAParams.opp_ps = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11534 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucOpp_ps; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11535 | halSetP2PGONOAParams.ctWindow = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11536 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uCtWindow; |
| 11537 | halSetP2PGONOAParams.count = pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucCount; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11538 | halSetP2PGONOAParams.duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11539 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uDuration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11540 | halSetP2PGONOAParams.interval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11541 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11542 | halSetP2PGONOAParams.single_noa_duration = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11543 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.uSingle_noa_duration; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11544 | halSetP2PGONOAParams.psSelection = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11545 | pwdiP2PGONOAReqParams->wdiP2PGONOAInfo.ucPsSelection; |
| 11546 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11547 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11548 | &halSetP2PGONOAParams, |
| 11549 | sizeof(halSetP2PGONOAParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11550 | |
| 11551 | pWDICtx->wdiReqStatusCB = pwdiP2PGONOAReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11552 | pWDICtx->pReqStatusUserData = pwdiP2PGONOAReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11553 | |
| 11554 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11555 | Send Update Probe Resp Template Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11556 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11557 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11558 | wdiP2PGONOAReqRspCb, pEventData->pUserData, |
| 11559 | WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11560 | }/*WDI_ProcessP2PGONOAReq*/ |
| 11561 | |
| 11562 | #endif |
| 11563 | |
| 11564 | |
| 11565 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11566 | @brief Function to handle the ack from DXE once the power |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11567 | state is set. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11568 | @param None |
| 11569 | |
| 11570 | @see |
| 11571 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11572 | */ |
| 11573 | void |
| 11574 | WDI_SetPowerStateCb |
| 11575 | ( |
| 11576 | wpt_status status, |
| 11577 | unsigned int dxePhyAddr, |
| 11578 | void *pContext |
| 11579 | ) |
| 11580 | { |
| 11581 | wpt_status wptStatus; |
| 11582 | WDI_ControlBlockType *pCB = NULL; |
| 11583 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 11584 | if(eWLAN_PAL_STATUS_E_FAILURE == status ) |
| 11585 | { |
| 11586 | //it shouldn't happen, put an error msg |
| 11587 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11588 | /* |
| 11589 | * Trigger the event to bring the Enter BMPS req function to come |
| 11590 | * out of wait |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11591 | */ |
| 11592 | if( NULL != pContext ) |
| 11593 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11594 | pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11595 | } |
| 11596 | else |
| 11597 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11598 | //put an error msg |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11599 | pCB = &gWDICb; |
| 11600 | } |
| 11601 | pCB->dxePhyAddr = dxePhyAddr; |
| 11602 | wptStatus = wpalEventSet(&pCB->setPowerStateEvent); |
| 11603 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 11604 | { |
| 11605 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11606 | "Failed to set an event"); |
| 11607 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11608 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11609 | } |
| 11610 | return; |
| 11611 | } |
| 11612 | |
| 11613 | |
| 11614 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11615 | @brief Process Enter IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11616 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11617 | |
| 11618 | @param pWDICtx: pointer to the WLAN DAL context |
| 11619 | pEventData: pointer to the event information structure |
| 11620 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11621 | @see |
| 11622 | @return Result of the function call |
| 11623 | */ |
| 11624 | WDI_Status |
| 11625 | WDI_ProcessEnterImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11626 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11627 | WDI_ControlBlockType* pWDICtx, |
| 11628 | WDI_EventInfoType* pEventData |
| 11629 | ) |
| 11630 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11631 | wpt_status wptStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11632 | WDI_EnterImpsRspCb wdiEnterImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11633 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11634 | wpt_uint16 usDataOffset = 0; |
| 11635 | wpt_uint16 usSendSize = 0; |
| 11636 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11637 | |
| 11638 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11639 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11640 | -------------------------------------------------------------------------*/ |
| 11641 | if (( NULL == pEventData ) || |
| 11642 | ( NULL == (wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pEventData->pCBfnc))) |
| 11643 | { |
| 11644 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11645 | "%s: Invalid parameters", __FUNCTION__); |
| 11646 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11647 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11648 | } |
| 11649 | |
| 11650 | /*----------------------------------------------------------------------- |
| 11651 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11652 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11653 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11654 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11655 | 0, |
| 11656 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11657 | ( usSendSize < (usDataOffset ))) |
| 11658 | { |
| 11659 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11660 | "Unable to get send buffer in Enter IMPS req %x %x", |
| 11661 | pEventData, wdiEnterImpsRspCb); |
| 11662 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11663 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11664 | } |
| 11665 | |
| 11666 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11667 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 11668 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11669 | { |
| 11670 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11671 | "WDI Init failed to reset an event"); |
| 11672 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11673 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11674 | return VOS_STATUS_E_FAILURE; |
| 11675 | } |
| 11676 | |
| 11677 | // notify DTS that we are entering IMPS |
| 11678 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_IMPS, WDI_SetPowerStateCb); |
| 11679 | |
| 11680 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11681 | * 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] | 11682 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11683 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 11684 | WDI_SET_POWER_STATE_TIMEOUT); |
| 11685 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11686 | { |
| 11687 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11688 | "WDI Init failed to wait on an event"); |
| 11689 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11690 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11691 | return VOS_STATUS_E_FAILURE; |
| 11692 | } |
| 11693 | |
| 11694 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11695 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11696 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11697 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11698 | wdiEnterImpsRspCb, pEventData->pUserData, WDI_ENTER_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11699 | }/*WDI_ProcessEnterImpsReq*/ |
| 11700 | |
| 11701 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11702 | @brief Process Exit IMPS Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11703 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11704 | |
| 11705 | @param pWDICtx: pointer to the WLAN DAL context |
| 11706 | pEventData: pointer to the event information structure |
| 11707 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11708 | @see |
| 11709 | @return Result of the function call |
| 11710 | */ |
| 11711 | WDI_Status |
| 11712 | WDI_ProcessExitImpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11713 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11714 | WDI_ControlBlockType* pWDICtx, |
| 11715 | WDI_EventInfoType* pEventData |
| 11716 | ) |
| 11717 | { |
| 11718 | WDI_ExitImpsRspCb wdiExitImpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11719 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11720 | wpt_uint16 usDataOffset = 0; |
| 11721 | wpt_uint16 usSendSize = 0; |
| 11722 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11723 | |
| 11724 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11725 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11726 | -------------------------------------------------------------------------*/ |
| 11727 | if (( NULL == pEventData ) || |
| 11728 | ( NULL == (wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pEventData->pCBfnc))) |
| 11729 | { |
| 11730 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11731 | "%s: Invalid parameters", __FUNCTION__); |
| 11732 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11733 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11734 | } |
| 11735 | |
| 11736 | /*----------------------------------------------------------------------- |
| 11737 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11738 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11739 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11740 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_IMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11741 | 0, |
| 11742 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11743 | ( usSendSize < (usDataOffset ))) |
| 11744 | { |
| 11745 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11746 | "Unable to get send buffer in Exit IMPS req %x %x", |
| 11747 | pEventData, wdiExitImpsRspCb); |
| 11748 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11749 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11750 | } |
| 11751 | |
| 11752 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11753 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11754 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11755 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11756 | wdiExitImpsRspCb, pEventData->pUserData, WDI_EXIT_IMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11757 | }/*WDI_ProcessExitImpsReq*/ |
| 11758 | |
| 11759 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11760 | @brief Process Enter BMPS Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11761 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11762 | |
| 11763 | @param pWDICtx: pointer to the WLAN DAL context |
| 11764 | pEventData: pointer to the event information structure |
| 11765 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11766 | @see |
| 11767 | @return Result of the function call |
| 11768 | */ |
| 11769 | WDI_Status |
| 11770 | WDI_ProcessEnterBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11771 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11772 | WDI_ControlBlockType* pWDICtx, |
| 11773 | WDI_EventInfoType* pEventData |
| 11774 | ) |
| 11775 | { |
| 11776 | WDI_EnterBmpsReqParamsType* pwdiEnterBmpsReqParams = NULL; |
| 11777 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11778 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11779 | wpt_uint16 usDataOffset = 0; |
| 11780 | wpt_uint16 usSendSize = 0; |
| 11781 | tHalEnterBmpsReqParams enterBmpsReq; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11782 | wpt_status wptStatus; |
| 11783 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11784 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11785 | |
| 11786 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11787 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11788 | -------------------------------------------------------------------------*/ |
| 11789 | if (( NULL == pEventData ) || |
| 11790 | ( NULL == (pwdiEnterBmpsReqParams = (WDI_EnterBmpsReqParamsType*)pEventData->pEventData)) || |
| 11791 | ( NULL == (wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pEventData->pCBfnc))) |
| 11792 | { |
| 11793 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11794 | "%s: Invalid parameters", __FUNCTION__); |
| 11795 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11796 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11797 | } |
| 11798 | |
| 11799 | /*----------------------------------------------------------------------- |
| 11800 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11801 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11802 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11803 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11804 | sizeof(enterBmpsReq), |
| 11805 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11806 | ( usSendSize < (usDataOffset + sizeof(enterBmpsReq) ))) |
| 11807 | { |
| 11808 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11809 | "Unable to get send buffer in Enter BMPS req %x %x %x", |
| 11810 | pEventData, pwdiEnterBmpsReqParams, wdiEnterBmpsRspCb); |
| 11811 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11812 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11813 | } |
| 11814 | |
| 11815 | /* Reset the event to be not signalled */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11816 | wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent); |
| 11817 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11818 | { |
| 11819 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11820 | "WDI Init failed to reset an event"); |
| 11821 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11822 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11823 | return VOS_STATUS_E_FAILURE; |
| 11824 | } |
| 11825 | |
| 11826 | // notify DTS that we are entering BMPS |
| 11827 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_BMPS, WDI_SetPowerStateCb); |
| 11828 | |
| 11829 | /* |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11830 | * 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] | 11831 | */ |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 11832 | wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, |
| 11833 | WDI_SET_POWER_STATE_TIMEOUT); |
| 11834 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11835 | { |
| 11836 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11837 | "WDI Init failed to wait on an event"); |
| 11838 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11839 | WDI_ASSERT(0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11840 | return VOS_STATUS_E_FAILURE; |
| 11841 | } |
| 11842 | |
| 11843 | pWDICtx->bInBmps = eWLAN_PAL_TRUE; |
| 11844 | |
| 11845 | enterBmpsReq.bssIdx = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucBssIdx; |
| 11846 | enterBmpsReq.tbtt = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.uTbtt; |
| 11847 | enterBmpsReq.dtimCount = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimCount; |
| 11848 | enterBmpsReq.dtimPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.ucDtimPeriod; |
| 11849 | |
| 11850 | // For CCX and 11R Roaming |
| 11851 | enterBmpsReq.rssiFilterPeriod = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.rssiFilterPeriod; |
| 11852 | enterBmpsReq.numBeaconPerRssiAverage = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.numBeaconPerRssiAverage; |
| 11853 | enterBmpsReq.bRssiFilterEnable = pwdiEnterBmpsReqParams->wdiEnterBmpsInfo.bRssiFilterEnable; |
| 11854 | |
| 11855 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11856 | &enterBmpsReq, |
| 11857 | sizeof(enterBmpsReq)); |
| 11858 | |
| 11859 | pWDICtx->wdiReqStatusCB = pwdiEnterBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11860 | pWDICtx->pReqStatusUserData = pwdiEnterBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11861 | |
| 11862 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11863 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11864 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11865 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11866 | wdiEnterBmpsRspCb, pEventData->pUserData, WDI_ENTER_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11867 | }/*WDI_ProcessEnterBmpsReq*/ |
| 11868 | |
| 11869 | /** |
| 11870 | @brief Process Exit BMPS Request function (called when Main FSM |
| 11871 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11872 | |
| 11873 | @param pWDICtx: pointer to the WLAN DAL context |
| 11874 | pEventData: pointer to the event information structure |
| 11875 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11876 | @see |
| 11877 | @return Result of the function call |
| 11878 | */ |
| 11879 | WDI_Status |
| 11880 | WDI_ProcessExitBmpsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11881 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11882 | WDI_ControlBlockType* pWDICtx, |
| 11883 | WDI_EventInfoType* pEventData |
| 11884 | ) |
| 11885 | { |
| 11886 | WDI_ExitBmpsReqParamsType* pwdiExitBmpsReqParams = NULL; |
| 11887 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11888 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11889 | wpt_uint16 usDataOffset = 0; |
| 11890 | wpt_uint16 usSendSize = 0; |
| 11891 | tHalExitBmpsReqParams exitBmpsReq; |
| 11892 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11893 | |
| 11894 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11895 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11896 | -------------------------------------------------------------------------*/ |
| 11897 | if (( NULL == pEventData ) || |
| 11898 | ( NULL == (pwdiExitBmpsReqParams = (WDI_ExitBmpsReqParamsType*)pEventData->pEventData)) || |
| 11899 | ( NULL == (wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pEventData->pCBfnc))) |
| 11900 | { |
| 11901 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11902 | "%s: Invalid parameters", __FUNCTION__); |
| 11903 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11904 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11905 | } |
| 11906 | |
| 11907 | /*----------------------------------------------------------------------- |
| 11908 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11909 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11910 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11911 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_BMPS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11912 | sizeof(exitBmpsReq), |
| 11913 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11914 | ( usSendSize < (usDataOffset + sizeof(exitBmpsReq) ))) |
| 11915 | { |
| 11916 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11917 | "Unable to get send buffer in Exit BMPS req %x %x %x", |
| 11918 | pEventData, pwdiExitBmpsReqParams, wdiExitBmpsRspCb); |
| 11919 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11920 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11921 | } |
| 11922 | exitBmpsReq.sendDataNull = pwdiExitBmpsReqParams->wdiExitBmpsInfo.ucSendDataNull; |
| 11923 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11924 | exitBmpsReq.bssIdx = pwdiExitBmpsReqParams->wdiExitBmpsInfo.bssIdx; |
| 11925 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11926 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 11927 | &exitBmpsReq, |
| 11928 | sizeof(exitBmpsReq)); |
| 11929 | |
| 11930 | pWDICtx->wdiReqStatusCB = pwdiExitBmpsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11931 | pWDICtx->pReqStatusUserData = pwdiExitBmpsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11932 | |
| 11933 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11934 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11935 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11936 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 11937 | wdiExitBmpsRspCb, pEventData->pUserData, WDI_EXIT_BMPS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11938 | }/*WDI_ProcessExitBmpsReq*/ |
| 11939 | |
| 11940 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11941 | @brief Process Enter UAPSD Request function (called when Main |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11942 | FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11943 | |
| 11944 | @param pWDICtx: pointer to the WLAN DAL context |
| 11945 | pEventData: pointer to the event information structure |
| 11946 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11947 | @see |
| 11948 | @return Result of the function call |
| 11949 | */ |
| 11950 | WDI_Status |
| 11951 | WDI_ProcessEnterUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11952 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11953 | WDI_ControlBlockType* pWDICtx, |
| 11954 | WDI_EventInfoType* pEventData |
| 11955 | ) |
| 11956 | { |
| 11957 | WDI_EnterUapsdReqParamsType* pwdiEnterUapsdReqParams = NULL; |
| 11958 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11959 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11960 | wpt_uint16 usDataOffset = 0; |
| 11961 | wpt_uint16 usSendSize = 0; |
| 11962 | tUapsdReqParams enterUapsdReq; |
| 11963 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 11964 | |
| 11965 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11966 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11967 | -------------------------------------------------------------------------*/ |
| 11968 | if (( NULL == pEventData ) || |
| 11969 | ( NULL == (pwdiEnterUapsdReqParams = (WDI_EnterUapsdReqParamsType*)pEventData->pEventData)) || |
| 11970 | ( NULL == (wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pEventData->pCBfnc))) |
| 11971 | { |
| 11972 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11973 | "%s: Invalid parameters", __FUNCTION__); |
| 11974 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11975 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11976 | } |
| 11977 | |
| 11978 | /*----------------------------------------------------------------------- |
| 11979 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11980 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11981 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11982 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_ENTER_UAPSD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11983 | sizeof(enterUapsdReq), |
| 11984 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 11985 | ( usSendSize < (usDataOffset + sizeof(enterUapsdReq) ))) |
| 11986 | { |
| 11987 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 11988 | "Unable to get send buffer in Enter UAPSD req %x %x %x", |
| 11989 | pEventData, pwdiEnterUapsdReqParams, wdiEnterUapsdRspCb); |
| 11990 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 11991 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 11992 | } |
| 11993 | |
| 11994 | enterUapsdReq.beDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeDeliveryEnabled; |
| 11995 | enterUapsdReq.beTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBeTriggerEnabled; |
| 11996 | enterUapsdReq.bkDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkDeliveryEnabled; |
| 11997 | enterUapsdReq.bkTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucBkTriggerEnabled; |
| 11998 | enterUapsdReq.viDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViDeliveryEnabled; |
| 11999 | enterUapsdReq.viTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucViTriggerEnabled; |
| 12000 | enterUapsdReq.voDeliveryEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoDeliveryEnabled; |
| 12001 | enterUapsdReq.voTriggerEnabled = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.ucVoTriggerEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12002 | enterUapsdReq.bssIdx = pwdiEnterUapsdReqParams->wdiEnterUapsdInfo.bssIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12003 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12004 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12005 | &enterUapsdReq, |
| 12006 | sizeof(enterUapsdReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12007 | |
| 12008 | pWDICtx->wdiReqStatusCB = pwdiEnterUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12009 | pWDICtx->pReqStatusUserData = pwdiEnterUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12010 | |
| 12011 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12012 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12013 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12014 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12015 | wdiEnterUapsdRspCb, pEventData->pUserData, WDI_ENTER_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12016 | }/*WDI_ProcessEnterUapsdReq*/ |
| 12017 | |
| 12018 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12019 | @brief Process Exit UAPSD Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12020 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12021 | |
| 12022 | @param pWDICtx: pointer to the WLAN DAL context |
| 12023 | pEventData: pointer to the event information structure |
| 12024 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12025 | @see |
| 12026 | @return Result of the function call |
| 12027 | */ |
| 12028 | WDI_Status |
| 12029 | WDI_ProcessExitUapsdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12030 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12031 | WDI_ControlBlockType* pWDICtx, |
| 12032 | WDI_EventInfoType* pEventData |
| 12033 | ) |
| 12034 | { |
| 12035 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12036 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12037 | wpt_uint16 usDataOffset = 0; |
| 12038 | wpt_uint16 usSendSize = 0; |
| 12039 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12040 | |
| 12041 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12042 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12043 | -------------------------------------------------------------------------*/ |
| 12044 | if (( NULL == pEventData ) || |
| 12045 | ( NULL == (wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pEventData->pCBfnc))) |
| 12046 | { |
| 12047 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12048 | "%s: Invalid parameters", __FUNCTION__); |
| 12049 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12050 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12051 | } |
| 12052 | |
| 12053 | /*----------------------------------------------------------------------- |
| 12054 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12055 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12056 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12057 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_EXIT_UAPSD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12058 | 0, |
| 12059 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12060 | ( usSendSize < (usDataOffset ))) |
| 12061 | { |
| 12062 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12063 | "Unable to get send buffer in Exit UAPSD req %x %x", |
| 12064 | pEventData, wdiExitUapsdRspCb); |
| 12065 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12066 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12067 | } |
| 12068 | |
| 12069 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12070 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12071 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12072 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12073 | wdiExitUapsdRspCb, pEventData->pUserData, WDI_EXIT_UAPSD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12074 | }/*WDI_ProcessExitUapsdReq*/ |
| 12075 | |
| 12076 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12077 | @brief Process Set UAPSD params Request function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12078 | Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12079 | |
| 12080 | @param pWDICtx: pointer to the WLAN DAL context |
| 12081 | pEventData: pointer to the event information structure |
| 12082 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12083 | @see |
| 12084 | @return Result of the function call |
| 12085 | */ |
| 12086 | WDI_Status |
| 12087 | WDI_ProcessSetUapsdAcParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12088 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12089 | WDI_ControlBlockType* pWDICtx, |
| 12090 | WDI_EventInfoType* pEventData |
| 12091 | ) |
| 12092 | { |
| 12093 | WDI_SetUapsdAcParamsReqParamsType* pwdiSetUapsdAcParams = NULL; |
| 12094 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12095 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12096 | wpt_uint16 usDataOffset = 0; |
| 12097 | wpt_uint16 usSendSize = 0; |
| 12098 | tUapsdInfo uapsdAcParamsReq; |
| 12099 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12100 | |
| 12101 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12102 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12103 | -------------------------------------------------------------------------*/ |
| 12104 | if (( NULL == pEventData ) || |
| 12105 | ( NULL == (pwdiSetUapsdAcParams = (WDI_SetUapsdAcParamsReqParamsType*)pEventData->pEventData)) || |
| 12106 | ( NULL == (wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pEventData->pCBfnc))) |
| 12107 | { |
| 12108 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12109 | "%s: Invalid parameters", __FUNCTION__); |
| 12110 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12111 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12112 | } |
| 12113 | |
| 12114 | /*----------------------------------------------------------------------- |
| 12115 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12116 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12117 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12118 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12119 | sizeof(uapsdAcParamsReq), |
| 12120 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12121 | ( usSendSize < (usDataOffset + sizeof(uapsdAcParamsReq) ))) |
| 12122 | { |
| 12123 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12124 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12125 | pEventData, pwdiSetUapsdAcParams, wdiSetUapsdAcParamsCb); |
| 12126 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12127 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12128 | } |
| 12129 | |
| 12130 | uapsdAcParamsReq.ac = pwdiSetUapsdAcParams->wdiUapsdInfo.ucAc; |
| 12131 | uapsdAcParamsReq.staidx = pwdiSetUapsdAcParams->wdiUapsdInfo.ucSTAIdx; |
| 12132 | uapsdAcParamsReq.up = pwdiSetUapsdAcParams->wdiUapsdInfo.ucUp; |
| 12133 | uapsdAcParamsReq.delayInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uDelayInterval; |
| 12134 | uapsdAcParamsReq.srvInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSrvInterval; |
| 12135 | uapsdAcParamsReq.susInterval = pwdiSetUapsdAcParams->wdiUapsdInfo.uSusInterval; |
| 12136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12137 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12138 | &uapsdAcParamsReq, |
| 12139 | sizeof(uapsdAcParamsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12140 | |
| 12141 | pWDICtx->wdiReqStatusCB = pwdiSetUapsdAcParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12142 | pWDICtx->pReqStatusUserData = pwdiSetUapsdAcParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12143 | |
| 12144 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12145 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12146 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12147 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12148 | wdiSetUapsdAcParamsCb, pEventData->pUserData, WDI_SET_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12149 | }/*WDI_ProcessSetUapsdAcParamsReq*/ |
| 12150 | |
| 12151 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12152 | @brief Process update UAPSD params Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12153 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12154 | |
| 12155 | @param pWDICtx: pointer to the WLAN DAL context |
| 12156 | pEventData: pointer to the event information structure |
| 12157 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12158 | @see |
| 12159 | @return Result of the function call |
| 12160 | */ |
| 12161 | WDI_Status |
| 12162 | WDI_ProcessUpdateUapsdParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12163 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12164 | WDI_ControlBlockType* pWDICtx, |
| 12165 | WDI_EventInfoType* pEventData |
| 12166 | ) |
| 12167 | { |
| 12168 | WDI_UpdateUapsdReqParamsType* pwdiUpdateUapsdReqParams = NULL; |
| 12169 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12170 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12171 | wpt_uint16 usDataOffset = 0; |
| 12172 | wpt_uint16 usSendSize = 0; |
| 12173 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12174 | |
| 12175 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12176 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12177 | -------------------------------------------------------------------------*/ |
| 12178 | if (( NULL == pEventData ) || |
| 12179 | ( NULL == (pwdiUpdateUapsdReqParams = (WDI_UpdateUapsdReqParamsType*)pEventData->pEventData)) || |
| 12180 | ( NULL == (wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pEventData->pCBfnc))) |
| 12181 | { |
| 12182 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12183 | "%s: Invalid parameters", __FUNCTION__); |
| 12184 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12185 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12186 | } |
| 12187 | |
| 12188 | /*----------------------------------------------------------------------- |
| 12189 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12190 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12191 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12192 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_UAPSD_PARAM_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12193 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo), |
| 12194 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12195 | ( usSendSize < (usDataOffset + sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo) ))) |
| 12196 | { |
| 12197 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12198 | "Unable to get send buffer in Update UAPSD params req %x %x %x", |
| 12199 | pEventData, pwdiUpdateUapsdReqParams, wdiUpdateUapsdParamsCb); |
| 12200 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12201 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12202 | } |
| 12203 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12204 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12205 | &pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo, |
| 12206 | sizeof(pwdiUpdateUapsdReqParams->wdiUpdateUapsdInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12207 | |
| 12208 | pWDICtx->wdiReqStatusCB = pwdiUpdateUapsdReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12209 | pWDICtx->pReqStatusUserData = pwdiUpdateUapsdReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12210 | |
| 12211 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12212 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12213 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12214 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12215 | wdiUpdateUapsdParamsCb, pEventData->pUserData, WDI_UPDATE_UAPSD_PARAM_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12216 | }/*WDI_ProcessUpdateUapsdParamsReq*/ |
| 12217 | |
| 12218 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12219 | @brief Process Configure RXP filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12220 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12221 | |
| 12222 | @param pWDICtx: pointer to the WLAN DAL context |
| 12223 | pEventData: pointer to the event information structure |
| 12224 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12225 | @see |
| 12226 | @return Result of the function call |
| 12227 | */ |
| 12228 | WDI_Status |
| 12229 | WDI_ProcessConfigureRxpFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12230 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12231 | WDI_ControlBlockType* pWDICtx, |
| 12232 | WDI_EventInfoType* pEventData |
| 12233 | ) |
| 12234 | { |
| 12235 | WDI_ConfigureRxpFilterReqParamsType* pwdiRxpFilterParams = NULL; |
| 12236 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12237 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12238 | wpt_uint16 usDataOffset = 0; |
| 12239 | wpt_uint16 usSendSize = 0; |
| 12240 | tHalConfigureRxpFilterReqParams halRxpFilterParams; |
| 12241 | |
| 12242 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12243 | |
| 12244 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12245 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12246 | -------------------------------------------------------------------------*/ |
| 12247 | if (( NULL == pEventData ) || |
| 12248 | ( NULL == (pwdiRxpFilterParams = (WDI_ConfigureRxpFilterReqParamsType*)pEventData->pEventData)) || |
| 12249 | ( NULL == (wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pEventData->pCBfnc))) |
| 12250 | { |
| 12251 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12252 | "%s: Invalid parameters", __FUNCTION__); |
| 12253 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12254 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12255 | } |
| 12256 | |
| 12257 | /*----------------------------------------------------------------------- |
| 12258 | Get message buffer |
| 12259 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12260 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_CONFIGURE_RXP_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12261 | sizeof(halRxpFilterParams), |
| 12262 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12263 | ( usSendSize < (usDataOffset + sizeof(halRxpFilterParams) ))) |
| 12264 | { |
| 12265 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12266 | "Unable to get send buffer in Set UAPSD params req %x %x %x", |
| 12267 | pEventData, pwdiRxpFilterParams, wdiConfigureRxpFilterCb); |
| 12268 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12269 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12270 | } |
| 12271 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12272 | halRxpFilterParams.setMcstBcstFilterSetting = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12273 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilterSetting; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12274 | halRxpFilterParams.setMcstBcstFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12275 | pwdiRxpFilterParams->wdiRxpFilterParam.ucSetMcstBcstFilter; |
| 12276 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12277 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12278 | &halRxpFilterParams, |
| 12279 | sizeof(halRxpFilterParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12280 | |
| 12281 | pWDICtx->wdiReqStatusCB = pwdiRxpFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12282 | pWDICtx->pReqStatusUserData = pwdiRxpFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12283 | |
| 12284 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12285 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12286 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12287 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12288 | wdiConfigureRxpFilterCb, pEventData->pUserData, WDI_CONFIGURE_RXP_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12289 | }/*WDI_ProcessConfigureRxpFilterReq*/ |
| 12290 | |
| 12291 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12292 | @brief Process set beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12293 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12294 | |
| 12295 | @param pWDICtx: pointer to the WLAN DAL context |
| 12296 | pEventData: pointer to the event information structure |
| 12297 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12298 | @see |
| 12299 | @return Result of the function call |
| 12300 | */ |
| 12301 | WDI_Status |
| 12302 | WDI_ProcessSetBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12303 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12304 | WDI_ControlBlockType* pWDICtx, |
| 12305 | WDI_EventInfoType* pEventData |
| 12306 | ) |
| 12307 | { |
| 12308 | WDI_BeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12309 | WDI_SetBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12310 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12311 | wpt_uint16 usDataOffset = 0; |
| 12312 | wpt_uint16 usSendSize = 0; |
| 12313 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12314 | |
| 12315 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12316 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12317 | -------------------------------------------------------------------------*/ |
| 12318 | if (( NULL == pEventData ) || |
| 12319 | ( NULL == (pwdiBeaconFilterParams = (WDI_BeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 12320 | ( NULL == (wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pEventData->pCBfnc))) |
| 12321 | { |
| 12322 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12323 | "%s: Invalid parameters", __FUNCTION__); |
| 12324 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12325 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12326 | } |
| 12327 | |
| 12328 | /*----------------------------------------------------------------------- |
| 12329 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12330 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12331 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12332 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12333 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) + pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe), |
| 12334 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12335 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 12336 | { |
| 12337 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12338 | "Unable to get send buffer in Set beacon filter req %x %x %x", |
| 12339 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 12340 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12341 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12342 | } |
| 12343 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12344 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12345 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 12346 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
| 12347 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 12348 | &pwdiBeaconFilterParams->aFilters[0], |
| 12349 | pwdiBeaconFilterParams->wdiBeaconFilterInfo.usIeNum * sizeof(tBeaconFilterIe)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12350 | |
| 12351 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12352 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12353 | |
| 12354 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12355 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12356 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12357 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12358 | wdiBeaconFilterCb, pEventData->pUserData, WDI_SET_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12359 | }/*WDI_ProcessSetBeaconFilterReq*/ |
| 12360 | |
| 12361 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12362 | @brief Process remove beacon filter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12363 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12364 | |
| 12365 | @param pWDICtx: pointer to the WLAN DAL context |
| 12366 | pEventData: pointer to the event information structure |
| 12367 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12368 | @see |
| 12369 | @return Result of the function call |
| 12370 | */ |
| 12371 | WDI_Status |
| 12372 | WDI_ProcessRemBeaconFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12373 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12374 | WDI_ControlBlockType* pWDICtx, |
| 12375 | WDI_EventInfoType* pEventData |
| 12376 | ) |
| 12377 | { |
| 12378 | WDI_RemBeaconFilterReqParamsType* pwdiBeaconFilterParams = NULL; |
| 12379 | WDI_RemBeaconFilterCb wdiBeaconFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12380 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12381 | wpt_uint16 usDataOffset = 0; |
| 12382 | wpt_uint16 usSendSize = 0; |
| 12383 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12384 | |
| 12385 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12386 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12387 | -------------------------------------------------------------------------*/ |
| 12388 | if (( NULL == pEventData ) || |
| 12389 | ( NULL == (pwdiBeaconFilterParams = (WDI_RemBeaconFilterReqParamsType*)pEventData->pEventData)) || |
| 12390 | ( NULL == (wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pEventData->pCBfnc))) |
| 12391 | { |
| 12392 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12393 | "%s: Invalid parameters", __FUNCTION__); |
| 12394 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12395 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12396 | } |
| 12397 | |
| 12398 | /*----------------------------------------------------------------------- |
| 12399 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12400 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12401 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12402 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_REM_BEACON_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12403 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo), |
| 12404 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12405 | ( usSendSize < (usDataOffset + sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo) ))) |
| 12406 | { |
| 12407 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12408 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 12409 | pEventData, pwdiBeaconFilterParams, wdiBeaconFilterCb); |
| 12410 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12411 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12412 | } |
| 12413 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12414 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12415 | &pwdiBeaconFilterParams->wdiBeaconFilterInfo, |
| 12416 | sizeof(pwdiBeaconFilterParams->wdiBeaconFilterInfo)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12417 | |
| 12418 | pWDICtx->wdiReqStatusCB = pwdiBeaconFilterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12419 | pWDICtx->pReqStatusUserData = pwdiBeaconFilterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12420 | |
| 12421 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12422 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12423 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12424 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12425 | wdiBeaconFilterCb, pEventData->pUserData, WDI_REM_BEACON_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12426 | } |
| 12427 | |
| 12428 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12429 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12430 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12431 | |
| 12432 | @param pWDICtx: pointer to the WLAN DAL context |
| 12433 | pEventData: pointer to the event information structure |
| 12434 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12435 | @see |
| 12436 | @return Result of the function call |
| 12437 | */ |
| 12438 | WDI_Status |
| 12439 | WDI_ProcessSetRSSIThresholdsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12440 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12441 | WDI_ControlBlockType* pWDICtx, |
| 12442 | WDI_EventInfoType* pEventData |
| 12443 | ) |
| 12444 | { |
| 12445 | WDI_SetRSSIThresholdsReqParamsType* pwdiRSSIThresholdsParams = NULL; |
| 12446 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12447 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12448 | wpt_uint16 usDataOffset = 0; |
| 12449 | wpt_uint16 usSendSize = 0; |
| 12450 | tHalRSSIThresholds rssiThresholdsReq; |
| 12451 | WDI_Status ret_status = 0; |
| 12452 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12453 | |
| 12454 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12455 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12456 | -------------------------------------------------------------------------*/ |
| 12457 | if (( NULL == pEventData ) || |
| 12458 | ( NULL == (pwdiRSSIThresholdsParams = (WDI_SetRSSIThresholdsReqParamsType*)pEventData->pEventData)) || |
| 12459 | ( NULL == (wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pEventData->pCBfnc))) |
| 12460 | { |
| 12461 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12462 | "%s: Invalid parameters", __FUNCTION__); |
| 12463 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12464 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12465 | } |
| 12466 | |
| 12467 | /*----------------------------------------------------------------------- |
| 12468 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12469 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12470 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12471 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_RSSI_THRESHOLDS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12472 | sizeof(rssiThresholdsReq), |
| 12473 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12474 | ( usSendSize < (usDataOffset + sizeof(rssiThresholdsReq) ))) |
| 12475 | { |
| 12476 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12477 | "Unable to get send buffer in remove beacon filter req %x %x %x", |
| 12478 | pEventData, pwdiRSSIThresholdsParams, wdiRSSIThresholdsCb); |
| 12479 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12480 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12481 | } |
| 12482 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12483 | rssiThresholdsReq.bReserved10 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12484 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bReserved10; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12485 | rssiThresholdsReq.bRssiThres1NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12486 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12487 | rssiThresholdsReq.bRssiThres1PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12488 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres1PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12489 | rssiThresholdsReq.bRssiThres2NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12490 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12491 | rssiThresholdsReq.bRssiThres2PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12492 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres2PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12493 | rssiThresholdsReq.bRssiThres3NegNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12494 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3NegNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12495 | rssiThresholdsReq.bRssiThres3PosNotify = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12496 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.bRssiThres3PosNotify; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12497 | rssiThresholdsReq.ucRssiThreshold1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12498 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12499 | rssiThresholdsReq.ucRssiThreshold2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12500 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12501 | rssiThresholdsReq.ucRssiThreshold3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12502 | pwdiRSSIThresholdsParams->wdiRSSIThresholdsInfo.ucRssiThreshold3; |
| 12503 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12504 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12505 | &rssiThresholdsReq, |
| 12506 | sizeof(rssiThresholdsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12507 | |
| 12508 | pWDICtx->wdiReqStatusCB = pwdiRSSIThresholdsParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12509 | pWDICtx->pReqStatusUserData = pwdiRSSIThresholdsParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12510 | |
| 12511 | /*------------------------------------------------------------------------- |
| 12512 | Send Set threshold req to HAL |
| 12513 | -------------------------------------------------------------------------*/ |
| 12514 | if ((ret_status = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12515 | wdiRSSIThresholdsCb, pEventData->pUserData, WDI_SET_RSSI_THRESHOLDS_RESP)) == WDI_STATUS_SUCCESS) |
| 12516 | { |
| 12517 | // When we are in idle state WDI_STARTED_ST and we receive indication for threshold |
| 12518 | // req. Then as a result of processing the threshold cross ind, we trigger |
| 12519 | // a Set threshold req, then we need to indicate to WDI that it needs to |
| 12520 | // go to busy state as a result of the indication as we sent a req in the |
| 12521 | // same WDI context. |
| 12522 | // Hence expected state transition is to busy. |
| 12523 | pWDICtx->ucExpectedStateTransition = WDI_BUSY_ST; |
| 12524 | } |
| 12525 | |
| 12526 | return ret_status; |
| 12527 | } |
| 12528 | |
| 12529 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12530 | @brief Process set RSSI thresholds Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12531 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12532 | |
| 12533 | @param pWDICtx: pointer to the WLAN DAL context |
| 12534 | pEventData: pointer to the event information structure |
| 12535 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12536 | @see |
| 12537 | @return Result of the function call |
| 12538 | */ |
| 12539 | WDI_Status |
| 12540 | WDI_ProcessHostOffloadReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12541 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12542 | WDI_ControlBlockType* pWDICtx, |
| 12543 | WDI_EventInfoType* pEventData |
| 12544 | ) |
| 12545 | { |
| 12546 | WDI_HostOffloadReqParamsType* pwdiHostOffloadParams = NULL; |
| 12547 | WDI_HostOffloadCb wdiHostOffloadCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12548 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12549 | wpt_uint16 usDataOffset = 0; |
| 12550 | wpt_uint16 usSendSize = 0; |
| 12551 | tHalHostOffloadReq hostOffloadParams; |
| 12552 | tHalNSOffloadParams nsOffloadParams; |
| 12553 | |
| 12554 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12555 | |
| 12556 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12557 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12558 | -------------------------------------------------------------------------*/ |
| 12559 | if (( NULL == pEventData ) || |
| 12560 | ( NULL == (pwdiHostOffloadParams = (WDI_HostOffloadReqParamsType*)pEventData->pEventData)) || |
| 12561 | ( NULL == (wdiHostOffloadCb = (WDI_HostOffloadCb)pEventData->pCBfnc))) |
| 12562 | { |
| 12563 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12564 | "%s: Invalid parameters", __FUNCTION__); |
| 12565 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12566 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12567 | } |
| 12568 | |
| 12569 | /*----------------------------------------------------------------------- |
| 12570 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12571 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12572 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12573 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HOST_OFFLOAD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12574 | sizeof(hostOffloadParams)+sizeof(nsOffloadParams), |
| 12575 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12576 | ( usSendSize < (usDataOffset + sizeof(hostOffloadParams) + sizeof(nsOffloadParams) ))) |
| 12577 | { |
| 12578 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12579 | "Unable to get send buffer in host offload req %x %x %x", |
| 12580 | pEventData, pwdiHostOffloadParams, wdiHostOffloadCb); |
| 12581 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12582 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12583 | } |
| 12584 | |
| 12585 | hostOffloadParams.offloadType = pwdiHostOffloadParams->wdiHostOffloadInfo.ucOffloadType; |
| 12586 | hostOffloadParams.enableOrDisable = pwdiHostOffloadParams->wdiHostOffloadInfo.ucEnableOrDisable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12587 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12588 | if( HAL_IPV4_ARP_REPLY_OFFLOAD == hostOffloadParams.offloadType ) |
| 12589 | { |
| 12590 | // ARP Offload |
| 12591 | wpalMemoryCopy(hostOffloadParams.params.hostIpv4Addr, |
| 12592 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv4Addr, |
| 12593 | 4); |
| 12594 | } |
| 12595 | else |
| 12596 | { |
| 12597 | // NS Offload |
| 12598 | wpalMemoryCopy(hostOffloadParams.params.hostIpv6Addr, |
| 12599 | pwdiHostOffloadParams->wdiHostOffloadInfo.params.aHostIpv6Addr, |
| 12600 | 16); |
| 12601 | |
| 12602 | #ifdef WLAN_NS_OFFLOAD |
| 12603 | // copy pwdiHostOffloadParams->wdiNsOffloadParams into nsOffloadParams |
| 12604 | wpalMemoryCopy(nsOffloadParams.srcIPv6Addr, |
| 12605 | pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6Addr, |
| 12606 | 16); |
| 12607 | wpalMemoryCopy(nsOffloadParams.selfIPv6Addr, |
| 12608 | pwdiHostOffloadParams->wdiNsOffloadParams.selfIPv6Addr, |
| 12609 | 16); |
| 12610 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr1, |
| 12611 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1, |
| 12612 | 16); |
| 12613 | wpalMemoryCopy(nsOffloadParams.targetIPv6Addr2, |
| 12614 | pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2, |
| 12615 | 16); |
| 12616 | wpalMemoryCopy(nsOffloadParams.selfMacAddr, |
| 12617 | pwdiHostOffloadParams->wdiNsOffloadParams.selfMacAddr, |
| 12618 | 6); |
| 12619 | nsOffloadParams.srcIPv6AddrValid = pwdiHostOffloadParams->wdiNsOffloadParams.srcIPv6AddrValid; |
| 12620 | nsOffloadParams.targetIPv6Addr1Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr1Valid; |
| 12621 | nsOffloadParams.targetIPv6Addr2Valid = pwdiHostOffloadParams->wdiNsOffloadParams.targetIPv6Addr2Valid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12622 | |
| 12623 | nsOffloadParams.bssIdx = pwdiHostOffloadParams->wdiNsOffloadParams.bssIdx; |
| 12624 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12625 | #endif // WLAN_NS_OFFLOAD |
| 12626 | } |
| 12627 | |
| 12628 | // copy hostOffloadParams into pSendBuffer |
| 12629 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12630 | &hostOffloadParams, |
| 12631 | sizeof(hostOffloadParams)); |
| 12632 | |
| 12633 | #ifdef WLAN_NS_OFFLOAD |
| 12634 | if( HAL_IPV6_NS_OFFLOAD == hostOffloadParams.offloadType ) |
| 12635 | { |
| 12636 | // copy nsOffloadParams into pSendBuffer |
| 12637 | wpalMemoryCopy( pSendBuffer+usDataOffset+sizeof(hostOffloadParams), |
| 12638 | &nsOffloadParams, |
| 12639 | sizeof(nsOffloadParams)); |
| 12640 | } |
| 12641 | #endif // WLAN_NS_OFFLOAD |
| 12642 | |
| 12643 | pWDICtx->wdiReqStatusCB = pwdiHostOffloadParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12644 | pWDICtx->pReqStatusUserData = pwdiHostOffloadParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12645 | |
| 12646 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12647 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12648 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12649 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12650 | wdiHostOffloadCb, pEventData->pUserData, WDI_HOST_OFFLOAD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12651 | }/*WDI_ProcessHostOffloadReq*/ |
| 12652 | |
| 12653 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12654 | @brief Process Keep Alive Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12655 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12656 | |
| 12657 | @param pWDICtx: pointer to the WLAN DAL context |
| 12658 | pEventData: pointer to the event information structure |
| 12659 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12660 | @see |
| 12661 | @return Result of the function call |
| 12662 | */ |
| 12663 | WDI_Status |
| 12664 | WDI_ProcessKeepAliveReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12665 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12666 | WDI_ControlBlockType* pWDICtx, |
| 12667 | WDI_EventInfoType* pEventData |
| 12668 | ) |
| 12669 | { |
| 12670 | WDI_KeepAliveReqParamsType* pwdiKeepAliveParams = NULL; |
| 12671 | WDI_KeepAliveCb wdiKeepAliveCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12672 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12673 | wpt_uint16 usDataOffset = 0; |
| 12674 | wpt_uint16 usSendSize = 0; |
| 12675 | tHalKeepAliveReq keepAliveReq; |
| 12676 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12677 | |
| 12678 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12679 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12680 | -------------------------------------------------------------------------*/ |
| 12681 | if (( NULL == pEventData ) || |
| 12682 | ( NULL == (pwdiKeepAliveParams = (WDI_KeepAliveReqParamsType*)pEventData->pEventData)) || |
| 12683 | ( NULL == (wdiKeepAliveCb = (WDI_KeepAliveCb)pEventData->pCBfnc))) |
| 12684 | { |
| 12685 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12686 | "Invalid parameters in Keep Alive req"); |
| 12687 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12688 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12689 | } |
| 12690 | |
| 12691 | /*----------------------------------------------------------------------- |
| 12692 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12693 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12694 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12695 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_KEEP_ALIVE_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12696 | sizeof(keepAliveReq), |
| 12697 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12698 | ( usSendSize < (usDataOffset + sizeof(keepAliveReq) ))) |
| 12699 | { |
| 12700 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 12701 | "Unable to get send buffer in keep alive req %x %x %x", |
| 12702 | pEventData, pwdiKeepAliveParams, wdiKeepAliveCb); |
| 12703 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12704 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12705 | } |
| 12706 | |
| 12707 | keepAliveReq.packetType = pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType; |
| 12708 | keepAliveReq.timePeriod = pwdiKeepAliveParams->wdiKeepAliveInfo.ucTimePeriod; |
| 12709 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12710 | keepAliveReq.bssIdx = pwdiKeepAliveParams->wdiKeepAliveInfo.bssIdx; |
| 12711 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12712 | if(pwdiKeepAliveParams->wdiKeepAliveInfo.ucPacketType == 2) |
| 12713 | { |
| 12714 | wpalMemoryCopy(keepAliveReq.hostIpv4Addr, |
| 12715 | pwdiKeepAliveParams->wdiKeepAliveInfo.aHostIpv4Addr, |
| 12716 | HAL_IPV4_ADDR_LEN); |
| 12717 | wpalMemoryCopy(keepAliveReq.destIpv4Addr, |
| 12718 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestIpv4Addr, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12719 | HAL_IPV4_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12720 | wpalMemoryCopy(keepAliveReq.destMacAddr, |
| 12721 | pwdiKeepAliveParams->wdiKeepAliveInfo.aDestMacAddr, |
| 12722 | HAL_MAC_ADDR_LEN); |
| 12723 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12724 | |
| 12725 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12726 | &keepAliveReq, |
| 12727 | sizeof(keepAliveReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12728 | |
| 12729 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12730 | "Process keep alive req %d",sizeof(keepAliveReq)); |
| 12731 | |
| 12732 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12733 | "Process keep alive req time period %d",keepAliveReq.timePeriod); |
| 12734 | |
| 12735 | pWDICtx->wdiReqStatusCB = pwdiKeepAliveParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12736 | pWDICtx->pReqStatusUserData = pwdiKeepAliveParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12737 | |
| 12738 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 12739 | "Sending keep alive req to HAL"); |
| 12740 | |
| 12741 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12742 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12743 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12744 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12745 | wdiKeepAliveCb, pEventData->pUserData, WDI_KEEP_ALIVE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12746 | }/*WDI_ProcessKeepAliveReq*/ |
| 12747 | |
| 12748 | |
| 12749 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12750 | @brief Process Wowl add bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12751 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12752 | |
| 12753 | @param pWDICtx: pointer to the WLAN DAL context |
| 12754 | pEventData: pointer to the event information structure |
| 12755 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12756 | @see |
| 12757 | @return Result of the function call |
| 12758 | */ |
| 12759 | WDI_Status |
| 12760 | WDI_ProcessWowlAddBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12761 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12762 | WDI_ControlBlockType* pWDICtx, |
| 12763 | WDI_EventInfoType* pEventData |
| 12764 | ) |
| 12765 | { |
| 12766 | WDI_WowlAddBcPtrnReqParamsType* pwdiWowlAddBcPtrnParams = NULL; |
| 12767 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12768 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12769 | wpt_uint16 usDataOffset = 0; |
| 12770 | wpt_uint16 usSendSize = 0; |
| 12771 | tHalWowlAddBcastPtrn wowlAddBcPtrnReq; |
| 12772 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12773 | |
| 12774 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12775 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12776 | -------------------------------------------------------------------------*/ |
| 12777 | if (( NULL == pEventData ) || |
| 12778 | ( NULL == (pwdiWowlAddBcPtrnParams = (WDI_WowlAddBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 12779 | ( NULL == (wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pEventData->pCBfnc))) |
| 12780 | { |
| 12781 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12782 | "%s: Invalid parameters", __FUNCTION__); |
| 12783 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12784 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12785 | } |
| 12786 | |
| 12787 | /*----------------------------------------------------------------------- |
| 12788 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12789 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12790 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12791 | 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] | 12792 | sizeof(wowlAddBcPtrnReq), |
| 12793 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12794 | ( usSendSize < (usDataOffset + sizeof(wowlAddBcPtrnReq) ))) |
| 12795 | { |
| 12796 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12797 | "Unable to get send buffer in Wowl add bc ptrn req %x %x %x", |
| 12798 | pEventData, pwdiWowlAddBcPtrnParams, wdiWowlAddBcPtrnCb); |
| 12799 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12800 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12801 | } |
| 12802 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12803 | wowlAddBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12804 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12805 | wowlAddBcPtrnReq.ucPatternByteOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12806 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternByteOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12807 | wowlAddBcPtrnReq.ucPatternMaskSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12808 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12809 | wowlAddBcPtrnReq.ucPatternSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12810 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize; |
| 12811 | |
| 12812 | if (pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize <= HAL_WOWL_BCAST_PATTERN_MAX_SIZE) |
| 12813 | { |
| 12814 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12815 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12816 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternSize); |
| 12817 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12818 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12819 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize); |
| 12820 | } |
| 12821 | else |
| 12822 | { |
| 12823 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12824 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12825 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12826 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12827 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12828 | HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12829 | |
| 12830 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPattern, |
| 12831 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPattern, |
| 12832 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12833 | wpalMemoryCopy(wowlAddBcPtrnReq.ucPatternMask, |
| 12834 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMask, |
| 12835 | pwdiWowlAddBcPtrnParams->wdiWowlAddBcPtrnInfo.ucPatternMaskSize - HAL_WOWL_BCAST_PATTERN_MAX_SIZE); |
| 12836 | } |
| 12837 | |
| 12838 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12839 | &wowlAddBcPtrnReq, |
| 12840 | sizeof(wowlAddBcPtrnReq)); |
| 12841 | |
| 12842 | pWDICtx->wdiReqStatusCB = pwdiWowlAddBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12843 | pWDICtx->pReqStatusUserData = pwdiWowlAddBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12844 | |
| 12845 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12846 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12847 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12848 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12849 | wdiWowlAddBcPtrnCb, pEventData->pUserData, WDI_WOWL_ADD_BC_PTRN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12850 | }/*WDI_ProcessWowlAddBcPtrnReq*/ |
| 12851 | |
| 12852 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12853 | @brief Process Wowl delete bc ptrn Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12854 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12855 | |
| 12856 | @param pWDICtx: pointer to the WLAN DAL context |
| 12857 | pEventData: pointer to the event information structure |
| 12858 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12859 | @see |
| 12860 | @return Result of the function call |
| 12861 | */ |
| 12862 | WDI_Status |
| 12863 | WDI_ProcessWowlDelBcPtrnReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12864 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12865 | WDI_ControlBlockType* pWDICtx, |
| 12866 | WDI_EventInfoType* pEventData |
| 12867 | ) |
| 12868 | { |
| 12869 | WDI_WowlDelBcPtrnReqParamsType* pwdiWowlDelBcPtrnParams = NULL; |
| 12870 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12871 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12872 | wpt_uint16 usDataOffset = 0; |
| 12873 | wpt_uint16 usSendSize = 0; |
| 12874 | tHalWowlDelBcastPtrn wowlDelBcPtrnReq; |
| 12875 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12876 | |
| 12877 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12878 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12879 | -------------------------------------------------------------------------*/ |
| 12880 | if (( NULL == pEventData ) || |
| 12881 | ( NULL == (pwdiWowlDelBcPtrnParams = (WDI_WowlDelBcPtrnReqParamsType*)pEventData->pEventData)) || |
| 12882 | ( NULL == (wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pEventData->pCBfnc))) |
| 12883 | { |
| 12884 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12885 | "%s: Invalid parameters", __FUNCTION__); |
| 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 | |
| 12890 | /*----------------------------------------------------------------------- |
| 12891 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12892 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12893 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12894 | 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] | 12895 | sizeof(wowlDelBcPtrnReq), |
| 12896 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12897 | ( usSendSize < (usDataOffset + sizeof(wowlDelBcPtrnReq) ))) |
| 12898 | { |
| 12899 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12900 | "Unable to get send buffer in Wowl del bc ptrn req %x %x %x", |
| 12901 | pEventData, pwdiWowlDelBcPtrnParams, wdiWowlDelBcPtrnCb); |
| 12902 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12903 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12904 | } |
| 12905 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12906 | wowlDelBcPtrnReq.ucPatternId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12907 | pwdiWowlDelBcPtrnParams->wdiWowlDelBcPtrnInfo.ucPatternId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12908 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 12909 | &wowlDelBcPtrnReq, |
| 12910 | sizeof(wowlDelBcPtrnReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12911 | |
| 12912 | pWDICtx->wdiReqStatusCB = pwdiWowlDelBcPtrnParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12913 | pWDICtx->pReqStatusUserData = pwdiWowlDelBcPtrnParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12914 | |
| 12915 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12916 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12917 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12918 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 12919 | wdiWowlDelBcPtrnCb, pEventData->pUserData, WDI_WOWL_DEL_BC_PTRN_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12920 | }/*WDI_ProcessWowlDelBcPtrnReq*/ |
| 12921 | |
| 12922 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12923 | @brief Process Wowl enter Request function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12924 | when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12925 | |
| 12926 | @param pWDICtx: pointer to the WLAN DAL context |
| 12927 | pEventData: pointer to the event information structure |
| 12928 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12929 | @see |
| 12930 | @return Result of the function call |
| 12931 | */ |
| 12932 | WDI_Status |
| 12933 | WDI_ProcessWowlEnterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12934 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12935 | WDI_ControlBlockType* pWDICtx, |
| 12936 | WDI_EventInfoType* pEventData |
| 12937 | ) |
| 12938 | { |
| 12939 | WDI_WowlEnterReqParamsType* pwdiWowlEnterParams = NULL; |
| 12940 | WDI_WowlEnterReqCb wdiWowlEnterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12941 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12942 | wpt_uint16 usDataOffset = 0; |
| 12943 | wpt_uint16 usSendSize = 0; |
| 12944 | tHalWowlEnterParams wowlEnterReq; |
| 12945 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 12946 | |
| 12947 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12948 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12949 | -------------------------------------------------------------------------*/ |
| 12950 | if (( NULL == pEventData ) || |
| 12951 | ( NULL == (pwdiWowlEnterParams = (WDI_WowlEnterReqParamsType*)pEventData->pEventData)) || |
| 12952 | ( NULL == (wdiWowlEnterCb = (WDI_WowlEnterReqCb)pEventData->pCBfnc))) |
| 12953 | { |
| 12954 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12955 | "%s: Invalid parameters", __FUNCTION__); |
| 12956 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12957 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12958 | } |
| 12959 | |
| 12960 | /*----------------------------------------------------------------------- |
| 12961 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12962 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12963 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12964 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_ENTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12965 | sizeof(wowlEnterReq), |
| 12966 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 12967 | ( usSendSize < (usDataOffset + sizeof(wowlEnterReq) ))) |
| 12968 | { |
| 12969 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 12970 | "Unable to get send buffer in Wowl enter req %x %x %x", |
| 12971 | pEventData, pwdiWowlEnterParams, wdiWowlEnterCb); |
| 12972 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12973 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12974 | } |
| 12975 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12976 | wowlEnterReq.ucMagicPktEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12977 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucMagicPktEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12978 | wowlEnterReq.ucPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12979 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12980 | wowlEnterReq.ucUcastPatternFilteringEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12981 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucUcastPatternFilteringEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12982 | wowlEnterReq.ucWowChnlSwitchRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12983 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowChnlSwitchRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12984 | wowlEnterReq.ucWowDeauthRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12985 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDeauthRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12986 | wowlEnterReq.ucWowDisassocRcv = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12987 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowDisassocRcv; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12988 | wowlEnterReq.ucWowMaxMissedBeacons = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12989 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxMissedBeacons; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 12990 | wowlEnterReq.ucWowMaxSleepUsec = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 12991 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowMaxSleepUsec; |
| 12992 | |
| 12993 | #ifdef WLAN_WAKEUP_EVENTS |
| 12994 | wowlEnterReq.ucWoWEAPIDRequestEnable = |
| 12995 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPIDRequestEnable; |
| 12996 | |
| 12997 | wowlEnterReq.ucWoWEAPOL4WayEnable = |
| 12998 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWEAPOL4WayEnable; |
| 12999 | |
| 13000 | wowlEnterReq.ucWowNetScanOffloadMatch = |
| 13001 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowNetScanOffloadMatch; |
| 13002 | |
| 13003 | wowlEnterReq.ucWowGTKRekeyError = |
| 13004 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWowGTKRekeyError; |
| 13005 | |
| 13006 | wowlEnterReq.ucWoWBSSConnLoss = |
| 13007 | pwdiWowlEnterParams->wdiWowlEnterInfo.ucWoWBSSConnLoss; |
| 13008 | #endif // WLAN_WAKEUP_EVENTS |
| 13009 | |
| 13010 | wpalMemoryCopy(wowlEnterReq.magicPtrn, |
| 13011 | pwdiWowlEnterParams->wdiWowlEnterInfo.magicPtrn, |
| 13012 | sizeof(tSirMacAddr)); |
| 13013 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13014 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13015 | &wowlEnterReq, |
| 13016 | sizeof(wowlEnterReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13017 | |
| 13018 | pWDICtx->wdiReqStatusCB = pwdiWowlEnterParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13019 | pWDICtx->pReqStatusUserData = pwdiWowlEnterParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13020 | |
| 13021 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13022 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13023 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13024 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13025 | wdiWowlEnterCb, pEventData->pUserData, WDI_WOWL_ENTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13026 | }/*WDI_ProcessWowlEnterReq*/ |
| 13027 | |
| 13028 | /** |
| 13029 | @brief Process Wowl exit Request function (called when Main FSM |
| 13030 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13031 | |
| 13032 | @param pWDICtx: pointer to the WLAN DAL context |
| 13033 | pEventData: pointer to the event information structure |
| 13034 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13035 | @see |
| 13036 | @return Result of the function call |
| 13037 | */ |
| 13038 | WDI_Status |
| 13039 | WDI_ProcessWowlExitReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13040 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13041 | WDI_ControlBlockType* pWDICtx, |
| 13042 | WDI_EventInfoType* pEventData |
| 13043 | ) |
| 13044 | { |
| 13045 | WDI_WowlExitReqCb wdiWowlExitCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13046 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13047 | wpt_uint16 usDataOffset = 0; |
| 13048 | wpt_uint16 usSendSize = 0; |
| 13049 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13050 | |
| 13051 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13052 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13053 | -------------------------------------------------------------------------*/ |
| 13054 | if (( NULL == pEventData ) || |
| 13055 | ( NULL == (wdiWowlExitCb = (WDI_WowlExitReqCb)pEventData->pCBfnc))) |
| 13056 | { |
| 13057 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13058 | "%s: Invalid parameters", __FUNCTION__); |
| 13059 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13060 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13061 | } |
| 13062 | |
| 13063 | /*----------------------------------------------------------------------- |
| 13064 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13065 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13066 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13067 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_WOWL_EXIT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13068 | 0, |
| 13069 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13070 | ( usSendSize < (usDataOffset ))) |
| 13071 | { |
| 13072 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13073 | "Unable to get send buffer in Wowl Exit req %x %x", |
| 13074 | pEventData, wdiWowlExitCb); |
| 13075 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13076 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13077 | } |
| 13078 | |
| 13079 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13080 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13081 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13082 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13083 | wdiWowlExitCb, pEventData->pUserData, WDI_WOWL_EXIT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13084 | }/*WDI_ProcessWowlExitReq*/ |
| 13085 | |
| 13086 | /** |
| 13087 | @brief Process Configure Apps Cpu Wakeup State Request function |
| 13088 | (called when Main FSM allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13089 | |
| 13090 | @param pWDICtx: pointer to the WLAN DAL context |
| 13091 | pEventData: pointer to the event information structure |
| 13092 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13093 | @see |
| 13094 | @return Result of the function call |
| 13095 | */ |
| 13096 | WDI_Status |
| 13097 | WDI_ProcessConfigureAppsCpuWakeupStateReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13098 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13099 | WDI_ControlBlockType* pWDICtx, |
| 13100 | WDI_EventInfoType* pEventData |
| 13101 | ) |
| 13102 | { |
| 13103 | WDI_ConfigureAppsCpuWakeupStateReqParamsType* pwdiAppsCpuWakeupStateParams = NULL; |
| 13104 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13105 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13106 | wpt_uint16 usDataOffset = 0; |
| 13107 | wpt_uint16 usSendSize = 0; |
| 13108 | tHalConfigureAppsCpuWakeupStateReqParams halCfgAppsCpuWakeupStateReqParams; |
| 13109 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13110 | |
| 13111 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13112 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13113 | -------------------------------------------------------------------------*/ |
| 13114 | if (( NULL == pEventData ) || |
| 13115 | ( NULL == (pwdiAppsCpuWakeupStateParams = (WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEventData->pEventData)) || |
| 13116 | ( NULL == (wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pEventData->pCBfnc))) |
| 13117 | { |
| 13118 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13119 | "%s: Invalid parameters", __FUNCTION__); |
| 13120 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13121 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13122 | } |
| 13123 | |
| 13124 | /*----------------------------------------------------------------------- |
| 13125 | Get message buffer |
| 13126 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13127 | 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] | 13128 | sizeof(halCfgAppsCpuWakeupStateReqParams), |
| 13129 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13130 | ( usSendSize < (usDataOffset + sizeof(pwdiAppsCpuWakeupStateParams->bIsAppsAwake) ))) |
| 13131 | { |
| 13132 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13133 | "Unable to get send buffer in Apps CPU Wakeup State req %x %x %x", |
| 13134 | pEventData, pwdiAppsCpuWakeupStateParams, wdiConfigureAppsCpuWakeupStateCb); |
| 13135 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13136 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13137 | } |
| 13138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13139 | halCfgAppsCpuWakeupStateReqParams.isAppsCpuAwake = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13140 | pwdiAppsCpuWakeupStateParams->bIsAppsAwake; |
| 13141 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13142 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13143 | &halCfgAppsCpuWakeupStateReqParams, |
| 13144 | sizeof(halCfgAppsCpuWakeupStateReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13145 | |
| 13146 | pWDICtx->wdiReqStatusCB = pwdiAppsCpuWakeupStateParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13147 | pWDICtx->pReqStatusUserData = pwdiAppsCpuWakeupStateParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13148 | |
| 13149 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13150 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13151 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13152 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 13153 | wdiConfigureAppsCpuWakeupStateCb, pEventData->pUserData, |
| 13154 | WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13155 | }/*WDI_ProcessConfigureAppsCpuWakeupStateReq*/ |
| 13156 | |
| 13157 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 13158 | /** |
| 13159 | @brief Process Aggregated Add TSpec Request function (called when Main FSM |
| 13160 | allows it) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13161 | |
| 13162 | @param pWDICtx: pointer to the WLAN DAL context |
| 13163 | pEventData: pointer to the event information structure |
| 13164 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13165 | @see |
| 13166 | @return Result of the function call |
| 13167 | */ |
| 13168 | WDI_Status |
| 13169 | WDI_ProcessAggrAddTSpecReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13170 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13171 | WDI_ControlBlockType* pWDICtx, |
| 13172 | WDI_EventInfoType* pEventData |
| 13173 | ) |
| 13174 | { |
| 13175 | WDI_AggrAddTSReqParamsType* pwdiAggrAddTSParams; |
| 13176 | WDI_AggrAddTsRspCb wdiAggrAddTSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13177 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13178 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13179 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13180 | wpt_uint16 usDataOffset = 0; |
| 13181 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13182 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13183 | wpt_macAddr macBSSID; |
| 13184 | tAggrAddTsReq halAggrAddTsReq; |
| 13185 | int i; |
| 13186 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13187 | |
| 13188 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13189 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13190 | -------------------------------------------------------------------------*/ |
| 13191 | if (( NULL == pEventData ) || ( NULL == pEventData->pEventData ) || |
| 13192 | ( NULL == pEventData->pCBfnc )) |
| 13193 | { |
| 13194 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13195 | "%s: Invalid parameters", __FUNCTION__); |
| 13196 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13197 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13198 | } |
| 13199 | wpalMemoryFill( &halAggrAddTsReq, sizeof(tAggrAddTsReq), 0 ); |
| 13200 | pwdiAggrAddTSParams = (WDI_AggrAddTSReqParamsType*)pEventData->pEventData; |
| 13201 | wdiAggrAddTSRspCb = (WDI_AggrAddTsRspCb)pEventData->pCBfnc; |
| 13202 | /*------------------------------------------------------------------------- |
| 13203 | 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] | 13204 | not it means it is free to process request |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13205 | -------------------------------------------------------------------------*/ |
| 13206 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13207 | |
| 13208 | /*------------------------------------------------------------------------ |
| 13209 | Find the BSS for which the request is made and identify WDI session |
| 13210 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13211 | if ( WDI_STATUS_SUCCESS != WDI_STATableGetStaBSSIDAddr(pWDICtx, |
| 13212 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13213 | &macBSSID)) |
| 13214 | { |
| 13215 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13216 | "This station does not exist in the WDI Station Table %d"); |
| 13217 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13218 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13219 | } |
| 13220 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13221 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, macBSSID, &pBSSSes); |
| 13222 | if ( NULL == pBSSSes ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13223 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13224 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13225 | "%s: Association sequence for this BSS does not yet exist. macBSSID " MAC_ADDRESS_STR, |
| 13226 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13227 | |
| 13228 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13229 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13230 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13231 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13232 | /*------------------------------------------------------------------------ |
| 13233 | Check if this BSS is being currently processed or queued, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13234 | if queued - queue the new request as well |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13235 | ------------------------------------------------------------------------*/ |
| 13236 | if ( eWLAN_PAL_TRUE == pBSSSes->bAssocReqQueued ) |
| 13237 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13238 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13239 | "%s: Association sequence for this BSS exists but currently queued. macBSSID " MAC_ADDRESS_STR, |
| 13240 | __func__, MAC_ADDR_ARRAY(macBSSID)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13241 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13242 | wdiStatus = WDI_QueueAssocRequest( pWDICtx, pBSSSes, pEventData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13243 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13244 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13245 | } |
| 13246 | |
| 13247 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13248 | /*----------------------------------------------------------------------- |
| 13249 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13250 | ! TO DO : proper conversion into the HAL Message Request Format |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13251 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13252 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_AGGR_ADD_TS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13253 | sizeof(tAggrAddTsParams), |
| 13254 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 13255 | ( usSendSize < (usDataOffset + sizeof(tAggrAddTsParams) ))) |
| 13256 | { |
| 13257 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13258 | "Unable to get send buffer in set bss key req %x %x %x", |
| 13259 | pEventData, pwdiAggrAddTSParams, wdiAggrAddTSRspCb); |
| 13260 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13261 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13262 | } |
| 13263 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13264 | halAggrAddTsReq.aggrAddTsParam.staIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13265 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucSTAIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13266 | halAggrAddTsReq.aggrAddTsParam.tspecIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13267 | pwdiAggrAddTSParams->wdiAggrTsInfo.ucTspecIdx; |
| 13268 | |
| 13269 | for( i = 0; i < WLAN_HAL_MAX_AC; i++ ) |
| 13270 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13271 | halAggrAddTsReq.aggrAddTsParam.tspec[i].type = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13272 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13273 | halAggrAddTsReq.aggrAddTsParam.tspec[i].length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13274 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].ucLength; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13275 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.ackPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13276 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13277 | ackPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13278 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.accessPolicy = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13279 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13280 | accessPolicy; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13281 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.userPrio = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13282 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13283 | userPrio; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13284 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.psb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13285 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13286 | psb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13287 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.aggregation = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13288 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13289 | aggregation; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13290 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.direction = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13291 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13292 | direction; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13293 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13294 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13295 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13296 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.traffic.tsid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13297 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiTraffic. |
| 13298 | trafficType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13299 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.rsvd = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13300 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.rsvd; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13301 | halAggrAddTsReq.aggrAddTsParam.tspec[i].tsinfo.schedule.schedule = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13302 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].wdiTSinfo.wdiSchedule.schedule; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13303 | |
| 13304 | |
| 13305 | halAggrAddTsReq.aggrAddTsParam.tspec[i].nomMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13306 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usNomMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13307 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxMsduSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13308 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMaxMsduSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13309 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13310 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13311 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxSvcInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13312 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxSvcInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13313 | halAggrAddTsReq.aggrAddTsParam.tspec[i].inactInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13314 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uInactInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13315 | halAggrAddTsReq.aggrAddTsParam.tspec[i].suspendInterval = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13316 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSuspendInterval; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13317 | halAggrAddTsReq.aggrAddTsParam.tspec[i].svcStartTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13318 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uSvcStartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13319 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13320 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13321 | halAggrAddTsReq.aggrAddTsParam.tspec[i].meanDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13322 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMeanDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13323 | halAggrAddTsReq.aggrAddTsParam.tspec[i].peakDataRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13324 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uPeakDataRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13325 | halAggrAddTsReq.aggrAddTsParam.tspec[i].maxBurstSz = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13326 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMaxBurstSz; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13327 | halAggrAddTsReq.aggrAddTsParam.tspec[i].delayBound = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13328 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uDelayBound; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13329 | halAggrAddTsReq.aggrAddTsParam.tspec[i].minPhyRate = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13330 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].uMinPhyRate; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13331 | halAggrAddTsReq.aggrAddTsParam.tspec[i].surplusBw = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13332 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usSurplusBw; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13333 | halAggrAddTsReq.aggrAddTsParam.tspec[i].mediumTime = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13334 | pwdiAggrAddTSParams->wdiAggrTsInfo.wdiTspecIE[i].usMediumTime; |
| 13335 | } |
| 13336 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13337 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 13338 | &halAggrAddTsReq, |
| 13339 | sizeof(halAggrAddTsReq)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13340 | |
| 13341 | pWDICtx->wdiReqStatusCB = pwdiAggrAddTSParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13342 | pWDICtx->pReqStatusUserData = pwdiAggrAddTSParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13343 | |
| 13344 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13345 | Send Add TS Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13346 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13347 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13348 | wdiAggrAddTSRspCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13349 | WDI_AGGR_ADD_TS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13350 | }/*WDI_ProcessAggrAddTSpecReq*/ |
| 13351 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 13352 | |
| 13353 | /** |
| 13354 | @brief Process Shutdown Request function (called when Main FSM |
| 13355 | allows it) |
| 13356 | |
| 13357 | @param pWDICtx: pointer to the WLAN DAL context |
| 13358 | pEventData: pointer to the event information structure |
| 13359 | |
| 13360 | @see |
| 13361 | @return Result of the function call |
| 13362 | */ |
| 13363 | WDI_Status |
| 13364 | WDI_ProcessShutdownReq |
| 13365 | ( |
| 13366 | WDI_ControlBlockType* pWDICtx, |
| 13367 | WDI_EventInfoType* pEventData |
| 13368 | ) |
| 13369 | { |
| 13370 | wpt_status wptStatus; |
| 13371 | |
| 13372 | |
| 13373 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13374 | |
| 13375 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13376 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13377 | -------------------------------------------------------------------------*/ |
| 13378 | if ( NULL == pEventData ) |
| 13379 | { |
| 13380 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13381 | "%s: Invalid parameters", __FUNCTION__); |
| 13382 | WDI_ASSERT(0); |
| 13383 | return WDI_STATUS_E_FAILURE; |
| 13384 | } |
| 13385 | |
| 13386 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13387 | |
| 13388 | |
| 13389 | gWDIInitialized = eWLAN_PAL_FALSE; |
| 13390 | /*! TO DO: stop the data services */ |
| 13391 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 13392 | { |
| 13393 | /*Stop the STA Table !UT- check this logic again |
| 13394 | It is safer to do it here than on the response - because a stop is imminent*/ |
| 13395 | WDI_STATableStop(pWDICtx); |
| 13396 | |
| 13397 | /* Stop Transport Driver, DXE */ |
| 13398 | WDTS_Stop(pWDICtx); |
| 13399 | } |
| 13400 | |
| 13401 | /*Clear all pending request*/ |
| 13402 | WDI_ClearPendingRequests(pWDICtx); |
| 13403 | /* Close Data transport*/ |
| 13404 | /* FTM mode does not open Data Path */ |
| 13405 | if ( eDRIVER_TYPE_MFG != pWDICtx->driverMode ) |
| 13406 | { |
| 13407 | WDTS_Close(pWDICtx); |
| 13408 | } |
| 13409 | /*Close the STA Table !UT- check this logic again*/ |
| 13410 | WDI_STATableClose(pWDICtx); |
| 13411 | /*close the PAL */ |
| 13412 | wptStatus = wpalClose(pWDICtx->pPALContext); |
| 13413 | if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) |
| 13414 | { |
| 13415 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13416 | "Failed to wpal Close %d", wptStatus); |
| 13417 | WDI_ASSERT(0); |
| 13418 | } |
| 13419 | |
| 13420 | /*Transition back to init state*/ |
| 13421 | WDI_STATE_TRANSITION( pWDICtx, WDI_INIT_ST); |
| 13422 | |
| 13423 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13424 | |
| 13425 | /*Make sure the expected state is properly defaulted to Init*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13426 | pWDICtx->ucExpectedStateTransition = WDI_INIT_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13427 | |
| 13428 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13429 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13430 | }/*WDI_ProcessShutdownReq*/ |
| 13431 | |
| 13432 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13433 | Main DAL Control Path Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13434 | ========================================================================*/ |
| 13435 | |
| 13436 | /** |
| 13437 | @brief Process Start Response function (called when a response |
| 13438 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13439 | |
| 13440 | @param pWDICtx: pointer to the WLAN DAL context |
| 13441 | pEventData: pointer to the event information structure |
| 13442 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13443 | @see |
| 13444 | @return Result of the function call |
| 13445 | */ |
| 13446 | WDI_Status |
| 13447 | WDI_ProcessStartRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13448 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13449 | WDI_ControlBlockType* pWDICtx, |
| 13450 | WDI_EventInfoType* pEventData |
| 13451 | ) |
| 13452 | { |
| 13453 | WDI_StartRspParamsType wdiRspParams; |
| 13454 | WDI_StartRspCb wdiStartRspCb = NULL; |
| 13455 | |
| 13456 | tHalMacStartRspParams* startRspParams; |
| 13457 | |
| 13458 | #ifndef HAL_SELF_STA_PER_BSS |
| 13459 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 13460 | #endif |
| 13461 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13462 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13463 | wdiStartRspCb = (WDI_StartRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13464 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13465 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13466 | -------------------------------------------------------------------------*/ |
| 13467 | if (( NULL == pEventData ) || |
| 13468 | ( NULL == pEventData->pEventData) || |
| 13469 | ( NULL == wdiStartRspCb )) |
| 13470 | { |
| 13471 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13472 | "%s: Invalid parameters", __FUNCTION__); |
| 13473 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13474 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13475 | } |
| 13476 | |
| 13477 | /*------------------------------------------------------------------------- |
| 13478 | Extract response and send it to UMAC |
| 13479 | -------------------------------------------------------------------------*/ |
| 13480 | if ( sizeof(tHalMacStartRspParams) > pEventData->uEventDataSize ) |
| 13481 | { |
| 13482 | // not enough data was received |
| 13483 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 13484 | "Invalid response length in Start Resp Expect %x Rcvd %x", |
| 13485 | sizeof(tHalMacStartRspParams), pEventData->uEventDataSize); |
| 13486 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13487 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13488 | } |
| 13489 | |
| 13490 | /*------------------------------------------------------------------------- |
| 13491 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13492 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13493 | -------------------------------------------------------------------------*/ |
| 13494 | startRspParams = (tHalMacStartRspParams *) pEventData->pEventData; |
| 13495 | |
| 13496 | wdiRspParams.ucMaxBssids = startRspParams->ucMaxBssids; |
| 13497 | wdiRspParams.ucMaxStations = startRspParams->ucMaxStations; |
| 13498 | wdiRspParams.wlanCompiledVersion.major = WLAN_HAL_VER_MAJOR; |
| 13499 | wdiRspParams.wlanCompiledVersion.minor = WLAN_HAL_VER_MINOR; |
| 13500 | wdiRspParams.wlanCompiledVersion.version = WLAN_HAL_VER_VERSION; |
| 13501 | wdiRspParams.wlanCompiledVersion.revision = WLAN_HAL_VER_REVISION; |
| 13502 | wdiRspParams.wlanReportedVersion.major = |
| 13503 | startRspParams->wcnssWlanVersion.major; |
| 13504 | wdiRspParams.wlanReportedVersion.minor = |
| 13505 | startRspParams->wcnssWlanVersion.minor; |
| 13506 | wdiRspParams.wlanReportedVersion.version = |
| 13507 | startRspParams->wcnssWlanVersion.version; |
| 13508 | wdiRspParams.wlanReportedVersion.revision = |
| 13509 | startRspParams->wcnssWlanVersion.revision; |
| 13510 | wpalMemoryCopy(wdiRspParams.wcnssSoftwareVersion, |
| 13511 | startRspParams->wcnssCrmVersionString, |
| 13512 | sizeof(wdiRspParams.wcnssSoftwareVersion)); |
| 13513 | wpalMemoryCopy(wdiRspParams.wcnssHardwareVersion, |
| 13514 | startRspParams->wcnssWlanVersionString, |
| 13515 | sizeof(wdiRspParams.wcnssHardwareVersion)); |
| 13516 | wdiRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS(startRspParams->status); |
| 13517 | |
| 13518 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13519 | if ( WDI_STATUS_SUCCESS == wdiRspParams.wdiStatus ) |
| 13520 | { |
| 13521 | pWDICtx->ucExpectedStateTransition = WDI_STARTED_ST; |
| 13522 | |
| 13523 | /*Cache the start response for further use*/ |
| 13524 | wpalMemoryCopy( &pWDICtx->wdiCachedStartRspParams , |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13525 | &wdiRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13526 | sizeof(pWDICtx->wdiCachedStartRspParams)); |
| 13527 | |
| 13528 | } |
| 13529 | else |
| 13530 | { |
| 13531 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13532 | "Failed to start device with status %s(%d)", |
| 13533 | WDI_getHALStatusMsgString(startRspParams->status), |
| 13534 | startRspParams->status); |
| 13535 | |
| 13536 | /*Set the expected state transition to stopped - because the start has |
| 13537 | failed*/ |
| 13538 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 13539 | |
| 13540 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13541 | |
| 13542 | /*Notify UMAC*/ |
| 13543 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13544 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13545 | WDI_DetectedDeviceError(pWDICtx, wdiRspParams.wdiStatus); |
| 13546 | |
| 13547 | /*Although the response is an error - it was processed by our function |
| 13548 | so as far as the caller is concerned this is a succesful reponse processing*/ |
| 13549 | return WDI_STATUS_SUCCESS; |
| 13550 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13551 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13552 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13553 | |
| 13554 | if(eDRIVER_TYPE_MFG == pWDICtx->driverMode) |
| 13555 | { |
| 13556 | /* FTM mode does not need to execute below */ |
| 13557 | /* Notify UMAC */ |
| 13558 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 13559 | return WDI_STATUS_SUCCESS; |
| 13560 | } |
| 13561 | |
| 13562 | /* START the Data transport */ |
| 13563 | WDTS_startTransport(pWDICtx); |
| 13564 | |
| 13565 | /*Start the STA Table !- check this logic again*/ |
| 13566 | WDI_STATableStart(pWDICtx); |
| 13567 | |
| 13568 | #ifndef HAL_SELF_STA_PER_BSS |
| 13569 | /* Store the Self STA Index */ |
| 13570 | pWDICtx->ucSelfStaId = halStartRspMsg.startRspParams.selfStaIdx; |
| 13571 | |
| 13572 | pWDICtx->usSelfStaDpuId = wdiRspParams.usSelfStaDpuId; |
| 13573 | wpalMemoryCopy(pWDICtx->macSelfSta, wdiRspParams.macSelfSta, |
| 13574 | WDI_MAC_ADDR_LEN); |
| 13575 | |
| 13576 | /* At this point add the self-STA */ |
| 13577 | |
| 13578 | /*! TO DO: wdiAddSTAParam.bcastMgmtDpuSignature */ |
| 13579 | /* !TO DO: wdiAddSTAParam.bcastDpuSignature */ |
| 13580 | /*! TO DO: wdiAddSTAParam.dpuSig */ |
| 13581 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 13582 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 13583 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 13584 | |
| 13585 | //all DPU indices are the same for self STA |
| 13586 | wdiAddSTAParam.bcastDpuIndex = wdiRspParams.usSelfStaDpuId; |
| 13587 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiRspParams.usSelfStaDpuId; |
| 13588 | wdiAddSTAParam.dpuIndex = wdiRspParams.usSelfStaDpuId;; |
| 13589 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiRspParams.macSelfSta, |
| 13590 | WDI_MAC_ADDR_LEN); |
| 13591 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 13592 | wdiAddSTAParam.ucSTAIdx = halStartRspMsg.startRspParams.selfStaIdx; |
| 13593 | |
| 13594 | /* Note: Since we don't get an explicit config STA request for self STA, we |
| 13595 | add the self STA upon receiving the Start response message. But the |
| 13596 | self STA entry in the table is deleted when WDI gets an explicit delete STA |
| 13597 | request */ |
| 13598 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 13599 | #endif |
| 13600 | |
| 13601 | /*Notify UMAC*/ |
| 13602 | wdiStartRspCb( &wdiRspParams, pWDICtx->pRspCBUserData); |
| 13603 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13604 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13605 | }/*WDI_ProcessStartRsp*/ |
| 13606 | |
| 13607 | |
| 13608 | /** |
| 13609 | @brief Process Stop Response function (called when a response |
| 13610 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13611 | |
| 13612 | @param pWDICtx: pointer to the WLAN DAL context |
| 13613 | pEventData: pointer to the event information structure |
| 13614 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13615 | @see |
| 13616 | @return Result of the function call |
| 13617 | */ |
| 13618 | WDI_Status |
| 13619 | WDI_ProcessStopRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13620 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13621 | WDI_ControlBlockType* pWDICtx, |
| 13622 | WDI_EventInfoType* pEventData |
| 13623 | ) |
| 13624 | { |
| 13625 | WDI_Status wdiStatus; |
| 13626 | WDI_StopRspCb wdiStopRspCb = NULL; |
| 13627 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13628 | tHalMacStopRspMsg halMacStopRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13629 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13630 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13631 | wdiStopRspCb = (WDI_StopRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13632 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13633 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13634 | -------------------------------------------------------------------------*/ |
| 13635 | if (( NULL == pEventData ) || |
| 13636 | ( NULL == pEventData->pEventData) || |
| 13637 | ( NULL == wdiStopRspCb )) |
| 13638 | { |
| 13639 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13640 | "%s: Invalid parameters", __FUNCTION__); |
| 13641 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13642 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13643 | } |
| 13644 | |
| 13645 | /*------------------------------------------------------------------------- |
| 13646 | Extract response and send it to UMAC |
| 13647 | -------------------------------------------------------------------------*/ |
| 13648 | if ( sizeof(halMacStopRspMsg) < pEventData->uEventDataSize ) |
| 13649 | { |
| 13650 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13651 | "Invalid response length in Stop Resp %x %x", |
| 13652 | pEventData->uEventDataSize); |
| 13653 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13654 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13655 | } |
| 13656 | |
| 13657 | /*------------------------------------------------------------------------- |
| 13658 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13659 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13660 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13661 | wpalMemoryCopy( &halMacStopRspMsg.stopRspParams, |
| 13662 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13663 | sizeof(halMacStopRspMsg.stopRspParams)); |
| 13664 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13665 | wdiStatus = WDI_HAL_2_WDI_STATUS(halMacStopRspMsg.stopRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13666 | |
| 13667 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 13668 | |
| 13669 | /*-------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13670 | Check to see if the stop went OK |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13671 | --------------------------------------------------------------------------*/ |
| 13672 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 13673 | { |
| 13674 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13675 | "Failed to stop the device with status %s (%d)", |
| 13676 | WDI_getHALStatusMsgString(halMacStopRspMsg.stopRspParams.status), |
| 13677 | halMacStopRspMsg.stopRspParams.status); |
| 13678 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13679 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 13680 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13681 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13682 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13683 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13684 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13685 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 13686 | |
| 13687 | /*Transition now as WDI may get preempted imediately after it sends |
| 13688 | up the Stop Response and it will not get to process the state transition |
| 13689 | from Main Rsp function*/ |
| 13690 | WDI_STATE_TRANSITION( pWDICtx, pWDICtx->ucExpectedStateTransition); |
| 13691 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 13692 | |
| 13693 | /*! TO DO: - STOP the Data transport */ |
| 13694 | |
| 13695 | /*Notify UMAC*/ |
| 13696 | wdiStopRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13697 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13698 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13699 | }/*WDI_ProcessStopRsp*/ |
| 13700 | |
| 13701 | /** |
| 13702 | @brief Process Close Rsp function (called when a response |
| 13703 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13704 | |
| 13705 | @param pWDICtx: pointer to the WLAN DAL context |
| 13706 | pEventData: pointer to the event information structure |
| 13707 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13708 | @see |
| 13709 | @return Result of the function call |
| 13710 | */ |
| 13711 | WDI_Status |
| 13712 | WDI_ProcessCloseRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13713 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13714 | WDI_ControlBlockType* pWDICtx, |
| 13715 | WDI_EventInfoType* pEventData |
| 13716 | ) |
| 13717 | { |
| 13718 | /*There is no close response comming from HAL - function just kept for |
| 13719 | simmetry */ |
| 13720 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13721 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13722 | }/*WDI_ProcessCloseRsp*/ |
| 13723 | |
| 13724 | |
| 13725 | /*============================================================================ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13726 | SCAN RESPONSE PROCESSING API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13727 | ============================================================================*/ |
| 13728 | |
| 13729 | /** |
| 13730 | @brief Process Init Scan Rsp function (called when a response |
| 13731 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13732 | |
| 13733 | @param pWDICtx: pointer to the WLAN DAL context |
| 13734 | pEventData: pointer to the event information structure |
| 13735 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13736 | @see |
| 13737 | @return Result of the function call |
| 13738 | */ |
| 13739 | WDI_Status |
| 13740 | WDI_ProcessInitScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13741 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13742 | WDI_ControlBlockType* pWDICtx, |
| 13743 | WDI_EventInfoType* pEventData |
| 13744 | ) |
| 13745 | { |
| 13746 | WDI_Status wdiStatus; |
| 13747 | WDI_InitScanRspCb wdiInitScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13748 | tHalInitScanRspMsg halInitScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13749 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13750 | |
| 13751 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13752 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13753 | -------------------------------------------------------------------------*/ |
| 13754 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13755 | ( NULL == pEventData->pEventData)) |
| 13756 | { |
| 13757 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13758 | "%s: Invalid parameters", __FUNCTION__); |
| 13759 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13760 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13761 | } |
| 13762 | |
| 13763 | wdiInitScanRspCb = (WDI_InitScanRspCb)pWDICtx->pfncRspCB; |
| 13764 | if( NULL == wdiInitScanRspCb) |
| 13765 | { |
| 13766 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 13767 | "%s: call back function is NULL", __FUNCTION__); |
| 13768 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13769 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13770 | } |
| 13771 | |
| 13772 | /*------------------------------------------------------------------------- |
| 13773 | Unpack HAL Response Message - the header was already extracted by the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13774 | main Response Handling procedure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13775 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13776 | wpalMemoryCopy( &halInitScanRspMsg.initScanRspParams, |
| 13777 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13778 | sizeof(halInitScanRspMsg.initScanRspParams)); |
| 13779 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13780 | wdiStatus = WDI_HAL_2_WDI_STATUS(halInitScanRspMsg.initScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13781 | |
| 13782 | if ( pWDICtx->bInBmps ) |
| 13783 | { |
| 13784 | // notify DTS that we are entering Full power |
| 13785 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 13786 | } |
| 13787 | |
| 13788 | /*Notify UMAC*/ |
| 13789 | wdiInitScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13790 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13791 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13792 | }/*WDI_ProcessInitScanRsp*/ |
| 13793 | |
| 13794 | |
| 13795 | /** |
| 13796 | @brief Process Start Scan Rsp function (called when a response |
| 13797 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13798 | |
| 13799 | @param pWDICtx: pointer to the WLAN DAL context |
| 13800 | pEventData: pointer to the event information structure |
| 13801 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13802 | @see |
| 13803 | @return Result of the function call |
| 13804 | */ |
| 13805 | WDI_Status |
| 13806 | WDI_ProcessStartScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13807 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13808 | WDI_ControlBlockType* pWDICtx, |
| 13809 | WDI_EventInfoType* pEventData |
| 13810 | ) |
| 13811 | { |
| 13812 | WDI_StartScanRspParamsType wdiStartScanParams; |
| 13813 | WDI_StartScanRspCb wdiStartScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13814 | |
| 13815 | tHalStartScanRspMsg halStartScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13816 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13817 | |
| 13818 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13819 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13820 | -------------------------------------------------------------------------*/ |
| 13821 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13822 | ( NULL == pEventData->pEventData)) |
| 13823 | { |
| 13824 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13825 | "%s: Invalid parameters", __FUNCTION__); |
| 13826 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13827 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13828 | } |
| 13829 | |
| 13830 | wdiStartScanRspCb = (WDI_StartScanRspCb)pWDICtx->pfncRspCB; |
| 13831 | if( NULL == wdiStartScanRspCb) |
| 13832 | { |
| 13833 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 13834 | "%s: call back function is NULL", __FUNCTION__); |
| 13835 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13836 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13837 | } |
| 13838 | |
| 13839 | /*------------------------------------------------------------------------- |
| 13840 | Extract response and send it to UMAC |
| 13841 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13842 | wpalMemoryCopy( &halStartScanRspMsg.startScanRspParams, |
| 13843 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13844 | sizeof(halStartScanRspMsg.startScanRspParams)); |
| 13845 | |
| 13846 | wdiStartScanParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 13847 | halStartScanRspMsg.startScanRspParams.status); |
| 13848 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13849 | wdiStartScanParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13850 | halStartScanRspMsg.startScanRspParams.txMgmtPower; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13851 | wpalMemoryCopy( wdiStartScanParams.aStartTSF, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13852 | halStartScanRspMsg.startScanRspParams.startTSF, |
| 13853 | 2); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13854 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13855 | |
| 13856 | if ( eHAL_STATUS_SUCCESS != halStartScanRspMsg.startScanRspParams.status ) |
| 13857 | { |
| 13858 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13859 | "Start scan failed with status %s (%d)", |
| 13860 | WDI_getHALStatusMsgString(halStartScanRspMsg.startScanRspParams.status), |
| 13861 | halStartScanRspMsg.startScanRspParams.status); |
| 13862 | /* send the status to UMAC, don't return from here*/ |
| 13863 | } |
| 13864 | |
| 13865 | /*Notify UMAC*/ |
| 13866 | wdiStartScanRspCb( &wdiStartScanParams, pWDICtx->pRspCBUserData); |
| 13867 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13868 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13869 | |
| 13870 | }/*WDI_ProcessStartScanRsp*/ |
| 13871 | |
| 13872 | |
| 13873 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13874 | @brief Process End Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13875 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13876 | |
| 13877 | @param pWDICtx: pointer to the WLAN DAL context |
| 13878 | pEventData: pointer to the event information structure |
| 13879 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13880 | @see |
| 13881 | @return Result of the function call |
| 13882 | */ |
| 13883 | WDI_Status |
| 13884 | WDI_ProcessEndScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13885 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13886 | WDI_ControlBlockType* pWDICtx, |
| 13887 | WDI_EventInfoType* pEventData |
| 13888 | ) |
| 13889 | { |
| 13890 | WDI_Status wdiStatus; |
| 13891 | tHalEndScanRspMsg halEndScanRspMsg; |
| 13892 | WDI_EndScanRspCb wdiEndScanRspCb; |
| 13893 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13894 | |
| 13895 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13896 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13897 | -------------------------------------------------------------------------*/ |
| 13898 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13899 | ( NULL == pEventData->pEventData)) |
| 13900 | { |
| 13901 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13902 | "%s: Invalid parameters", __FUNCTION__); |
| 13903 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13904 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13905 | } |
| 13906 | |
| 13907 | wdiEndScanRspCb = (WDI_EndScanRspCb)pWDICtx->pfncRspCB; |
| 13908 | |
| 13909 | /*------------------------------------------------------------------------- |
| 13910 | Extract response and send it to UMAC |
| 13911 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13912 | wpalMemoryCopy( &halEndScanRspMsg.endScanRspParams, |
| 13913 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13914 | sizeof(halEndScanRspMsg.endScanRspParams)); |
| 13915 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13916 | wdiStatus = WDI_HAL_2_WDI_STATUS(halEndScanRspMsg.endScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13917 | |
| 13918 | if ( eHAL_STATUS_SUCCESS != halEndScanRspMsg.endScanRspParams.status ) |
| 13919 | { |
| 13920 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13921 | "End Scan failed with status %s (%d )", |
| 13922 | WDI_getHALStatusMsgString(halEndScanRspMsg.endScanRspParams.status), |
| 13923 | halEndScanRspMsg.endScanRspParams.status); |
| 13924 | /* send the status to UMAC, don't return from here*/ |
| 13925 | } |
| 13926 | |
| 13927 | /*Notify UMAC*/ |
| 13928 | wdiEndScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13929 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13930 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13931 | }/*WDI_ProcessEndScanRsp*/ |
| 13932 | |
| 13933 | |
| 13934 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13935 | @brief Process Finish Scan Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13936 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13937 | |
| 13938 | @param pWDICtx: pointer to the WLAN DAL context |
| 13939 | pEventData: pointer to the event information structure |
| 13940 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13941 | @see |
| 13942 | @return Result of the function call |
| 13943 | */ |
| 13944 | WDI_Status |
| 13945 | WDI_ProcessFinishScanRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13946 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13947 | WDI_ControlBlockType* pWDICtx, |
| 13948 | WDI_EventInfoType* pEventData |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13949 | ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13950 | { |
| 13951 | WDI_Status wdiStatus; |
| 13952 | WDI_FinishScanRspCb wdiFinishScanRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13953 | |
| 13954 | tHalFinishScanRspMsg halFinishScanRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13955 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 13956 | |
| 13957 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13958 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13959 | -------------------------------------------------------------------------*/ |
| 13960 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 13961 | ( NULL == pEventData->pEventData)) |
| 13962 | { |
| 13963 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 13964 | "%s: Invalid parameters", __FUNCTION__); |
| 13965 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13966 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13967 | } |
| 13968 | |
| 13969 | wdiFinishScanRspCb = (WDI_FinishScanRspCb)pWDICtx->pfncRspCB; |
| 13970 | |
| 13971 | /*------------------------------------------------------------------------- |
| 13972 | Extract response and send it to UMAC |
| 13973 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13974 | wpalMemoryCopy( (void *)&halFinishScanRspMsg.finishScanRspParams.status, |
| 13975 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13976 | sizeof(halFinishScanRspMsg.finishScanRspParams.status)); |
| 13977 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13978 | wdiStatus = WDI_HAL_2_WDI_STATUS(halFinishScanRspMsg.finishScanRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13979 | |
| 13980 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO_LOW, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13981 | "Finish scan response reported status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13982 | halFinishScanRspMsg.finishScanRspParams.status); |
| 13983 | |
| 13984 | if (( eHAL_STATUS_SUCCESS != halFinishScanRspMsg.finishScanRspParams.status )&& |
| 13985 | ( eHAL_STATUS_NOTIFY_BSS_FAIL != halFinishScanRspMsg.finishScanRspParams.status )) |
| 13986 | { |
| 13987 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 13988 | "Finish Scan failed with status %s (%d)", |
| 13989 | WDI_getHALStatusMsgString(halFinishScanRspMsg.finishScanRspParams.status), |
| 13990 | halFinishScanRspMsg.finishScanRspParams.status); |
| 13991 | /* send the status to UMAC, don't return from here*/ |
| 13992 | } |
| 13993 | |
| 13994 | /*Notify UMAC*/ |
| 13995 | wdiFinishScanRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 13996 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 13997 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 13998 | }/*WDI_ProcessFinishScanRsp*/ |
| 13999 | |
| 14000 | /** |
| 14001 | @brief Process Join Response function (called when a response |
| 14002 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14003 | |
| 14004 | @param pWDICtx: pointer to the WLAN DAL context |
| 14005 | pEventData: pointer to the event information structure |
| 14006 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14007 | @see |
| 14008 | @return Result of the function call |
| 14009 | */ |
| 14010 | WDI_Status |
| 14011 | WDI_ProcessJoinRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14012 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14013 | WDI_ControlBlockType* pWDICtx, |
| 14014 | WDI_EventInfoType* pEventData |
| 14015 | ) |
| 14016 | { |
| 14017 | WDI_Status wdiStatus; |
| 14018 | WDI_JoinRspCb wdiJoinRspCb; |
| 14019 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14020 | |
| 14021 | tHalJoinRspMsg halJoinRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14022 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14023 | |
| 14024 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14025 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14026 | -------------------------------------------------------------------------*/ |
| 14027 | if (( NULL == pWDICtx ) || |
| 14028 | ( NULL == pWDICtx->pfncRspCB ) || |
| 14029 | ( NULL == pEventData ) || |
| 14030 | ( NULL == pEventData->pEventData)) |
| 14031 | { |
| 14032 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14033 | "%s: Invalid parameters", __FUNCTION__); |
| 14034 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14035 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14036 | } |
| 14037 | |
| 14038 | wdiJoinRspCb = (WDI_JoinRspCb)pWDICtx->pfncRspCB; |
| 14039 | |
| 14040 | /*------------------------------------------------------------------------- |
| 14041 | Extract response and send it to UMAC |
| 14042 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14043 | wpalMemoryCopy( &halJoinRspMsg.joinRspParams, |
| 14044 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14045 | sizeof(halJoinRspMsg.joinRspParams)); |
| 14046 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14047 | wdiStatus = WDI_HAL_2_WDI_STATUS(halJoinRspMsg.joinRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14048 | |
| 14049 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14050 | |
| 14051 | /*----------------------------------------------------------------------- |
| 14052 | Join response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14053 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14054 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14055 | if (( !WDI_VALID_SESSION_IDX(pWDICtx->ucCurrentBSSSesIdx )) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14056 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14057 | { |
| 14058 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14059 | "%s: Association sequence for this BSS does not yet exist (bssIdx %d) or " |
| 14060 | "association no longer in progress %d - mysterious HAL response", |
| 14061 | __func__, pWDICtx->ucCurrentBSSSesIdx, pWDICtx->bAssociationInProgress); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14062 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14063 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14064 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14065 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14066 | } |
| 14067 | |
| 14068 | pBSSSes = &pWDICtx->aBSSSessions[pWDICtx->ucCurrentBSSSesIdx]; |
| 14069 | |
| 14070 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14071 | Join Response is only allowed in init state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14072 | -----------------------------------------------------------------------*/ |
| 14073 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14074 | { |
| 14075 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14076 | "Join only allowed in Joining state - failure state is %d " |
| 14077 | "strange HAL response", pBSSSes->wdiAssocState); |
| 14078 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14079 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14080 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14081 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14082 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14083 | } |
| 14084 | |
| 14085 | |
| 14086 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14087 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14088 | -----------------------------------------------------------------------*/ |
| 14089 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 14090 | { |
| 14091 | /*Association was failed by HAL - remove session*/ |
| 14092 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14093 | |
| 14094 | /*Association no longer in progress */ |
| 14095 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14096 | |
| 14097 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14098 | WDI_DequeueAssocRequest(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14099 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14100 | } |
| 14101 | else |
| 14102 | { |
| 14103 | /*Transition to state Joining - this may be redundant as we are supposed |
| 14104 | to be in this state already - but just to be safe*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14105 | pBSSSes->wdiAssocState = WDI_ASSOC_JOINING_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14106 | } |
| 14107 | |
| 14108 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14109 | |
| 14110 | /*Notify UMAC*/ |
| 14111 | wdiJoinRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14112 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14113 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14114 | }/*WDI_ProcessJoinRsp*/ |
| 14115 | |
| 14116 | |
| 14117 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14118 | @brief Process Config BSS Response function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14119 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14120 | |
| 14121 | @param pWDICtx: pointer to the WLAN DAL context |
| 14122 | pEventData: pointer to the event information structure |
| 14123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14124 | @see |
| 14125 | @return Result of the function call |
| 14126 | */ |
| 14127 | WDI_Status |
| 14128 | WDI_ProcessConfigBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14129 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14130 | WDI_ControlBlockType* pWDICtx, |
| 14131 | WDI_EventInfoType* pEventData |
| 14132 | ) |
| 14133 | { |
| 14134 | WDI_ConfigBSSRspParamsType wdiConfigBSSParams; |
| 14135 | WDI_ConfigBSSRspCb wdiConfigBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14136 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14137 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14138 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14139 | tConfigBssRspMsg halConfigBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14140 | WDI_AddStaParams wdiBcastAddSTAParam = {0}; |
| 14141 | WDI_AddStaParams wdiAddSTAParam = {0}; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14142 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14143 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14144 | |
| 14145 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14146 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14147 | -------------------------------------------------------------------------*/ |
| 14148 | if (( NULL == pEventData ) || |
| 14149 | ( NULL == pEventData->pEventData)) |
| 14150 | { |
| 14151 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14152 | "%s: Invalid parameters", __FUNCTION__); |
| 14153 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14154 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14155 | } |
| 14156 | |
| 14157 | wdiConfigBSSRspCb = (WDI_ConfigBSSRspCb)pWDICtx->pfncRspCB; |
| 14158 | |
| 14159 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14160 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14161 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14162 | wpalMemoryCopy( &halConfigBssRspMsg.configBssRspParams, |
| 14163 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14164 | sizeof(halConfigBssRspMsg.configBssRspParams)); |
| 14165 | |
| 14166 | wdiConfigBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 14167 | halConfigBssRspMsg.configBssRspParams.status); |
| 14168 | if(WDI_STATUS_SUCCESS == wdiConfigBSSParams.wdiStatus) |
| 14169 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14170 | wpalMemoryCopy( wdiConfigBSSParams.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14171 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.macBSSID, |
| 14172 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14173 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14174 | wdiConfigBSSParams.ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14175 | |
| 14176 | wdiConfigBSSParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14177 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14178 | |
| 14179 | wdiConfigBSSParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14180 | halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14182 | wdiConfigBSSParams.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14183 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14184 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14185 | wdiConfigBSSParams.ucTxMgmtPower = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14186 | halConfigBssRspMsg.configBssRspParams.txMgmtPower; |
| 14187 | #endif |
| 14188 | wpalMemoryCopy( wdiConfigBSSParams.macSTA, |
| 14189 | halConfigBssRspMsg.configBssRspParams.staMac, |
| 14190 | WDI_MAC_ADDR_LEN ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14191 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14192 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14193 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14194 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14195 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14196 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 14197 | wdiConfigBSSParams.macBSSID, |
| 14198 | &pBSSSes); |
| 14199 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14200 | /*----------------------------------------------------------------------- |
| 14201 | Config BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14202 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14203 | -----------------------------------------------------------------------*/ |
| 14204 | if ( NULL == pBSSSes ) |
| 14205 | { |
| 14206 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14207 | "Association sequence for this BSS does not yet exist " |
| 14208 | "- mysterious HAL response"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14209 | |
| 14210 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14211 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14212 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14213 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14214 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14216 | /*Save data for this BSS*/ |
| 14217 | pBSSSes->wdiBssType = pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiBSSType; |
| 14218 | pBSSSes->ucBSSIdx = halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14219 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14220 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14221 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14222 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14223 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14224 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14225 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14226 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14227 | pBSSSes->ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14228 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
| 14229 | pBSSSes->bcastStaIdx = |
| 14230 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14231 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14232 | /* !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] | 14233 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14234 | /*------------------------------------------------------------------------- |
| 14235 | Add Peer STA |
| 14236 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14237 | wdiAddSTAParam.ucSTAIdx = halConfigBssRspMsg.configBssRspParams.bssStaIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14238 | wdiAddSTAParam.dpuIndex = halConfigBssRspMsg.configBssRspParams.dpuDescIndx; |
| 14239 | wdiAddSTAParam.dpuSig = halConfigBssRspMsg.configBssRspParams.ucastDpuSignature; |
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 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14242 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14243 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14244 | wdiAddSTAParam.ucHTCapable = |
| 14245 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.ucHTCapable; |
| 14246 | wdiAddSTAParam.ucStaType = |
| 14247 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.wdiSTAType; |
| 14248 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14249 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14250 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 14251 | halConfigBssRspMsg.configBssRspParams.staMac, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14252 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14253 | |
| 14254 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 14255 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.wdiSTAContext.macBSSID , |
| 14256 | WDI_MAC_ADDR_LEN); |
| 14257 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14258 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14259 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14260 | halConfigBssRspMsg.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14261 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14262 | halConfigBssRspMsg.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14263 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14264 | halConfigBssRspMsg.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14265 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14266 | halConfigBssRspMsg.configBssRspParams.bcastDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14267 | wdiAddSTAParam.ucRmfEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14268 | pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucRMFEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14269 | wdiAddSTAParam.ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14270 | halConfigBssRspMsg.configBssRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14271 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14272 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 14273 | "Add STA to the table index: %d", wdiAddSTAParam.ucSTAIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14274 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14275 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 14276 | /*------------------------------------------------------------------------- |
| 14277 | Add Broadcast STA only in AP mode |
| 14278 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14279 | if( pWDICtx->wdiCachedConfigBssReq.wdiReqInfo.ucOperMode == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14280 | WDI_BSS_OPERATIONAL_MODE_AP ) |
| 14281 | { |
| 14282 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 14283 | "Add BCAST STA to table for index: %d", |
| 14284 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14285 | |
| 14286 | wpalMemoryCopy( &wdiBcastAddSTAParam, &wdiAddSTAParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14287 | sizeof(WDI_AddStaParams) ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14288 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14289 | WDI_AddBcastSTAtoSTATable( pWDICtx, &wdiBcastAddSTAParam, |
| 14290 | halConfigBssRspMsg.configBssRspParams.bssBcastStaIdx ); |
| 14291 | } |
| 14292 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14293 | } |
| 14294 | else |
| 14295 | { |
| 14296 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14297 | "Config BSS RSP failed with status : %s(%d)", |
| 14298 | WDI_getHALStatusMsgString( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14299 | halConfigBssRspMsg.configBssRspParams.status), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14300 | halConfigBssRspMsg.configBssRspParams.status); |
| 14301 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14302 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14303 | /*Association was failed by HAL - remove session*/ |
| 14304 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14305 | |
| 14306 | /*Association no longer in progress */ |
| 14307 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14308 | |
| 14309 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14310 | WDI_DequeueAssocRequest(pWDICtx); |
| 14311 | |
| 14312 | } |
| 14313 | |
| 14314 | /*Notify UMAC*/ |
| 14315 | wdiConfigBSSRspCb( &wdiConfigBSSParams, pWDICtx->pRspCBUserData); |
| 14316 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14317 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14318 | }/*WDI_ProcessConfigBSSRsp*/ |
| 14319 | |
| 14320 | |
| 14321 | /** |
| 14322 | @brief Process Del BSS Response function (called when a response |
| 14323 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14324 | |
| 14325 | @param pWDICtx: pointer to the WLAN DAL context |
| 14326 | pEventData: pointer to the event information structure |
| 14327 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14328 | @see |
| 14329 | @return Result of the function call |
| 14330 | */ |
| 14331 | WDI_Status |
| 14332 | WDI_ProcessDelBSSRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14333 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14334 | WDI_ControlBlockType* pWDICtx, |
| 14335 | WDI_EventInfoType* pEventData |
| 14336 | ) |
| 14337 | { |
| 14338 | WDI_DelBSSRspParamsType wdiDelBSSParams; |
| 14339 | WDI_DelBSSRspCb wdiDelBSSRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14340 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14341 | WDI_BSSSessionType* pBSSSes = NULL; |
| 14342 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14343 | tDeleteBssRspMsg halDelBssRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14344 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14345 | |
| 14346 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14347 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14348 | -------------------------------------------------------------------------*/ |
| 14349 | if (( NULL == pEventData ) || |
| 14350 | ( NULL == pEventData->pEventData)) |
| 14351 | { |
| 14352 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14353 | "%s: Invalid parameters", __FUNCTION__); |
| 14354 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14355 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14356 | } |
| 14357 | |
| 14358 | wdiDelBSSRspCb = (WDI_DelBSSRspCb)pWDICtx->pfncRspCB; |
| 14359 | |
| 14360 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14361 | Extract response and send it to UMAC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14362 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14363 | wpalMemoryCopy( &halDelBssRspMsg.deleteBssRspParams, |
| 14364 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14365 | sizeof(halDelBssRspMsg.deleteBssRspParams)); |
| 14366 | |
| 14367 | |
| 14368 | wdiDelBSSParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14369 | halDelBssRspMsg.deleteBssRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14370 | |
| 14371 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14372 | |
| 14373 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14374 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14375 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14376 | ucCurrentBSSSesIdx = WDI_FindAssocSessionByBSSIdx( pWDICtx, |
| 14377 | halDelBssRspMsg.deleteBssRspParams.bssIdx, |
| 14378 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14379 | |
| 14380 | /*----------------------------------------------------------------------- |
| 14381 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14382 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14383 | -----------------------------------------------------------------------*/ |
| 14384 | if ( NULL == pBSSSes ) |
| 14385 | { |
| 14386 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14387 | "Association sequence for this BSS does not yet exist or " |
| 14388 | "association no longer in progress - mysterious HAL response"); |
| 14389 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14390 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14391 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14392 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14393 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14394 | } |
| 14395 | |
| 14396 | /*Extract BSSID for the response to UMAC*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14397 | wpalMemoryCopy(wdiDelBSSParams.macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14398 | pBSSSes->macBSSID, WDI_MAC_ADDR_LEN); |
| 14399 | |
| 14400 | wdiDelBSSParams.ucBssIdx = halDelBssRspMsg.deleteBssRspParams.bssIdx; |
| 14401 | |
| 14402 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14403 | The current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14404 | -----------------------------------------------------------------------*/ |
| 14405 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14406 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14407 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14408 | /* Delete the BCAST STA entry from the STA table if SAP/GO session is deleted */ |
| 14409 | if(WDI_INFRA_AP_MODE == pBSSSes->wdiBssType) |
| 14410 | { |
| 14411 | (void)WDI_STATableDelSta( pWDICtx, pBSSSes->bcastStaIdx ); |
| 14412 | } |
| 14413 | |
| 14414 | /* Delete the STA's in this BSS */ |
| 14415 | WDI_STATableBSSDelSta(pWDICtx, halDelBssRspMsg.deleteBssRspParams.bssIdx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14416 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14417 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14418 | |
| 14419 | /*Notify UMAC*/ |
| 14420 | wdiDelBSSRspCb( &wdiDelBSSParams, pWDICtx->pRspCBUserData); |
| 14421 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14422 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14423 | }/*WDI_ProcessDelBSSRsp*/ |
| 14424 | |
| 14425 | /** |
| 14426 | @brief Process Post Assoc Rsp function (called when a response |
| 14427 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14428 | |
| 14429 | @param pWDICtx: pointer to the WLAN DAL context |
| 14430 | pEventData: pointer to the event information structure |
| 14431 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14432 | @see |
| 14433 | @return Result of the function call |
| 14434 | */ |
| 14435 | WDI_Status |
| 14436 | WDI_ProcessPostAssocRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14437 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14438 | WDI_ControlBlockType* pWDICtx, |
| 14439 | WDI_EventInfoType* pEventData |
| 14440 | ) |
| 14441 | { |
| 14442 | WDI_PostAssocRspParamsType wdiPostAssocParams; |
| 14443 | WDI_PostAssocRspCb wdiPostAssocRspCb; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14444 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14445 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14446 | tPostAssocRspMsg halPostAssocRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14447 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14448 | |
| 14449 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14450 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14451 | -------------------------------------------------------------------------*/ |
| 14452 | if (( NULL == pEventData ) || |
| 14453 | ( NULL == pEventData->pEventData)) |
| 14454 | { |
| 14455 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14456 | "%s: Invalid parameters", __FUNCTION__); |
| 14457 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14458 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14459 | } |
| 14460 | |
| 14461 | wdiPostAssocRspCb = (WDI_PostAssocRspCb)pWDICtx->pfncRspCB; |
| 14462 | |
| 14463 | /*------------------------------------------------------------------------- |
| 14464 | Extract response and send it to UMAC |
| 14465 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14466 | wpalMemoryCopy( &halPostAssocRspMsg.postAssocRspParams, |
| 14467 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14468 | sizeof(halPostAssocRspMsg.postAssocRspParams)); |
| 14469 | |
| 14470 | /*Extract the Post Assoc STA Params */ |
| 14471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14472 | wdiPostAssocParams.staParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14473 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.staIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14474 | wdiPostAssocParams.staParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14475 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14476 | wdiPostAssocParams.staParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14477 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 14478 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14479 | wdiPostAssocParams.wdiStatus = |
| 14480 | WDI_HAL_2_WDI_STATUS(halPostAssocRspMsg.postAssocRspParams.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14481 | |
| 14482 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 14483 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14484 | wpalMemoryCopy( wdiPostAssocParams.staParams.macSTA, |
| 14485 | pWDICtx->wdiCachedPostAssocReq.wdiSTAParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14486 | WDI_MAC_ADDR_LEN); |
| 14487 | |
| 14488 | /* Extract Post Assoc BSS Params */ |
| 14489 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14490 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macBSSID, |
| 14491 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.macBSSID, |
| 14492 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14493 | |
| 14494 | /*Copy the MAC addresses from the cached storage in the WDI CB as they are not |
| 14495 | included in the response */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14496 | wpalMemoryCopy( wdiPostAssocParams.bssParams.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14497 | pWDICtx->wdiCachedPostAssocReq.wdiBSSParams.wdiSTAContext |
| 14498 | .macSTA, WDI_MAC_ADDR_LEN); |
| 14499 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14500 | wdiPostAssocParams.bssParams.ucBcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14501 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucBcastSig; |
| 14502 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14503 | wdiPostAssocParams.bssParams.ucUcastSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14504 | halPostAssocRspMsg.postAssocRspParams.configStaRspParams.ucUcastSig; |
| 14505 | |
| 14506 | wdiPostAssocParams.bssParams.ucBSSIdx = |
| 14507 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 14508 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14509 | wdiPostAssocParams.bssParams.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14510 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssStaIdx; |
| 14511 | |
| 14512 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 14513 | |
| 14514 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14515 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14516 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14517 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14518 | wdiPostAssocParams.bssParams. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14519 | macBSSID, &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14520 | |
| 14521 | /*----------------------------------------------------------------------- |
| 14522 | Post assoc response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14523 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14524 | -----------------------------------------------------------------------*/ |
| 14525 | if (( NULL == pBSSSes ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14526 | ( ucCurrentBSSSesIdx != pWDICtx->ucCurrentBSSSesIdx ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14527 | ( eWLAN_PAL_FALSE == pWDICtx->bAssociationInProgress )) |
| 14528 | { |
| 14529 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14530 | "Association sequence for this BSS does not yet exist or " |
| 14531 | "association no longer in progress - mysterious HAL response"); |
| 14532 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14533 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14535 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14536 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14537 | } |
| 14538 | |
| 14539 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14540 | Post Assoc Request is only allowed in Joining state |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14541 | -----------------------------------------------------------------------*/ |
| 14542 | if ( WDI_ASSOC_JOINING_ST != pBSSSes->wdiAssocState) |
| 14543 | { |
| 14544 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14545 | "Post Assoc not allowed before JOIN - failing request " |
| 14546 | "strange HAL response"); |
| 14547 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14548 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 14549 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14550 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14551 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14552 | } |
| 14553 | |
| 14554 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14555 | If assoc has failed the current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14556 | -----------------------------------------------------------------------*/ |
| 14557 | if ( WDI_STATUS_SUCCESS != wdiPostAssocParams.wdiStatus ) |
| 14558 | { |
| 14559 | /*Association was failed by HAL - remove session*/ |
| 14560 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 14561 | } |
| 14562 | else |
| 14563 | { |
| 14564 | /*Transition to state POST Assoc*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14565 | pBSSSes->wdiAssocState = WDI_ASSOC_POST_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14566 | |
| 14567 | /*Save DPU Info*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14568 | pBSSSes->bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14569 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14570 | pBSSSes->bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14571 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.mgmtDpuSignature; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14572 | pBSSSes->bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14573 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuDescIndx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14574 | pBSSSes->bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14575 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bcastDpuSignature; |
| 14576 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14577 | pBSSSes->ucBSSIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14578 | halPostAssocRspMsg.postAssocRspParams.configBssRspParams.bssIdx; |
| 14579 | } |
| 14580 | |
| 14581 | /*Association no longer in progress */ |
| 14582 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 14583 | |
| 14584 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 14585 | WDI_DequeueAssocRequest(pWDICtx); |
| 14586 | |
| 14587 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 14588 | |
| 14589 | /*Notify UMAC*/ |
| 14590 | wdiPostAssocRspCb( &wdiPostAssocParams, 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_ProcessPostAssocRsp*/ |
| 14594 | |
| 14595 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14596 | @brief Process Del STA Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14597 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14598 | |
| 14599 | @param pWDICtx: pointer to the WLAN DAL context |
| 14600 | pEventData: pointer to the event information structure |
| 14601 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14602 | @see |
| 14603 | @return Result of the function call |
| 14604 | */ |
| 14605 | WDI_Status |
| 14606 | WDI_ProcessDelSTARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14607 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14608 | WDI_ControlBlockType* pWDICtx, |
| 14609 | WDI_EventInfoType* pEventData |
| 14610 | ) |
| 14611 | { |
| 14612 | WDI_DelSTARspParamsType wdiDelSTARsp; |
| 14613 | WDI_DelSTARspCb wdiDelSTARspCb; |
| 14614 | wpt_uint8 staType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14615 | tDeleteStaRspMsg halDelStaRspMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14616 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14617 | |
| 14618 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14619 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14620 | -------------------------------------------------------------------------*/ |
| 14621 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14622 | ( NULL == pEventData->pEventData)) |
| 14623 | { |
| 14624 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14625 | "%s: Invalid parameters", __FUNCTION__); |
| 14626 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14627 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14628 | } |
| 14629 | |
| 14630 | wdiDelSTARspCb = (WDI_DelSTARspCb)pWDICtx->pfncRspCB; |
| 14631 | |
| 14632 | /*------------------------------------------------------------------------- |
| 14633 | Extract response and send it to UMAC |
| 14634 | -------------------------------------------------------------------------*/ |
| 14635 | wpalMemoryCopy( &halDelStaRspMsg.delStaRspParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14636 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14637 | sizeof(halDelStaRspMsg.delStaRspParams)); |
| 14638 | |
| 14639 | wdiDelSTARsp.ucSTAIdx = halDelStaRspMsg.delStaRspParams.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14640 | wdiDelSTARsp.wdiStatus = |
| 14641 | WDI_HAL_2_WDI_STATUS(halDelStaRspMsg.delStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14642 | |
| 14643 | WDI_STATableGetStaType(pWDICtx, wdiDelSTARsp.ucSTAIdx, &staType); |
| 14644 | |
| 14645 | /* If the DEL STA request is for self STA do not delete it - Really weird!!What happens in concurrency */ |
| 14646 | if(staType == WDI_STA_ENTRY_SELF) |
| 14647 | { |
| 14648 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 14649 | |
| 14650 | /* At this point add the self-STA */ |
| 14651 | |
| 14652 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 14653 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 14654 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 14655 | |
| 14656 | #define WDI_DPU_SELF_STA_DEFAULT_IDX 0 |
| 14657 | #define WDI_DPU_SELF_STA_DEFAULT_SIG 0 |
| 14658 | |
| 14659 | //all DPU indices are the same for self STA |
| 14660 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14661 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14662 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuIndex = WDI_DPU_SELF_STA_DEFAULT_IDX; |
| 14663 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 14664 | pSTATable[wdiDelSTARsp.ucSTAIdx].bcastMgmtDpuSignature = WDI_DPU_SELF_STA_DEFAULT_SIG; |
| 14665 | pSTATable[wdiDelSTARsp.ucSTAIdx].dpuSig = WDI_DPU_SELF_STA_DEFAULT_SIG; |
Madan Mohan Koyyalamudi | 2f11c2e | 2012-09-24 12:15:05 -0700 | [diff] [blame] | 14666 | |
| 14667 | pSTATable[wdiDelSTARsp.ucSTAIdx].bssIdx = WDI_BSS_INVALID_IDX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14668 | } |
| 14669 | else |
| 14670 | { |
| 14671 | //Delete the station in the table |
| 14672 | WDI_STATableDelSta( pWDICtx, wdiDelSTARsp.ucSTAIdx); |
| 14673 | } |
| 14674 | |
| 14675 | /*Notify UMAC*/ |
| 14676 | wdiDelSTARspCb( &wdiDelSTARsp, pWDICtx->pRspCBUserData); |
| 14677 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14678 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14679 | }/*WDI_ProcessDelSTARsp*/ |
| 14680 | |
| 14681 | |
| 14682 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14683 | Security Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14684 | ==========================================================================*/ |
| 14685 | |
| 14686 | /** |
| 14687 | @brief Process Set BSS Key Rsp function (called when a response |
| 14688 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14689 | |
| 14690 | @param pWDICtx: pointer to the WLAN DAL context |
| 14691 | pEventData: pointer to the event information structure |
| 14692 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14693 | @see |
| 14694 | @return Result of the function call |
| 14695 | */ |
| 14696 | WDI_Status |
| 14697 | WDI_ProcessSetBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14698 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14699 | WDI_ControlBlockType* pWDICtx, |
| 14700 | WDI_EventInfoType* pEventData |
| 14701 | ) |
| 14702 | { |
| 14703 | WDI_Status wdiStatus; |
| 14704 | eHalStatus halStatus; |
| 14705 | WDI_SetBSSKeyRspCb wdiSetBSSKeyRspCb; |
| 14706 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14707 | |
| 14708 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14709 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14710 | -------------------------------------------------------------------------*/ |
| 14711 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14712 | ( NULL == pEventData->pEventData)) |
| 14713 | { |
| 14714 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14715 | "%s: Invalid parameters", __FUNCTION__); |
| 14716 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14717 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14718 | } |
| 14719 | |
| 14720 | wdiSetBSSKeyRspCb = (WDI_SetBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 14721 | |
| 14722 | /*------------------------------------------------------------------------- |
| 14723 | Extract response and send it to UMAC |
| 14724 | -------------------------------------------------------------------------*/ |
| 14725 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14726 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14727 | |
| 14728 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14729 | { |
| 14730 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14731 | "Set BSS Key failed with status %s (%d)", |
| 14732 | WDI_getHALStatusMsgString(halStatus), |
| 14733 | halStatus); |
| 14734 | /* send the status to UMAC, don't return from here*/ |
| 14735 | } |
| 14736 | |
| 14737 | /*Notify UMAC*/ |
| 14738 | wdiSetBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14739 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14740 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14741 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 14742 | |
| 14743 | /** |
| 14744 | @brief Process Remove BSS Key Rsp function (called when a response |
| 14745 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14746 | |
| 14747 | @param pWDICtx: pointer to the WLAN DAL context |
| 14748 | pEventData: pointer to the event information structure |
| 14749 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14750 | @see |
| 14751 | @return Result of the function call |
| 14752 | */ |
| 14753 | WDI_Status |
| 14754 | WDI_ProcessRemoveBssKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14755 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14756 | WDI_ControlBlockType* pWDICtx, |
| 14757 | WDI_EventInfoType* pEventData |
| 14758 | ) |
| 14759 | { |
| 14760 | WDI_Status wdiStatus; |
| 14761 | eHalStatus halStatus; |
| 14762 | WDI_RemoveBSSKeyRspCb wdiRemoveBSSKeyRspCb; |
| 14763 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14764 | |
| 14765 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14766 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14767 | -------------------------------------------------------------------------*/ |
| 14768 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14769 | ( NULL == pEventData->pEventData)) |
| 14770 | { |
| 14771 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14772 | "%s: Invalid parameters", __FUNCTION__); |
| 14773 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14774 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14775 | } |
| 14776 | |
| 14777 | wdiRemoveBSSKeyRspCb = (WDI_RemoveBSSKeyRspCb)pWDICtx->pfncRspCB; |
| 14778 | |
| 14779 | /*------------------------------------------------------------------------- |
| 14780 | Extract response and send it to UMAC |
| 14781 | -------------------------------------------------------------------------*/ |
| 14782 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14783 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14784 | |
| 14785 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14786 | { |
| 14787 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14788 | "Remove BSS Key failed with status %s (%d )", |
| 14789 | WDI_getHALStatusMsgString(halStatus), |
| 14790 | halStatus); |
| 14791 | /* send the status to UMAC, don't return from here*/ |
| 14792 | } |
| 14793 | |
| 14794 | /*Notify UMAC*/ |
| 14795 | wdiRemoveBSSKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14796 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14797 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14798 | }/*WDI_ProcessSetBssKeyRsp*/ |
| 14799 | |
| 14800 | |
| 14801 | /** |
| 14802 | @brief Process Set STA Key Rsp 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_ProcessSetStaKeyRsp |
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 | eHalStatus halStatus; |
| 14820 | WDI_SetSTAKeyRspCb wdiSetSTAKeyRspCb; |
| 14821 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14822 | |
| 14823 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14824 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14825 | -------------------------------------------------------------------------*/ |
| 14826 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14827 | ( NULL == pEventData->pEventData)) |
| 14828 | { |
| 14829 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14830 | "%s: Invalid parameters", __FUNCTION__); |
| 14831 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14832 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14833 | } |
| 14834 | |
| 14835 | wdiSetSTAKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 14836 | |
| 14837 | /*------------------------------------------------------------------------- |
| 14838 | Extract response and send it to UMAC |
| 14839 | -------------------------------------------------------------------------*/ |
| 14840 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14841 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14842 | |
| 14843 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14844 | { |
| 14845 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14846 | "Set STA Key failed with status %s (%d)", |
| 14847 | WDI_getHALStatusMsgString(halStatus), |
| 14848 | halStatus); |
| 14849 | /* send the status to UMAC, don't return from here*/ |
| 14850 | } |
| 14851 | |
| 14852 | /*Notify UMAC*/ |
| 14853 | wdiSetSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14854 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14855 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14856 | }/*WDI_ProcessSetSTAKeyRsp*/ |
| 14857 | |
| 14858 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14859 | @brief Process Remove STA Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14860 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14861 | |
| 14862 | @param pWDICtx: pointer to the WLAN DAL context |
| 14863 | pEventData: pointer to the event information structure |
| 14864 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14865 | @see |
| 14866 | @return Result of the function call |
| 14867 | */ |
| 14868 | WDI_Status |
| 14869 | WDI_ProcessRemoveStaKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14870 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14871 | WDI_ControlBlockType* pWDICtx, |
| 14872 | WDI_EventInfoType* pEventData |
| 14873 | ) |
| 14874 | { |
| 14875 | WDI_Status wdiStatus; |
| 14876 | eHalStatus halStatus; |
| 14877 | WDI_RemoveSTAKeyRspCb wdiRemoveSTAKeyRspCb; |
| 14878 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14879 | |
| 14880 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14881 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14882 | -------------------------------------------------------------------------*/ |
| 14883 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14884 | ( NULL == pEventData->pEventData)) |
| 14885 | { |
| 14886 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14887 | "%s: Invalid parameters", __FUNCTION__); |
| 14888 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14889 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14890 | } |
| 14891 | |
| 14892 | wdiRemoveSTAKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 14893 | |
| 14894 | /*------------------------------------------------------------------------- |
| 14895 | Extract response and send it to UMAC |
| 14896 | -------------------------------------------------------------------------*/ |
| 14897 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14898 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14899 | |
| 14900 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14901 | { |
| 14902 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14903 | "Remove STA Key failed with status %s (%d)", |
| 14904 | WDI_getHALStatusMsgString(halStatus), |
| 14905 | halStatus); |
| 14906 | /* send the status to UMAC, don't return from here*/ |
| 14907 | } |
| 14908 | |
| 14909 | /*Notify UMAC*/ |
| 14910 | wdiRemoveSTAKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14911 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14912 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14913 | }/*WDI_ProcessRemoveStaKeyRsp*/ |
| 14914 | |
| 14915 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14916 | @brief Process Set STA Bcast Key Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14917 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14918 | |
| 14919 | @param pWDICtx: pointer to the WLAN DAL context |
| 14920 | pEventData: pointer to the event information structure |
| 14921 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14922 | @see |
| 14923 | @return Result of the function call |
| 14924 | */ |
| 14925 | WDI_Status |
| 14926 | WDI_ProcessSetStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14927 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14928 | WDI_ControlBlockType* pWDICtx, |
| 14929 | WDI_EventInfoType* pEventData |
| 14930 | ) |
| 14931 | { |
| 14932 | WDI_Status wdiStatus; |
| 14933 | eHalStatus halStatus; |
| 14934 | WDI_SetSTAKeyRspCb wdiSetSTABcastKeyRspCb; |
| 14935 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14936 | |
| 14937 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14938 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14939 | -------------------------------------------------------------------------*/ |
| 14940 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 14941 | ( NULL == pEventData->pEventData)) |
| 14942 | { |
| 14943 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 14944 | "%s: Invalid parameters", __FUNCTION__); |
| 14945 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14946 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14947 | } |
| 14948 | |
| 14949 | wdiSetSTABcastKeyRspCb = (WDI_SetSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 14950 | |
| 14951 | /*------------------------------------------------------------------------- |
| 14952 | Extract response and send it to UMAC |
| 14953 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14954 | wpalMemoryCopy( &halStatus, |
| 14955 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14956 | sizeof(halStatus)); |
| 14957 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14958 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14959 | |
| 14960 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 14961 | { |
| 14962 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 14963 | "Set STA Key failed with status %s (%d)", |
| 14964 | WDI_getHALStatusMsgString(halStatus), |
| 14965 | halStatus); |
| 14966 | /* send the status to UMAC, don't return from here*/ |
| 14967 | } |
| 14968 | |
| 14969 | /*Notify UMAC*/ |
| 14970 | wdiSetSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 14971 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14972 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14973 | }/*WDI_ProcessSetSTABcastKeyRsp*/ |
| 14974 | |
| 14975 | /** |
| 14976 | @brief Process Remove STA Bcast Key Rsp function (called when a |
| 14977 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14978 | |
| 14979 | @param pWDICtx: pointer to the WLAN DAL context |
| 14980 | pEventData: pointer to the event information structure |
| 14981 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14982 | @see |
| 14983 | @return Result of the function call |
| 14984 | */ |
| 14985 | WDI_Status |
| 14986 | WDI_ProcessRemoveStaBcastKeyRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14987 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14988 | WDI_ControlBlockType* pWDICtx, |
| 14989 | WDI_EventInfoType* pEventData |
| 14990 | ) |
| 14991 | { |
| 14992 | WDI_Status wdiStatus; |
| 14993 | eHalStatus halStatus; |
| 14994 | WDI_RemoveSTAKeyRspCb wdiRemoveSTABcastKeyRspCb; |
| 14995 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 14996 | |
| 14997 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 14998 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 14999 | -------------------------------------------------------------------------*/ |
| 15000 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15001 | ( NULL == pEventData->pEventData)) |
| 15002 | { |
| 15003 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15004 | "%s: Invalid parameters", __FUNCTION__); |
| 15005 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15006 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15007 | } |
| 15008 | |
| 15009 | wdiRemoveSTABcastKeyRspCb = (WDI_RemoveSTAKeyRspCb)pWDICtx->pfncRspCB; |
| 15010 | |
| 15011 | /*------------------------------------------------------------------------- |
| 15012 | Extract response and send it to UMAC |
| 15013 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15014 | wpalMemoryCopy( &halStatus, |
| 15015 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15016 | sizeof(halStatus)); |
| 15017 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15018 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15019 | |
| 15020 | if ( eHAL_STATUS_SUCCESS != halStatus ) |
| 15021 | { |
| 15022 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15023 | "Remove STA Key failed with status %s (%d)", |
| 15024 | WDI_getHALStatusMsgString(halStatus), |
| 15025 | halStatus); |
| 15026 | /* send the status to UMAC, don't return from here*/ |
| 15027 | } |
| 15028 | |
| 15029 | /*Notify UMAC*/ |
| 15030 | wdiRemoveSTABcastKeyRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15031 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15032 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15033 | }/*WDI_ProcessRemoveStaBcastKeyRsp*/ |
| 15034 | |
| 15035 | |
| 15036 | /*========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15037 | QoS and BA Response Processing Functions |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15038 | ==========================================================================*/ |
| 15039 | |
| 15040 | /** |
| 15041 | @brief Process Add TSpec Rsp function (called when a response |
| 15042 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15043 | |
| 15044 | @param pWDICtx: pointer to the WLAN DAL context |
| 15045 | pEventData: pointer to the event information structure |
| 15046 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15047 | @see |
| 15048 | @return Result of the function call |
| 15049 | */ |
| 15050 | WDI_Status |
| 15051 | WDI_ProcessAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15052 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15053 | WDI_ControlBlockType* pWDICtx, |
| 15054 | WDI_EventInfoType* pEventData |
| 15055 | ) |
| 15056 | { |
| 15057 | WDI_Status wdiStatus; |
| 15058 | eHalStatus halStatus; |
| 15059 | WDI_AddTsRspCb wdiAddTsRspCb; |
| 15060 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15061 | |
| 15062 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15063 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15064 | -------------------------------------------------------------------------*/ |
| 15065 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15066 | ( NULL == pEventData->pEventData)) |
| 15067 | { |
| 15068 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15069 | "%s: Invalid parameters", __FUNCTION__); |
| 15070 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15071 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15072 | } |
| 15073 | |
| 15074 | wdiAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 15075 | |
| 15076 | /*------------------------------------------------------------------------- |
| 15077 | Extract response and send it to UMAC |
| 15078 | -------------------------------------------------------------------------*/ |
| 15079 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15080 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15081 | |
| 15082 | /*Notify UMAC*/ |
| 15083 | wdiAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15084 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15085 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15086 | }/*WDI_ProcessAddTSpecRsp*/ |
| 15087 | |
| 15088 | |
| 15089 | /** |
| 15090 | @brief Process Del TSpec Rsp function (called when a response |
| 15091 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15092 | |
| 15093 | @param pWDICtx: pointer to the WLAN DAL context |
| 15094 | pEventData: pointer to the event information structure |
| 15095 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15096 | @see |
| 15097 | @return Result of the function call |
| 15098 | */ |
| 15099 | WDI_Status |
| 15100 | WDI_ProcessDelTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15101 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15102 | WDI_ControlBlockType* pWDICtx, |
| 15103 | WDI_EventInfoType* pEventData |
| 15104 | ) |
| 15105 | { |
| 15106 | WDI_Status wdiStatus; |
| 15107 | eHalStatus halStatus; |
| 15108 | WDI_DelTsRspCb wdiDelTsRspCb; |
| 15109 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15110 | |
| 15111 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15112 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15113 | -------------------------------------------------------------------------*/ |
| 15114 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15115 | ( NULL == pEventData->pEventData)) |
| 15116 | { |
| 15117 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15118 | "%s: Invalid parameters", __FUNCTION__); |
| 15119 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15120 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15121 | } |
| 15122 | |
| 15123 | wdiDelTsRspCb = (WDI_DelTsRspCb)pWDICtx->pfncRspCB; |
| 15124 | |
| 15125 | /*------------------------------------------------------------------------- |
| 15126 | Extract response and send it to UMAC |
| 15127 | -------------------------------------------------------------------------*/ |
| 15128 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15129 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15130 | |
| 15131 | /*Notify UMAC*/ |
| 15132 | wdiDelTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15133 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15134 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15135 | }/*WDI_ProcessDelTSpecRsp*/ |
| 15136 | |
| 15137 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15138 | @brief Process Update EDCA Parameters Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15139 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15140 | |
| 15141 | @param pWDICtx: pointer to the WLAN DAL context |
| 15142 | pEventData: pointer to the event information structure |
| 15143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15144 | @see |
| 15145 | @return Result of the function call |
| 15146 | */ |
| 15147 | WDI_Status |
| 15148 | WDI_ProcessUpdateEDCAParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15149 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15150 | WDI_ControlBlockType* pWDICtx, |
| 15151 | WDI_EventInfoType* pEventData |
| 15152 | ) |
| 15153 | { |
| 15154 | WDI_Status wdiStatus; |
| 15155 | eHalStatus halStatus; |
| 15156 | WDI_UpdateEDCAParamsRspCb wdiUpdateEDCAParamsRspCb; |
| 15157 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15158 | |
| 15159 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15160 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15161 | -------------------------------------------------------------------------*/ |
| 15162 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15163 | ( NULL == pEventData->pEventData)) |
| 15164 | { |
| 15165 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15166 | "%s: Invalid parameters", __FUNCTION__); |
| 15167 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15168 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15169 | } |
| 15170 | |
| 15171 | wdiUpdateEDCAParamsRspCb = (WDI_UpdateEDCAParamsRspCb)pWDICtx->pfncRspCB; |
| 15172 | |
| 15173 | /*------------------------------------------------------------------------- |
| 15174 | Extract response and send it to UMAC |
| 15175 | -------------------------------------------------------------------------*/ |
| 15176 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15177 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15178 | |
| 15179 | /*Notify UMAC*/ |
| 15180 | wdiUpdateEDCAParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15181 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15182 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15183 | }/*WDI_ProcessUpdateEDCAParamsRsp*/ |
| 15184 | |
| 15185 | |
| 15186 | /** |
| 15187 | @brief Process Add BA Rsp function (called when a response |
| 15188 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15189 | |
| 15190 | @param pWDICtx: pointer to the WLAN DAL context |
| 15191 | pEventData: pointer to the event information structure |
| 15192 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15193 | @see |
| 15194 | @return Result of the function call |
| 15195 | */ |
| 15196 | WDI_Status |
| 15197 | WDI_ProcessAddBASessionRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15198 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15199 | WDI_ControlBlockType* pWDICtx, |
| 15200 | WDI_EventInfoType* pEventData |
| 15201 | ) |
| 15202 | { |
| 15203 | WDI_AddBASessionRspCb wdiAddBASessionRspCb; |
| 15204 | |
| 15205 | tAddBASessionRspParams halBASessionRsp; |
| 15206 | WDI_AddBASessionRspParamsType wdiBASessionRsp; |
| 15207 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15208 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15209 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15210 | |
| 15211 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15212 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15213 | -------------------------------------------------------------------------*/ |
| 15214 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15215 | ( NULL == pEventData->pEventData)) |
| 15216 | { |
| 15217 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15218 | "%s: Invalid parameters", __FUNCTION__); |
| 15219 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15220 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15221 | } |
| 15222 | |
| 15223 | wdiAddBASessionRspCb = (WDI_AddBASessionRspCb)pWDICtx->pfncRspCB; |
| 15224 | |
| 15225 | /*------------------------------------------------------------------------- |
| 15226 | Extract response and send it to UMAC |
| 15227 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15228 | wpalMemoryCopy( &halBASessionRsp, |
| 15229 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15230 | sizeof(halBASessionRsp)); |
| 15231 | |
| 15232 | wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status); |
| 15233 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 15234 | if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15235 | { |
| 15236 | wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken; |
| 15237 | wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID; |
| 15238 | wdiBASessionRsp.ucBaBufferSize = halBASessionRsp.baBufferSize; |
| 15239 | wdiBASessionRsp.usBaSessionID = halBASessionRsp.baSessionID; |
| 15240 | wdiBASessionRsp.ucWinSize = halBASessionRsp.winSize; |
| 15241 | wdiBASessionRsp.ucSTAIdx = halBASessionRsp.STAID; |
| 15242 | wdiBASessionRsp.usBaSSN = halBASessionRsp.SSN; |
| 15243 | } |
| 15244 | |
| 15245 | /*Notify UMAC*/ |
| 15246 | wdiAddBASessionRspCb( &wdiBASessionRsp, pWDICtx->pRspCBUserData); |
| 15247 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15248 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15249 | }/*WDI_ProcessAddSessionBARsp*/ |
| 15250 | |
| 15251 | |
| 15252 | /** |
| 15253 | @brief Process Del BA Rsp function (called when a response |
| 15254 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15255 | |
| 15256 | @param pWDICtx: pointer to the WLAN DAL context |
| 15257 | pEventData: pointer to the event information structure |
| 15258 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15259 | @see |
| 15260 | @return Result of the function call |
| 15261 | */ |
| 15262 | WDI_Status |
| 15263 | WDI_ProcessDelBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15264 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15265 | WDI_ControlBlockType* pWDICtx, |
| 15266 | WDI_EventInfoType* pEventData |
| 15267 | ) |
| 15268 | { |
| 15269 | WDI_Status wdiStatus; |
| 15270 | eHalStatus halStatus; |
| 15271 | WDI_DelBARspCb wdiDelBARspCb; |
| 15272 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15273 | |
| 15274 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15275 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15276 | -------------------------------------------------------------------------*/ |
| 15277 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15278 | ( NULL == pEventData->pEventData)) |
| 15279 | { |
| 15280 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15281 | "%s: Invalid parameters", __FUNCTION__); |
| 15282 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15283 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15284 | } |
| 15285 | |
| 15286 | wdiDelBARspCb = (WDI_DelBARspCb)pWDICtx->pfncRspCB; |
| 15287 | |
| 15288 | /*------------------------------------------------------------------------- |
| 15289 | Extract response and send it to UMAC |
| 15290 | -------------------------------------------------------------------------*/ |
| 15291 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15292 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15293 | |
| 15294 | if ( eHAL_STATUS_SUCCESS == halStatus ) |
| 15295 | { |
| 15296 | /*! TO DO: I should notify the DAL Data Path that the BA was deleted*/ |
| 15297 | } |
| 15298 | |
| 15299 | /*Notify UMAC*/ |
| 15300 | wdiDelBARspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15301 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15302 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15303 | }/*WDI_ProcessDelBARsp*/ |
| 15304 | |
| 15305 | #ifdef FEATURE_WLAN_CCX |
| 15306 | /** |
| 15307 | @brief Process TSM Stats Rsp function (called when a response |
| 15308 | is being received over the bus from HAL) |
| 15309 | |
| 15310 | @param pWDICtx: pointer to the WLAN DAL context |
| 15311 | pEventData: pointer to the event information structure |
| 15312 | |
| 15313 | @see |
| 15314 | @return Result of the function call |
| 15315 | */ |
| 15316 | WDI_Status |
| 15317 | WDI_ProcessTsmStatsRsp |
| 15318 | ( |
| 15319 | WDI_ControlBlockType* pWDICtx, |
| 15320 | WDI_EventInfoType* pEventData |
| 15321 | ) |
| 15322 | { |
| 15323 | WDI_TsmRspCb wdiTsmStatsRspCb; |
| 15324 | tTsmStatsRspMsg halTsmStatsRspMsg; |
| 15325 | WDI_TSMStatsRspParamsType wdiTsmStatsRspParams; |
| 15326 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15327 | |
| 15328 | /*------------------------------------------------------------------------- |
| 15329 | Sanity check |
| 15330 | -------------------------------------------------------------------------*/ |
| 15331 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15332 | ( NULL == pEventData->pEventData)) |
| 15333 | { |
| 15334 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15335 | "%s: Invalid parameters", __FUNCTION__); |
| 15336 | WDI_ASSERT(0); |
| 15337 | return WDI_STATUS_E_FAILURE; |
| 15338 | } |
| 15339 | |
| 15340 | wdiTsmStatsRspCb = (WDI_TsmRspCb)pWDICtx->pfncRspCB; |
| 15341 | |
| 15342 | /*------------------------------------------------------------------------- |
| 15343 | Unpack HAL Response Message - the header was already extracted by the |
| 15344 | main Response Handling procedure |
| 15345 | -------------------------------------------------------------------------*/ |
| 15346 | wpalMemoryCopy( &halTsmStatsRspMsg.tsmStatsRspParams, |
| 15347 | pEventData->pEventData, |
| 15348 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams)); |
| 15349 | |
| 15350 | wdiTsmStatsRspParams.UplinkPktQueueDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDly; |
| 15351 | wpalMemoryCopy( wdiTsmStatsRspParams.UplinkPktQueueDlyHist, |
| 15352 | halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist, |
| 15353 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist)/ |
| 15354 | sizeof(halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktQueueDlyHist[0])); |
| 15355 | wdiTsmStatsRspParams.UplinkPktTxDly = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktTxDly; |
| 15356 | wdiTsmStatsRspParams.UplinkPktLoss = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktLoss; |
| 15357 | wdiTsmStatsRspParams.UplinkPktCount = halTsmStatsRspMsg.tsmStatsRspParams.UplinkPktCount; |
| 15358 | wdiTsmStatsRspParams.RoamingCount = halTsmStatsRspMsg.tsmStatsRspParams.RoamingCount; |
| 15359 | wdiTsmStatsRspParams.RoamingDly = halTsmStatsRspMsg.tsmStatsRspParams.RoamingDly; |
| 15360 | wdiTsmStatsRspParams.wdiStatus = WDI_HAL_2_WDI_STATUS( |
| 15361 | halTsmStatsRspMsg.tsmStatsRspParams.status); |
| 15362 | |
| 15363 | /*Notify UMAC*/ |
| 15364 | wdiTsmStatsRspCb( &wdiTsmStatsRspParams, pWDICtx->pRspCBUserData); |
| 15365 | |
| 15366 | return WDI_STATUS_SUCCESS; |
| 15367 | }/*WDI_ProcessTsmStatsRsp*/ |
| 15368 | |
| 15369 | #endif |
| 15370 | |
| 15371 | |
| 15372 | |
| 15373 | /** |
| 15374 | @brief Process Flush AC Rsp function (called when a response |
| 15375 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15376 | |
| 15377 | @param pWDICtx: pointer to the WLAN DAL context |
| 15378 | pEventData: pointer to the event information structure |
| 15379 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15380 | @see |
| 15381 | @return Result of the function call |
| 15382 | */ |
| 15383 | WDI_Status |
| 15384 | WDI_ProcessFlushAcRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15385 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15386 | WDI_ControlBlockType* pWDICtx, |
| 15387 | WDI_EventInfoType* pEventData |
| 15388 | ) |
| 15389 | { |
| 15390 | WDI_Status wdiStatus; |
| 15391 | eHalStatus halStatus; |
| 15392 | WDI_FlushAcRspCb wdiFlushAcRspCb; |
| 15393 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15394 | |
| 15395 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15396 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15397 | -------------------------------------------------------------------------*/ |
| 15398 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15399 | ( NULL == pEventData->pEventData)) |
| 15400 | { |
| 15401 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15402 | "%s: Invalid parameters", __FUNCTION__); |
| 15403 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15404 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15405 | } |
| 15406 | |
| 15407 | wdiFlushAcRspCb = (WDI_FlushAcRspCb)pWDICtx->pfncRspCB; |
| 15408 | |
| 15409 | /*------------------------------------------------------------------------- |
| 15410 | Extract response and send it to UMAC |
| 15411 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15412 | wpalMemoryCopy( &halStatus, |
| 15413 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15414 | sizeof(halStatus)); |
| 15415 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15416 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15417 | |
| 15418 | /*Notify UMAC*/ |
| 15419 | wdiFlushAcRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15420 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15421 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15422 | }/*WDI_ProcessFlushAcRsp*/ |
| 15423 | |
| 15424 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15425 | @brief Process BT AMP event Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15426 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15427 | |
| 15428 | @param pWDICtx: pointer to the WLAN DAL context |
| 15429 | pEventData: pointer to the event information structure |
| 15430 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15431 | @see |
| 15432 | @return Result of the function call |
| 15433 | */ |
| 15434 | WDI_Status |
| 15435 | WDI_ProcessBtAmpEventRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15436 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15437 | WDI_ControlBlockType* pWDICtx, |
| 15438 | WDI_EventInfoType* pEventData |
| 15439 | ) |
| 15440 | { |
| 15441 | WDI_Status wdiStatus; |
| 15442 | eHalStatus halStatus; |
| 15443 | WDI_BtAmpEventRspCb wdiBtAmpEventRspCb; |
| 15444 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15445 | |
| 15446 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15447 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15448 | -------------------------------------------------------------------------*/ |
| 15449 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15450 | ( NULL == pEventData->pEventData)) |
| 15451 | { |
| 15452 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15453 | "%s: Invalid parameters", __FUNCTION__); |
| 15454 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15455 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15456 | } |
| 15457 | |
| 15458 | wdiBtAmpEventRspCb = (WDI_BtAmpEventRspCb)pWDICtx->pfncRspCB; |
| 15459 | |
| 15460 | /*------------------------------------------------------------------------- |
| 15461 | Extract response and send it to UMAC |
| 15462 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15463 | wpalMemoryCopy( &halStatus, |
| 15464 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15465 | sizeof(halStatus)); |
| 15466 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15467 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15468 | |
| 15469 | /*Notify UMAC*/ |
| 15470 | wdiBtAmpEventRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 15471 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15472 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15473 | }/*WDI_ProcessBtAmpEventRsp*/ |
| 15474 | |
| 15475 | |
| 15476 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15477 | @brief Process ADD STA SELF Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15478 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15479 | |
| 15480 | @param pWDICtx: pointer to the WLAN DAL context |
| 15481 | pEventData: pointer to the event information structure |
| 15482 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15483 | @see |
| 15484 | @return Result of the function call |
| 15485 | */ |
| 15486 | WDI_Status |
| 15487 | WDI_ProcessAddSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15488 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15489 | WDI_ControlBlockType* pWDICtx, |
| 15490 | WDI_EventInfoType* pEventData |
| 15491 | ) |
| 15492 | { |
| 15493 | WDI_AddSTASelfRspParamsType wdiAddSTASelfParams; |
| 15494 | WDI_AddSTASelfParamsRspCb wdiAddSTASelfReqParamsRspCb; |
| 15495 | tAddStaSelfRspMsg halAddStaSelfRsp; |
| 15496 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 15497 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15498 | |
| 15499 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15500 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15501 | -------------------------------------------------------------------------*/ |
| 15502 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15503 | ( NULL == pEventData->pEventData)) |
| 15504 | { |
| 15505 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15506 | "%s: Invalid parameters", __FUNCTION__); |
| 15507 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15508 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15509 | } |
| 15510 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15511 | wdiAddSTASelfReqParamsRspCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15512 | (WDI_AddSTASelfParamsRspCb)pWDICtx->pfncRspCB; |
| 15513 | |
| 15514 | /*------------------------------------------------------------------------- |
| 15515 | Extract response and send it to UMAC |
| 15516 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15517 | wpalMemoryCopy( &halAddStaSelfRsp.addStaSelfRspParams, |
| 15518 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15519 | sizeof(halAddStaSelfRsp.addStaSelfRspParams)); |
| 15520 | |
| 15521 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15522 | wdiAddSTASelfParams.wdiStatus = |
| 15523 | WDI_HAL_2_WDI_STATUS(halAddStaSelfRsp.addStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15524 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15525 | wdiAddSTASelfParams.ucSTASelfIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15526 | halAddStaSelfRsp.addStaSelfRspParams.selfStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15527 | wdiAddSTASelfParams.dpuIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15528 | halAddStaSelfRsp.addStaSelfRspParams.dpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15529 | wdiAddSTASelfParams.dpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15530 | halAddStaSelfRsp.addStaSelfRspParams.dpuSignature; |
| 15531 | |
| 15532 | wpalMemoryCopy(wdiAddSTASelfParams.macSelfSta, |
| 15533 | pWDICtx->wdiCacheAddSTASelfReq.wdiAddSTASelfInfo.selfMacAddr, |
| 15534 | WDI_MAC_ADDR_LEN); |
| 15535 | |
| 15536 | |
| 15537 | #ifdef HAL_SELF_STA_PER_BSS |
| 15538 | |
| 15539 | /* At this point add the self-STA */ |
| 15540 | |
| 15541 | /*! TO DO: wdiAddSTAParam.ucWmmEnabled */ |
| 15542 | /*! TO DO: wdiAddSTAParam.ucHTCapable */ |
| 15543 | /*! TO DO: wdiAddSTAParam.ucRmfEnabled */ |
| 15544 | |
| 15545 | //all DPU indices are the same for self STA |
| 15546 | |
| 15547 | /*DPU Information*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15548 | wdiAddSTAParam.dpuIndex = wdiAddSTASelfParams.dpuIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15549 | wdiAddSTAParam.dpuSig = wdiAddSTASelfParams.dpuSignature; |
| 15550 | wdiAddSTAParam.bcastDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 15551 | wdiAddSTAParam.bcastMgmtDpuSignature = wdiAddSTASelfParams.dpuSignature; |
| 15552 | wdiAddSTAParam.bcastDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 15553 | wdiAddSTAParam.bcastMgmtDpuIndex = wdiAddSTASelfParams.dpuIdx; |
| 15554 | |
| 15555 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, wdiAddSTASelfParams.macSelfSta, |
| 15556 | WDI_MAC_ADDR_LEN); |
| 15557 | |
| 15558 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_SELF; /* 0 - self */ |
| 15559 | wdiAddSTAParam.ucSTAIdx = wdiAddSTASelfParams.ucSTASelfIdx; |
| 15560 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15561 | if(halAddStaSelfRsp.addStaSelfRspParams.status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15562 | != eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO) |
| 15563 | { |
| 15564 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 15565 | } |
| 15566 | #endif |
| 15567 | |
| 15568 | /*Notify UMAC*/ |
| 15569 | wdiAddSTASelfReqParamsRspCb( &wdiAddSTASelfParams, pWDICtx->pRspCBUserData); |
| 15570 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15571 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15572 | }/*WDI_ProcessAddSTASelfRsp*/ |
| 15573 | |
| 15574 | |
| 15575 | |
| 15576 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15577 | @brief WDI_ProcessDelSTASelfRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15578 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15579 | |
| 15580 | @param pWDICtx: pointer to the WLAN DAL context |
| 15581 | pEventData: pointer to the event information structure |
| 15582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15583 | @see |
| 15584 | @return Result of the function call |
| 15585 | */ |
| 15586 | WDI_Status |
| 15587 | WDI_ProcessDelSTASelfRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15588 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15589 | WDI_ControlBlockType* pWDICtx, |
| 15590 | WDI_EventInfoType* pEventData |
| 15591 | ) |
| 15592 | { |
| 15593 | WDI_DelSTASelfRspParamsType wdiDelStaSelfRspParams; |
| 15594 | WDI_DelSTASelfRspCb wdiDelStaSelfRspCb; |
| 15595 | tDelStaSelfRspParams delStaSelfRspParams; |
| 15596 | wpt_uint8 ucStaIdx; |
| 15597 | |
| 15598 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15599 | |
| 15600 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15601 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15602 | -------------------------------------------------------------------------*/ |
| 15603 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15604 | ( NULL == pEventData->pEventData)) |
| 15605 | { |
| 15606 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15607 | "%s: Invalid parameters", __FUNCTION__); |
| 15608 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15609 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15610 | } |
| 15611 | |
| 15612 | wdiDelStaSelfRspCb = (WDI_DelSTASelfRspCb)pWDICtx->pfncRspCB; |
| 15613 | |
| 15614 | /*------------------------------------------------------------------------- |
| 15615 | Extract response and send it to UMAC |
| 15616 | -------------------------------------------------------------------------*/ |
| 15617 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15618 | wpalMemoryCopy( &delStaSelfRspParams, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15619 | (wpt_uint8*)pEventData->pEventData, |
| 15620 | sizeof(tDelStaSelfRspParams)); |
| 15621 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15622 | wdiDelStaSelfRspParams.wdiStatus = |
| 15623 | WDI_HAL_2_WDI_STATUS(delStaSelfRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15624 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15625 | /* delStaSelfRspParams.status is not |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15626 | eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO*/ |
| 15627 | if( eHAL_STATUS_SUCCESS == delStaSelfRspParams.status ) |
| 15628 | { |
| 15629 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15630 | wdiStatus = WDI_STATableFindStaidByAddr(pWDICtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15631 | delStaSelfRspParams.selfMacAddr, |
| 15632 | &ucStaIdx); |
| 15633 | if(WDI_STATUS_E_FAILURE == wdiStatus) |
| 15634 | { |
| 15635 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15636 | "%s: Unable to extract the STA Idx ", __FUNCTION__); |
| 15637 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15638 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15639 | } |
| 15640 | WDI_STATableDelSta(pWDICtx, ucStaIdx); |
| 15641 | } |
| 15642 | |
| 15643 | /*Notify UMAC*/ |
| 15644 | wdiDelStaSelfRspCb(&wdiDelStaSelfRspParams, (void*) pWDICtx->pRspCBUserData); |
| 15645 | |
| 15646 | return WDI_STATUS_SUCCESS; |
| 15647 | } |
| 15648 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15649 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 15650 | /** |
| 15651 | @brief Start Oem Data Rsp function (called when a |
| 15652 | response is being received over the bus from HAL) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15653 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15654 | @param pWDICtx: pointer to the WLAN DAL context |
| 15655 | pEventData: pointer to the event information structure |
| 15656 | |
| 15657 | @see |
| 15658 | @return Result of the function call |
| 15659 | */ |
| 15660 | #define OFFSET_OF(structType,fldName) (&((structType*)0)->fldName) |
| 15661 | |
| 15662 | WDI_Status |
| 15663 | WDI_ProcessStartOemDataRsp |
| 15664 | ( |
| 15665 | WDI_ControlBlockType* pWDICtx, |
| 15666 | WDI_EventInfoType* pEventData |
| 15667 | ) |
| 15668 | { |
| 15669 | WDI_oemDataRspCb wdiOemDataRspCb; |
| 15670 | WDI_oemDataRspParamsType* wdiOemDataRspParams; |
| 15671 | tStartOemDataRspParams* halStartOemDataRspParams; |
| 15672 | |
| 15673 | /*------------------------------------------------------------------------- |
| 15674 | Sanity check |
| 15675 | -------------------------------------------------------------------------*/ |
| 15676 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15677 | ( NULL == pEventData->pEventData)) |
| 15678 | { |
| 15679 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15680 | "%s: Invalid parameters", __FUNCTION__); |
| 15681 | WDI_ASSERT(0); |
| 15682 | return WDI_STATUS_E_FAILURE; |
| 15683 | } |
| 15684 | |
| 15685 | wdiOemDataRspCb = (WDI_oemDataRspCb)pWDICtx->pfncRspCB; |
| 15686 | |
| 15687 | /*------------------------------------------------------------------------- |
| 15688 | Extract response and send it to UMAC |
| 15689 | -------------------------------------------------------------------------*/ |
| 15690 | halStartOemDataRspParams = (tStartOemDataRspParams *)pEventData->pEventData; |
| 15691 | |
| 15692 | |
| 15693 | //It is the responsibility of the application code to check for failure |
| 15694 | //conditions! |
| 15695 | |
| 15696 | //Allocate memory for WDI OEM DATA RSP structure |
| 15697 | wdiOemDataRspParams = wpalMemoryAllocate(sizeof(WDI_oemDataRspParamsType)) ; |
| 15698 | |
| 15699 | if(NULL == wdiOemDataRspParams) |
| 15700 | { |
| 15701 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15702 | "Failed to allocate memory in OEM DATA Response %x %x %x ", |
| 15703 | pWDICtx, pEventData, pEventData->pEventData); |
| 15704 | WDI_ASSERT(0); |
| 15705 | return WDI_STATUS_E_FAILURE; |
| 15706 | } |
| 15707 | |
| 15708 | /* Populate WDI structure members */ |
| 15709 | wpalMemoryCopy(wdiOemDataRspParams->oemDataRsp, halStartOemDataRspParams->oemDataRsp, OEM_DATA_RSP_SIZE); |
| 15710 | |
| 15711 | /*Notify UMAC*/ |
| 15712 | wdiOemDataRspCb(wdiOemDataRspParams, pWDICtx->pRspCBUserData); |
| 15713 | |
| 15714 | //Free memory allocated for WDI OEM_DATA MEAS RSP structure |
| 15715 | wpalMemoryFree(wdiOemDataRspParams); |
| 15716 | |
| 15717 | return WDI_STATUS_SUCCESS; |
| 15718 | }/*WDI_PrcoessStartOemDataRsp*/ |
| 15719 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15720 | |
| 15721 | /*=========================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15722 | Miscellaneous Control Response Processing API |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15723 | ===========================================================================*/ |
| 15724 | |
| 15725 | /** |
| 15726 | @brief Process Channel Switch Rsp function (called when a response |
| 15727 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15728 | |
| 15729 | @param pWDICtx: pointer to the WLAN DAL context |
| 15730 | pEventData: pointer to the event information structure |
| 15731 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15732 | @see |
| 15733 | @return Result of the function call |
| 15734 | */ |
| 15735 | WDI_Status |
| 15736 | WDI_ProcessChannelSwitchRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15737 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15738 | WDI_ControlBlockType* pWDICtx, |
| 15739 | WDI_EventInfoType* pEventData |
| 15740 | ) |
| 15741 | { |
| 15742 | WDI_SwitchCHRspParamsType wdiSwitchChRsp; |
| 15743 | WDI_SwitchChRspCb wdiChSwitchRspCb; |
| 15744 | tSwitchChannelRspParams halSwitchChannelRsp; |
| 15745 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15746 | |
| 15747 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15748 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15749 | -------------------------------------------------------------------------*/ |
| 15750 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15751 | ( NULL == pEventData->pEventData)) |
| 15752 | { |
| 15753 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15754 | "%s: Invalid parameters", __FUNCTION__); |
| 15755 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15756 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15757 | } |
| 15758 | |
| 15759 | wdiChSwitchRspCb = (WDI_SwitchChRspCb)pWDICtx->pfncRspCB; |
| 15760 | |
| 15761 | /*------------------------------------------------------------------------- |
| 15762 | Extract response and send it to UMAC |
| 15763 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15764 | wpalMemoryCopy( &halSwitchChannelRsp, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15765 | (wpt_uint8*)pEventData->pEventData, |
| 15766 | sizeof(halSwitchChannelRsp)); |
| 15767 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15768 | wdiSwitchChRsp.wdiStatus = |
| 15769 | WDI_HAL_2_WDI_STATUS(halSwitchChannelRsp.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15770 | wdiSwitchChRsp.ucChannel = halSwitchChannelRsp.channelNumber; |
| 15771 | |
| 15772 | #ifdef WLAN_FEATURE_VOWIFI |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15773 | wdiSwitchChRsp.ucTxMgmtPower = halSwitchChannelRsp.txMgmtPower; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15774 | #endif |
| 15775 | |
| 15776 | /*Notify UMAC*/ |
| 15777 | wdiChSwitchRspCb( &wdiSwitchChRsp, pWDICtx->pRspCBUserData); |
| 15778 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15779 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15780 | }/*WDI_ProcessChannelSwitchRsp*/ |
| 15781 | |
| 15782 | |
| 15783 | /** |
| 15784 | @brief Process Config STA Rsp function (called when a response |
| 15785 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15786 | |
| 15787 | @param pWDICtx: pointer to the WLAN DAL context |
| 15788 | pEventData: pointer to the event information structure |
| 15789 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15790 | @see |
| 15791 | @return Result of the function call |
| 15792 | */ |
| 15793 | WDI_Status |
| 15794 | WDI_ProcessConfigStaRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15795 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15796 | WDI_ControlBlockType* pWDICtx, |
| 15797 | WDI_EventInfoType* pEventData |
| 15798 | ) |
| 15799 | { |
| 15800 | WDI_ConfigSTARspParamsType wdiCfgSTAParams; |
| 15801 | WDI_ConfigSTARspCb wdiConfigSTARspCb; |
| 15802 | WDI_AddStaParams wdiAddSTAParam; |
| 15803 | |
| 15804 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15805 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15806 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15807 | tConfigStaRspMsg halConfigStaRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15808 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15809 | |
| 15810 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15811 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15812 | -------------------------------------------------------------------------*/ |
| 15813 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15814 | ( NULL == pEventData->pEventData)) |
| 15815 | { |
| 15816 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15817 | "%s: Invalid parameters", __FUNCTION__); |
| 15818 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15819 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15820 | } |
| 15821 | |
| 15822 | wdiConfigSTARspCb = (WDI_ConfigSTARspCb)pWDICtx->pfncRspCB; |
| 15823 | |
| 15824 | /*------------------------------------------------------------------------- |
| 15825 | Extract response and send it to UMAC |
| 15826 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15827 | wpalMemoryCopy( &halConfigStaRsp.configStaRspParams, |
| 15828 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15829 | sizeof(halConfigStaRsp.configStaRspParams)); |
| 15830 | |
| 15831 | |
| 15832 | wdiCfgSTAParams.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
| 15833 | wdiCfgSTAParams.ucBssIdx = halConfigStaRsp.configStaRspParams.bssIdx; |
| 15834 | wdiCfgSTAParams.ucUcastSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 15835 | wdiCfgSTAParams.ucBcastSig = halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 15836 | wdiCfgSTAParams.ucMgmtSig = halConfigStaRsp.configStaRspParams.ucMgmtSig; |
| 15837 | |
| 15838 | /* MAC Address of STA - take from cache as it does not come back in the |
| 15839 | response*/ |
| 15840 | wpalMemoryCopy( wdiCfgSTAParams.macSTA, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15841 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15842 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15843 | |
| 15844 | wdiCfgSTAParams.wdiStatus = |
| 15845 | WDI_HAL_2_WDI_STATUS(halConfigStaRsp.configStaRspParams.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15846 | |
| 15847 | wdiCfgSTAParams.ucDpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
| 15848 | wdiCfgSTAParams.ucBcastDpuIndex = halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
| 15849 | wdiCfgSTAParams.ucBcastMgmtDpuIdx = halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
| 15850 | |
| 15851 | if ( WDI_STATUS_SUCCESS == wdiCfgSTAParams.wdiStatus ) |
| 15852 | { |
| 15853 | if ( WDI_ADD_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 15854 | { |
| 15855 | /* ADD STA to table */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15856 | wdiAddSTAParam.ucSTAIdx = halConfigStaRsp.configStaRspParams.staIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15857 | wdiAddSTAParam.dpuSig = halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 15858 | wdiAddSTAParam.dpuIndex = halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15859 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15860 | /*This info can be retrieved from the cached initial request*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15861 | wdiAddSTAParam.ucWmmEnabled = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15862 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucWMMEnabled; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15863 | wdiAddSTAParam.ucHTCapable = |
| 15864 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.ucHTCapable; |
| 15865 | wdiAddSTAParam.ucStaType = |
| 15866 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiSTAType; |
| 15867 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15868 | /* MAC Address of STA */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15869 | wpalMemoryCopy(wdiAddSTAParam.staMacAddr, |
| 15870 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15871 | WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15872 | |
| 15873 | wpalMemoryCopy(wdiAddSTAParam.macBSSID, |
| 15874 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID , |
| 15875 | WDI_MAC_ADDR_LEN); |
| 15876 | |
| 15877 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 15878 | pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.macBSSID, |
| 15879 | &pBSSSes); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15880 | |
| 15881 | if ( NULL == pBSSSes ) |
| 15882 | { |
| 15883 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 15884 | "Association for this BSSID is not in place"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15885 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15886 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15887 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15888 | } |
| 15889 | |
| 15890 | /*Add BSS specific parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15891 | wdiAddSTAParam.bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15892 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15893 | wdiAddSTAParam.bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15894 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15895 | wdiAddSTAParam.bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15896 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15897 | wdiAddSTAParam.bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15898 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
| 15899 | wdiAddSTAParam.ucRmfEnabled = pBSSSes->ucRmfEnabled; |
| 15900 | wdiAddSTAParam.ucBSSIdx = ucCurrentBSSSesIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15901 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15902 | WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 15903 | } |
| 15904 | if( WDI_UPDATE_STA == pWDICtx->wdiCachedConfigStaReq.wdiReqInfo.wdiAction ) |
| 15905 | { |
| 15906 | WDI_StaStruct* pSTATable = (WDI_StaStruct*) pWDICtx->staTable; |
| 15907 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15908 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15909 | halConfigStaRsp.configStaRspParams.bcastDpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15910 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15911 | halConfigStaRsp.configStaRspParams.ucBcastSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15912 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15913 | halConfigStaRsp.configStaRspParams.bcastMgmtDpuIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15914 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bcastMgmtDpuSignature = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15915 | halConfigStaRsp.configStaRspParams.ucMgmtSig; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15916 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].bssIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15917 | halConfigStaRsp.configStaRspParams.bssIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15918 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuIndex = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15919 | halConfigStaRsp.configStaRspParams.dpuIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15920 | pSTATable[halConfigStaRsp.configStaRspParams.staIdx].dpuSig = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15921 | halConfigStaRsp.configStaRspParams.ucUcastSig; |
| 15922 | } |
| 15923 | } |
| 15924 | |
| 15925 | /*Notify UMAC*/ |
| 15926 | wdiConfigSTARspCb( &wdiCfgSTAParams, pWDICtx->pRspCBUserData); |
| 15927 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15928 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15929 | }/*WDI_ProcessConfigStaRsp*/ |
| 15930 | |
| 15931 | |
| 15932 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15933 | @brief Process Set Link State Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15934 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15935 | |
| 15936 | @param pWDICtx: pointer to the WLAN DAL context |
| 15937 | pEventData: pointer to the event information structure |
| 15938 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15939 | @see |
| 15940 | @return Result of the function call |
| 15941 | */ |
| 15942 | WDI_Status |
| 15943 | WDI_ProcessSetLinkStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15944 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15945 | WDI_ControlBlockType* pWDICtx, |
| 15946 | WDI_EventInfoType* pEventData |
| 15947 | ) |
| 15948 | { |
| 15949 | WDI_Status wdiStatus; |
| 15950 | eHalStatus halStatus; |
| 15951 | WDI_SetLinkStateRspCb wdiSetLinkStateRspCb; |
| 15952 | |
| 15953 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15954 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15955 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 15956 | |
| 15957 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15958 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15959 | -------------------------------------------------------------------------*/ |
| 15960 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 15961 | ( NULL == pEventData->pEventData)) |
| 15962 | { |
| 15963 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 15964 | "%s: Invalid parameters", __FUNCTION__); |
| 15965 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15966 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15967 | } |
| 15968 | |
| 15969 | wdiSetLinkStateRspCb = (WDI_SetLinkStateRspCb)pWDICtx->pfncRspCB; |
| 15970 | |
| 15971 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 15972 | |
| 15973 | /*If the link is being transitioned to idle - the BSS is to be deleted |
| 15974 | - this type of ending a session is possible when UMAC has failed an |
| 15975 | - association session during Join*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15976 | if ( WDI_LINK_IDLE_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15977 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 15978 | { |
| 15979 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15980 | Find the BSS for which the request is made |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15981 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15982 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 15983 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.macBSSID, |
| 15984 | &pBSSSes); |
| 15985 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15986 | /*----------------------------------------------------------------------- |
| 15987 | Del BSS response can only be received for an existing assoc that |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 15988 | is current and in progress |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15989 | -----------------------------------------------------------------------*/ |
| 15990 | if ( NULL == pBSSSes ) |
| 15991 | { |
| 15992 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 15993 | "Set link response received outside association session"); |
| 15994 | } |
| 15995 | else |
| 15996 | { |
| 15997 | /* For BT AMP roles no need to delete the sessions if assoc fails. There |
| 15998 | will be del BSS coming after this to stop the beaconing & cleaning up the |
| 15999 | sessions*/ |
| 16000 | if(( WDI_BTAMP_STA_MODE != pBSSSes->wdiBssType )&& |
| 16001 | ( WDI_BTAMP_AP_MODE != pBSSSes->wdiBssType )) |
| 16002 | { |
| 16003 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16004 | The current session will be deleted |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16005 | -----------------------------------------------------------------------*/ |
| 16006 | WDI_DeleteSession(pWDICtx, pBSSSes); |
| 16007 | |
| 16008 | /*----------------------------------------------------------------------- |
| 16009 | Check to see if this association is in progress - if so disable the |
| 16010 | flag as this has ended |
| 16011 | -----------------------------------------------------------------------*/ |
| 16012 | if ( ucCurrentBSSSesIdx == pWDICtx->ucCurrentBSSSesIdx ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16013 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16014 | /*Association no longer in progress */ |
| 16015 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16016 | /*Association no longer in progress - prepare pending assoc for processing*/ |
| 16017 | WDI_DequeueAssocRequest(pWDICtx); |
| 16018 | } |
| 16019 | } |
| 16020 | } |
| 16021 | } |
| 16022 | /* If the link state has been set to POST ASSOC, reset the "association in |
| 16023 | progress" flag */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16024 | if ( WDI_LINK_POSTASSOC_STATE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16025 | pWDICtx->wdiCacheSetLinkStReq.wdiLinkInfo.wdiLinkState ) |
| 16026 | { |
| 16027 | pWDICtx->bAssociationInProgress = eWLAN_PAL_FALSE; |
| 16028 | WDI_DequeueAssocRequest(pWDICtx); |
| 16029 | } |
| 16030 | |
| 16031 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 16032 | |
| 16033 | /*------------------------------------------------------------------------- |
| 16034 | Extract response and send it to UMAC |
| 16035 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16036 | wpalMemoryCopy( &halStatus, |
| 16037 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16038 | sizeof(halStatus)); |
| 16039 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16040 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16041 | |
| 16042 | /*Notify UMAC*/ |
| 16043 | wdiSetLinkStateRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16044 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16045 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16046 | }/*WDI_ProcessSetLinkStateRsp*/ |
| 16047 | |
| 16048 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16049 | @brief Process Get Stats Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16050 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16051 | |
| 16052 | @param pWDICtx: pointer to the WLAN DAL context |
| 16053 | pEventData: pointer to the event information structure |
| 16054 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16055 | @see |
| 16056 | @return Result of the function call |
| 16057 | */ |
| 16058 | WDI_Status |
| 16059 | WDI_ProcessGetStatsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16060 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16061 | WDI_ControlBlockType* pWDICtx, |
| 16062 | WDI_EventInfoType* pEventData |
| 16063 | ) |
| 16064 | { |
| 16065 | WDI_GetStatsRspParamsType *wdiGetStatsRsp; |
| 16066 | WDI_GetStatsRspCb wdiGetStatsRspCb; |
| 16067 | tHalStatsRspParams* pHalStatsRspParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16068 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16069 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16070 | |
| 16071 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16072 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16073 | -------------------------------------------------------------------------*/ |
| 16074 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16075 | ( NULL == pEventData->pEventData)) |
| 16076 | { |
| 16077 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16078 | "%s: Invalid parameters", __FUNCTION__); |
| 16079 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16080 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16081 | } |
| 16082 | |
| 16083 | /*------------------------------------------------------------------------- |
| 16084 | Extract response and send it to UMAC |
| 16085 | -------------------------------------------------------------------------*/ |
| 16086 | pHalStatsRspParams = (tHalStatsRspParams *)pEventData->pEventData; |
| 16087 | |
| 16088 | /*allocate the stats response buffer */ |
| 16089 | wdiGetStatsRsp = (WDI_GetStatsRspParamsType *)wpalMemoryAllocate( |
| 16090 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams) |
| 16091 | + sizeof(WDI_GetStatsRspParamsType)); |
| 16092 | |
| 16093 | if(NULL == wdiGetStatsRsp) |
| 16094 | { |
| 16095 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16096 | "Failed to allocate memory in Get Stats Response %x %x %x ", |
| 16097 | pWDICtx, pEventData, pEventData->pEventData); |
| 16098 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16099 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16100 | } |
| 16101 | |
| 16102 | wdiGetStatsRspCb = (WDI_GetStatsRspCb)pWDICtx->pfncRspCB; |
| 16103 | |
| 16104 | wpalMemoryZero(wdiGetStatsRsp, pHalStatsRspParams->msgLen); |
| 16105 | wdiGetStatsRsp->usMsgType = pHalStatsRspParams->msgType; |
| 16106 | wdiGetStatsRsp->usMsgLen = pHalStatsRspParams->msgLen; |
| 16107 | wdiGetStatsRsp->wdiStatus = WDI_HAL_2_WDI_STATUS(pHalStatsRspParams->status); |
| 16108 | wdiGetStatsRsp->ucSTAIdx = pHalStatsRspParams->staId; |
| 16109 | wdiGetStatsRsp->uStatsMask = pHalStatsRspParams->statsMask; |
| 16110 | |
| 16111 | /* copy the stats from buffer at the end of the tHalStatsRspParams message */ |
| 16112 | wpalMemoryCopy(wdiGetStatsRsp + 1, |
| 16113 | (wpt_uint8*)pEventData->pEventData + sizeof(tHalStatsRspParams), |
| 16114 | pHalStatsRspParams->msgLen - sizeof(tHalStatsRspParams)); |
| 16115 | |
| 16116 | /*Notify UMAC*/ |
| 16117 | wdiGetStatsRspCb( wdiGetStatsRsp, pWDICtx->pRspCBUserData); |
| 16118 | |
| 16119 | wpalMemoryFree(wdiGetStatsRsp); |
| 16120 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16121 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16122 | }/*WDI_ProcessGetStatsRsp*/ |
| 16123 | |
| 16124 | |
| 16125 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16126 | @brief Process Update Cfg Rsp function (called when a response is |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16127 | being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16128 | |
| 16129 | @param pWDICtx: pointer to the WLAN DAL context |
| 16130 | pEventData: pointer to the event information structure |
| 16131 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16132 | @see |
| 16133 | @return Result of the function call |
| 16134 | */ |
| 16135 | WDI_Status |
| 16136 | WDI_ProcessUpdateCfgRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16137 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16138 | WDI_ControlBlockType* pWDICtx, |
| 16139 | WDI_EventInfoType* pEventData |
| 16140 | ) |
| 16141 | { |
| 16142 | WDI_Status wdiStatus; |
| 16143 | eHalStatus halStatus; |
| 16144 | WDI_UpdateCfgRspCb wdiUpdateCfgRspCb; |
| 16145 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16146 | |
| 16147 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16148 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16149 | -------------------------------------------------------------------------*/ |
| 16150 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16151 | ( NULL == pEventData->pEventData)) |
| 16152 | { |
| 16153 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16154 | "%s: Invalid parameters", __FUNCTION__); |
| 16155 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16156 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16157 | } |
| 16158 | |
| 16159 | wdiUpdateCfgRspCb = (WDI_UpdateCfgRspCb)pWDICtx->pfncRspCB; |
| 16160 | |
| 16161 | /*------------------------------------------------------------------------- |
| 16162 | Extract response and send it to UMAC |
| 16163 | -------------------------------------------------------------------------*/ |
| 16164 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16165 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16166 | |
| 16167 | /*Notify UMAC*/ |
| 16168 | wdiUpdateCfgRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16169 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16170 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16171 | }/*WDI_ProcessUpdateCfgRsp*/ |
| 16172 | |
| 16173 | |
| 16174 | |
| 16175 | /** |
| 16176 | @brief Process Add BA Rsp function (called when a response |
| 16177 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16178 | |
| 16179 | @param pWDICtx: pointer to the WLAN DAL context |
| 16180 | pEventData: pointer to the event information structure |
| 16181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16182 | @see |
| 16183 | @return Result of the function call |
| 16184 | */ |
| 16185 | WDI_Status |
| 16186 | WDI_ProcessAddBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16187 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16188 | WDI_ControlBlockType* pWDICtx, |
| 16189 | WDI_EventInfoType* pEventData |
| 16190 | ) |
| 16191 | { |
| 16192 | WDI_AddBARspCb wdiAddBARspCb; |
| 16193 | |
| 16194 | tAddBARspParams halAddBARsp; |
| 16195 | WDI_AddBARspinfoType wdiAddBARsp; |
| 16196 | |
| 16197 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16198 | |
| 16199 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16200 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16201 | -------------------------------------------------------------------------*/ |
| 16202 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16203 | ( NULL == pEventData->pEventData)) |
| 16204 | { |
| 16205 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16206 | "%s: Invalid parameters", __FUNCTION__); |
| 16207 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16208 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16209 | } |
| 16210 | |
| 16211 | wdiAddBARspCb = (WDI_AddBARspCb)pWDICtx->pfncRspCB; |
| 16212 | |
| 16213 | /*------------------------------------------------------------------------- |
| 16214 | Extract response and send it to UMAC |
| 16215 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16216 | wpalMemoryCopy( &halAddBARsp, |
| 16217 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16218 | sizeof(halAddBARsp)); |
| 16219 | |
| 16220 | wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status); |
| 16221 | |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 16222 | if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16223 | { |
| 16224 | wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken; |
| 16225 | } |
| 16226 | |
| 16227 | /*Notify UMAC*/ |
| 16228 | wdiAddBARspCb( &wdiAddBARsp, pWDICtx->pRspCBUserData); |
| 16229 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16230 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16231 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16232 | |
| 16233 | /** |
| 16234 | @brief Process Add BA Rsp function (called when a response |
| 16235 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16236 | |
| 16237 | @param pWDICtx: pointer to the WLAN DAL context |
| 16238 | pEventData: pointer to the event information structure |
| 16239 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16240 | @see |
| 16241 | @return Result of the function call |
| 16242 | */ |
| 16243 | WDI_Status |
| 16244 | WDI_ProcessTriggerBARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16245 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16246 | WDI_ControlBlockType* pWDICtx, |
| 16247 | WDI_EventInfoType* pEventData |
| 16248 | ) |
| 16249 | { |
| 16250 | WDI_TriggerBARspCb wdiTriggerBARspCb; |
| 16251 | |
| 16252 | tTriggerBARspParams* halTriggerBARsp; |
| 16253 | tTriggerBaRspCandidate* halBaCandidate; |
| 16254 | WDI_TriggerBARspParamsType* wdiTriggerBARsp; |
| 16255 | WDI_TriggerBARspCandidateType* wdiTriggerBARspCandidate; |
| 16256 | wpt_uint16 index; |
| 16257 | wpt_uint16 TidIndex; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16258 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16259 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16260 | |
| 16261 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16262 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16263 | -------------------------------------------------------------------------*/ |
| 16264 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16265 | ( NULL == pEventData->pEventData)) |
| 16266 | { |
| 16267 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16268 | "%s: Invalid parameters", __FUNCTION__); |
| 16269 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16270 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16271 | } |
| 16272 | |
| 16273 | wdiTriggerBARspCb = (WDI_TriggerBARspCb)pWDICtx->pfncRspCB; |
| 16274 | |
| 16275 | /*------------------------------------------------------------------------- |
| 16276 | Extract response and send it to UMAC |
| 16277 | -------------------------------------------------------------------------*/ |
| 16278 | halTriggerBARsp = (tTriggerBARspParams *)pEventData->pEventData; |
| 16279 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16280 | wdiTriggerBARsp = wpalMemoryAllocate(sizeof(WDI_TriggerBARspParamsType) + |
| 16281 | halTriggerBARsp->baCandidateCnt * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16282 | sizeof(WDI_TriggerBARspCandidateType)); |
| 16283 | if(NULL == wdiTriggerBARsp) |
| 16284 | { |
| 16285 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16286 | "Failed to allocate memory in Trigger BA Response %x %x %x ", |
| 16287 | pWDICtx, pEventData, pEventData->pEventData); |
| 16288 | wpalMemoryFree(halTriggerBARsp); |
| 16289 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16290 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16291 | } |
| 16292 | |
| 16293 | wdiTriggerBARsp->wdiStatus = WDI_HAL_2_WDI_STATUS(halTriggerBARsp->status); |
| 16294 | |
| 16295 | if ( WDI_STATUS_SUCCESS == wdiTriggerBARsp->wdiStatus) |
| 16296 | { |
| 16297 | wdiTriggerBARsp->usBaCandidateCnt = halTriggerBARsp->baCandidateCnt; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16298 | wpalMemoryCopy(wdiTriggerBARsp->macBSSID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16299 | halTriggerBARsp->bssId , WDI_MAC_ADDR_LEN); |
| 16300 | |
| 16301 | wdiTriggerBARspCandidate = (WDI_TriggerBARspCandidateType*)(wdiTriggerBARsp + 1); |
| 16302 | halBaCandidate = (tTriggerBaRspCandidate*)(halTriggerBARsp + 1); |
| 16303 | |
| 16304 | for(index = 0; index < wdiTriggerBARsp->usBaCandidateCnt; index++) |
| 16305 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16306 | wpalMemoryCopy(wdiTriggerBARspCandidate->macSTA, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16307 | halBaCandidate->staAddr, WDI_MAC_ADDR_LEN); |
| 16308 | for(TidIndex = 0; TidIndex < STA_MAX_TC; TidIndex++) |
| 16309 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16310 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].fBaEnable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16311 | halBaCandidate->baInfo[TidIndex].fBaEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16312 | wdiTriggerBARspCandidate->wdiBAInfo[TidIndex].startingSeqNum = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16313 | halBaCandidate->baInfo[TidIndex].startingSeqNum; |
| 16314 | } |
| 16315 | wdiTriggerBARspCandidate++; |
| 16316 | halBaCandidate++; |
| 16317 | } |
| 16318 | } |
| 16319 | |
| 16320 | /*Notify UMAC*/ |
| 16321 | wdiTriggerBARspCb( wdiTriggerBARsp, pWDICtx->pRspCBUserData); |
| 16322 | |
| 16323 | wpalMemoryFree(wdiTriggerBARsp); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16324 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16325 | }/*WDI_ProcessAddSessionBARsp*/ |
| 16326 | |
| 16327 | /** |
| 16328 | @brief Process Update Beacon Params Rsp function (called when a response |
| 16329 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16330 | |
| 16331 | @param pWDICtx: pointer to the WLAN DAL context |
| 16332 | pEventData: pointer to the event information structure |
| 16333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16334 | @see |
| 16335 | @return Result of the function call |
| 16336 | */ |
| 16337 | WDI_Status |
| 16338 | WDI_ProcessUpdateBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16339 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16340 | WDI_ControlBlockType* pWDICtx, |
| 16341 | WDI_EventInfoType* pEventData |
| 16342 | ) |
| 16343 | { |
| 16344 | WDI_Status wdiStatus; |
| 16345 | eHalStatus halStatus; |
| 16346 | WDI_UpdateBeaconParamsRspCb wdiUpdateBeaconParamsRspCb; |
| 16347 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16348 | |
| 16349 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16350 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16351 | -------------------------------------------------------------------------*/ |
| 16352 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16353 | ( NULL == pEventData->pEventData)) |
| 16354 | { |
| 16355 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16356 | "%s: Invalid parameters", __FUNCTION__); |
| 16357 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16358 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16359 | } |
| 16360 | |
| 16361 | wdiUpdateBeaconParamsRspCb = (WDI_UpdateBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 16362 | |
| 16363 | /*------------------------------------------------------------------------- |
| 16364 | Extract response and send it to UMAC |
| 16365 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16366 | wpalMemoryCopy( &halStatus, |
| 16367 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16368 | sizeof(halStatus)); |
| 16369 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16370 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16371 | |
| 16372 | /*Notify UMAC*/ |
| 16373 | wdiUpdateBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16374 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16375 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16376 | }/*WDI_ProcessUpdateBeaconParamsRsp*/ |
| 16377 | |
| 16378 | /** |
| 16379 | @brief Process Send Beacon template Rsp function (called when a response |
| 16380 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16381 | |
| 16382 | @param pWDICtx: pointer to the WLAN DAL context |
| 16383 | pEventData: pointer to the event information structure |
| 16384 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16385 | @see |
| 16386 | @return Result of the function call |
| 16387 | */ |
| 16388 | WDI_Status |
| 16389 | WDI_ProcessSendBeaconParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16390 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16391 | WDI_ControlBlockType* pWDICtx, |
| 16392 | WDI_EventInfoType* pEventData |
| 16393 | ) |
| 16394 | { |
| 16395 | WDI_Status wdiStatus; |
| 16396 | eHalStatus halStatus; |
| 16397 | WDI_SendBeaconParamsRspCb wdiSendBeaconParamsRspCb; |
| 16398 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16399 | |
| 16400 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16401 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16402 | -------------------------------------------------------------------------*/ |
| 16403 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16404 | ( NULL == pEventData->pEventData)) |
| 16405 | { |
| 16406 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16407 | "%s: Invalid parameters", __FUNCTION__); |
| 16408 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16409 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16410 | } |
| 16411 | |
| 16412 | wdiSendBeaconParamsRspCb = (WDI_SendBeaconParamsRspCb)pWDICtx->pfncRspCB; |
| 16413 | |
| 16414 | /*------------------------------------------------------------------------- |
| 16415 | Extract response and send it to UMAC |
| 16416 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16417 | wpalMemoryCopy( &halStatus, |
| 16418 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16419 | sizeof(halStatus)); |
| 16420 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16421 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16422 | |
| 16423 | /*Notify UMAC*/ |
| 16424 | wdiSendBeaconParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16425 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16426 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16427 | }/*WDI_ProcessSendBeaconParamsRsp*/ |
| 16428 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16429 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16430 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16431 | @brief Process Update Probe Resp Template Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16432 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16433 | |
| 16434 | @param pWDICtx: pointer to the WLAN DAL context |
| 16435 | pEventData: pointer to the event information structure |
| 16436 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16437 | @see |
| 16438 | @return Result of the function call |
| 16439 | */ |
| 16440 | WDI_Status |
| 16441 | WDI_ProcessUpdateProbeRspTemplateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16442 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16443 | WDI_ControlBlockType* pWDICtx, |
| 16444 | WDI_EventInfoType* pEventData |
| 16445 | ) |
| 16446 | { |
| 16447 | WDI_Status wdiStatus; |
| 16448 | eHalStatus halStatus; |
| 16449 | WDI_UpdateProbeRspTemplateRspCb wdiUpdProbeRspTemplRspCb; |
| 16450 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16451 | |
| 16452 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16453 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16454 | -------------------------------------------------------------------------*/ |
| 16455 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16456 | ( NULL == pEventData->pEventData)) |
| 16457 | { |
| 16458 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16459 | "%s: Invalid parameters", __FUNCTION__); |
| 16460 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16461 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16462 | } |
| 16463 | |
| 16464 | wdiUpdProbeRspTemplRspCb = (WDI_UpdateProbeRspTemplateRspCb)pWDICtx->pfncRspCB; |
| 16465 | |
| 16466 | /*------------------------------------------------------------------------- |
| 16467 | Extract response and send it to UMAC |
| 16468 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16469 | wpalMemoryCopy( &halStatus, |
| 16470 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16471 | sizeof(halStatus)); |
| 16472 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16473 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16474 | |
| 16475 | /*Notify UMAC*/ |
| 16476 | wdiUpdProbeRspTemplRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16477 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16478 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16479 | }/*WDI_ProcessUpdateProbeRspTemplateRsp*/ |
| 16480 | |
| 16481 | /** |
| 16482 | @brief Process Set Max Tx Power Rsp function (called when a response |
| 16483 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16484 | |
| 16485 | @param pWDICtx: pointer to the WLAN DAL context |
| 16486 | pEventData: pointer to the event information structure |
| 16487 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16488 | @see |
| 16489 | @return Result of the function call |
| 16490 | */ |
| 16491 | WDI_Status |
| 16492 | WDI_ProcessSetMaxTxPowerRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16493 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16494 | WDI_ControlBlockType* pWDICtx, |
| 16495 | WDI_EventInfoType* pEventData |
| 16496 | ) |
| 16497 | { |
| 16498 | tSetMaxTxPwrRspMsg halTxpowerrsp; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16499 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16500 | WDI_SetMaxTxPowerRspMsg wdiSetMaxTxPowerRspMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16501 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16502 | WDA_SetMaxTxPowerRspCb wdiReqStatusCb; |
| 16503 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16504 | |
| 16505 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16506 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16507 | -------------------------------------------------------------------------*/ |
| 16508 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16509 | ( NULL == pEventData->pEventData)) |
| 16510 | { |
| 16511 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16512 | "%s: Invalid parameters", __FUNCTION__); |
| 16513 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16514 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16515 | } |
| 16516 | |
| 16517 | wdiReqStatusCb = (WDA_SetMaxTxPowerRspCb)pWDICtx->pfncRspCB; |
| 16518 | |
| 16519 | /*------------------------------------------------------------------------- |
| 16520 | Extract response and send it to UMAC |
| 16521 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16522 | wpalMemoryCopy( &halTxpowerrsp.setMaxTxPwrRspParams, |
| 16523 | pEventData->pEventData, |
| 16524 | sizeof(halTxpowerrsp.setMaxTxPwrRspParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16525 | |
| 16526 | if ( eHAL_STATUS_SUCCESS != halTxpowerrsp.setMaxTxPwrRspParams.status ) |
| 16527 | { |
| 16528 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 16529 | "Error status returned in Set Max Tx Power Response "); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16530 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_BASIC_OP_FAILURE); |
| 16531 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16532 | } |
| 16533 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16534 | wdiSetMaxTxPowerRspMsg.wdiStatus = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16535 | WDI_HAL_2_WDI_STATUS(halTxpowerrsp.setMaxTxPwrRspParams.status); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16536 | wdiSetMaxTxPowerRspMsg.ucPower = halTxpowerrsp.setMaxTxPwrRspParams.power; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16537 | |
| 16538 | /*Notify UMAC*/ |
| 16539 | wdiReqStatusCb( &wdiSetMaxTxPowerRspMsg, pWDICtx->pRspCBUserData); |
| 16540 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16541 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16542 | } |
| 16543 | |
| 16544 | #ifdef WLAN_FEATURE_P2P |
| 16545 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16546 | @brief Process P2P Group Owner Notice Of Absense Rsp function (called |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16547 | when a response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16548 | |
| 16549 | @param pWDICtx: pointer to the WLAN DAL context |
| 16550 | pEventData: pointer to the event information structure |
| 16551 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16552 | @see |
| 16553 | @return Result of the function call |
| 16554 | */ |
| 16555 | WDI_Status |
| 16556 | WDI_ProcessP2PGONOARsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16557 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16558 | WDI_ControlBlockType* pWDICtx, |
| 16559 | WDI_EventInfoType* pEventData |
| 16560 | ) |
| 16561 | { |
| 16562 | WDI_Status wdiStatus; |
| 16563 | eHalStatus halStatus; |
| 16564 | WDI_SetP2PGONOAReqParamsRspCb wdiP2PGONOAReqParamsRspCb; |
| 16565 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16566 | |
| 16567 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16568 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16569 | -------------------------------------------------------------------------*/ |
| 16570 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16571 | ( NULL == pEventData->pEventData)) |
| 16572 | { |
| 16573 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16574 | "%s: Invalid parameters", __FUNCTION__); |
| 16575 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16576 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16577 | } |
| 16578 | |
| 16579 | wdiP2PGONOAReqParamsRspCb = (WDI_SetP2PGONOAReqParamsRspCb)pWDICtx->pfncRspCB; |
| 16580 | |
| 16581 | /*------------------------------------------------------------------------- |
| 16582 | Extract response and send it to UMAC |
| 16583 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16584 | wpalMemoryCopy( &halStatus, |
| 16585 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16586 | sizeof(halStatus)); |
| 16587 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16588 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16589 | |
| 16590 | /*Notify UMAC*/ |
| 16591 | wdiP2PGONOAReqParamsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16592 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16593 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16594 | }/*WDI_ProcessP2PGONOARsp*/ |
| 16595 | #endif |
| 16596 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16597 | @brief Process Enter IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16598 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16599 | |
| 16600 | @param pWDICtx: pointer to the WLAN DAL context |
| 16601 | pEventData: pointer to the event information structure |
| 16602 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16603 | @see |
| 16604 | @return Result of the function call |
| 16605 | */ |
| 16606 | WDI_Status |
| 16607 | WDI_ProcessEnterImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16608 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16609 | WDI_ControlBlockType* pWDICtx, |
| 16610 | WDI_EventInfoType* pEventData |
| 16611 | ) |
| 16612 | { |
| 16613 | WDI_Status wdiStatus; |
| 16614 | eHalStatus halStatus; |
| 16615 | WDI_EnterImpsRspCb wdiEnterImpsRspCb; |
| 16616 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16617 | |
| 16618 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16619 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16620 | -------------------------------------------------------------------------*/ |
| 16621 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16622 | ( NULL == pEventData->pEventData)) |
| 16623 | { |
| 16624 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16625 | "%s: Invalid parameters", __FUNCTION__); |
| 16626 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16627 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16628 | } |
| 16629 | |
| 16630 | wdiEnterImpsRspCb = (WDI_EnterImpsRspCb)pWDICtx->pfncRspCB; |
| 16631 | |
| 16632 | /*------------------------------------------------------------------------- |
| 16633 | Extract response and send it to UMAC |
| 16634 | -------------------------------------------------------------------------*/ |
| 16635 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 16636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16637 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16638 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16639 | /* If IMPS req failed, riva is not power collapsed Put the DXE in FULL state. |
| 16640 | * Other module states are taken care by PMC. |
| 16641 | * TODO: How do we take care of the case where IMPS is success, but riva power collapse fails?? |
| 16642 | */ |
| 16643 | if (wdiStatus != WDI_STATUS_SUCCESS) { |
| 16644 | |
| 16645 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 16646 | "WDI PRocess Enter IMPS RSP failed With HAL Status Code: %d",halStatus); |
| 16647 | /* Call Back is not required as we are putting the DXE in FULL |
| 16648 | * and riva is already in full (IMPS RSP Failed)*/ |
| 16649 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16650 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16651 | /*Notify UMAC*/ |
| 16652 | wdiEnterImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16653 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16654 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16655 | }/*WDI_ProcessEnterImpsRsp*/ |
| 16656 | |
| 16657 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16658 | @brief Process Exit IMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16659 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16660 | |
| 16661 | @param pWDICtx: pointer to the WLAN DAL context |
| 16662 | pEventData: pointer to the event information structure |
| 16663 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16664 | @see |
| 16665 | @return Result of the function call |
| 16666 | */ |
| 16667 | WDI_Status |
| 16668 | WDI_ProcessExitImpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16669 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16670 | WDI_ControlBlockType* pWDICtx, |
| 16671 | WDI_EventInfoType* pEventData |
| 16672 | ) |
| 16673 | { |
| 16674 | WDI_Status wdiStatus; |
| 16675 | eHalStatus halStatus; |
| 16676 | WDI_ExitImpsRspCb wdiExitImpsRspCb; |
| 16677 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16678 | |
| 16679 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16680 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16681 | -------------------------------------------------------------------------*/ |
| 16682 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16683 | ( NULL == pEventData->pEventData)) |
| 16684 | { |
| 16685 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16686 | "%s: Invalid parameters", __FUNCTION__); |
| 16687 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16688 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16689 | } |
| 16690 | |
| 16691 | wdiExitImpsRspCb = (WDI_ExitImpsRspCb)pWDICtx->pfncRspCB; |
| 16692 | |
| 16693 | /*------------------------------------------------------------------------- |
| 16694 | Extract response and send it to UMAC |
| 16695 | -------------------------------------------------------------------------*/ |
| 16696 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16697 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16698 | |
| 16699 | // notify DTS that we are entering Full power |
| 16700 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16701 | |
| 16702 | /*Notify UMAC*/ |
| 16703 | wdiExitImpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16704 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16705 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16706 | }/*WDI_ProcessExitImpsRsp*/ |
| 16707 | |
| 16708 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16709 | @brief Process Enter BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16710 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16711 | |
| 16712 | @param pWDICtx: pointer to the WLAN DAL context |
| 16713 | pEventData: pointer to the event information structure |
| 16714 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16715 | @see |
| 16716 | @return Result of the function call |
| 16717 | */ |
| 16718 | WDI_Status |
| 16719 | WDI_ProcessEnterBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16720 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16721 | WDI_ControlBlockType* pWDICtx, |
| 16722 | WDI_EventInfoType* pEventData |
| 16723 | ) |
| 16724 | { |
| 16725 | WDI_Status wdiStatus; |
| 16726 | eHalStatus halStatus; |
| 16727 | WDI_EnterBmpsRspCb wdiEnterBmpsRspCb; |
| 16728 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16729 | |
| 16730 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16731 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16732 | -------------------------------------------------------------------------*/ |
| 16733 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16734 | ( NULL == pEventData->pEventData)) |
| 16735 | { |
| 16736 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16737 | "%s: Invalid parameters", __FUNCTION__); |
| 16738 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16739 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16740 | } |
| 16741 | |
| 16742 | wdiEnterBmpsRspCb = (WDI_EnterBmpsRspCb)pWDICtx->pfncRspCB; |
| 16743 | |
| 16744 | /*------------------------------------------------------------------------- |
| 16745 | Extract response and send it to UMAC |
| 16746 | -------------------------------------------------------------------------*/ |
| 16747 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16748 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16749 | |
Madan Mohan Koyyalamudi | 48e375a | 2012-09-24 13:19:17 -0700 | [diff] [blame] | 16750 | /* If BMPS req failed, riva is not power collapsed put the DXE in FULL state. |
| 16751 | * Other module states are taken care by PMC. |
| 16752 | * TODO: How do we take care of the case where BMPS is success, but riva power collapse fails?? |
| 16753 | */ |
| 16754 | if (wdiStatus != WDI_STATUS_SUCCESS) { |
| 16755 | |
| 16756 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 16757 | "WDI PRocess Enter BMPS RSP failed With HAL Status Code: %d",halStatus); |
| 16758 | /* Call Back is not required as we are putting the DXE in FULL |
| 16759 | * and riva is already in FULL (BMPS RSP Failed)*/ |
| 16760 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16761 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
| 16762 | } |
| 16763 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16764 | /*Notify UMAC*/ |
| 16765 | wdiEnterBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16766 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16767 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16768 | }/*WDI_ProcessEnterBmpsRsp*/ |
| 16769 | |
| 16770 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16771 | @brief Process Exit BMPS Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16772 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16773 | |
| 16774 | @param pWDICtx: pointer to the WLAN DAL context |
| 16775 | pEventData: pointer to the event information structure |
| 16776 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16777 | @see |
| 16778 | @return Result of the function call |
| 16779 | */ |
| 16780 | WDI_Status |
| 16781 | WDI_ProcessExitBmpsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16782 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16783 | WDI_ControlBlockType* pWDICtx, |
| 16784 | WDI_EventInfoType* pEventData |
| 16785 | ) |
| 16786 | { |
| 16787 | WDI_Status wdiStatus; |
| 16788 | eHalStatus halStatus; |
| 16789 | WDI_ExitBmpsRspCb wdiExitBmpsRspCb; |
| 16790 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16791 | |
| 16792 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16793 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16794 | -------------------------------------------------------------------------*/ |
| 16795 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16796 | ( NULL == pEventData->pEventData)) |
| 16797 | { |
| 16798 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16799 | "%s: Invalid parameters", __FUNCTION__); |
| 16800 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16801 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16802 | } |
| 16803 | |
| 16804 | wdiExitBmpsRspCb = (WDI_ExitBmpsRspCb)pWDICtx->pfncRspCB; |
| 16805 | |
| 16806 | /*------------------------------------------------------------------------- |
| 16807 | Extract response and send it to UMAC |
| 16808 | -------------------------------------------------------------------------*/ |
| 16809 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16810 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16811 | |
| 16812 | // notify DTS that we are entering Full power |
| 16813 | WDTS_SetPowerState(pWDICtx, WDTS_POWER_STATE_FULL, NULL); |
| 16814 | |
| 16815 | pWDICtx->bInBmps = eWLAN_PAL_FALSE; |
| 16816 | |
| 16817 | /*Notify UMAC*/ |
| 16818 | wdiExitBmpsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16819 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16820 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16821 | }/*WDI_ProcessExitBmpsRsp*/ |
| 16822 | |
| 16823 | /** |
| 16824 | @brief Process Enter UAPSD Rsp function (called when a response |
| 16825 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16826 | |
| 16827 | @param pWDICtx: pointer to the WLAN DAL context |
| 16828 | pEventData: pointer to the event information structure |
| 16829 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16830 | @see |
| 16831 | @return Result of the function call |
| 16832 | */ |
| 16833 | WDI_Status |
| 16834 | WDI_ProcessEnterUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16835 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16836 | WDI_ControlBlockType* pWDICtx, |
| 16837 | WDI_EventInfoType* pEventData |
| 16838 | ) |
| 16839 | { |
| 16840 | WDI_Status wdiStatus; |
| 16841 | eHalStatus halStatus; |
| 16842 | WDI_EnterUapsdRspCb wdiEnterUapsdRspCb; |
| 16843 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16844 | |
| 16845 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16846 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16847 | -------------------------------------------------------------------------*/ |
| 16848 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16849 | ( NULL == pEventData->pEventData)) |
| 16850 | { |
| 16851 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16852 | "%s: Invalid parameters", __FUNCTION__); |
| 16853 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16854 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16855 | } |
| 16856 | |
| 16857 | wdiEnterUapsdRspCb = (WDI_EnterUapsdRspCb)pWDICtx->pfncRspCB; |
| 16858 | |
| 16859 | /*------------------------------------------------------------------------- |
| 16860 | Extract response and send it to UMAC |
| 16861 | -------------------------------------------------------------------------*/ |
| 16862 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16863 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16864 | |
| 16865 | if(WDI_STATUS_SUCCESS == wdiStatus) |
| 16866 | { |
| 16867 | // Set the DPU routing flag to the FW WQ, all the TX frames would be now pushed |
| 16868 | // from DPU to the FW-WQ (5) in UAPSD. FW would be in data path, monitoring |
| 16869 | // the traffic to decide when to suspend the trigger frames when there is no traffic |
| 16870 | // activity on the trigger enabled ACs |
| 16871 | pWDICtx->ucDpuRF = BMUWQ_FW_DPU_TX; |
| 16872 | |
| 16873 | #ifdef WLAN_PERF |
| 16874 | // Increment the BD signature to refresh the fast path BD utilization |
| 16875 | pWDICtx->uBdSigSerialNum++; |
| 16876 | #endif |
| 16877 | } |
| 16878 | |
| 16879 | /*Notify UMAC*/ |
| 16880 | wdiEnterUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16881 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16882 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16883 | }/*WDI_ProcessEnterUapsdRsp*/ |
| 16884 | |
| 16885 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16886 | @brief Process Exit UAPSD Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16887 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16888 | |
| 16889 | @param pWDICtx: pointer to the WLAN DAL context |
| 16890 | pEventData: pointer to the event information structure |
| 16891 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16892 | @see |
| 16893 | @return Result of the function call |
| 16894 | */ |
| 16895 | WDI_Status |
| 16896 | WDI_ProcessExitUapsdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16897 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16898 | WDI_ControlBlockType* pWDICtx, |
| 16899 | WDI_EventInfoType* pEventData |
| 16900 | ) |
| 16901 | { |
| 16902 | WDI_Status wdiStatus; |
| 16903 | eHalStatus halStatus; |
| 16904 | WDI_ExitUapsdRspCb wdiExitUapsdRspCb; |
| 16905 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16906 | |
| 16907 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16908 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16909 | -------------------------------------------------------------------------*/ |
| 16910 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16911 | ( NULL == pEventData->pEventData)) |
| 16912 | { |
| 16913 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16914 | "%s: Invalid parameters", __FUNCTION__); |
| 16915 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16916 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16917 | } |
| 16918 | |
| 16919 | wdiExitUapsdRspCb = (WDI_ExitUapsdRspCb)pWDICtx->pfncRspCB; |
| 16920 | |
| 16921 | /*------------------------------------------------------------------------- |
| 16922 | Extract response and send it to UMAC |
| 16923 | -------------------------------------------------------------------------*/ |
| 16924 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16925 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16926 | |
| 16927 | // Restore back the DPU routing flag in the TxBD, for DPU to push the TxBDs to BTQM |
| 16928 | // directly instead of the FW WQ. |
| 16929 | pWDICtx->ucDpuRF = BMUWQ_BTQM_TX_MGMT; |
| 16930 | |
| 16931 | #ifdef WLAN_PERF |
| 16932 | // Increment the BD signature to refresh the fast path BD utilization |
| 16933 | pWDICtx->uBdSigSerialNum++; |
| 16934 | #endif |
| 16935 | |
| 16936 | /*Notify UMAC*/ |
| 16937 | wdiExitUapsdRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16939 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16940 | }/*WDI_ProcessExitUapsdRsp*/ |
| 16941 | |
| 16942 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16943 | @brief Process set UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16944 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16945 | |
| 16946 | @param pWDICtx: pointer to the WLAN DAL context |
| 16947 | pEventData: pointer to the event information structure |
| 16948 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16949 | @see |
| 16950 | @return Result of the function call |
| 16951 | */ |
| 16952 | WDI_Status |
| 16953 | WDI_ProcessSetUapsdAcParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16954 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16955 | WDI_ControlBlockType* pWDICtx, |
| 16956 | WDI_EventInfoType* pEventData |
| 16957 | ) |
| 16958 | { |
| 16959 | WDI_Status wdiStatus; |
| 16960 | eHalStatus halStatus; |
| 16961 | WDI_SetUapsdAcParamsCb wdiSetUapsdAcParamsCb; |
| 16962 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 16963 | |
| 16964 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16965 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16966 | -------------------------------------------------------------------------*/ |
| 16967 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 16968 | ( NULL == pEventData->pEventData)) |
| 16969 | { |
| 16970 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 16971 | "%s: Invalid parameters", __FUNCTION__); |
| 16972 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16973 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16974 | } |
| 16975 | |
| 16976 | wdiSetUapsdAcParamsCb = (WDI_SetUapsdAcParamsCb)pWDICtx->pfncRspCB; |
| 16977 | |
| 16978 | /*------------------------------------------------------------------------- |
| 16979 | Extract response and send it to UMAC |
| 16980 | -------------------------------------------------------------------------*/ |
| 16981 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16982 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16983 | |
| 16984 | /*Notify UMAC*/ |
| 16985 | wdiSetUapsdAcParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 16986 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16987 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16988 | }/*WDI_ProcessSetUapsdAcParamsRsp*/ |
| 16989 | |
| 16990 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16991 | @brief Process update UAPSD params Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16992 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 16993 | |
| 16994 | @param pWDICtx: pointer to the WLAN DAL context |
| 16995 | pEventData: pointer to the event information structure |
| 16996 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16997 | @see |
| 16998 | @return Result of the function call |
| 16999 | */ |
| 17000 | WDI_Status |
| 17001 | WDI_ProcessUpdateUapsdParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17002 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17003 | WDI_ControlBlockType* pWDICtx, |
| 17004 | WDI_EventInfoType* pEventData |
| 17005 | ) |
| 17006 | { |
| 17007 | WDI_Status wdiStatus; |
| 17008 | eHalStatus halStatus; |
| 17009 | WDI_UpdateUapsdParamsCb wdiUpdateUapsdParamsCb; |
| 17010 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17011 | |
| 17012 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17013 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17014 | -------------------------------------------------------------------------*/ |
| 17015 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17016 | ( NULL == pEventData->pEventData)) |
| 17017 | { |
| 17018 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17019 | "%s: Invalid parameters", __FUNCTION__); |
| 17020 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17021 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17022 | } |
| 17023 | |
| 17024 | wdiUpdateUapsdParamsCb = (WDI_UpdateUapsdParamsCb)pWDICtx->pfncRspCB; |
| 17025 | |
| 17026 | /*------------------------------------------------------------------------- |
| 17027 | Extract response and send it to UMAC |
| 17028 | -------------------------------------------------------------------------*/ |
| 17029 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17030 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17031 | |
| 17032 | /*Notify UMAC*/ |
| 17033 | wdiUpdateUapsdParamsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17034 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17035 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17036 | }/*WDI_ProcessUpdateUapsdParamsRsp*/ |
| 17037 | |
| 17038 | /** |
| 17039 | @brief Process Configure RXP filter Rsp function (called when a |
| 17040 | response 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_ProcessConfigureRxpFilterRsp |
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_Status wdiStatus; |
| 17056 | eHalStatus halStatus; |
| 17057 | WDI_ConfigureRxpFilterCb wdiConfigureRxpFilterCb; |
| 17058 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17059 | |
| 17060 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17061 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17062 | -------------------------------------------------------------------------*/ |
| 17063 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17064 | ( NULL == pEventData->pEventData)) |
| 17065 | { |
| 17066 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17067 | "%s: Invalid parameters", __FUNCTION__); |
| 17068 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17069 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17070 | } |
| 17071 | |
| 17072 | wdiConfigureRxpFilterCb = (WDI_ConfigureRxpFilterCb)pWDICtx->pfncRspCB; |
| 17073 | |
| 17074 | /*------------------------------------------------------------------------- |
| 17075 | Extract response and send it to UMAC |
| 17076 | -------------------------------------------------------------------------*/ |
| 17077 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17078 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17079 | |
| 17080 | /*Notify UMAC*/ |
| 17081 | wdiConfigureRxpFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17082 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17083 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17084 | }/*WDI_ProcessConfigureRxpFilterRsp*/ |
| 17085 | |
| 17086 | /** |
| 17087 | @brief Process Set beacon filter Rsp function (called when a |
| 17088 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17089 | |
| 17090 | @param pWDICtx: pointer to the WLAN DAL context |
| 17091 | pEventData: pointer to the event information structure |
| 17092 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17093 | @see |
| 17094 | @return Result of the function call |
| 17095 | */ |
| 17096 | WDI_Status |
| 17097 | WDI_ProcessSetBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17098 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17099 | WDI_ControlBlockType* pWDICtx, |
| 17100 | WDI_EventInfoType* pEventData |
| 17101 | ) |
| 17102 | { |
| 17103 | WDI_Status wdiStatus; |
| 17104 | eHalStatus halStatus; |
| 17105 | WDI_SetBeaconFilterCb wdiBeaconFilterCb; |
| 17106 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17107 | |
| 17108 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17109 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17110 | -------------------------------------------------------------------------*/ |
| 17111 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17112 | ( NULL == pEventData->pEventData)) |
| 17113 | { |
| 17114 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17115 | "%s: Invalid parameters", __FUNCTION__); |
| 17116 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17117 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17118 | } |
| 17119 | |
| 17120 | wdiBeaconFilterCb = (WDI_SetBeaconFilterCb)pWDICtx->pfncRspCB; |
| 17121 | |
| 17122 | /*------------------------------------------------------------------------- |
| 17123 | Extract response and send it to UMAC |
| 17124 | -------------------------------------------------------------------------*/ |
| 17125 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17126 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17127 | |
| 17128 | /*Notify UMAC*/ |
| 17129 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17130 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17131 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17132 | }/*WDI_ProcessSetBeaconFilterRsp*/ |
| 17133 | |
| 17134 | /** |
| 17135 | @brief Process remove beacon filter Rsp function (called when a |
| 17136 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17137 | |
| 17138 | @param pWDICtx: pointer to the WLAN DAL context |
| 17139 | pEventData: pointer to the event information structure |
| 17140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17141 | @see |
| 17142 | @return Result of the function call |
| 17143 | */ |
| 17144 | WDI_Status |
| 17145 | WDI_ProcessRemBeaconFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17146 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17147 | WDI_ControlBlockType* pWDICtx, |
| 17148 | WDI_EventInfoType* pEventData |
| 17149 | ) |
| 17150 | { |
| 17151 | WDI_Status wdiStatus; |
| 17152 | eHalStatus halStatus; |
| 17153 | WDI_RemBeaconFilterCb wdiBeaconFilterCb; |
| 17154 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17155 | |
| 17156 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17157 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17158 | -------------------------------------------------------------------------*/ |
| 17159 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17160 | ( NULL == pEventData->pEventData)) |
| 17161 | { |
| 17162 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17163 | "%s: Invalid parameters", __FUNCTION__); |
| 17164 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17165 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17166 | } |
| 17167 | |
| 17168 | wdiBeaconFilterCb = (WDI_RemBeaconFilterCb)pWDICtx->pfncRspCB; |
| 17169 | |
| 17170 | /*------------------------------------------------------------------------- |
| 17171 | Extract response and send it to UMAC |
| 17172 | -------------------------------------------------------------------------*/ |
| 17173 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17174 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17175 | |
| 17176 | /*Notify UMAC*/ |
| 17177 | wdiBeaconFilterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17178 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17179 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17180 | }/*WDI_ProcessRemBeaconFilterRsp*/ |
| 17181 | |
| 17182 | /** |
| 17183 | @brief Process set RSSI thresholds Rsp function (called when a |
| 17184 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17185 | |
| 17186 | @param pWDICtx: pointer to the WLAN DAL context |
| 17187 | pEventData: pointer to the event information structure |
| 17188 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17189 | @see |
| 17190 | @return Result of the function call |
| 17191 | */ |
| 17192 | WDI_Status |
| 17193 | WDI_ProcessSetRSSIThresoldsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17194 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17195 | WDI_ControlBlockType* pWDICtx, |
| 17196 | WDI_EventInfoType* pEventData |
| 17197 | ) |
| 17198 | { |
| 17199 | WDI_Status wdiStatus; |
| 17200 | eHalStatus halStatus; |
| 17201 | WDI_SetRSSIThresholdsCb wdiRSSIThresholdsCb; |
| 17202 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17203 | |
| 17204 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17205 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17206 | -------------------------------------------------------------------------*/ |
| 17207 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17208 | ( NULL == pEventData->pEventData)) |
| 17209 | { |
| 17210 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17211 | "%s: Invalid parameters", __FUNCTION__); |
| 17212 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17213 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17214 | } |
| 17215 | |
| 17216 | wdiRSSIThresholdsCb = (WDI_SetRSSIThresholdsCb)pWDICtx->pfncRspCB; |
| 17217 | |
| 17218 | /*------------------------------------------------------------------------- |
| 17219 | Extract response and send it to UMAC |
| 17220 | -------------------------------------------------------------------------*/ |
| 17221 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17222 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17223 | |
| 17224 | /*Notify UMAC*/ |
| 17225 | wdiRSSIThresholdsCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17226 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17227 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17228 | }/*WDI_ProcessSetRSSIThresoldsRsp*/ |
| 17229 | |
| 17230 | /** |
| 17231 | @brief Process host offload Rsp function (called when a |
| 17232 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17233 | |
| 17234 | @param pWDICtx: pointer to the WLAN DAL context |
| 17235 | pEventData: pointer to the event information structure |
| 17236 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17237 | @see |
| 17238 | @return Result of the function call |
| 17239 | */ |
| 17240 | WDI_Status |
| 17241 | WDI_ProcessHostOffloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17242 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17243 | WDI_ControlBlockType* pWDICtx, |
| 17244 | WDI_EventInfoType* pEventData |
| 17245 | ) |
| 17246 | { |
| 17247 | WDI_Status wdiStatus; |
| 17248 | eHalStatus halStatus; |
| 17249 | WDI_HostOffloadCb wdiHostOffloadCb; |
| 17250 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17251 | |
| 17252 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17253 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17254 | -------------------------------------------------------------------------*/ |
| 17255 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17256 | ( NULL == pEventData->pEventData)) |
| 17257 | { |
| 17258 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17259 | "%s: Invalid parameters", __FUNCTION__); |
| 17260 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17261 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17262 | } |
| 17263 | |
| 17264 | wdiHostOffloadCb = (WDI_HostOffloadCb)pWDICtx->pfncRspCB; |
| 17265 | |
| 17266 | /*------------------------------------------------------------------------- |
| 17267 | Extract response and send it to UMAC |
| 17268 | -------------------------------------------------------------------------*/ |
| 17269 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17270 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17271 | |
| 17272 | /*Notify UMAC*/ |
| 17273 | wdiHostOffloadCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17274 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17275 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17276 | }/*WDI_ProcessHostOffloadRsp*/ |
| 17277 | |
| 17278 | /** |
| 17279 | @brief Process keep alive Rsp function (called when a |
| 17280 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17281 | |
| 17282 | @param pWDICtx: pointer to the WLAN DAL context |
| 17283 | pEventData: pointer to the event information structure |
| 17284 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17285 | @see |
| 17286 | @return Result of the function call |
| 17287 | */ |
| 17288 | WDI_Status |
| 17289 | WDI_ProcessKeepAliveRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17290 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17291 | WDI_ControlBlockType* pWDICtx, |
| 17292 | WDI_EventInfoType* pEventData |
| 17293 | ) |
| 17294 | { |
| 17295 | WDI_Status wdiStatus; |
| 17296 | eHalStatus halStatus; |
| 17297 | WDI_KeepAliveCb wdiKeepAliveCb; |
| 17298 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17299 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 17300 | "Received WDI_ProcessKeepAliveRsp Callback from HAL"); |
| 17301 | |
| 17302 | |
| 17303 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17304 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17305 | -------------------------------------------------------------------------*/ |
| 17306 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17307 | ( NULL == pEventData->pEventData)) |
| 17308 | { |
| 17309 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17310 | "%s: Invalid parameters", __FUNCTION__); |
| 17311 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17312 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17313 | } |
| 17314 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17315 | wdiKeepAliveCb = (WDI_KeepAliveCb)pWDICtx->pfncRspCB; |
| 17316 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17317 | /*------------------------------------------------------------------------- |
| 17318 | Extract response and send it to UMAC |
| 17319 | -------------------------------------------------------------------------*/ |
| 17320 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17321 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17322 | |
| 17323 | /*Notify UMAC*/ |
| 17324 | wdiKeepAliveCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17325 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17326 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17327 | }/*WDI_ProcessKeepAliveRsp*/ |
| 17328 | |
| 17329 | /** |
| 17330 | @brief Process wowl add ptrn Rsp function (called when a |
| 17331 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17332 | |
| 17333 | @param pWDICtx: pointer to the WLAN DAL context |
| 17334 | pEventData: pointer to the event information structure |
| 17335 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17336 | @see |
| 17337 | @return Result of the function call |
| 17338 | */ |
| 17339 | WDI_Status |
| 17340 | WDI_ProcessWowlAddBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17341 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17342 | WDI_ControlBlockType* pWDICtx, |
| 17343 | WDI_EventInfoType* pEventData |
| 17344 | ) |
| 17345 | { |
| 17346 | WDI_Status wdiStatus; |
| 17347 | eHalStatus halStatus; |
| 17348 | WDI_WowlAddBcPtrnCb wdiWowlAddBcPtrnCb; |
| 17349 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17350 | |
| 17351 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17352 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17353 | -------------------------------------------------------------------------*/ |
| 17354 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17355 | ( NULL == pEventData->pEventData)) |
| 17356 | { |
| 17357 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17358 | "%s: Invalid parameters", __FUNCTION__); |
| 17359 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17360 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17361 | } |
| 17362 | |
| 17363 | wdiWowlAddBcPtrnCb = (WDI_WowlAddBcPtrnCb)pWDICtx->pfncRspCB; |
| 17364 | |
| 17365 | /*------------------------------------------------------------------------- |
| 17366 | Extract response and send it to UMAC |
| 17367 | -------------------------------------------------------------------------*/ |
| 17368 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17369 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17370 | |
| 17371 | /*Notify UMAC*/ |
| 17372 | wdiWowlAddBcPtrnCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17373 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17374 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17375 | }/*WDI_ProcessWowlAddBcPtrnRsp*/ |
| 17376 | |
| 17377 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17378 | @brief Process wowl delete ptrn Rsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17379 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17380 | |
| 17381 | @param pWDICtx: pointer to the WLAN DAL context |
| 17382 | pEventData: pointer to the event information structure |
| 17383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17384 | @see |
| 17385 | @return Result of the function call |
| 17386 | */ |
| 17387 | WDI_Status |
| 17388 | WDI_ProcessWowlDelBcPtrnRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17389 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17390 | WDI_ControlBlockType* pWDICtx, |
| 17391 | WDI_EventInfoType* pEventData |
| 17392 | ) |
| 17393 | { |
| 17394 | WDI_Status wdiStatus; |
| 17395 | eHalStatus halStatus; |
| 17396 | WDI_WowlDelBcPtrnCb wdiWowlDelBcPtrnCb; |
| 17397 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17398 | |
| 17399 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17400 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17401 | -------------------------------------------------------------------------*/ |
| 17402 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17403 | ( NULL == pEventData->pEventData)) |
| 17404 | { |
| 17405 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17406 | "%s: Invalid parameters", __FUNCTION__); |
| 17407 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17408 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17409 | } |
| 17410 | |
| 17411 | wdiWowlDelBcPtrnCb = (WDI_WowlDelBcPtrnCb)pWDICtx->pfncRspCB; |
| 17412 | |
| 17413 | /*------------------------------------------------------------------------- |
| 17414 | Extract response and send it to UMAC |
| 17415 | -------------------------------------------------------------------------*/ |
| 17416 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17417 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17418 | |
| 17419 | /*Notify UMAC*/ |
| 17420 | wdiWowlDelBcPtrnCb( wdiStatus, 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 | }/*WDI_ProcessWowlDelBcPtrnRsp*/ |
| 17424 | |
| 17425 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17426 | @brief Process wowl enter Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17427 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17428 | |
| 17429 | @param pWDICtx: pointer to the WLAN DAL context |
| 17430 | pEventData: pointer to the event information structure |
| 17431 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17432 | @see |
| 17433 | @return Result of the function call |
| 17434 | */ |
| 17435 | WDI_Status |
| 17436 | WDI_ProcessWowlEnterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17437 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17438 | WDI_ControlBlockType* pWDICtx, |
| 17439 | WDI_EventInfoType* pEventData |
| 17440 | ) |
| 17441 | { |
| 17442 | WDI_Status wdiStatus; |
| 17443 | eHalStatus halStatus; |
| 17444 | WDI_WowlEnterReqCb wdiWowlEnterCb; |
| 17445 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17446 | |
| 17447 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17448 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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", __FUNCTION__); |
| 17455 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17456 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17457 | } |
| 17458 | |
| 17459 | wdiWowlEnterCb = (WDI_WowlEnterReqCb)pWDICtx->pfncRspCB; |
| 17460 | |
| 17461 | /*------------------------------------------------------------------------- |
| 17462 | Extract response and send it to UMAC |
| 17463 | -------------------------------------------------------------------------*/ |
| 17464 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17465 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17466 | |
| 17467 | /*Notify UMAC*/ |
| 17468 | wdiWowlEnterCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17469 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17470 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17471 | }/*WDI_ProcessWowlEnterRsp*/ |
| 17472 | |
| 17473 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17474 | @brief Process wowl exit Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17475 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17476 | |
| 17477 | @param pWDICtx: pointer to the WLAN DAL context |
| 17478 | pEventData: pointer to the event information structure |
| 17479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17480 | @see |
| 17481 | @return Result of the function call |
| 17482 | */ |
| 17483 | WDI_Status |
| 17484 | WDI_ProcessWowlExitRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17485 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17486 | WDI_ControlBlockType* pWDICtx, |
| 17487 | WDI_EventInfoType* pEventData |
| 17488 | ) |
| 17489 | { |
| 17490 | WDI_Status wdiStatus; |
| 17491 | eHalStatus halStatus; |
| 17492 | WDI_WowlExitReqCb wdiWowlExitCb; |
| 17493 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17494 | |
| 17495 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17496 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17497 | -------------------------------------------------------------------------*/ |
| 17498 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17499 | ( NULL == pEventData->pEventData)) |
| 17500 | { |
| 17501 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17502 | "%s: Invalid parameters", __FUNCTION__); |
| 17503 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17504 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17505 | } |
| 17506 | |
| 17507 | wdiWowlExitCb = (WDI_WowlExitReqCb)pWDICtx->pfncRspCB; |
| 17508 | |
| 17509 | /*------------------------------------------------------------------------- |
| 17510 | Extract response and send it to UMAC |
| 17511 | -------------------------------------------------------------------------*/ |
| 17512 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17513 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17514 | |
| 17515 | /*Notify UMAC*/ |
| 17516 | wdiWowlExitCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17517 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17518 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17519 | }/*WDI_ProcessWowlExitRsp*/ |
| 17520 | |
| 17521 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17522 | @brief Process Configure Apps CPU wakeup State Rsp function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17523 | (called when a response is being received over the bus |
| 17524 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17525 | |
| 17526 | @param pWDICtx: pointer to the WLAN DAL context |
| 17527 | pEventData: pointer to the event information structure |
| 17528 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17529 | @see |
| 17530 | @return Result of the function call |
| 17531 | */ |
| 17532 | WDI_Status |
| 17533 | WDI_ProcessConfigureAppsCpuWakeupStateRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17534 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17535 | WDI_ControlBlockType* pWDICtx, |
| 17536 | WDI_EventInfoType* pEventData |
| 17537 | ) |
| 17538 | { |
| 17539 | WDI_Status wdiStatus; |
| 17540 | eHalStatus halStatus; |
| 17541 | WDI_ConfigureAppsCpuWakeupStateCb wdiConfigureAppsCpuWakeupStateCb; |
| 17542 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17543 | |
| 17544 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17545 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17546 | -------------------------------------------------------------------------*/ |
| 17547 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17548 | ( NULL == pEventData->pEventData)) |
| 17549 | { |
| 17550 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17551 | "%s: Invalid parameters", __FUNCTION__); |
| 17552 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17553 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17554 | } |
| 17555 | |
| 17556 | wdiConfigureAppsCpuWakeupStateCb = (WDI_ConfigureAppsCpuWakeupStateCb)pWDICtx->pfncRspCB; |
| 17557 | |
| 17558 | /*------------------------------------------------------------------------- |
| 17559 | Extract response and send it to UMAC |
| 17560 | -------------------------------------------------------------------------*/ |
| 17561 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17562 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17563 | |
| 17564 | /*Notify UMAC*/ |
| 17565 | wdiConfigureAppsCpuWakeupStateCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17566 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17567 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17568 | }/*WDI_ProcessConfigureAppsCpuWakeupStateRsp*/ |
| 17569 | |
| 17570 | |
| 17571 | /** |
| 17572 | @brief Process Nv download(called when a response |
| 17573 | 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] | 17574 | |
| 17575 | @param pWDICtx: pointer to the WLAN DAL context |
| 17576 | pEventData: pointer to the event information structure |
| 17577 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17578 | @see |
| 17579 | @return Result of the function call |
| 17580 | */ |
| 17581 | WDI_Status |
| 17582 | WDI_ProcessNvDownloadRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17583 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17584 | WDI_ControlBlockType* pWDICtx, |
| 17585 | WDI_EventInfoType* pEventData |
| 17586 | ) |
| 17587 | { |
| 17588 | |
| 17589 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 17590 | tHalNvImgDownloadRspParams halNvDownloadRsp; |
| 17591 | WDI_NvDownloadRspInfoType wdiNvDownloadRsp; |
| 17592 | |
| 17593 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17594 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17595 | -------------------------------------------------------------------------*/ |
| 17596 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17597 | ( NULL == pEventData->pEventData)) |
| 17598 | { |
| 17599 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17600 | "%s: Invalid parameters", __FUNCTION__); |
| 17601 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17602 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17603 | } |
| 17604 | |
| 17605 | /*------------------------------------------------------------------------- |
| 17606 | Extract response and send it to UMAC |
| 17607 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17608 | wpalMemoryCopy( &halNvDownloadRsp, |
| 17609 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17610 | sizeof(halNvDownloadRsp)); |
| 17611 | |
| 17612 | wdiNvDownloadRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halNvDownloadRsp.status); |
| 17613 | |
| 17614 | if((wdiNvDownloadRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17615 | (pWDICtx->wdiNvBlobInfo.usCurrentFragment != |
| 17616 | pWDICtx->wdiNvBlobInfo.usTotalFragment )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17617 | { |
| 17618 | WDI_NvDownloadReq(&pWDICtx->wdiCachedNvDownloadReq, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17619 | (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB, pWDICtx->pRspCBUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17620 | } |
| 17621 | else |
| 17622 | { |
| 17623 | /*Reset the Nv related global information in WDI context information */ |
| 17624 | pWDICtx->wdiNvBlobInfo.usTotalFragment = 0; |
| 17625 | pWDICtx->wdiNvBlobInfo.usFragmentSize = 0; |
| 17626 | pWDICtx->wdiNvBlobInfo.usCurrentFragment = 0; |
| 17627 | /*call WDA callback function for last fragment */ |
| 17628 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pWDICtx->pfncRspCB; |
| 17629 | wdiNvDownloadRspCb( &wdiNvDownloadRsp, pWDICtx->pRspCBUserData); |
| 17630 | } |
| 17631 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17632 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17633 | } |
| 17634 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 17635 | /** |
| 17636 | @brief Process Add TSpec Rsp function (called when a response |
| 17637 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17638 | |
| 17639 | @param pWDICtx: pointer to the WLAN DAL context |
| 17640 | pEventData: pointer to the event information structure |
| 17641 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17642 | @see |
| 17643 | @return Result of the function call |
| 17644 | */ |
| 17645 | WDI_Status |
| 17646 | WDI_ProcessAggrAddTSpecRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17647 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17648 | WDI_ControlBlockType* pWDICtx, |
| 17649 | WDI_EventInfoType* pEventData |
| 17650 | ) |
| 17651 | { |
| 17652 | WDI_Status wdiStatus; |
| 17653 | tAggrAddTsRspParams aggrAddTsRsp; |
| 17654 | WDI_AggrAddTsRspCb wdiAggrAddTsRspCb; |
| 17655 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17656 | |
| 17657 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17658 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17659 | -------------------------------------------------------------------------*/ |
| 17660 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17661 | ( NULL == pEventData->pEventData)) |
| 17662 | { |
| 17663 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17664 | "%s: Invalid parameters", __FUNCTION__); |
| 17665 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17666 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17667 | } |
| 17668 | |
| 17669 | wdiAggrAddTsRspCb = (WDI_AddTsRspCb)pWDICtx->pfncRspCB; |
| 17670 | |
| 17671 | /*------------------------------------------------------------------------- |
| 17672 | Extract response and send it to UMAC |
| 17673 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17674 | wpalMemoryCopy( &aggrAddTsRsp, |
| 17675 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17676 | sizeof(aggrAddTsRsp)); |
| 17677 | |
| 17678 | /* What is the difference between status0 and status1? */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17679 | wdiStatus = WDI_HAL_2_WDI_STATUS(aggrAddTsRsp.status0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17680 | |
| 17681 | /*Notify UMAC*/ |
| 17682 | wdiAggrAddTsRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17683 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17684 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17685 | }/*WDI_ProcessAddTSpecRsp*/ |
| 17686 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 17687 | |
| 17688 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17689 | @brief WDI_ProcessHostResumeRsp function (called when a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17690 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17691 | |
| 17692 | @param pWDICtx: pointer to the WLAN DAL context |
| 17693 | pEventData: pointer to the event information structure |
| 17694 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17695 | @see |
| 17696 | @return Result of the function call |
| 17697 | */ |
| 17698 | WDI_Status |
| 17699 | WDI_ProcessHostResumeRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17700 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17701 | WDI_ControlBlockType* pWDICtx, |
| 17702 | WDI_EventInfoType* pEventData |
| 17703 | ) |
| 17704 | { |
| 17705 | WDI_SuspendResumeRspParamsType wdiResumeRspParams; |
| 17706 | WDI_HostResumeEventRspCb wdiHostResumeRspCb; |
| 17707 | tHalHostResumeRspParams hostResumeRspMsg; |
| 17708 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17709 | |
| 17710 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17711 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17712 | -------------------------------------------------------------------------*/ |
| 17713 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17714 | ( NULL == pEventData->pEventData)) |
| 17715 | { |
| 17716 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17717 | "%s: Invalid parameters", __FUNCTION__); |
| 17718 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17719 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17720 | } |
| 17721 | |
| 17722 | wdiHostResumeRspCb = (WDI_HostResumeEventRspCb)pWDICtx->pfncRspCB; |
| 17723 | |
| 17724 | /*------------------------------------------------------------------------- |
| 17725 | Extract response and send it to UMAC |
| 17726 | -------------------------------------------------------------------------*/ |
| 17727 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17728 | wpalMemoryCopy( &hostResumeRspMsg, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17729 | (wpt_uint8*)pEventData->pEventData, |
| 17730 | sizeof(hostResumeRspMsg)); |
| 17731 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17732 | wdiResumeRspParams.wdiStatus = |
| 17733 | WDI_HAL_2_WDI_STATUS(hostResumeRspMsg.status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17734 | |
| 17735 | /*Notify UMAC*/ |
| 17736 | wdiHostResumeRspCb(&wdiResumeRspParams, (void*) pWDICtx->pRspCBUserData); |
| 17737 | |
| 17738 | return WDI_STATUS_SUCCESS; |
| 17739 | } |
| 17740 | |
| 17741 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17742 | @brief Process Set Tx PER Rsp function (called when a response |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17743 | is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17744 | |
| 17745 | @param pWDICtx: pointer to the WLAN DAL context |
| 17746 | pEventData: pointer to the event information structure |
| 17747 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17748 | @see |
| 17749 | @return Result of the function call |
| 17750 | */ |
| 17751 | WDI_Status |
| 17752 | WDI_ProcessSetTxPerTrackingRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17753 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17754 | WDI_ControlBlockType* pWDICtx, |
| 17755 | WDI_EventInfoType* pEventData |
| 17756 | ) |
| 17757 | { |
| 17758 | WDI_Status wdiStatus; |
| 17759 | eHalStatus halStatus; |
| 17760 | WDI_SetTxPerTrackingRspCb pwdiSetTxPerTrackingRspCb; |
| 17761 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17762 | |
| 17763 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17764 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17765 | -------------------------------------------------------------------------*/ |
| 17766 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17767 | ( NULL == pEventData->pEventData)) |
| 17768 | { |
| 17769 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17770 | "%s: Invalid parameters", __FUNCTION__); |
| 17771 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17772 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17773 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17774 | |
| 17775 | pwdiSetTxPerTrackingRspCb = (WDI_SetTxPerTrackingRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17776 | |
| 17777 | /*------------------------------------------------------------------------- |
| 17778 | Extract response and send it to UMAC |
| 17779 | -------------------------------------------------------------------------*/ |
| 17780 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17781 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17782 | |
| 17783 | /*Notify UMAC*/ |
| 17784 | pwdiSetTxPerTrackingRspCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 17785 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17786 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17787 | }/*WDI_ProcessSetTxPerTrackingRsp*/ |
| 17788 | |
| 17789 | /*========================================================================== |
| 17790 | Indications from HAL |
| 17791 | ==========================================================================*/ |
| 17792 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17793 | @brief Process Low RSSI Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17794 | indication of this kind is being received over the bus |
| 17795 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17796 | |
| 17797 | @param pWDICtx: pointer to the WLAN DAL context |
| 17798 | pEventData: pointer to the event information structure |
| 17799 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17800 | @see |
| 17801 | @return Result of the function call |
| 17802 | */ |
| 17803 | WDI_Status |
| 17804 | WDI_ProcessLowRSSIInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17805 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17806 | WDI_ControlBlockType* pWDICtx, |
| 17807 | WDI_EventInfoType* pEventData |
| 17808 | ) |
| 17809 | { |
| 17810 | WDI_LowLevelIndType wdiInd; |
| 17811 | tHalRSSINotificationIndMsg halRSSINotificationIndMsg; |
| 17812 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17813 | |
| 17814 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17815 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17816 | -------------------------------------------------------------------------*/ |
| 17817 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17818 | ( NULL == pEventData->pEventData)) |
| 17819 | { |
| 17820 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17821 | "%s: Invalid parameters", __FUNCTION__); |
| 17822 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17823 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17824 | } |
| 17825 | |
| 17826 | /*------------------------------------------------------------------------- |
| 17827 | Extract indication and send it to UMAC |
| 17828 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17829 | wpalMemoryCopy( (void *)&halRSSINotificationIndMsg.rssiNotificationParams, |
| 17830 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17831 | sizeof(tHalRSSINotification)); |
| 17832 | |
| 17833 | /*Fill in the indication parameters*/ |
| 17834 | wdiInd.wdiIndicationType = WDI_RSSI_NOTIFICATION_IND; |
| 17835 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1PosCross = |
| 17836 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1PosCross; |
| 17837 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres1NegCross = |
| 17838 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres1NegCross; |
| 17839 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2PosCross = |
| 17840 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2PosCross; |
| 17841 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres2NegCross = |
| 17842 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres2NegCross; |
| 17843 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3PosCross = |
| 17844 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3PosCross; |
| 17845 | wdiInd.wdiIndicationData.wdiLowRSSIInfo.bRssiThres3NegCross = |
| 17846 | halRSSINotificationIndMsg.rssiNotificationParams.bRssiThres3NegCross; |
| 17847 | |
| 17848 | /*Notify UMAC*/ |
| 17849 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17850 | |
| 17851 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17852 | }/*WDI_ProcessLowRSSIInd*/ |
| 17853 | |
| 17854 | |
| 17855 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17856 | @brief Process Missed Beacon Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17857 | an indication of this kind is being received over the |
| 17858 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17859 | |
| 17860 | @param pWDICtx: pointer to the WLAN DAL context |
| 17861 | pEventData: pointer to the event information structure |
| 17862 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17863 | @see |
| 17864 | @return Result of the function call |
| 17865 | */ |
| 17866 | WDI_Status |
| 17867 | WDI_ProcessMissedBeaconInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17868 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17869 | WDI_ControlBlockType* pWDICtx, |
| 17870 | WDI_EventInfoType* pEventData |
| 17871 | ) |
| 17872 | { |
| 17873 | WDI_Status wdiStatus; |
| 17874 | eHalStatus halStatus; |
| 17875 | WDI_LowLevelIndType wdiInd; |
| 17876 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17877 | |
| 17878 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17879 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17880 | -------------------------------------------------------------------------*/ |
| 17881 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17882 | ( NULL == pEventData->pEventData)) |
| 17883 | { |
| 17884 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17885 | "%s: Invalid parameters", __FUNCTION__); |
| 17886 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17887 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17888 | } |
| 17889 | |
| 17890 | /*------------------------------------------------------------------------- |
| 17891 | Extract indication and send it to UMAC |
| 17892 | -------------------------------------------------------------------------*/ |
| 17893 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 17894 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17895 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17896 | |
| 17897 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17898 | wdiInd.wdiIndicationType = WDI_MISSED_BEACON_IND; |
| 17899 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17900 | /*Notify UMAC*/ |
| 17901 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17902 | |
| 17903 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17904 | }/*WDI_ProcessMissedBeaconInd*/ |
| 17905 | |
| 17906 | |
| 17907 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17908 | @brief Process Unk Addr Frame Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17909 | an indication of this kind is being received over the |
| 17910 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17911 | |
| 17912 | @param pWDICtx: pointer to the WLAN DAL context |
| 17913 | pEventData: pointer to the event information structure |
| 17914 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17915 | @see |
| 17916 | @return Result of the function call |
| 17917 | */ |
| 17918 | WDI_Status |
| 17919 | WDI_ProcessUnkAddrFrameInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17920 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17921 | WDI_ControlBlockType* pWDICtx, |
| 17922 | WDI_EventInfoType* pEventData |
| 17923 | ) |
| 17924 | { |
| 17925 | WDI_Status wdiStatus; |
| 17926 | eHalStatus halStatus; |
| 17927 | WDI_LowLevelIndType wdiInd; |
| 17928 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17929 | |
| 17930 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17931 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17932 | -------------------------------------------------------------------------*/ |
| 17933 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17934 | ( NULL == pEventData->pEventData)) |
| 17935 | { |
| 17936 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17937 | "%s: Invalid parameters", __FUNCTION__); |
| 17938 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17939 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17940 | } |
| 17941 | |
| 17942 | /*------------------------------------------------------------------------- |
| 17943 | Extract indication and send it to UMAC |
| 17944 | -------------------------------------------------------------------------*/ |
| 17945 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 17946 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17947 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17948 | |
| 17949 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17950 | wdiInd.wdiIndicationType = WDI_UNKNOWN_ADDR2_FRAME_RX_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17951 | /* ! TO DO - fill in from HAL struct: |
| 17952 | wdiInd.wdiIndicationData.wdiUnkAddr2FrmInfo*/ |
| 17953 | |
| 17954 | /*Notify UMAC*/ |
| 17955 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17956 | |
| 17957 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17958 | }/*WDI_ProcessUnkAddrFrameInd*/ |
| 17959 | |
| 17960 | |
| 17961 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17962 | @brief Process MIC Failure Indication function (called when an |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17963 | indication of this kind is being received over the bus |
| 17964 | from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17965 | |
| 17966 | @param pWDICtx: pointer to the WLAN DAL context |
| 17967 | pEventData: pointer to the event information structure |
| 17968 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17969 | @see |
| 17970 | @return Result of the function call |
| 17971 | */ |
| 17972 | WDI_Status |
| 17973 | WDI_ProcessMicFailureInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17974 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17975 | WDI_ControlBlockType* pWDICtx, |
| 17976 | WDI_EventInfoType* pEventData |
| 17977 | ) |
| 17978 | { |
| 17979 | WDI_LowLevelIndType wdiInd; |
| 17980 | tpSirMicFailureInd pHalMicFailureInd; |
| 17981 | |
| 17982 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 17983 | |
| 17984 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17985 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17986 | -------------------------------------------------------------------------*/ |
| 17987 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 17988 | ( NULL == pEventData->pEventData)) |
| 17989 | { |
| 17990 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 17991 | "%s: Invalid parameters", __FUNCTION__); |
| 17992 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17993 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17994 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 17995 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 17996 | pHalMicFailureInd = (tpSirMicFailureInd)pEventData->pEventData; |
| 17997 | /*------------------------------------------------------------------------- |
| 17998 | Extract indication and send it to UMAC |
| 17999 | -------------------------------------------------------------------------*/ |
| 18000 | |
| 18001 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18002 | wdiInd.wdiIndicationType = WDI_MIC_FAILURE_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18003 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.bssId, |
| 18004 | pHalMicFailureInd->bssId, WDI_MAC_ADDR_LEN); |
| 18005 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macSrcAddr, |
| 18006 | pHalMicFailureInd->info.srcMacAddr, WDI_MAC_ADDR_LEN); |
| 18007 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macTaAddr, |
| 18008 | pHalMicFailureInd->info.taMacAddr, WDI_MAC_ADDR_LEN); |
| 18009 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macDstAddr, |
| 18010 | pHalMicFailureInd->info.dstMacAddr, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18011 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucMulticast = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18012 | pHalMicFailureInd->info.multicast; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18013 | wdiInd.wdiIndicationData.wdiMICFailureInfo.ucIV1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18014 | pHalMicFailureInd->info.IV1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18015 | wdiInd.wdiIndicationData.wdiMICFailureInfo.keyId= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18016 | pHalMicFailureInd->info.keyId; |
| 18017 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.TSC, |
| 18018 | pHalMicFailureInd->info.TSC,WDI_CIPHER_SEQ_CTR_SIZE); |
| 18019 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiMICFailureInfo.macRxAddr, |
| 18020 | pHalMicFailureInd->info.rxMacAddr, WDI_MAC_ADDR_LEN); |
| 18021 | /*Notify UMAC*/ |
| 18022 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18023 | |
| 18024 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18025 | }/*WDI_ProcessMicFailureInd*/ |
| 18026 | |
| 18027 | |
| 18028 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18029 | @brief Process Fatal Failure Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18030 | an indication of this kind is being received over the |
| 18031 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18032 | |
| 18033 | @param pWDICtx: pointer to the WLAN DAL context |
| 18034 | pEventData: pointer to the event information structure |
| 18035 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18036 | @see |
| 18037 | @return Result of the function call |
| 18038 | */ |
| 18039 | WDI_Status |
| 18040 | WDI_ProcessFatalErrorInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18041 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18042 | WDI_ControlBlockType* pWDICtx, |
| 18043 | WDI_EventInfoType* pEventData |
| 18044 | ) |
| 18045 | { |
| 18046 | WDI_Status wdiStatus; |
| 18047 | eHalStatus halStatus; |
| 18048 | WDI_LowLevelIndType wdiInd; |
| 18049 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18050 | |
| 18051 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18052 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18053 | -------------------------------------------------------------------------*/ |
| 18054 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18055 | ( NULL == pEventData->pEventData)) |
| 18056 | { |
| 18057 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18058 | "%s: Invalid parameters", __FUNCTION__); |
| 18059 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18060 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18061 | } |
| 18062 | |
| 18063 | /*------------------------------------------------------------------------- |
| 18064 | Extract indication and send it to UMAC |
| 18065 | -------------------------------------------------------------------------*/ |
| 18066 | |
| 18067 | /*! TO DO: Parameters need to be unpacked according to HAL struct*/ |
| 18068 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18069 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18070 | |
| 18071 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18072 | "Fatal failure received from device %d ", halStatus ); |
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 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18075 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 18076 | wdiInd.wdiIndicationData.usErrorCode = WDI_ERR_DEV_INTERNAL_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18077 | |
| 18078 | /*Notify UMAC*/ |
| 18079 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18080 | |
| 18081 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18082 | }/*WDI_ProcessFatalErrorInd*/ |
| 18083 | |
| 18084 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18085 | @brief Process Delete STA Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18086 | an indication of this kind is being received over the |
| 18087 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18088 | |
| 18089 | @param pWDICtx: pointer to the WLAN DAL context |
| 18090 | pEventData: pointer to the event information structure |
| 18091 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18092 | @see |
| 18093 | @return Result of the function call |
| 18094 | */ |
| 18095 | WDI_Status |
| 18096 | WDI_ProcessDelSTAInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18097 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18098 | WDI_ControlBlockType* pWDICtx, |
| 18099 | WDI_EventInfoType* pEventData |
| 18100 | ) |
| 18101 | { |
| 18102 | tDeleteStaContextParams halDelSTACtx; |
| 18103 | WDI_LowLevelIndType wdiInd; |
| 18104 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18105 | |
| 18106 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18107 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18108 | -------------------------------------------------------------------------*/ |
| 18109 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18110 | ( NULL == pEventData->pEventData)) |
| 18111 | { |
| 18112 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18113 | "%s: Invalid parameters", __FUNCTION__); |
| 18114 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18115 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18116 | } |
| 18117 | |
| 18118 | /*------------------------------------------------------------------------- |
| 18119 | Extract indication and send it to UMAC |
| 18120 | -------------------------------------------------------------------------*/ |
| 18121 | |
| 18122 | /* Parameters need to be unpacked according to HAL struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18123 | wpalMemoryCopy( &halDelSTACtx, |
| 18124 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18125 | sizeof(halDelSTACtx)); |
| 18126 | |
| 18127 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18128 | wdiInd.wdiIndicationType = WDI_DEL_STA_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18129 | |
| 18130 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macADDR2, |
| 18131 | halDelSTACtx.addr2, WDI_MAC_ADDR_LEN); |
| 18132 | wpalMemoryCopy(wdiInd.wdiIndicationData.wdiDeleteSTAIndType.macBSSID, |
| 18133 | halDelSTACtx.bssId, WDI_MAC_ADDR_LEN); |
| 18134 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18135 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.usAssocId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18136 | halDelSTACtx.assocId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18137 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.ucSTAIdx = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18138 | halDelSTACtx.staId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18139 | wdiInd.wdiIndicationData.wdiDeleteSTAIndType.wptReasonCode = |
| 18140 | halDelSTACtx.reasonCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18141 | |
| 18142 | /*Notify UMAC*/ |
| 18143 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18144 | |
| 18145 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18146 | }/*WDI_ProcessDelSTAInd*/ |
| 18147 | |
| 18148 | /** |
| 18149 | *@brief Process Coex Indication function (called when |
| 18150 | an indication of this kind is being received over the |
| 18151 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18152 | |
| 18153 | @param pWDICtx: pointer to the WLAN DAL context |
| 18154 | pEventData: pointer to the event information structure |
| 18155 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18156 | @see |
| 18157 | @return Result of the function call |
| 18158 | */ |
| 18159 | WDI_Status |
| 18160 | WDI_ProcessCoexInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18161 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18162 | WDI_ControlBlockType* pWDICtx, |
| 18163 | WDI_EventInfoType* pEventData |
| 18164 | ) |
| 18165 | { |
| 18166 | WDI_LowLevelIndType wdiInd; |
| 18167 | tCoexIndMsg halCoexIndMsg; |
| 18168 | wpt_uint32 index; |
| 18169 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18170 | |
| 18171 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18172 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18173 | -------------------------------------------------------------------------*/ |
| 18174 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18175 | ( NULL == pEventData->pEventData )) |
| 18176 | { |
| 18177 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18178 | "%s: Invalid parameters", __FUNCTION__); |
| 18179 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18180 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18181 | } |
| 18182 | |
| 18183 | /*------------------------------------------------------------------------- |
| 18184 | Extract indication and send it to UMAC |
| 18185 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18186 | wpalMemoryCopy( &halCoexIndMsg.coexIndParams, |
| 18187 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18188 | sizeof(halCoexIndMsg.coexIndParams) ); |
| 18189 | |
| 18190 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18191 | wdiInd.wdiIndicationType = WDI_COEX_IND; |
| 18192 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType = halCoexIndMsg.coexIndParams.coexIndType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18193 | for (index = 0; index < WDI_COEX_IND_DATA_SIZE; index++) |
| 18194 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18195 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[index] = halCoexIndMsg.coexIndParams.coexIndData[index]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18196 | } |
| 18197 | |
| 18198 | // DEBUG |
| 18199 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 18200 | "[COEX WDI] Coex Ind Type (%x) data (%x %x %x %x)", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18201 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndType, |
| 18202 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[0], |
| 18203 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[1], |
| 18204 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[2], |
| 18205 | wdiInd.wdiIndicationData.wdiCoexInfo.coexIndData[3] ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18206 | |
| 18207 | /*Notify UMAC*/ |
| 18208 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18209 | |
| 18210 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18211 | }/*WDI_ProcessCoexInd*/ |
| 18212 | |
| 18213 | /** |
| 18214 | *@brief Process Tx Complete Indication function (called when |
| 18215 | an indication of this kind is being received over the |
| 18216 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18217 | |
| 18218 | @param pWDICtx: pointer to the WLAN DAL context |
| 18219 | pEventData: pointer to the event information structure |
| 18220 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18221 | @see |
| 18222 | @return Result of the function call |
| 18223 | */ |
| 18224 | WDI_Status |
| 18225 | WDI_ProcessTxCompleteInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18226 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18227 | WDI_ControlBlockType* pWDICtx, |
| 18228 | WDI_EventInfoType* pEventData |
| 18229 | ) |
| 18230 | { |
| 18231 | WDI_LowLevelIndType wdiInd; |
| 18232 | tTxComplIndMsg halTxComplIndMsg; |
| 18233 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18234 | |
| 18235 | /*------------------------------------------------------------------------- |
| 18236 | Sanity check |
| 18237 | -------------------------------------------------------------------------*/ |
| 18238 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18239 | ( NULL == pEventData->pEventData )) |
| 18240 | { |
| 18241 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18242 | "%s: Invalid parameters", __FUNCTION__); |
| 18243 | WDI_ASSERT( 0 ); |
| 18244 | return WDI_STATUS_E_FAILURE; |
| 18245 | } |
| 18246 | |
| 18247 | /*------------------------------------------------------------------------- |
| 18248 | Extract indication and send it to UMAC |
| 18249 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18250 | wpalMemoryCopy( &halTxComplIndMsg.txComplParams, |
| 18251 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18252 | sizeof(halTxComplIndMsg.txComplParams) ); |
| 18253 | |
| 18254 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18255 | wdiInd.wdiIndicationType = WDI_TX_COMPLETE_IND; |
| 18256 | wdiInd.wdiIndicationData.tx_complete_status |
| 18257 | = halTxComplIndMsg.txComplParams.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18258 | |
| 18259 | /*Notify UMAC*/ |
| 18260 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18261 | |
| 18262 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18263 | }/*WDI_ProcessTxCompleteInd*/ |
| 18264 | |
| 18265 | #ifdef WLAN_FEATURE_P2P |
| 18266 | /** |
| 18267 | *@brief Process Noa Attr Indication function (called when |
| 18268 | an indication of this kind is being received over the |
| 18269 | bus from HAL) |
| 18270 | |
| 18271 | @param pWDICtx: pointer to the WLAN DAL context |
| 18272 | pEventData: pointer to the event information structure |
| 18273 | |
| 18274 | @see |
| 18275 | @return Result of the function call |
| 18276 | */ |
| 18277 | WDI_Status |
| 18278 | WDI_ProcessP2pNoaAttrInd |
| 18279 | ( |
| 18280 | WDI_ControlBlockType* pWDICtx, |
| 18281 | WDI_EventInfoType* pEventData |
| 18282 | ) |
| 18283 | { |
| 18284 | WDI_LowLevelIndType wdiInd; |
| 18285 | tNoaAttrIndMsg halNoaAttrIndMsg; |
| 18286 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18287 | |
| 18288 | /*------------------------------------------------------------------------- |
| 18289 | Sanity check |
| 18290 | -------------------------------------------------------------------------*/ |
| 18291 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18292 | ( NULL == pEventData->pEventData )) |
| 18293 | { |
| 18294 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18295 | "%s: Invalid parameters", __FUNCTION__); |
| 18296 | WDI_ASSERT( 0 ); |
| 18297 | return WDI_STATUS_E_FAILURE; |
| 18298 | } |
| 18299 | |
| 18300 | /*------------------------------------------------------------------------- |
| 18301 | Extract indication and send it to UMAC |
| 18302 | -------------------------------------------------------------------------*/ |
| 18303 | wpalMemoryCopy( &halNoaAttrIndMsg.noaAttrIndParams, |
| 18304 | pEventData->pEventData, |
| 18305 | sizeof(halNoaAttrIndMsg.noaAttrIndParams) ); |
| 18306 | |
| 18307 | /*Fill in the indication parameters*/ |
| 18308 | wdiInd.wdiIndicationType = WDI_P2P_NOA_ATTR_IND; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18309 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18310 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.status |
| 18311 | = halNoaAttrIndMsg.noaAttrIndParams.status; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18312 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18313 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucIndex |
| 18314 | = halNoaAttrIndMsg.noaAttrIndParams.index; |
| 18315 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.ucOppPsFlag |
| 18316 | = halNoaAttrIndMsg.noaAttrIndParams.oppPsFlag; |
| 18317 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usCtWin |
| 18318 | = halNoaAttrIndMsg.noaAttrIndParams.ctWin; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18319 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18320 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa1IntervalCnt |
| 18321 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1IntervalCnt; |
| 18322 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Duration |
| 18323 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Duration; |
| 18324 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1Interval |
| 18325 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1Interval; |
| 18326 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa1StartTime |
| 18327 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa1StartTime; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18328 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18329 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.usNoa2IntervalCnt |
| 18330 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2IntervalCnt; |
| 18331 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Duration |
| 18332 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Duration; |
| 18333 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2Interval |
| 18334 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2Interval; |
| 18335 | wdiInd.wdiIndicationData.wdiP2pNoaAttrInfo.uslNoa2StartTime |
| 18336 | = halNoaAttrIndMsg.noaAttrIndParams.uNoa2StartTime; |
| 18337 | |
| 18338 | /*Notify UMAC*/ |
| 18339 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18340 | |
| 18341 | return WDI_STATUS_SUCCESS; |
| 18342 | }/*WDI_ProcessNoaAttrInd*/ |
| 18343 | #endif |
| 18344 | |
| 18345 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18346 | @brief Process Tx PER Hit Indication function (called when |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18347 | an indication of this kind is being received over the |
| 18348 | bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18349 | |
| 18350 | @param pWDICtx: pointer to the WLAN DAL context |
| 18351 | pEventData: pointer to the event information structure |
| 18352 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18353 | @see |
| 18354 | @return Result of the function call |
| 18355 | */ |
| 18356 | WDI_Status |
| 18357 | WDI_ProcessTxPerHitInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18358 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18359 | WDI_ControlBlockType* pWDICtx, |
| 18360 | WDI_EventInfoType* pEventData |
| 18361 | ) |
| 18362 | { |
| 18363 | WDI_LowLevelIndType wdiInd; |
| 18364 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18365 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18366 | /*------------------------------------------------------------------------- |
| 18367 | Extract indication and send it to UMAC |
| 18368 | -------------------------------------------------------------------------*/ |
| 18369 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18370 | wdiInd.wdiIndicationType = WDI_TX_PER_HIT_IND; |
| 18371 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18372 | /*Notify UMAC*/ |
| 18373 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
| 18374 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18375 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18376 | }/*WDI_ProcessTxPerHitInd*/ |
| 18377 | |
| 18378 | #ifdef ANI_MANF_DIAG |
| 18379 | /** |
| 18380 | @brief WDI_ProcessFTMCommandReq |
| 18381 | Process FTM Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18382 | |
| 18383 | @param pWDICtx: pointer to the WLAN DAL context |
| 18384 | pEventData: pointer to the event information structure |
| 18385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18386 | @see |
| 18387 | @return Result of the function call |
| 18388 | */ |
| 18389 | WDI_Status |
| 18390 | WDI_ProcessFTMCommandReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18391 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18392 | WDI_ControlBlockType* pWDICtx, |
| 18393 | WDI_EventInfoType* pEventData |
| 18394 | ) |
| 18395 | { |
| 18396 | WDI_FTMCommandReqType *ftmCommandReq = NULL; |
| 18397 | wpt_uint8 *ftmCommandBuffer = NULL; |
| 18398 | wpt_uint16 dataOffset; |
| 18399 | wpt_uint16 bufferSize; |
| 18400 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18401 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18402 | -------------------------------------------------------------------------*/ |
| 18403 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18404 | ( NULL == pEventData->pEventData)) |
| 18405 | |
| 18406 | { |
| 18407 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18408 | "%s: Invalid parameters", __FUNCTION__); |
| 18409 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18410 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18411 | } |
| 18412 | |
| 18413 | ftmCommandReq = (WDI_FTMCommandReqType *)pEventData->pEventData; |
| 18414 | |
| 18415 | /* Get MSG Buffer */ |
| 18416 | WDI_GetMessageBuffer(pWDICtx, |
| 18417 | WDI_FTM_CMD_REQ, |
| 18418 | ftmCommandReq->bodyLength, |
| 18419 | &ftmCommandBuffer, |
| 18420 | &dataOffset, |
| 18421 | &bufferSize); |
| 18422 | |
| 18423 | wpalMemoryCopy(ftmCommandBuffer + dataOffset, |
| 18424 | ftmCommandReq->FTMCommandBody, |
| 18425 | ftmCommandReq->bodyLength); |
| 18426 | |
| 18427 | /* Send MSG */ |
| 18428 | return WDI_SendMsg(pWDICtx, |
| 18429 | ftmCommandBuffer, |
| 18430 | bufferSize, |
| 18431 | pEventData->pCBfnc, |
| 18432 | pEventData->pUserData, |
| 18433 | WDI_FTM_CMD_RESP); |
| 18434 | } |
| 18435 | |
| 18436 | /** |
| 18437 | @brief WDI_ProcessFTMCommandRsp |
| 18438 | Process FTM Command Response from HAL, simply route to HDD FTM |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18439 | |
| 18440 | @param pWDICtx: pointer to the WLAN DAL context |
| 18441 | pEventData: pointer to the event information structure |
| 18442 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18443 | @see |
| 18444 | @return Result of the function call |
| 18445 | */ |
| 18446 | WDI_Status |
| 18447 | WDI_ProcessFTMCommandRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18448 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18449 | WDI_ControlBlockType* pWDICtx, |
| 18450 | WDI_EventInfoType* pEventData |
| 18451 | ) |
| 18452 | { |
| 18453 | WDI_FTMCommandRspCb ftmCMDRspCb; |
| 18454 | tProcessPttRspParams *ftmCMDRspData = NULL; |
| 18455 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18456 | |
| 18457 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18458 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18459 | -------------------------------------------------------------------------*/ |
| 18460 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18461 | ( NULL == pEventData->pEventData)) |
| 18462 | { |
| 18463 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18464 | "%s: Invalid parameters", __FUNCTION__); |
| 18465 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18466 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18467 | } |
| 18468 | |
| 18469 | ftmCMDRspCb = (WDI_FTMCommandRspCb)pWDICtx->pfncRspCB; |
| 18470 | |
| 18471 | ftmCMDRspData = (tProcessPttRspParams *)pEventData->pEventData; |
| 18472 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18473 | wpalMemoryCopy((void *)pWDICtx->ucFTMCommandRspBuffer, |
| 18474 | (void *)&ftmCMDRspData->pttMsgBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18475 | ftmCMDRspData->pttMsgBuffer.msgBodyLength); |
| 18476 | |
| 18477 | /*Notify UMAC*/ |
| 18478 | ftmCMDRspCb((void *)pWDICtx->ucFTMCommandRspBuffer, pWDICtx->pRspCBUserData); |
| 18479 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18480 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18481 | } |
| 18482 | #endif /* ANI_MANF_DIAG */ |
| 18483 | /** |
| 18484 | @brief WDI_ProcessHalDumpCmdReq |
| 18485 | Process hal dump Command, simply route to HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18486 | |
| 18487 | @param pWDICtx: pointer to the WLAN DAL context |
| 18488 | pEventData: pointer to the event information structure |
| 18489 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18490 | @see |
| 18491 | @return Result of the function call |
| 18492 | */ |
| 18493 | WDI_Status |
| 18494 | WDI_ProcessHALDumpCmdReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18495 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18496 | WDI_ControlBlockType* pWDICtx, |
| 18497 | WDI_EventInfoType* pEventData |
| 18498 | ) |
| 18499 | { |
| 18500 | WDI_HALDumpCmdReqParamsType* pwdiHALDumpCmdParams = NULL; |
| 18501 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb = NULL; |
| 18502 | wpt_uint16 usDataOffset = 0; |
| 18503 | wpt_uint16 usSendSize = 0; |
| 18504 | tHalDumpCmdReqMsg halDumpCmdReqMsg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18505 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18506 | |
| 18507 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18508 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18509 | -------------------------------------------------------------------------*/ |
| 18510 | if (( NULL == pEventData ) || |
| 18511 | ( NULL == pEventData->pEventData) || |
| 18512 | ( NULL == pEventData->pCBfnc )) |
| 18513 | { |
| 18514 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18515 | "%s: Invalid parameters", __FUNCTION__); |
| 18516 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18517 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18518 | } |
| 18519 | |
| 18520 | pwdiHALDumpCmdParams = (WDI_HALDumpCmdReqParamsType*)pEventData->pEventData; |
| 18521 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pEventData->pCBfnc; |
| 18522 | |
| 18523 | /* Copying the HAL DUMP Command Information HAL Structure*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18524 | halDumpCmdReqMsg.dumpCmdReqParams.argument1 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18525 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.command; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18526 | halDumpCmdReqMsg.dumpCmdReqParams.argument2 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18527 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument1; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18528 | halDumpCmdReqMsg.dumpCmdReqParams.argument3 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18529 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument2; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18530 | halDumpCmdReqMsg.dumpCmdReqParams.argument4 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18531 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument3; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18532 | halDumpCmdReqMsg.dumpCmdReqParams.argument5 = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18533 | pwdiHALDumpCmdParams->wdiHALDumpCmdInfoType.argument4; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18534 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18535 | /*----------------------------------------------------------------------- |
| 18536 | Get message buffer |
| 18537 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18538 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_HAL_DUMP_CMD_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18539 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams), |
| 18540 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18541 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18542 | (usDataOffset + sizeof(halDumpCmdReqMsg.dumpCmdReqParams) ))) |
| 18543 | { |
| 18544 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18545 | "Unable to get send buffer in HAL Dump Command req %x %x %x", |
| 18546 | pEventData, pwdiHALDumpCmdParams, wdiHALDumpCmdRspCb); |
| 18547 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18548 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18549 | } |
| 18550 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18551 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 18552 | &halDumpCmdReqMsg.dumpCmdReqParams, |
| 18553 | sizeof(halDumpCmdReqMsg.dumpCmdReqParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18554 | |
| 18555 | pWDICtx->wdiReqStatusCB = pwdiHALDumpCmdParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18556 | pWDICtx->pReqStatusUserData = pwdiHALDumpCmdParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18557 | |
| 18558 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18559 | Send Start Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18560 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18561 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 18562 | wdiHALDumpCmdRspCb, pEventData->pUserData, |
| 18563 | WDI_HAL_DUMP_CMD_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18564 | } |
| 18565 | |
| 18566 | /** |
| 18567 | @brief WDI_ProcessHalDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18568 | Process hal Dump Command Response from HAL, simply route to HDD |
| 18569 | |
| 18570 | @param pWDICtx: pointer to the WLAN DAL context |
| 18571 | pEventData: pointer to the event information structure |
| 18572 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18573 | @see |
| 18574 | @return Result of the function call |
| 18575 | */ |
| 18576 | WDI_Status |
| 18577 | WDI_ProcessHALDumpCmdRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18578 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18579 | WDI_ControlBlockType* pWDICtx, |
| 18580 | WDI_EventInfoType* pEventData |
| 18581 | ) |
| 18582 | { |
| 18583 | WDI_HALDumpCmdRspCb wdiHALDumpCmdRspCb; |
| 18584 | tpHalDumpCmdRspParams halDumpCmdRspParams; |
| 18585 | WDI_HALDumpCmdRspParamsType wdiHALDumpCmdRsp; |
| 18586 | |
| 18587 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18588 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18589 | -------------------------------------------------------------------------*/ |
| 18590 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 18591 | ( NULL == pEventData->pEventData)) |
| 18592 | { |
| 18593 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18594 | "%s: Invalid parameters", __FUNCTION__); |
| 18595 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18596 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18597 | } |
| 18598 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18599 | wdiHALDumpCmdRspCb = (WDI_HALDumpCmdRspCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18600 | |
| 18601 | /*Initialize the WDI Response structure */ |
| 18602 | wdiHALDumpCmdRsp.usBufferLen = 0; |
| 18603 | wdiHALDumpCmdRsp.pBuffer = NULL; |
| 18604 | |
| 18605 | halDumpCmdRspParams = (tHalDumpCmdRspParams *)pEventData->pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18606 | |
| 18607 | wdiHALDumpCmdRsp.wdiStatus = |
| 18608 | WDI_HAL_2_WDI_STATUS(halDumpCmdRspParams->status); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18609 | |
| 18610 | if (( wdiHALDumpCmdRsp.wdiStatus == WDI_STATUS_SUCCESS) && |
| 18611 | (halDumpCmdRspParams->rspLength != 0)) |
| 18612 | { |
| 18613 | /* Copy the response data */ |
| 18614 | wdiHALDumpCmdRsp.usBufferLen = halDumpCmdRspParams->rspLength; |
| 18615 | wdiHALDumpCmdRsp.pBuffer = wpalMemoryAllocate(halDumpCmdRspParams->rspLength); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18616 | wpalMemoryCopy( &halDumpCmdRspParams->rspBuffer, |
| 18617 | wdiHALDumpCmdRsp.pBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18618 | sizeof(wdiHALDumpCmdRsp.usBufferLen)); |
| 18619 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18620 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18621 | /*Notify UMAC*/ |
| 18622 | wdiHALDumpCmdRspCb(&wdiHALDumpCmdRsp, pWDICtx->pRspCBUserData); |
| 18623 | |
| 18624 | if(wdiHALDumpCmdRsp.pBuffer != NULL) |
| 18625 | { |
| 18626 | /* Free the allocated buffer */ |
| 18627 | wpalMemoryFree(wdiHALDumpCmdRsp.pBuffer); |
| 18628 | } |
| 18629 | return WDI_STATUS_SUCCESS; |
| 18630 | } |
| 18631 | |
| 18632 | /*========================================================================== |
| 18633 | CONTRL TRANSPORT INTERACTION |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18634 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18635 | Callback function registered with the control transport - for receiving |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18636 | notifications and packets |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18637 | ==========================================================================*/ |
| 18638 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18639 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18640 | when it wishes to send up a notification like the ones |
| 18641 | mentioned above. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18642 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18643 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18644 | |
| 18645 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18646 | wctsEvent: the event being notified |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18647 | wctsNotifyCBData: the callback data of the user |
| 18648 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18649 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18650 | |
| 18651 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18652 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18653 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18654 | WDI_NotifyMsgCTSCB |
| 18655 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18656 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18657 | WCTS_NotifyEventType wctsEvent, |
| 18658 | void* wctsNotifyCBData |
| 18659 | ) |
| 18660 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18661 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsNotifyCBData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18662 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18663 | |
| 18664 | if (NULL == pWDICtx ) |
| 18665 | { |
| 18666 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18667 | "%s: Invalid parameters", __FUNCTION__); |
| 18668 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18669 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18670 | } |
| 18671 | |
| 18672 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 18673 | { |
| 18674 | /* callback presumably occurred after close */ |
| 18675 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18676 | "%s: Invalid control block", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18677 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18678 | } |
| 18679 | |
| 18680 | if ( WCTS_EVENT_OPEN == wctsEvent ) |
| 18681 | { |
| 18682 | /*Flag must be set atomically as it is checked from incoming request |
| 18683 | functions*/ |
| 18684 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18685 | pWDICtx->bCTOpened = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18686 | |
| 18687 | /*Nothing to do - so try to dequeue any pending request that may have |
| 18688 | occurred while we were trying to establish this*/ |
| 18689 | WDI_DequeuePendingReq(pWDICtx); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18690 | wpalMutexRelease(&pWDICtx->wptMutex); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18691 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18692 | else if ( WCTS_EVENT_CLOSE == wctsEvent ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18693 | { |
| 18694 | /*Flag must be set atomically as it is checked from incoming request |
| 18695 | functions*/ |
| 18696 | wpalMutexAcquire(&pWDICtx->wptMutex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18697 | pWDICtx->bCTOpened = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18698 | |
| 18699 | /*No other request will be processed from now on - fail all*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18700 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18701 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 18702 | |
| 18703 | /*Notify that the Control Channel is closed */ |
| 18704 | wpalEventSet(&pWDICtx->wctsActionEvent); |
| 18705 | } |
| 18706 | |
| 18707 | }/*WDI_NotifyMsgCTSCB*/ |
| 18708 | |
| 18709 | |
| 18710 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18711 | @brief This callback is invoked by the control transport |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18712 | when it wishes to send up a packet received over the |
| 18713 | bus. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18714 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18715 | @param |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18716 | |
| 18717 | wctsHandle: handle to the control transport service |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18718 | pMsg: the packet |
| 18719 | uLen: the packet length |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18720 | wctsRxMsgCBData: the callback data of the user |
| 18721 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18722 | @see WCTS_OpenTransport |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18723 | |
| 18724 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18725 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18726 | void |
| 18727 | WDI_RXMsgCTSCB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18728 | ( |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18729 | WCTS_HandleType wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18730 | void* pMsg, |
| 18731 | wpt_uint32 uLen, |
| 18732 | void* wctsRxMsgCBData |
| 18733 | ) |
| 18734 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18735 | tHalMsgHeader *pHalMsgHeader; |
| 18736 | WDI_EventInfoType wdiEventData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18737 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)wctsRxMsgCBData; |
| 18738 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 18739 | |
| 18740 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18741 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18742 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18743 | if ((NULL == pWDICtx ) || ( NULL == pMsg ) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18744 | ( uLen < sizeof(tHalMsgHeader))) |
| 18745 | { |
| 18746 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18747 | "%s: Invalid parameters", __FUNCTION__); |
| 18748 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18749 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18750 | } |
| 18751 | |
| 18752 | if (WDI_CONTROL_BLOCK_MAGIC != pWDICtx->magic) |
| 18753 | { |
| 18754 | /* callback presumably occurred after close */ |
| 18755 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 18756 | "%s: Invalid control block", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18757 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18758 | } |
| 18759 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18760 | /*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] | 18761 | context - so no serialization is necessary here |
| 18762 | ! - revisit this assumption */ |
| 18763 | |
| 18764 | pHalMsgHeader = (tHalMsgHeader *)pMsg; |
| 18765 | |
| 18766 | if ( uLen != pHalMsgHeader->msgLen ) |
| 18767 | { |
| 18768 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18769 | "Invalid packet received from HAL - catastrophic failure"); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18770 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); |
| 18771 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18772 | } |
| 18773 | |
| 18774 | wdiEventData.wdiResponse = HAL_2_WDI_RSP_TYPE( pHalMsgHeader->msgType ); |
| 18775 | |
| 18776 | /*The message itself starts after the header*/ |
| 18777 | wdiEventData.pEventData = (wpt_uint8*)pMsg + sizeof(tHalMsgHeader); |
| 18778 | wdiEventData.uEventDataSize = pHalMsgHeader->msgLen - sizeof(tHalMsgHeader); |
| 18779 | wdiEventData.pCBfnc = gWDICb.pfncRspCB; |
| 18780 | wdiEventData.pUserData = gWDICb.pRspCBUserData; |
| 18781 | |
| 18782 | |
| 18783 | if ( wdiEventData.wdiResponse == pWDICtx->wdiExpectedResponse ) |
| 18784 | { |
| 18785 | /*Stop the timer as the response was received */ |
| 18786 | /*!UT - check for potential race conditions between stop and response */ |
| 18787 | wpalTimerStop(&pWDICtx->wptResponseTimer); |
| 18788 | } |
| 18789 | /* Check if we receive a response message which is not expected */ |
| 18790 | else if ( wdiEventData.wdiResponse < WDI_HAL_IND_MIN ) |
| 18791 | { |
| 18792 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 18793 | "Received response %s (%d) when expecting %s (%d) - catastrophic failure", |
| 18794 | WDI_getRespMsgString(wdiEventData.wdiResponse), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18795 | wdiEventData.wdiResponse, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18796 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 18797 | pWDICtx->wdiExpectedResponse); |
| 18798 | /* WDI_DetectedDeviceError( pWDICtx, WDI_ERR_INVALID_RSP_FMT); */ |
| 18799 | return; |
| 18800 | } |
| 18801 | |
| 18802 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 18803 | "Rx smth from HAL: %d", wdiEventData.wdiResponse); |
| 18804 | |
| 18805 | /*Post response event to the state machine*/ |
| 18806 | WDI_PostMainEvent(pWDICtx, WDI_RESPONSE_EVENT, &wdiEventData); |
| 18807 | |
| 18808 | }/*WDI_RXMsgCTSCB*/ |
| 18809 | |
| 18810 | |
| 18811 | /*======================================================================== |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18812 | Internal Helper Routines |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18813 | ========================================================================*/ |
| 18814 | |
| 18815 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18816 | @brief WDI_CleanCB - internal helper routine used to clean the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18817 | WDI Main Control Block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18818 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18819 | @param pWDICtx - pointer to the control block |
| 18820 | |
| 18821 | @return Result of the function call |
| 18822 | */ |
| 18823 | WPT_INLINE WDI_Status |
| 18824 | WDI_CleanCB |
| 18825 | ( |
| 18826 | WDI_ControlBlockType* pWDICtx |
| 18827 | ) |
| 18828 | { |
| 18829 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 18830 | |
| 18831 | /*Clean the WDI Control Block*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18832 | wpalMemoryZero( pWDICtx, sizeof(*pWDICtx)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18833 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18834 | pWDICtx->uGlobalState = WDI_MAX_ST; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18835 | pWDICtx->ucMaxBssids = WDI_MAX_SUPPORTED_BSS; |
| 18836 | pWDICtx->ucMaxStations = WDI_MAX_SUPPORTED_STAS; |
| 18837 | |
| 18838 | WDI_ResetAssocSessions( pWDICtx ); |
| 18839 | |
| 18840 | return WDI_STATUS_SUCCESS; |
| 18841 | }/*WDI_CleanCB*/ |
| 18842 | |
| 18843 | |
| 18844 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18845 | @brief Process request helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18846 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18847 | |
| 18848 | @param pWDICtx: pointer to the WLAN DAL context |
| 18849 | pEventData: pointer to the event information structure |
| 18850 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18851 | @see |
| 18852 | @return Result of the function call |
| 18853 | */ |
| 18854 | WPT_INLINE WDI_Status |
| 18855 | WDI_ProcessRequest |
| 18856 | ( |
| 18857 | WDI_ControlBlockType* pWDICtx, |
| 18858 | WDI_EventInfoType* pEventData |
| 18859 | ) |
| 18860 | { |
| 18861 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18862 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18863 | /*!! Skip sanity check as this is called from the FSM functionss which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18864 | already checked these pointers*/ |
| 18865 | |
| 18866 | if (( pEventData->wdiRequest < WDI_MAX_UMAC_IND ) && |
| 18867 | ( NULL != pfnReqProcTbl[pEventData->wdiRequest] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18868 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18869 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 18870 | "Calling request processing function for req %s (%d) %x", |
| 18871 | WDI_getReqMsgString(pEventData->wdiRequest), |
| 18872 | pEventData->wdiRequest, pfnReqProcTbl[pEventData->wdiRequest]); |
| 18873 | return pfnReqProcTbl[pEventData->wdiRequest](pWDICtx, pEventData); |
| 18874 | } |
| 18875 | else |
| 18876 | { |
| 18877 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18878 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18879 | pEventData->wdiRequest); |
| 18880 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 18881 | } |
| 18882 | }/*WDI_ProcessRequest*/ |
| 18883 | |
| 18884 | |
| 18885 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18886 | @brief Get message helper function - it allocates memory for a |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18887 | message that is to be sent to HAL accross the bus and |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18888 | prefixes it with a send message header |
| 18889 | |
| 18890 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18891 | wdiReqType: type of the request being sent |
| 18892 | uBufferLen: message buffer len |
| 18893 | pMsgBuffer: resulting allocated buffer |
| 18894 | pusDataOffset: offset in the buffer where the caller |
| 18895 | can start copying its message data |
| 18896 | puBufferSize: the resulting buffer size (offset+buff |
| 18897 | len) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18898 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18899 | @see |
| 18900 | @return Result of the function call |
| 18901 | */ |
| 18902 | WDI_Status |
| 18903 | WDI_GetMessageBuffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18904 | ( |
| 18905 | WDI_ControlBlockType* pWDICtx, |
| 18906 | WDI_RequestEnumType wdiReqType, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18907 | wpt_uint16 usBufferLen, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18908 | wpt_uint8** pMsgBuffer, |
| 18909 | wpt_uint16* pusDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18910 | wpt_uint16* pusBufferSize |
| 18911 | ) |
| 18912 | { |
| 18913 | tHalMsgHeader halMsgHeader; |
| 18914 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 18915 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18916 | /*!! No sanity check here as we trust the called - ! check this assumption |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18917 | again*/ |
| 18918 | |
| 18919 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18920 | Try to allocate message buffer from PAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18921 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18922 | *pusBufferSize = sizeof(halMsgHeader) + usBufferLen; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18923 | *pMsgBuffer = (wpt_uint8*)wpalMemoryAllocate(*pusBufferSize); |
| 18924 | if ( NULL == *pMsgBuffer ) |
| 18925 | { |
| 18926 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 18927 | "Unable to allocate message buffer for req %s (%d)", |
| 18928 | WDI_getReqMsgString(wdiReqType), |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18929 | wdiReqType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18930 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18931 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18932 | } |
| 18933 | |
| 18934 | /*------------------------------------------------------------------------- |
| 18935 | Fill in the message header |
| 18936 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18937 | halMsgHeader.msgType = WDI_2_HAL_REQ_TYPE(wdiReqType); |
| 18938 | /* Fill msgVersion */ |
| 18939 | #ifdef WLAN_FEATURE_11AC |
| 18940 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 18941 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION1; |
| 18942 | else |
| 18943 | #endif |
| 18944 | halMsgHeader.msgVersion = WLAN_HAL_MSG_VERSION0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18945 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18946 | halMsgHeader.msgLen = sizeof(halMsgHeader) + usBufferLen; |
| 18947 | *pusDataOffset = sizeof(halMsgHeader); |
| 18948 | wpalMemoryCopy(*pMsgBuffer, &halMsgHeader, sizeof(halMsgHeader)); |
| 18949 | |
| 18950 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18951 | }/*WDI_GetMessageBuffer*/ |
| 18952 | |
| 18953 | |
| 18954 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18955 | @brief Send message helper function - sends a message over the |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18956 | bus using the control tranport and saves some info in |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18957 | the CB |
| 18958 | |
| 18959 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18960 | pSendBuffer: buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18961 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18962 | usSendSize size of the buffer to be sent |
| 18963 | pRspCb: response callback - save in the WDI |
| 18964 | CB |
| 18965 | pUserData: user data associated with the |
| 18966 | callback |
| 18967 | wdiExpectedResponse: the code of the response that is |
| 18968 | expected to be rx-ed for this request |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18969 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18970 | @see |
| 18971 | @return Result of the function call |
| 18972 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18973 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18974 | WDI_SendMsg |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18975 | ( |
| 18976 | WDI_ControlBlockType* pWDICtx, |
| 18977 | wpt_uint8* pSendBuffer, |
| 18978 | wpt_uint32 usSendSize, |
| 18979 | void* pRspCb, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18980 | void* pUserData, |
| 18981 | WDI_ResponseEnumType wdiExpectedResponse |
| 18982 | ) |
| 18983 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 18984 | WDI_Status wdiStatus = WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18985 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 18986 | |
| 18987 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18988 | Save needed info in the CB |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18989 | ------------------------------------------------------------------------*/ |
| 18990 | pWDICtx->pRspCBUserData = pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 18991 | pWDICtx->pfncRspCB = pRspCb; |
| 18992 | pWDICtx->wdiExpectedResponse = wdiExpectedResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 18993 | |
| 18994 | /*----------------------------------------------------------------------- |
| 18995 | Call the CTS to send this message over - free message afterwards |
| 18996 | - notify transport failure |
| 18997 | Note: CTS is reponsible for freeing the message buffer. |
| 18998 | -----------------------------------------------------------------------*/ |
| 18999 | if ( 0 != WCTS_SendMessage( pWDICtx->wctsHandle, (void*)pSendBuffer, usSendSize )) |
| 19000 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19001 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19002 | "Failed to send message over the bus - catastrophic failure"); |
| 19003 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19004 | wdiStatus = WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19005 | } |
| 19006 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19007 | /*Check if originator provided a request status callback*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19008 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 19009 | { |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19010 | /*Inform originator whether request went through or not*/ |
| 19011 | WDI_ReqStatusCb callback = pWDICtx->wdiReqStatusCB; |
| 19012 | void *callbackContext = pWDICtx->pReqStatusUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19013 | pWDICtx->wdiReqStatusCB = NULL; |
| 19014 | pWDICtx->pReqStatusUserData = NULL; |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19015 | callback(wdiStatus, callbackContext); |
| 19016 | |
| 19017 | /*For WDI requests which have registered a request callback, |
| 19018 | inform the WDA caller of the same via setting the return value |
| 19019 | (wdiStatus) to WDI_STATUS_PENDING. This makes sure that WDA doesnt |
| 19020 | end up repeating the functonality in the req callback for the |
| 19021 | WDI_STATUS_E_FAILURE case*/ |
| 19022 | if (wdiStatus == WDI_STATUS_E_FAILURE) |
| 19023 | wdiStatus = WDI_STATUS_PENDING; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19024 | } |
| 19025 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19026 | if ( wdiStatus == WDI_STATUS_SUCCESS ) |
| 19027 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19028 | /*Start timer for the expected response */ |
| 19029 | wpalTimerStart(&pWDICtx->wptResponseTimer, WDI_RESPONSE_TIMEOUT); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19030 | } |
| 19031 | else |
| 19032 | { |
| 19033 | /*Inform upper stack layers that a transport fatal error occured*/ |
| 19034 | WDI_DetectedDeviceError(pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 19035 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19036 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 19037 | return wdiStatus; |
| 19038 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19039 | }/*WDI_SendMsg*/ |
| 19040 | |
| 19041 | |
| 19042 | |
| 19043 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19044 | @brief Send indication helper function - sends a message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19045 | the bus using the control transport and saves some info |
| 19046 | in the CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19047 | |
| 19048 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19049 | pSendBuffer: buffer to be sent |
| 19050 | usSendSize: size of the buffer to be sent |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19051 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19052 | @see |
| 19053 | @return Result of the function call |
| 19054 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19055 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19056 | WDI_SendIndication |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19057 | ( |
| 19058 | WDI_ControlBlockType* pWDICtx, |
| 19059 | wpt_uint8* pSendBuffer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19060 | wpt_uint32 usSendSize |
| 19061 | ) |
| 19062 | { |
| 19063 | wpt_uint32 uStatus ; |
| 19064 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19065 | |
| 19066 | /*----------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19067 | Call the CTS to send this message over |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19068 | Note: CTS is reponsible for freeing the message buffer. |
| 19069 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19070 | uStatus = WCTS_SendMessage( pWDICtx->wctsHandle, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19071 | (void*)pSendBuffer, usSendSize ); |
| 19072 | |
| 19073 | /*Inform Upper MAC about the outcome of the request*/ |
| 19074 | if ( NULL != pWDICtx->wdiReqStatusCB ) |
| 19075 | { |
| 19076 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19077 | "Send indication status : %d", uStatus); |
| 19078 | |
| 19079 | pWDICtx->wdiReqStatusCB( (uStatus != 0 ) ? WDI_STATUS_E_FAILURE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19080 | WDI_STATUS_SUCCESS, |
| 19081 | pWDICtx->pReqStatusUserData); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19082 | } |
| 19083 | |
| 19084 | /*If sending of the message failed - it is considered catastrophic and |
| 19085 | indicates an error with the device*/ |
| 19086 | if ( 0 != uStatus) |
| 19087 | { |
| 19088 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19089 | "Failed to send indication over the bus - catastrophic failure"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19090 | |
| 19091 | WDI_DetectedDeviceError( pWDICtx, WDI_ERR_TRANSPORT_FAILURE); |
| 19092 | return WDI_STATUS_E_FAILURE; |
| 19093 | } |
| 19094 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19095 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19096 | }/*WDI_SendIndication*/ |
| 19097 | |
| 19098 | |
| 19099 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19100 | @brief WDI_DetectedDeviceError - called internally by DAL when |
| 19101 | it has detected a failure in the device |
| 19102 | |
| 19103 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19104 | usErrorCode: error code detected by WDI or received |
| 19105 | from HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19106 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19107 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19108 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19109 | */ |
| 19110 | void |
| 19111 | WDI_DetectedDeviceError |
| 19112 | ( |
| 19113 | WDI_ControlBlockType* pWDICtx, |
| 19114 | wpt_uint16 usErrorCode |
| 19115 | ) |
| 19116 | { |
| 19117 | WDI_LowLevelIndType wdiInd; |
| 19118 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19119 | |
| 19120 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19121 | "Device Error detected code: %d - transitioning to stopped state", |
| 19122 | usErrorCode); |
| 19123 | |
| 19124 | wpalMutexAcquire(&pWDICtx->wptMutex); |
| 19125 | |
| 19126 | WDI_STATableStop(pWDICtx); |
| 19127 | |
| 19128 | WDI_ResetAssocSessions(pWDICtx); |
| 19129 | |
| 19130 | /*Set the expected state transition to stopped - because the device |
| 19131 | experienced a failure*/ |
| 19132 | pWDICtx->ucExpectedStateTransition = WDI_STOPPED_ST; |
| 19133 | |
| 19134 | /*Transition to stopped to fail all incomming requests from this point on*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19135 | WDI_STATE_TRANSITION( pWDICtx, WDI_STOPPED_ST); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19136 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19137 | WDI_ClearPendingRequests(pWDICtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19138 | |
| 19139 | /*TO DO: - there should be an attempt to reset the device here*/ |
| 19140 | |
| 19141 | wpalMutexRelease(&pWDICtx->wptMutex); |
| 19142 | |
| 19143 | /*------------------------------------------------------------------------ |
| 19144 | Notify UMAC if a handler is registered |
| 19145 | ------------------------------------------------------------------------*/ |
| 19146 | if (pWDICtx->wdiLowLevelIndCB) |
| 19147 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19148 | wdiInd.wdiIndicationType = WDI_FATAL_ERROR_IND; |
| 19149 | wdiInd.wdiIndicationData.usErrorCode = usErrorCode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19150 | |
| 19151 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData); |
| 19152 | } |
| 19153 | }/*WDI_DetectedDeviceError*/ |
| 19154 | |
| 19155 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19156 | @brief This callback is invoked by the wpt when a timer that |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19157 | we started on send message has expire - this should |
| 19158 | never happen - it means device is stuck and cannot |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19159 | reply - trigger catastrophic failure |
| 19160 | @param |
| 19161 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19162 | pUserData: the callback data of the user (ptr to WDI CB) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19163 | |
| 19164 | @see |
| 19165 | @return None |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19166 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19167 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19168 | WDI_ResponseTimerCB |
| 19169 | ( |
| 19170 | void *pUserData |
| 19171 | ) |
| 19172 | { |
| 19173 | WDI_ControlBlockType* pWDICtx = (WDI_ControlBlockType*)pUserData; |
| 19174 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19175 | |
| 19176 | if (NULL == pWDICtx ) |
| 19177 | { |
| 19178 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19179 | "%s: Invalid parameters", __FUNCTION__); |
| 19180 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19181 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19182 | } |
| 19183 | |
| 19184 | if ( WDI_MAX_RESP != pWDICtx->wdiExpectedResponse ) |
| 19185 | { |
| 19186 | |
| 19187 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19188 | "Timeout occurred while waiting for %s (%d) message from device " |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19189 | " - catastrophic failure", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19190 | WDI_getRespMsgString(pWDICtx->wdiExpectedResponse), |
| 19191 | pWDICtx->wdiExpectedResponse); |
| 19192 | /* WDI timeout means Riva is not responding or SMD communication to Riva |
| 19193 | * is not happening. The only possible way to recover from this error |
| 19194 | * is to initiate SSR from APPS */ |
| 19195 | wpalRivaSubystemRestart(); |
| 19196 | } |
| 19197 | else |
| 19198 | { |
| 19199 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19200 | "Timeout occurred but not waiting for any response %d", |
| 19201 | pWDICtx->wdiExpectedResponse); |
| 19202 | } |
| 19203 | |
| 19204 | return; |
| 19205 | |
| 19206 | }/*WDI_ResponseTimerCB*/ |
| 19207 | |
| 19208 | |
| 19209 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19210 | @brief Process response helper function |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19211 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19212 | |
| 19213 | @param pWDICtx: pointer to the WLAN DAL context |
| 19214 | pEventData: pointer to the event information structure |
| 19215 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19216 | @see |
| 19217 | @return Result of the function call |
| 19218 | */ |
| 19219 | WPT_INLINE WDI_Status |
| 19220 | WDI_ProcessResponse |
| 19221 | ( |
| 19222 | WDI_ControlBlockType* pWDICtx, |
| 19223 | WDI_EventInfoType* pEventData |
| 19224 | ) |
| 19225 | { |
| 19226 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19227 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19228 | /* Skip sanity check as this is called from the FSM functions which |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19229 | already checked these pointers |
| 19230 | ! - revisit this assumption */ |
| 19231 | if (( pEventData->wdiResponse < WDI_MAX_RESP ) && |
| 19232 | ( NULL != pfnRspProcTbl[pEventData->wdiResponse] )) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19233 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19234 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19235 | "Calling response processing function for resp %s (%d) %x", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19236 | WDI_getRespMsgString(pEventData->wdiResponse), |
| 19237 | pEventData->wdiResponse, pfnRspProcTbl[pEventData->wdiResponse]); |
| 19238 | return pfnRspProcTbl[pEventData->wdiResponse](pWDICtx, pEventData); |
| 19239 | } |
| 19240 | else |
| 19241 | { |
| 19242 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19243 | "Operation %d is not yet implemented ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19244 | pEventData->wdiResponse); |
| 19245 | return WDI_STATUS_E_NOT_IMPLEMENT; |
| 19246 | } |
| 19247 | }/*WDI_ProcessResponse*/ |
| 19248 | |
| 19249 | |
| 19250 | /*========================================================================= |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19251 | QUEUE SUPPORT UTILITY FUNCTIONS |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19252 | =========================================================================*/ |
| 19253 | |
| 19254 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19255 | @brief Utility function used by the DAL Core to help queue a |
| 19256 | request that cannot be processed right away. |
| 19257 | @param |
| 19258 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19259 | pWDICtx: - pointer to the WDI control block |
| 19260 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19261 | queued |
| 19262 | |
| 19263 | @see |
| 19264 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19265 | */ |
| 19266 | WDI_Status |
| 19267 | WDI_QueuePendingReq |
| 19268 | ( |
| 19269 | WDI_ControlBlockType* pWDICtx, |
| 19270 | WDI_EventInfoType* pEventData |
| 19271 | ) |
| 19272 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19273 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19274 | WDI_EventInfoType* pEventDataQueue = wpalMemoryAllocate(sizeof(*pEventData)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19275 | void* pEventInfo = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19276 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19277 | |
| 19278 | if ( NULL == pEventDataQueue ) |
| 19279 | { |
| 19280 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19281 | "Cannot allocate memory for queueing"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19282 | WDI_ASSERT(0); |
| 19283 | return WDI_STATUS_MEM_FAILURE; |
| 19284 | } |
| 19285 | |
| 19286 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19287 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19288 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19289 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19290 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19291 | |
| 19292 | if( pEventData->uEventDataSize != 0 && pEventData->pEventData != NULL ) |
| 19293 | { |
| 19294 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19295 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19296 | if ( NULL == pEventInfo ) |
| 19297 | { |
| 19298 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19299 | "Cannot allocate memory for queueing event data info"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19300 | WDI_ASSERT(0); |
| 19301 | wpalMemoryFree(pEventDataQueue); |
| 19302 | return WDI_STATUS_MEM_FAILURE; |
| 19303 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19304 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19305 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19306 | |
| 19307 | } |
| 19308 | pEventDataQueue->pEventData = pEventInfo; |
| 19309 | |
| 19310 | /*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] | 19311 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19312 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19313 | wpal_list_insert_back(&(pWDICtx->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19314 | |
| 19315 | return WDI_STATUS_SUCCESS; |
| 19316 | }/*WDI_QueuePendingReq*/ |
| 19317 | |
| 19318 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19319 | @brief Callback function for serializing queued message |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19320 | processing in the control context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19321 | @param |
| 19322 | |
| 19323 | pMsg - pointer to the message |
| 19324 | |
| 19325 | @see |
| 19326 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19327 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19328 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19329 | WDI_PALCtrlMsgCB |
| 19330 | ( |
| 19331 | wpt_msg *pMsg |
| 19332 | ) |
| 19333 | { |
| 19334 | WDI_EventInfoType* pEventData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19335 | WDI_ControlBlockType* pWDICtx = NULL; |
| 19336 | WDI_Status wdiStatus; |
| 19337 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19338 | void* pUserData; |
| 19339 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19340 | |
| 19341 | if (( NULL == pMsg )|| |
| 19342 | ( NULL == (pEventData = (WDI_EventInfoType*)pMsg->ptr)) || |
| 19343 | ( NULL == (pWDICtx = (WDI_ControlBlockType*)pMsg->pContext ))) |
| 19344 | { |
| 19345 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19346 | "Invalid message received on serialize ctrl context API"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19347 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19348 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19349 | } |
| 19350 | |
| 19351 | /*Transition back to the state that we had before serialization |
| 19352 | - serialization transitions us to BUSY to stop any incomming requests |
| 19353 | ! TO DO L: possible race condition here if a request comes in between the |
| 19354 | state transition and the post function*/ |
| 19355 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19356 | WDI_STATE_TRANSITION( pWDICtx, pMsg->val); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19357 | |
| 19358 | /*----------------------------------------------------------------------- |
| 19359 | Check to see what type of event we are serializing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19360 | - responses are never expected to come through here |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19361 | -----------------------------------------------------------------------*/ |
| 19362 | switch ( pEventData->wdiRequest ) |
| 19363 | { |
| 19364 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19365 | case WDI_STOP_REQ: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19366 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_STOP_EVENT, pEventData); |
| 19367 | break; |
| 19368 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19369 | case WDI_NV_DOWNLOAD_REQ: |
| 19370 | // When WDI State is WDI_STARTED_ST, send WDI request message with event type WDI_REQUEST_EVENT. |
| 19371 | // In this case, because this request is called from response process, we could call WDI_ProcessRequest() directly. |
| 19372 | if (pWDICtx->uGlobalState == WDI_STARTED_ST) |
| 19373 | { |
| 19374 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19375 | "%s: WDI_NV_DOWNLOAD_REQ called in WDI_STARTED_ST - send with WDI_REQUEST_EVENT", __FUNCTION__); |
| 19376 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 19377 | } |
| 19378 | else |
| 19379 | { |
| 19380 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_START_EVENT, pEventData); |
| 19381 | } |
| 19382 | |
| 19383 | break; |
| 19384 | |
| 19385 | default: |
| 19386 | wdiStatus = WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, pEventData); |
| 19387 | break; |
| 19388 | }/*switch ( pEventData->wdiRequest )*/ |
| 19389 | |
| 19390 | if ( WDI_STATUS_SUCCESS != wdiStatus ) |
| 19391 | { |
| 19392 | WDI_ExtractRequestCBFromEvent(pEventData, &pfnReqStatusCB, &pUserData); |
| 19393 | |
| 19394 | if ( NULL != pfnReqStatusCB ) |
| 19395 | { |
| 19396 | /*Fail the request*/ |
| 19397 | pfnReqStatusCB( wdiStatus, pUserData); |
| 19398 | } |
| 19399 | } |
| 19400 | |
| 19401 | /* Free data - that was allocated when queueing*/ |
| 19402 | if( pEventData != NULL ) |
| 19403 | { |
| 19404 | if( pEventData->pEventData != NULL ) |
| 19405 | { |
| 19406 | wpalMemoryFree(pEventData->pEventData); |
| 19407 | } |
| 19408 | wpalMemoryFree(pEventData); |
| 19409 | } |
| 19410 | |
| 19411 | if( pMsg != NULL ) |
| 19412 | { |
| 19413 | wpalMemoryFree(pMsg); |
| 19414 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19415 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19416 | }/*WDI_PALCtrlMsgCB*/ |
| 19417 | |
| 19418 | /** |
| 19419 | @brief Utility function used by the DAL Core to help dequeue |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19420 | and schedule for execution a pending request |
| 19421 | @param |
| 19422 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19423 | pWDICtx: - pointer to the WDI control block |
| 19424 | pEventData: - pointer to the evnt info that needs to be |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19425 | queued |
| 19426 | |
| 19427 | @see |
| 19428 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19429 | */ |
| 19430 | WDI_Status |
| 19431 | WDI_DequeuePendingReq |
| 19432 | ( |
| 19433 | WDI_ControlBlockType* pWDICtx |
| 19434 | ) |
| 19435 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19436 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19437 | WDI_EventInfoType* pEventData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19438 | wpt_msg* palMsg; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19439 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19440 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19441 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19442 | |
| 19443 | if ( NULL == pNode ) |
| 19444 | { |
| 19445 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19446 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19447 | return WDI_STATUS_SUCCESS; |
| 19448 | } |
| 19449 | |
| 19450 | /*The node actually points to the 1st element inside the Event Data struct - |
| 19451 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19452 | pEventData = (WDI_EventInfoType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19453 | |
| 19454 | /*Serialize processing in the control thread |
| 19455 | !TO DO: - check to see if these are all the messages params that need |
| 19456 | to be filled in*/ |
| 19457 | palMsg = wpalMemoryAllocate(sizeof(wpt_msg)); |
| 19458 | |
| 19459 | if ( NULL == palMsg ) |
| 19460 | { |
| 19461 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19462 | "WDI_DequeuePendingReq: Cannot allocate memory for palMsg."); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19463 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19464 | return WDI_STATUS_MEM_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19465 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19466 | palMsg->pContext = pWDICtx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19467 | palMsg->callback = WDI_PALCtrlMsgCB; |
| 19468 | palMsg->ptr = pEventData; |
| 19469 | |
| 19470 | /*Save the global state as we need it on the other side*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19471 | palMsg->val = pWDICtx->uGlobalState; |
| 19472 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19473 | /*Transition back to BUSY as we need to handle a queued request*/ |
| 19474 | WDI_STATE_TRANSITION( pWDICtx, WDI_BUSY_ST); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19475 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19476 | wpalPostCtrlMsg(pWDICtx->pPALContext, palMsg); |
| 19477 | |
| 19478 | return WDI_STATUS_PENDING; |
| 19479 | }/*WDI_DequeuePendingReq*/ |
| 19480 | |
| 19481 | |
| 19482 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19483 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19484 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19485 | away.- The assoc requests will be queued by BSSID |
| 19486 | @param |
| 19487 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19488 | pWDICtx: - pointer to the WDI control block |
| 19489 | pEventData: pointer to the evnt info that needs to be queued |
| 19490 | macBSSID: bssid |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19491 | |
| 19492 | @see |
| 19493 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19494 | */ |
| 19495 | WDI_Status |
| 19496 | WDI_QueueNewAssocRequest |
| 19497 | ( |
| 19498 | WDI_ControlBlockType* pWDICtx, |
| 19499 | WDI_EventInfoType* pEventData, |
| 19500 | wpt_macAddr macBSSID |
| 19501 | ) |
| 19502 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19503 | wpt_uint8 i; |
| 19504 | WDI_BSSSessionType* pSession = NULL; |
| 19505 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19506 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19507 | void* pEventInfo; |
| 19508 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19509 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19510 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19511 | |
| 19512 | /*------------------------------------------------------------------------ |
| 19513 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19514 | ------------------------------------------------------------------------*/ |
| 19515 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 19516 | { |
| 19517 | if ( eWLAN_PAL_FALSE == pWDICtx->aBSSSessions[i].bInUse ) |
| 19518 | { |
| 19519 | /*Found an empty session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19520 | pSession = &pWDICtx->aBSSSessions[i]; |
| 19521 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19522 | } |
| 19523 | } |
| 19524 | |
| 19525 | if ( i >= WDI_MAX_BSS_SESSIONS ) |
| 19526 | { |
| 19527 | /*Cannot find any empty sessions*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19528 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19529 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19531 | /*------------------------------------------------------------------------ |
| 19532 | Fill in the BSSID for this session and set the usage flag |
| 19533 | ------------------------------------------------------------------------*/ |
| 19534 | wpalMemoryCopy(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19535 | pWDICtx->aBSSSessions[i].bInUse = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19536 | |
| 19537 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19538 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19539 | ------------------------------------------------------------------------*/ |
| 19540 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 19541 | if ( NULL == pEventDataQueue ) |
| 19542 | { |
| 19543 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19544 | "%s: Cannot allocate memory for queue node", __FUNCTION__); |
| 19545 | WDI_ASSERT(0); |
| 19546 | return WDI_STATUS_MEM_FAILURE; |
| 19547 | } |
| 19548 | |
| 19549 | pSessionIdElement = (WDI_NextSessionIdType*)wpalMemoryAllocate(sizeof(WDI_NextSessionIdType)); |
| 19550 | if ( NULL == pSessionIdElement ) |
| 19551 | { |
| 19552 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19553 | "%s: Cannot allocate memory for session ID", __FUNCTION__); |
| 19554 | WDI_ASSERT(0); |
| 19555 | wpalMemoryFree(pEventDataQueue); |
| 19556 | return WDI_STATUS_MEM_FAILURE; |
| 19557 | } |
| 19558 | |
| 19559 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 19560 | if ( NULL == pEventInfo ) |
| 19561 | { |
| 19562 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19563 | "%s: Cannot allocate memory for event data info", __FUNCTION__); |
| 19564 | WDI_ASSERT(0); |
| 19565 | wpalMemoryFree(pSessionIdElement); |
| 19566 | wpalMemoryFree(pEventDataQueue); |
| 19567 | return WDI_STATUS_MEM_FAILURE; |
| 19568 | } |
| 19569 | |
| 19570 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19571 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19572 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19573 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19574 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19575 | |
| 19576 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19577 | pEventDataQueue->pEventData = pEventInfo; |
| 19578 | |
| 19579 | /*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] | 19580 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19581 | |
| 19582 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19583 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19584 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19585 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19586 | |
| 19587 | /*We need to maintain a separate list that keeps track of the order in which |
| 19588 | the new assoc requests are being queued such that we can start processing |
| 19589 | them in the order that they had arrived*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19590 | pSessionIdElement->ucIndex = i; |
| 19591 | pNode = (wpt_list_node*)pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19592 | |
| 19593 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19594 | "Queueing up new assoc session : %d ", pSessionIdElement->ucIndex); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19595 | wpal_list_insert_back(&pWDICtx->wptPendingAssocSessionIdQueue, pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19596 | |
| 19597 | /*Return pending as this is what the status of the request is since it has |
| 19598 | been queued*/ |
| 19599 | return WDI_STATUS_PENDING; |
| 19600 | }/*WDI_QueueNewAssocRequest*/ |
| 19601 | |
| 19602 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19603 | @brief Utility function used by the DAL Core to help queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19604 | an association request that cannot be processed right |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19605 | away.- The assoc requests will be queued by BSSID |
| 19606 | @param |
| 19607 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19608 | pWDICtx: - pointer to the WDI control block |
| 19609 | pSession: - session in which to queue |
| 19610 | pEventData: pointer to the event info that needs to be |
| 19611 | queued |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19612 | |
| 19613 | @see |
| 19614 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19615 | */ |
| 19616 | WDI_Status |
| 19617 | WDI_QueueAssocRequest |
| 19618 | ( |
| 19619 | WDI_ControlBlockType* pWDICtx, |
| 19620 | WDI_BSSSessionType* pSession, |
| 19621 | WDI_EventInfoType* pEventData |
| 19622 | ) |
| 19623 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19624 | wpt_list_node* pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19625 | WDI_EventInfoType* pEventDataQueue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19626 | void* pEventInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19627 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19628 | |
| 19629 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19630 | Sanity check |
| 19631 | ------------------------------------------------------------------------*/ |
| 19632 | if (( NULL == pSession ) || ( NULL == pWDICtx )) |
| 19633 | { |
| 19634 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19635 | "%s: Invalid parameters", __FUNCTION__); |
| 19636 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19637 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19638 | } |
| 19639 | |
| 19640 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19641 | Allocate memory for this and place it in the queue |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19642 | ------------------------------------------------------------------------*/ |
| 19643 | pEventDataQueue = (WDI_EventInfoType*)wpalMemoryAllocate(sizeof(WDI_EventInfoType)); |
| 19644 | if ( NULL == pEventDataQueue ) |
| 19645 | { |
| 19646 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19647 | "%s: Cannot allocate memory for queueing", __FUNCTION__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19648 | WDI_ASSERT(0); |
| 19649 | return WDI_STATUS_MEM_FAILURE; |
| 19650 | } |
| 19651 | |
| 19652 | pEventInfo = wpalMemoryAllocate(pEventData->uEventDataSize); |
| 19653 | if ( NULL == pEventInfo ) |
| 19654 | { |
| 19655 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 19656 | "%s: Cannot allocate memory for queueing event data info", |
| 19657 | __FUNCTION__); |
| 19658 | WDI_ASSERT(0); |
| 19659 | wpalMemoryFree(pEventDataQueue); |
| 19660 | return WDI_STATUS_MEM_FAILURE; |
| 19661 | } |
| 19662 | |
| 19663 | pEventDataQueue->pCBfnc = pEventData->pCBfnc; |
| 19664 | pEventDataQueue->pUserData = pEventData->pUserData; |
| 19665 | pEventDataQueue->uEventDataSize = pEventData->uEventDataSize; |
| 19666 | pEventDataQueue->wdiRequest = pEventData->wdiRequest; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19667 | pEventDataQueue->wdiResponse = pEventData->wdiResponse; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19668 | pEventDataQueue->pEventData = pEventInfo; |
| 19669 | |
| 19670 | wpalMemoryCopy(pEventInfo, pEventData->pEventData, pEventData->uEventDataSize); |
| 19671 | |
| 19672 | /*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] | 19673 | pNode = (wpt_list_node*)pEventDataQueue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19674 | |
| 19675 | /*This association is currently being queued*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19676 | pSession->bAssocReqQueued = eWLAN_PAL_TRUE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19677 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19678 | wpal_list_insert_back(&(pSession->wptPendingQueue), pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19679 | |
| 19680 | /*The result of this operation is pending because the request has been |
| 19681 | queued and it will be processed at a later moment in time */ |
| 19682 | return WDI_STATUS_PENDING; |
| 19683 | }/*WDI_QueueAssocRequest*/ |
| 19684 | |
| 19685 | /** |
| 19686 | @brief Utility function used by the DAL Core to help dequeue |
| 19687 | an association request that was pending |
| 19688 | The request will be queued up in front of the main |
| 19689 | pending queue for imediate processing |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19690 | @param |
| 19691 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19692 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19693 | |
| 19694 | |
| 19695 | @see |
| 19696 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19697 | */ |
| 19698 | WDI_Status |
| 19699 | WDI_DequeueAssocRequest |
| 19700 | ( |
| 19701 | WDI_ControlBlockType* pWDICtx |
| 19702 | ) |
| 19703 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19704 | wpt_list_node* pNode = NULL; |
| 19705 | WDI_NextSessionIdType* pSessionIdElement; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19706 | WDI_BSSSessionType* pSession; |
| 19707 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19708 | |
| 19709 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19710 | Sanity check |
| 19711 | ------------------------------------------------------------------------*/ |
| 19712 | if ( NULL == pWDICtx ) |
| 19713 | { |
| 19714 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19715 | "%s: Invalid parameters", __FUNCTION__); |
| 19716 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19717 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19718 | } |
| 19719 | |
| 19720 | /*------------------------------------------------------------------------ |
| 19721 | An association has been completed => a new association can occur |
| 19722 | Check to see if there are any pending associations -> |
| 19723 | If so , transfer all the pending requests into the busy queue for |
| 19724 | processing |
| 19725 | These requests have arrived prior to the requests in the busy queue |
| 19726 | (bc they needed to be processed in order to be placed in this queue) |
| 19727 | => they will be placed at the front of the busy queue |
| 19728 | ------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19729 | wpal_list_remove_front(&(pWDICtx->wptPendingAssocSessionIdQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19730 | |
| 19731 | if ( NULL == pNode ) |
| 19732 | { |
| 19733 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19734 | "List is empty - return"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19735 | return WDI_STATUS_SUCCESS; |
| 19736 | } |
| 19737 | |
| 19738 | /*The node actually points to the 1st element inside the Session Id struct - |
| 19739 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19740 | pSessionIdElement = (WDI_NextSessionIdType*)pNode; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19741 | |
| 19742 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 19743 | "Dequeueing new assoc session : %d ", pSessionIdElement->ucIndex); |
| 19744 | |
| 19745 | if ( pSessionIdElement->ucIndex < WDI_MAX_BSS_SESSIONS ) |
| 19746 | { |
| 19747 | pSession = &pWDICtx->aBSSSessions[pSessionIdElement->ucIndex]; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19748 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19749 | /*Transfer all the pending requests in this assoc queue to |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19750 | the front of the main waiting queue for subsequent execution*/ |
| 19751 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19752 | while ( NULL != pNode ) |
| 19753 | { |
| 19754 | /*Place it in front of the main pending list*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19755 | wpal_list_insert_front( &(pWDICtx->wptPendingQueue), &pNode); |
| 19756 | wpal_list_remove_back(&(pSession->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19757 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19758 | pSession->bAssocReqQueued = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19759 | } |
| 19760 | else |
| 19761 | { |
| 19762 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19763 | "Invalid session id queued up for assoc"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19764 | WPAL_ASSERT(0); |
| 19765 | wpalMemoryFree(pSessionIdElement); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19766 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19767 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19768 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19769 | /*Clean this up as it is no longer needed in order to prevent memory leak*/ |
| 19770 | wpalMemoryFree(pSessionIdElement); |
| 19771 | return WDI_STATUS_SUCCESS; |
| 19772 | }/*WDI_DequeueAssocRequest*/ |
| 19773 | |
| 19774 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19775 | @brief Utility function used by the DAL Core to clear any |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19776 | pending requests - all req cb will be called with |
| 19777 | failure and the queue will be emptied. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19778 | @param |
| 19779 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19780 | pWDICtx: - pointer to the WDI control block |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19781 | |
| 19782 | @see |
| 19783 | @return Result of the operation |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19784 | */ |
| 19785 | WDI_Status |
| 19786 | WDI_ClearPendingRequests |
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 | WDI_ControlBlockType* pWDICtx |
| 19789 | ) |
| 19790 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19791 | wpt_list_node* pNode = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19792 | WDI_EventInfoType* pEventDataQueue = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19793 | WDI_ReqStatusCb pfnReqStatusCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19794 | void* pUserData; |
| 19795 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 19796 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19797 | wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19798 | |
| 19799 | /*------------------------------------------------------------------------ |
| 19800 | Go through all the requests and fail them - this will only be called |
| 19801 | 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] | 19802 | pending requests can no longer be sent down to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19803 | ------------------------------------------------------------------------*/ |
| 19804 | while( pNode ) |
| 19805 | { |
| 19806 | /*The node actually points to the 1st element inside the Event Data struct - |
| 19807 | just cast it back to the struct*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19808 | pEventDataQueue = (WDI_EventInfoType*)pNode; |
| 19809 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19810 | WDI_ExtractRequestCBFromEvent(pEventDataQueue, &pfnReqStatusCB, &pUserData); |
| 19811 | if ( NULL != pfnReqStatusCB ) |
| 19812 | { |
| 19813 | /*Fail the request*/ |
| 19814 | pfnReqStatusCB( WDI_STATUS_E_FAILURE, pUserData); |
| 19815 | } |
| 19816 | /* Free data - that was allocated when queueing */ |
| 19817 | if ( pEventDataQueue->pEventData != NULL ) |
| 19818 | { |
| 19819 | wpalMemoryFree(pEventDataQueue->pEventData); |
| 19820 | } |
| 19821 | wpalMemoryFree(pEventDataQueue); |
| 19822 | |
| 19823 | if (wpal_list_remove_front(&(pWDICtx->wptPendingQueue), &pNode) != eWLAN_PAL_STATUS_SUCCESS) |
| 19824 | { |
| 19825 | break; |
| 19826 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19827 | } |
| 19828 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19829 | return WDI_STATUS_SUCCESS; |
| 19830 | }/*WDI_ClearPendingRequests*/ |
| 19831 | |
| 19832 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19833 | @brief Helper routine used to init the BSS Sessions in the WDI control block |
| 19834 | |
| 19835 | |
| 19836 | @param pWDICtx: pointer to the WLAN DAL context |
| 19837 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19838 | @see |
| 19839 | */ |
| 19840 | void |
| 19841 | WDI_ResetAssocSessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19842 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19843 | WDI_ControlBlockType* pWDICtx |
| 19844 | ) |
| 19845 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19846 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19847 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19848 | |
| 19849 | /*------------------------------------------------------------------------- |
| 19850 | No Sanity check |
| 19851 | -------------------------------------------------------------------------*/ |
| 19852 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 19853 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19854 | wpalMemoryZero( &pWDICtx->aBSSSessions[i], sizeof(WDI_BSSSessionType) ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19855 | pWDICtx->aBSSSessions[i].wdiAssocState = WDI_ASSOC_INIT_ST; |
| 19856 | pWDICtx->aBSSSessions[i].bcastStaIdx = WDI_STA_INVALID_IDX; |
| 19857 | pWDICtx->aBSSSessions[i].ucBSSIdx = WDI_BSS_INVALID_IDX; |
| 19858 | } |
| 19859 | }/*WDI_ResetAssocSessions*/ |
| 19860 | |
| 19861 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19862 | @brief Helper routine used to find a session based on the BSSID |
| 19863 | |
| 19864 | |
| 19865 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19866 | macBSSID: BSSID of the session |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19867 | pSession: pointer to the session (if found) |
| 19868 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19869 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19870 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19871 | */ |
| 19872 | wpt_uint8 |
| 19873 | WDI_FindAssocSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19874 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19875 | WDI_ControlBlockType* pWDICtx, |
| 19876 | wpt_macAddr macBSSID, |
| 19877 | WDI_BSSSessionType** ppSession |
| 19878 | ) |
| 19879 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19880 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19881 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19882 | |
| 19883 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19884 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19885 | -------------------------------------------------------------------------*/ |
| 19886 | if ( NULL == ppSession ) |
| 19887 | { |
| 19888 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19889 | "%s: Invalid parameters", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19890 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19891 | } |
| 19892 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19893 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19894 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19895 | /*------------------------------------------------------------------------ |
| 19896 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19897 | ------------------------------------------------------------------------*/ |
| 19898 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 19899 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19900 | if ( eWLAN_PAL_TRUE == |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19901 | wpalMemoryCompare(pWDICtx->aBSSSessions[i].macBSSID, macBSSID, WDI_MAC_ADDR_LEN) ) |
| 19902 | { |
| 19903 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19904 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19905 | return i; |
| 19906 | } |
| 19907 | } |
| 19908 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19909 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19910 | }/*WDI_FindAssocSession*/ |
| 19911 | |
| 19912 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19913 | @brief Helper routine used to find a session based on the BSSID |
| 19914 | |
| 19915 | |
| 19916 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19917 | ucBSSIdx: BSS Index of the session |
| 19918 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19919 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19920 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19921 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19922 | */ |
| 19923 | wpt_uint8 |
| 19924 | WDI_FindAssocSessionByBSSIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19925 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19926 | WDI_ControlBlockType* pWDICtx, |
| 19927 | wpt_uint16 ucBSSIdx, |
| 19928 | WDI_BSSSessionType** ppSession |
| 19929 | ) |
| 19930 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19931 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19932 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19933 | |
| 19934 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19935 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19936 | -------------------------------------------------------------------------*/ |
| 19937 | if ( NULL == ppSession ) |
| 19938 | { |
| 19939 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19940 | "%s: Invalid parameters", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19941 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19942 | } |
| 19943 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19944 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19945 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19946 | /*------------------------------------------------------------------------ |
| 19947 | Search for a session that matches the BSSID |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19948 | ------------------------------------------------------------------------*/ |
| 19949 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 19950 | { |
| 19951 | if ( ucBSSIdx == pWDICtx->aBSSSessions[i].ucBSSIdx ) |
| 19952 | { |
| 19953 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19954 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19955 | return i; |
| 19956 | } |
| 19957 | } |
| 19958 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19959 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19960 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 19961 | |
| 19962 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19963 | @brief Helper routine used to find a session based on the BSSID |
| 19964 | |
| 19965 | |
| 19966 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19967 | ucBSSIdx: BSS Index of the session |
| 19968 | ppSession: out pointer to the session (if found) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19969 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19970 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19971 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19972 | */ |
| 19973 | wpt_uint8 |
| 19974 | WDI_FindAssocSessionByIdx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19975 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19976 | WDI_ControlBlockType* pWDICtx, |
| 19977 | wpt_uint16 usIdx, |
| 19978 | WDI_BSSSessionType** ppSession |
| 19979 | ) |
| 19980 | { |
| 19981 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 19982 | |
| 19983 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19984 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19985 | -------------------------------------------------------------------------*/ |
| 19986 | if ( NULL == ppSession || usIdx >= WDI_MAX_BSS_SESSIONS ) |
| 19987 | { |
| 19988 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 19989 | "%s: Invalid parameters", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19990 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19991 | } |
| 19992 | |
| 19993 | /*Found the session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19994 | *ppSession = &pWDICtx->aBSSSessions[usIdx]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19995 | |
| 19996 | return usIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 19997 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 19998 | }/*WDI_FindAssocSessionByBSSIdx*/ |
| 19999 | |
| 20000 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20001 | @brief Helper routine used to find an empty session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20002 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20003 | |
| 20004 | |
| 20005 | @param pWDICtx: pointer to the WLAN DAL context |
| 20006 | pSession: pointer to the session (if found) |
| 20007 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20008 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20009 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20010 | */ |
| 20011 | wpt_uint8 |
| 20012 | WDI_FindEmptySession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20013 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20014 | WDI_ControlBlockType* pWDICtx, |
| 20015 | WDI_BSSSessionType** ppSession |
| 20016 | ) |
| 20017 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20018 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20019 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20020 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20021 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20022 | -------------------------------------------------------------------------*/ |
| 20023 | if ( NULL == ppSession ) |
| 20024 | { |
| 20025 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20026 | "%s: Invalid parameters", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20027 | return WDI_MAX_BSS_SESSIONS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20028 | } |
| 20029 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20030 | *ppSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20031 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20032 | /*------------------------------------------------------------------------ |
| 20033 | Search for a session that it is not in use |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20034 | ------------------------------------------------------------------------*/ |
| 20035 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20036 | { |
| 20037 | if ( ! pWDICtx->aBSSSessions[i].bInUse ) |
| 20038 | { |
| 20039 | /*Found a session*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20040 | *ppSession = &pWDICtx->aBSSSessions[i]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20041 | return i; |
| 20042 | } |
| 20043 | } |
| 20044 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20045 | return i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20046 | }/*WDI_FindEmptySession*/ |
| 20047 | |
| 20048 | |
| 20049 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20050 | @brief Helper routine used to get the total count of active |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20051 | sessions |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20052 | |
| 20053 | |
| 20054 | @param pWDICtx: pointer to the WLAN DAL context |
| 20055 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20056 | @see |
| 20057 | @return Number of sessions in use |
| 20058 | */ |
| 20059 | wpt_uint8 |
| 20060 | WDI_GetActiveSessionsCount |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20061 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20062 | WDI_ControlBlockType* pWDICtx |
| 20063 | ) |
| 20064 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20065 | wpt_uint8 i, ucCount = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20066 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20067 | |
| 20068 | /*------------------------------------------------------------------------ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20069 | Count all sessions in use |
| 20070 | ------------------------------------------------------------------------*/ |
| 20071 | for ( i = 0; i < WDI_MAX_BSS_SESSIONS; i++ ) |
| 20072 | { |
| 20073 | if ( pWDICtx->aBSSSessions[i].bInUse ) |
| 20074 | { |
| 20075 | ucCount++; |
| 20076 | } |
| 20077 | } |
| 20078 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20079 | return ucCount; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20080 | }/*WDI_GetActiveSessionsCount*/ |
| 20081 | |
| 20082 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20083 | @brief Helper routine used to delete session in the WDI |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20084 | CB |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20085 | |
| 20086 | |
| 20087 | @param pWDICtx: pointer to the WLAN DAL context |
| 20088 | pSession: pointer to the session (if found) |
| 20089 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20090 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20091 | @return Index of the session in the array |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20092 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20093 | void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20094 | WDI_DeleteSession |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20095 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20096 | WDI_ControlBlockType* pWDICtx, |
| 20097 | WDI_BSSSessionType* ppSession |
| 20098 | ) |
| 20099 | { |
| 20100 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20101 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20102 | -------------------------------------------------------------------------*/ |
| 20103 | if ( NULL == ppSession ) |
| 20104 | { |
| 20105 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20106 | "%s: Invalid parameters", __FUNCTION__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20107 | return ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20108 | } |
| 20109 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20110 | /*------------------------------------------------------------------------ |
| 20111 | Reset the entries int session |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20112 | ------------------------------------------------------------------------*/ |
| 20113 | wpal_list_destroy(&ppSession->wptPendingQueue); |
| 20114 | wpalMemoryZero(ppSession, sizeof(*ppSession)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20115 | ppSession->wdiAssocState = WDI_ASSOC_INIT_ST; |
| 20116 | ppSession->bInUse = eWLAN_PAL_FALSE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20117 | ppSession->wdiBssType = WDI_INFRASTRUCTURE_MODE; |
| 20118 | wpal_list_init(&ppSession->wptPendingQueue); |
| 20119 | |
| 20120 | }/*WDI_DeleteSession*/ |
| 20121 | |
| 20122 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20123 | @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] | 20124 | The bcast STA ID is assigned by HAL and must be valid. |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20125 | @param |
| 20126 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20127 | WDI_AddStaParams: - pointer to the WDI Add STA params |
| 20128 | usBcastStaIdx: - Broadcast STA index passed by HAL |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20129 | |
| 20130 | @see |
| 20131 | @return void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20132 | */ |
| 20133 | void |
| 20134 | WDI_AddBcastSTAtoSTATable |
| 20135 | ( |
| 20136 | WDI_ControlBlockType* pWDICtx, |
| 20137 | WDI_AddStaParams * staParams, |
| 20138 | wpt_uint16 usBcastStaIdx |
| 20139 | ) |
| 20140 | { |
| 20141 | WDI_AddStaParams wdiAddSTAParam = {0}; |
| 20142 | wpt_macAddr bcastMacAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; |
| 20143 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 20144 | |
| 20145 | /*--------------------------------------------------------------------- |
| 20146 | Sanity check |
| 20147 | ---------------------------------------------------------------------*/ |
| 20148 | if ( NULL == staParams ) |
| 20149 | { |
| 20150 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20151 | "%s: Invalid parameters", __FUNCTION__); |
| 20152 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20153 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20154 | } |
| 20155 | |
| 20156 | wdiAddSTAParam.bcastDpuIndex = staParams->bcastDpuIndex; |
| 20157 | wdiAddSTAParam.bcastDpuSignature = staParams->bcastDpuSignature; |
| 20158 | wdiAddSTAParam.bcastMgmtDpuIndex = staParams->bcastMgmtDpuIndex; |
| 20159 | wdiAddSTAParam.bcastMgmtDpuSignature = staParams->bcastMgmtDpuSignature; |
| 20160 | wdiAddSTAParam.dpuIndex = staParams->dpuIndex; |
| 20161 | wdiAddSTAParam.dpuSig = staParams->dpuSig; |
| 20162 | wpalMemoryCopy( wdiAddSTAParam.macBSSID, staParams->macBSSID, |
| 20163 | WDI_MAC_ADDR_LEN ); |
| 20164 | wpalMemoryCopy( wdiAddSTAParam.staMacAddr, bcastMacAddr, WDI_MAC_ADDR_LEN ); |
| 20165 | wdiAddSTAParam.ucBSSIdx = staParams->ucBSSIdx; |
| 20166 | wdiAddSTAParam.ucHTCapable = staParams->ucHTCapable; |
| 20167 | wdiAddSTAParam.ucRmfEnabled = staParams->ucRmfEnabled; |
| 20168 | wdiAddSTAParam.ucStaType = WDI_STA_ENTRY_BCAST; |
| 20169 | wdiAddSTAParam.ucWmmEnabled = staParams->ucWmmEnabled; |
| 20170 | wdiAddSTAParam.ucSTAIdx = usBcastStaIdx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20171 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20172 | (void)WDI_STATableAddSta(pWDICtx,&wdiAddSTAParam); |
| 20173 | } |
| 20174 | |
| 20175 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20176 | @brief NV blob will be divided into fragments of size 4kb and |
| 20177 | Sent to HAL |
| 20178 | |
| 20179 | @param pWDICtx: pointer to the WLAN DAL context |
| 20180 | pEventData: pointer to the event information structure |
| 20181 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20182 | @see |
| 20183 | @return Result of the function call |
| 20184 | */ |
| 20185 | |
| 20186 | WDI_Status WDI_SendNvBlobReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20187 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20188 | WDI_ControlBlockType* pWDICtx, |
| 20189 | WDI_EventInfoType* pEventData |
| 20190 | ) |
| 20191 | { |
| 20192 | |
| 20193 | tHalNvImgDownloadReqMsg halNvImgDownloadParam; |
| 20194 | wpt_uint8* pSendBuffer = NULL; |
| 20195 | wpt_uint16 usDataOffset = 0; |
| 20196 | wpt_uint16 usSendSize = 0; |
| 20197 | wpt_uint16 usCurrentFragmentSize =0; |
| 20198 | wpt_uint8* pSrcBuffer = NULL; |
| 20199 | WDI_NvDownloadReqParamsType* pwdiNvDownloadReqParams =NULL ; |
| 20200 | WDI_NvDownloadRspCb wdiNvDownloadRspCb; |
| 20201 | |
| 20202 | wdiNvDownloadRspCb = (WDI_NvDownloadRspCb)pEventData->pCBfnc; |
| 20203 | WDI_ASSERT(NULL != wdiNvDownloadRspCb); |
| 20204 | pwdiNvDownloadReqParams = (WDI_NvDownloadReqParamsType*)pEventData->pEventData; |
| 20205 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20206 | /* Sanity Check is done by the caller */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20207 | pSrcBuffer =(wpt_uint8 *) pwdiNvDownloadReqParams->wdiBlobInfo.pBlobAddress; |
| 20208 | |
| 20209 | /* Update the current Fragment Number */ |
| 20210 | pWDICtx->wdiNvBlobInfo.usCurrentFragment += 1; |
| 20211 | |
| 20212 | /*Update the HAL REQ structure */ |
| 20213 | /*HAL maintaining the fragment count as 0,1,2...n where at WDI it is represented as 1,2,3.. n*/ |
| 20214 | halNvImgDownloadParam.nvImageReqParams.fragNumber = |
| 20215 | pWDICtx->wdiNvBlobInfo.usCurrentFragment-1; |
| 20216 | |
| 20217 | /* 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] | 20218 | 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] | 20219 | image will be sent to HAL*/ |
| 20220 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20221 | if(pWDICtx->wdiNvBlobInfo.usTotalFragment |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20222 | == pWDICtx->wdiNvBlobInfo.usCurrentFragment) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20223 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20224 | /* Taking care of boundry condition */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20225 | if( !(usCurrentFragmentSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20226 | pwdiNvDownloadReqParams->wdiBlobInfo.uBlobSize%FRAGMENT_SIZE )) |
| 20227 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 20228 | |
| 20229 | /*Update the HAL REQ structure */ |
| 20230 | halNvImgDownloadParam.nvImageReqParams.isLastFragment = 1; |
| 20231 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize= usCurrentFragmentSize; |
| 20232 | |
| 20233 | } |
| 20234 | else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20235 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20236 | usCurrentFragmentSize = FRAGMENT_SIZE; |
| 20237 | |
| 20238 | /*Update the HAL REQ structure */ |
| 20239 | halNvImgDownloadParam.nvImageReqParams.isLastFragment =0; |
| 20240 | halNvImgDownloadParam.nvImageReqParams.nvImgBufferSize = usCurrentFragmentSize; |
| 20241 | } |
| 20242 | |
| 20243 | /*----------------------------------------------------------------------- |
| 20244 | Get message buffer |
| 20245 | -----------------------------------------------------------------------*/ |
| 20246 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,WDI_NV_DOWNLOAD_REQ, |
| 20247 | sizeof(halNvImgDownloadParam.nvImageReqParams)+ usCurrentFragmentSize, |
| 20248 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20249 | ( usSendSize < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20250 | (usDataOffset + sizeof(halNvImgDownloadParam.nvImageReqParams) + usCurrentFragmentSize ))) |
| 20251 | { |
| 20252 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 20253 | "Unable to get send buffer in NV Download req %x %x ", |
| 20254 | pEventData, pwdiNvDownloadReqParams); |
| 20255 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20256 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20257 | } |
| 20258 | |
| 20259 | /* Copying the Hal NV download REQ structure */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20260 | wpalMemoryCopy(pSendBuffer + usDataOffset , |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20261 | &halNvImgDownloadParam.nvImageReqParams ,sizeof(tHalNvImgDownloadReqParams)); |
| 20262 | |
| 20263 | /* Appending the NV image fragment */ |
| 20264 | wpalMemoryCopy(pSendBuffer + usDataOffset + sizeof(tHalNvImgDownloadReqParams), |
| 20265 | (void *)(pSrcBuffer + halNvImgDownloadParam.nvImageReqParams.fragNumber * FRAGMENT_SIZE), |
| 20266 | usCurrentFragmentSize); |
| 20267 | |
| 20268 | pWDICtx->wdiReqStatusCB = pwdiNvDownloadReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20269 | pWDICtx->pReqStatusUserData = pwdiNvDownloadReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20270 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20271 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 20272 | wdiNvDownloadRspCb, pEventData->pUserData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20273 | WDI_NV_DOWNLOAD_RESP); |
| 20274 | |
| 20275 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20276 | /*============================================================================ |
| 20277 | Helper inline functions for |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20278 | ============================================================================*/ |
| 20279 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20280 | @brief Helper routine used to find a session based on the BSSID |
| 20281 | @param pContext: pointer to the WLAN DAL context |
| 20282 | @param pDPContext: pointer to the Datapath context |
| 20283 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20284 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20285 | @return |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20286 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20287 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20288 | WDI_DS_AssignDatapathContext (void *pContext, void *pDPContext) |
| 20289 | { |
| 20290 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20291 | |
| 20292 | pCB->pDPContext = pDPContext; |
| 20293 | return; |
| 20294 | } |
| 20295 | |
| 20296 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20297 | @brief Helper routine used to find a session based on the BSSID |
| 20298 | |
| 20299 | |
| 20300 | @param pContext: pointer to the WLAN DAL context |
| 20301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20302 | @see |
| 20303 | @return pointer to Datapath context |
| 20304 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20305 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20306 | WDI_DS_GetDatapathContext (void *pContext) |
| 20307 | { |
| 20308 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20309 | return pCB->pDPContext; |
| 20310 | } |
| 20311 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20312 | @brief Helper routine used to find a session based on the BSSID |
| 20313 | |
| 20314 | |
| 20315 | @param pContext: pointer to the WLAN DAL context |
| 20316 | @param pDTDriverContext: pointer to the Transport Driver context |
| 20317 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20318 | @see |
| 20319 | @return void |
| 20320 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20321 | WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20322 | WDT_AssignTransportDriverContext (void *pContext, void *pDTDriverContext) |
| 20323 | { |
| 20324 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
| 20325 | |
| 20326 | pCB->pDTDriverContext = pDTDriverContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20327 | return; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20328 | } |
| 20329 | |
| 20330 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20331 | @brief Helper routine used to find a session based on the BSSID |
| 20332 | |
| 20333 | |
| 20334 | @param pWDICtx: pointer to the WLAN DAL context |
| 20335 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20336 | @see |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20337 | @return pointer to datapath context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20338 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20339 | WPT_INLINE void * |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20340 | WDT_GetTransportDriverContext (void *pContext) |
| 20341 | { |
| 20342 | WDI_ControlBlockType *pCB = (WDI_ControlBlockType *)pContext; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20343 | return(pCB->pDTDriverContext); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20344 | } |
| 20345 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20346 | /*============================================================================ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20347 | Helper inline converters |
| 20348 | ============================================================================*/ |
| 20349 | /*Convert WDI driver type into HAL driver type*/ |
| 20350 | WPT_STATIC WPT_INLINE WDI_Status |
| 20351 | WDI_HAL_2_WDI_STATUS |
| 20352 | ( |
| 20353 | eHalStatus halStatus |
| 20354 | ) |
| 20355 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20356 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20357 | the chances of getting inlined*/ |
| 20358 | switch( halStatus ) |
| 20359 | { |
| 20360 | case eHAL_STATUS_SUCCESS: |
| 20361 | case eHAL_STATUS_ADD_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 20362 | case eHAL_STATUS_DEL_STA_SELF_IGNORED_REF_COUNT_NOT_ZERO: |
| 20363 | return WDI_STATUS_SUCCESS; |
| 20364 | case eHAL_STATUS_FAILURE: |
| 20365 | return WDI_STATUS_E_FAILURE; |
| 20366 | case eHAL_STATUS_FAILED_ALLOC: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20367 | return WDI_STATUS_MEM_FAILURE; |
| 20368 | /*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] | 20369 | they refer to specific internal modules of our device*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20370 | default: |
| 20371 | return WDI_STATUS_DEV_INTERNAL_FAILURE; |
| 20372 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20373 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20374 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20375 | }/*WDI_HAL_2_WDI_STATUS*/ |
| 20376 | |
| 20377 | /*Convert WDI request type into HAL request type*/ |
| 20378 | WPT_STATIC WPT_INLINE tHalHostMsgType |
| 20379 | WDI_2_HAL_REQ_TYPE |
| 20380 | ( |
| 20381 | WDI_RequestEnumType wdiReqType |
| 20382 | ) |
| 20383 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20384 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20385 | the chances of getting inlined*/ |
| 20386 | switch( wdiReqType ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20387 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20388 | case WDI_START_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20389 | return WLAN_HAL_START_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20390 | case WDI_STOP_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20391 | return WLAN_HAL_STOP_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20392 | case WDI_INIT_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20393 | return WLAN_HAL_INIT_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20394 | case WDI_START_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20395 | return WLAN_HAL_START_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20396 | case WDI_END_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20397 | return WLAN_HAL_END_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20398 | case WDI_FINISH_SCAN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20399 | return WLAN_HAL_FINISH_SCAN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20400 | case WDI_JOIN_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20401 | return WLAN_HAL_JOIN_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20402 | case WDI_CONFIG_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20403 | return WLAN_HAL_CONFIG_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20404 | case WDI_DEL_BSS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20405 | return WLAN_HAL_DELETE_BSS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20406 | case WDI_POST_ASSOC_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20407 | return WLAN_HAL_POST_ASSOC_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20408 | case WDI_DEL_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20409 | return WLAN_HAL_DELETE_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20410 | case WDI_SET_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20411 | return WLAN_HAL_SET_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20412 | case WDI_RMV_BSS_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20413 | return WLAN_HAL_RMV_BSSKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20414 | case WDI_SET_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20415 | return WLAN_HAL_SET_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20416 | case WDI_RMV_STA_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20417 | return WLAN_HAL_RMV_STAKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20418 | case WDI_SET_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20419 | return WLAN_HAL_SET_BCASTKEY_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20420 | case WDI_RMV_STA_BCAST_KEY_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20421 | //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] | 20422 | return WLAN_HAL_RMV_STAKEY_REQ; |
| 20423 | case WDI_ADD_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20424 | return WLAN_HAL_ADD_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20425 | case WDI_DEL_TS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20426 | return WLAN_HAL_DEL_TS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20427 | case WDI_UPD_EDCA_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20428 | return WLAN_HAL_UPD_EDCA_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20429 | case WDI_ADD_BA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20430 | return WLAN_HAL_ADD_BA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20431 | case WDI_DEL_BA_REQ: |
| 20432 | return WLAN_HAL_DEL_BA_REQ; |
| 20433 | #ifdef FEATURE_WLAN_CCX |
| 20434 | case WDI_TSM_STATS_REQ: |
| 20435 | return WLAN_HAL_TSM_STATS_REQ; |
| 20436 | #endif |
| 20437 | case WDI_CH_SWITCH_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20438 | return WLAN_HAL_CH_SWITCH_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20439 | case WDI_CONFIG_STA_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20440 | return WLAN_HAL_CONFIG_STA_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20441 | case WDI_SET_LINK_ST_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20442 | return WLAN_HAL_SET_LINK_ST_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20443 | case WDI_GET_STATS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20444 | return WLAN_HAL_GET_STATS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20445 | case WDI_UPDATE_CFG_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20446 | return WLAN_HAL_UPDATE_CFG_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20447 | case WDI_ADD_BA_SESSION_REQ: |
| 20448 | return WLAN_HAL_ADD_BA_SESSION_REQ; |
| 20449 | case WDI_TRIGGER_BA_REQ: |
| 20450 | return WLAN_HAL_TRIGGER_BA_REQ; |
| 20451 | case WDI_UPD_BCON_PRMS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20452 | return WLAN_HAL_UPDATE_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20453 | case WDI_SND_BCON_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20454 | return WLAN_HAL_SEND_BEACON_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20455 | case WDI_UPD_PROBE_RSP_TEMPLATE_REQ: |
| 20456 | return WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ; |
| 20457 | case WDI_SET_MAX_TX_POWER_REQ: |
| 20458 | return WLAN_HAL_SET_MAX_TX_POWER_REQ; |
| 20459 | #ifdef WLAN_FEATURE_P2P |
| 20460 | case WDI_P2P_GO_NOTICE_OF_ABSENCE_REQ: |
| 20461 | return WLAN_HAL_SET_P2P_GONOA_REQ; |
| 20462 | #endif |
| 20463 | case WDI_ENTER_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20464 | return WLAN_HAL_ENTER_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20465 | case WDI_EXIT_IMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20466 | return WLAN_HAL_EXIT_IMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20467 | case WDI_ENTER_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20468 | return WLAN_HAL_ENTER_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20469 | case WDI_EXIT_BMPS_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20470 | return WLAN_HAL_EXIT_BMPS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20471 | case WDI_ENTER_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20472 | return WLAN_HAL_ENTER_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20473 | case WDI_EXIT_UAPSD_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20474 | return WLAN_HAL_EXIT_UAPSD_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20475 | case WDI_SET_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20476 | return WLAN_HAL_SET_UAPSD_AC_PARAMS_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20477 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20478 | return WLAN_HAL_UPDATE_UAPSD_PARAM_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20479 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20480 | return WLAN_HAL_CONFIGURE_RXP_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20481 | case WDI_SET_BEACON_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20482 | return WLAN_HAL_ADD_BCN_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20483 | case WDI_REM_BEACON_FILTER_REQ: |
| 20484 | return WLAN_HAL_REM_BCN_FILTER_REQ; |
| 20485 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 20486 | return WLAN_HAL_SET_RSSI_THRESH_REQ; |
| 20487 | case WDI_HOST_OFFLOAD_REQ: |
| 20488 | return WLAN_HAL_HOST_OFFLOAD_REQ; |
| 20489 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 20490 | return WLAN_HAL_ADD_WOWL_BCAST_PTRN; |
| 20491 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 20492 | return WLAN_HAL_DEL_WOWL_BCAST_PTRN; |
| 20493 | case WDI_WOWL_ENTER_REQ: |
| 20494 | return WLAN_HAL_ENTER_WOWL_REQ; |
| 20495 | case WDI_WOWL_EXIT_REQ: |
| 20496 | return WLAN_HAL_EXIT_WOWL_REQ; |
| 20497 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 20498 | return WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ; |
| 20499 | case WDI_NV_DOWNLOAD_REQ: |
| 20500 | return WLAN_HAL_DOWNLOAD_NV_REQ; |
| 20501 | case WDI_FLUSH_AC_REQ: |
| 20502 | return WLAN_HAL_TL_HAL_FLUSH_AC_REQ; |
| 20503 | case WDI_BTAMP_EVENT_REQ: |
| 20504 | return WLAN_HAL_SIGNAL_BTAMP_EVENT_REQ; |
| 20505 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 20506 | case WDI_AGGR_ADD_TS_REQ: |
| 20507 | return WLAN_HAL_AGGR_ADD_TS_REQ; |
| 20508 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 20509 | #ifdef ANI_MANF_DIAG |
| 20510 | case WDI_FTM_CMD_REQ: |
| 20511 | return WLAN_HAL_PROCESS_PTT_REQ; |
| 20512 | #endif /* ANI_MANF_DIAG */ |
| 20513 | case WDI_ADD_STA_SELF_REQ: |
| 20514 | return WLAN_HAL_ADD_STA_SELF_REQ; |
| 20515 | case WDI_DEL_STA_SELF_REQ: |
| 20516 | return WLAN_HAL_DEL_STA_SELF_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20517 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 20518 | case WDI_START_OEM_DATA_REQ: |
| 20519 | return WLAN_HAL_START_OEM_DATA_REQ; |
| 20520 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20521 | case WDI_HOST_RESUME_REQ: |
| 20522 | return WLAN_HAL_HOST_RESUME_REQ; |
| 20523 | case WDI_HOST_SUSPEND_IND: |
| 20524 | return WLAN_HAL_HOST_SUSPEND_IND; |
| 20525 | case WDI_KEEP_ALIVE_REQ: |
| 20526 | return WLAN_HAL_KEEP_ALIVE_REQ; |
| 20527 | |
| 20528 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 20529 | case WDI_SET_PREF_NETWORK_REQ: |
| 20530 | return WLAN_HAL_SET_PREF_NETWORK_REQ; |
| 20531 | case WDI_SET_RSSI_FILTER_REQ: |
| 20532 | return WLAN_HAL_SET_RSSI_FILTER_REQ; |
| 20533 | case WDI_UPDATE_SCAN_PARAMS_REQ: |
| 20534 | return WLAN_HAL_UPDATE_SCAN_PARAM_REQ; |
| 20535 | #endif // FEATURE_WLAN_SCAN_PNO |
| 20536 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 20537 | return WLAN_HAL_SET_TX_PER_TRACKING_REQ; |
| 20538 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 20539 | case WDI_8023_MULTICAST_LIST_REQ: |
| 20540 | return WLAN_HAL_8023_MULTICAST_LIST_REQ; |
| 20541 | case WDI_RECEIVE_FILTER_SET_FILTER_REQ: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20542 | return WLAN_HAL_SET_PACKET_FILTER_REQ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20543 | case WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ: |
| 20544 | return WLAN_HAL_PACKET_FILTER_MATCH_COUNT_REQ; |
| 20545 | case WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ: |
| 20546 | return WLAN_HAL_CLEAR_PACKET_FILTER_REQ; |
| 20547 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 20548 | case WDI_HAL_DUMP_CMD_REQ: |
| 20549 | return WLAN_HAL_DUMP_COMMAND_REQ; |
| 20550 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 20551 | case WDI_GTK_OFFLOAD_REQ: |
| 20552 | return WLAN_HAL_GTK_OFFLOAD_REQ; |
| 20553 | case WDI_GTK_OFFLOAD_GETINFO_REQ: |
| 20554 | return WLAN_HAL_GTK_OFFLOAD_GETINFO_REQ; |
| 20555 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 20556 | |
| 20557 | case WDI_INIT_SCAN_CON_REQ: |
| 20558 | return WLAN_HAL_INIT_SCAN_CON_REQ; |
| 20559 | case WDI_SET_POWER_PARAMS_REQ: |
| 20560 | return WLAN_HAL_SET_POWER_PARAMS_REQ; |
| 20561 | case WDI_SET_TM_LEVEL_REQ: |
| 20562 | return WLAN_HAL_SET_THERMAL_MITIGATION_REQ; |
| 20563 | case WDI_FEATURE_CAPS_EXCHANGE_REQ: |
| 20564 | return WLAN_HAL_FEATURE_CAPS_EXCHANGE_REQ; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 20565 | #ifdef WLAN_FEATURE_11AC |
| 20566 | case WDI_UPDATE_VHT_OP_MODE_REQ: |
| 20567 | return WLAN_HAL_UPDATE_VHT_OP_MODE_REQ; |
| 20568 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20569 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20570 | return WLAN_HAL_MSG_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20571 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20572 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20573 | }/*WDI_2_HAL_REQ_TYPE*/ |
| 20574 | |
| 20575 | /*Convert WDI response type into HAL response type*/ |
| 20576 | WPT_STATIC WPT_INLINE WDI_ResponseEnumType |
| 20577 | HAL_2_WDI_RSP_TYPE |
| 20578 | ( |
| 20579 | tHalHostMsgType halMsg |
| 20580 | ) |
| 20581 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20582 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20583 | the chances of getting inlined*/ |
| 20584 | switch( halMsg ) |
| 20585 | { |
| 20586 | case WLAN_HAL_START_RSP: |
| 20587 | return WDI_START_RESP; |
| 20588 | case WLAN_HAL_STOP_RSP: |
| 20589 | return WDI_STOP_RESP; |
| 20590 | case WLAN_HAL_INIT_SCAN_RSP: |
| 20591 | return WDI_INIT_SCAN_RESP; |
| 20592 | case WLAN_HAL_START_SCAN_RSP: |
| 20593 | return WDI_START_SCAN_RESP; |
| 20594 | case WLAN_HAL_END_SCAN_RSP: |
| 20595 | return WDI_END_SCAN_RESP; |
| 20596 | case WLAN_HAL_FINISH_SCAN_RSP: |
| 20597 | return WDI_FINISH_SCAN_RESP; |
| 20598 | case WLAN_HAL_CONFIG_STA_RSP: |
| 20599 | return WDI_CONFIG_STA_RESP; |
| 20600 | case WLAN_HAL_DELETE_STA_RSP: |
| 20601 | return WDI_DEL_STA_RESP; |
| 20602 | case WLAN_HAL_CONFIG_BSS_RSP: |
| 20603 | return WDI_CONFIG_BSS_RESP; |
| 20604 | case WLAN_HAL_DELETE_BSS_RSP: |
| 20605 | return WDI_DEL_BSS_RESP; |
| 20606 | case WLAN_HAL_JOIN_RSP: |
| 20607 | return WDI_JOIN_RESP; |
| 20608 | case WLAN_HAL_POST_ASSOC_RSP: |
| 20609 | return WDI_POST_ASSOC_RESP; |
| 20610 | case WLAN_HAL_SET_BSSKEY_RSP: |
| 20611 | return WDI_SET_BSS_KEY_RESP; |
| 20612 | case WLAN_HAL_SET_STAKEY_RSP: |
| 20613 | return WDI_SET_STA_KEY_RESP; |
| 20614 | case WLAN_HAL_RMV_BSSKEY_RSP: |
| 20615 | return WDI_RMV_BSS_KEY_RESP; |
| 20616 | case WLAN_HAL_RMV_STAKEY_RSP: |
| 20617 | return WDI_RMV_STA_KEY_RESP; |
| 20618 | case WLAN_HAL_SET_BCASTKEY_RSP: |
| 20619 | return WDI_SET_STA_BCAST_KEY_RESP; |
| 20620 | //Some conflict in the old code - check this: case WLAN_HAL_RMV_BCASTKEY_RSP: |
| 20621 | // return WDI_RMV_STA_BCAST_KEY_RESP; |
| 20622 | case WLAN_HAL_ADD_TS_RSP: |
| 20623 | return WDI_ADD_TS_RESP; |
| 20624 | case WLAN_HAL_DEL_TS_RSP: |
| 20625 | return WDI_DEL_TS_RESP; |
| 20626 | case WLAN_HAL_UPD_EDCA_PARAMS_RSP: |
| 20627 | return WDI_UPD_EDCA_PRMS_RESP; |
| 20628 | case WLAN_HAL_ADD_BA_RSP: |
| 20629 | return WDI_ADD_BA_RESP; |
| 20630 | case WLAN_HAL_DEL_BA_RSP: |
| 20631 | return WDI_DEL_BA_RESP; |
| 20632 | #ifdef FEATURE_WLAN_CCX |
| 20633 | case WLAN_HAL_TSM_STATS_RSP: |
| 20634 | return WDI_TSM_STATS_RESP; |
| 20635 | #endif |
| 20636 | case WLAN_HAL_CH_SWITCH_RSP: |
| 20637 | return WDI_CH_SWITCH_RESP; |
| 20638 | case WLAN_HAL_SET_LINK_ST_RSP: |
| 20639 | return WDI_SET_LINK_ST_RESP; |
| 20640 | case WLAN_HAL_GET_STATS_RSP: |
| 20641 | return WDI_GET_STATS_RESP; |
| 20642 | case WLAN_HAL_UPDATE_CFG_RSP: |
| 20643 | return WDI_UPDATE_CFG_RESP; |
| 20644 | case WLAN_HAL_ADD_BA_SESSION_RSP: |
| 20645 | return WDI_ADD_BA_SESSION_RESP; |
| 20646 | case WLAN_HAL_TRIGGER_BA_RSP: |
| 20647 | return WDI_TRIGGER_BA_RESP; |
| 20648 | case WLAN_HAL_UPDATE_BEACON_RSP: |
| 20649 | return WDI_UPD_BCON_PRMS_RESP; |
| 20650 | case WLAN_HAL_SEND_BEACON_RSP: |
| 20651 | return WDI_SND_BCON_RESP; |
| 20652 | case WLAN_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP: |
| 20653 | return WDI_UPD_PROBE_RSP_TEMPLATE_RESP; |
| 20654 | /*Indications*/ |
| 20655 | case WLAN_HAL_RSSI_NOTIFICATION_IND: |
| 20656 | return WDI_HAL_RSSI_NOTIFICATION_IND; |
| 20657 | case WLAN_HAL_MISSED_BEACON_IND: |
| 20658 | return WDI_HAL_MISSED_BEACON_IND; |
| 20659 | case WLAN_HAL_UNKNOWN_ADDR2_FRAME_RX_IND: |
| 20660 | return WDI_HAL_UNKNOWN_ADDR2_FRAME_RX_IND; |
| 20661 | case WLAN_HAL_MIC_FAILURE_IND: |
| 20662 | return WDI_HAL_MIC_FAILURE_IND; |
| 20663 | case WLAN_HAL_FATAL_ERROR_IND: |
| 20664 | return WDI_HAL_FATAL_ERROR_IND; |
| 20665 | case WLAN_HAL_DELETE_STA_CONTEXT_IND: |
| 20666 | return WDI_HAL_DEL_STA_IND; |
| 20667 | case WLAN_HAL_COEX_IND: |
| 20668 | return WDI_HAL_COEX_IND; |
| 20669 | case WLAN_HAL_OTA_TX_COMPL_IND: |
| 20670 | return WDI_HAL_TX_COMPLETE_IND; |
| 20671 | #ifdef WLAN_FEATURE_P2P |
| 20672 | case WLAN_HAL_P2P_NOA_ATTR_IND: |
| 20673 | return WDI_HAL_P2P_NOA_ATTR_IND; |
| 20674 | #endif |
| 20675 | case WLAN_HAL_TX_PER_HIT_IND: |
| 20676 | return WDI_HAL_TX_PER_HIT_IND; |
| 20677 | case WLAN_HAL_SET_MAX_TX_POWER_RSP: |
| 20678 | return WDI_SET_MAX_TX_POWER_RESP; |
| 20679 | #ifdef WLAN_FEATURE_P2P |
| 20680 | case WLAN_HAL_SET_P2P_GONOA_RSP: |
| 20681 | return WDI_P2P_GO_NOTICE_OF_ABSENCE_RESP; |
| 20682 | #endif |
| 20683 | case WLAN_HAL_ENTER_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20684 | return WDI_ENTER_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20685 | case WLAN_HAL_EXIT_IMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20686 | return WDI_EXIT_IMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20687 | case WLAN_HAL_ENTER_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20688 | return WDI_ENTER_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20689 | case WLAN_HAL_EXIT_BMPS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20690 | return WDI_EXIT_BMPS_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20691 | case WLAN_HAL_ENTER_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20692 | return WDI_ENTER_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20693 | case WLAN_HAL_EXIT_UAPSD_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20694 | return WDI_EXIT_UAPSD_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20695 | case WLAN_HAL_SET_UAPSD_AC_PARAMS_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20696 | return WDI_SET_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20697 | case WLAN_HAL_UPDATE_UAPSD_PARAM_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20698 | return WDI_UPDATE_UAPSD_PARAM_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20699 | case WLAN_HAL_CONFIGURE_RXP_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20700 | return WDI_CONFIGURE_RXP_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20701 | case WLAN_HAL_ADD_BCN_FILTER_RSP: |
| 20702 | return WDI_SET_BEACON_FILTER_RESP; |
| 20703 | case WLAN_HAL_REM_BCN_FILTER_RSP: |
| 20704 | return WDI_REM_BEACON_FILTER_RESP; |
| 20705 | case WLAN_HAL_SET_RSSI_THRESH_RSP: |
| 20706 | return WDI_SET_RSSI_THRESHOLDS_RESP; |
| 20707 | case WLAN_HAL_HOST_OFFLOAD_RSP: |
| 20708 | return WDI_HOST_OFFLOAD_RESP; |
| 20709 | case WLAN_HAL_ADD_WOWL_BCAST_PTRN_RSP: |
| 20710 | return WDI_WOWL_ADD_BC_PTRN_RESP; |
| 20711 | case WLAN_HAL_DEL_WOWL_BCAST_PTRN_RSP: |
| 20712 | return WDI_WOWL_DEL_BC_PTRN_RESP; |
| 20713 | case WLAN_HAL_ENTER_WOWL_RSP: |
| 20714 | return WDI_WOWL_ENTER_RESP; |
| 20715 | case WLAN_HAL_EXIT_WOWL_RSP: |
| 20716 | return WDI_WOWL_EXIT_RESP; |
| 20717 | case WLAN_HAL_CONFIGURE_APPS_CPU_WAKEUP_STATE_RSP: |
| 20718 | return WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_RESP; |
| 20719 | case WLAN_HAL_DOWNLOAD_NV_RSP: |
| 20720 | return WDI_NV_DOWNLOAD_RESP; |
| 20721 | case WLAN_HAL_TL_HAL_FLUSH_AC_RSP: |
| 20722 | return WDI_FLUSH_AC_RESP; |
| 20723 | case WLAN_HAL_SIGNAL_BTAMP_EVENT_RSP: |
| 20724 | return WDI_BTAMP_EVENT_RESP; |
| 20725 | #ifdef ANI_MANF_DIAG |
| 20726 | case WLAN_HAL_PROCESS_PTT_RSP: |
| 20727 | return WDI_FTM_CMD_RESP; |
| 20728 | #endif /* ANI_MANF_DIAG */ |
| 20729 | case WLAN_HAL_ADD_STA_SELF_RSP: |
| 20730 | return WDI_ADD_STA_SELF_RESP; |
| 20731 | case WLAN_HAL_DEL_STA_SELF_RSP: |
| 20732 | return WDI_DEL_STA_SELF_RESP; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20733 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 20734 | case WLAN_HAL_START_OEM_DATA_RSP: |
| 20735 | return WDI_START_OEM_DATA_RESP; |
| 20736 | #endif /* FEATURE_OEM_DATA_SUPPORT */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20737 | case WLAN_HAL_HOST_RESUME_RSP: |
| 20738 | return WDI_HOST_RESUME_RESP; |
| 20739 | case WLAN_HAL_KEEP_ALIVE_RSP: |
| 20740 | return WDI_KEEP_ALIVE_RESP; |
| 20741 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 20742 | case WLAN_HAL_SET_PREF_NETWORK_RSP: |
| 20743 | return WDI_SET_PREF_NETWORK_RESP; |
| 20744 | case WLAN_HAL_SET_RSSI_FILTER_RSP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20745 | return WDI_SET_RSSI_FILTER_RESP; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20746 | case WLAN_HAL_UPDATE_SCAN_PARAM_RSP: |
| 20747 | return WDI_UPDATE_SCAN_PARAMS_RESP; |
| 20748 | case WLAN_HAL_PREF_NETW_FOUND_IND: |
| 20749 | return WDI_HAL_PREF_NETWORK_FOUND_IND; |
| 20750 | #endif // FEATURE_WLAN_SCAN_PNO |
| 20751 | case WLAN_HAL_SET_TX_PER_TRACKING_RSP: |
| 20752 | return WDI_SET_TX_PER_TRACKING_RESP; |
| 20753 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 20754 | case WLAN_HAL_8023_MULTICAST_LIST_RSP: |
| 20755 | return WDI_8023_MULTICAST_LIST_RESP; |
| 20756 | case WLAN_HAL_SET_PACKET_FILTER_RSP: |
| 20757 | return WDI_RECEIVE_FILTER_SET_FILTER_RESP; |
| 20758 | case WLAN_HAL_PACKET_FILTER_MATCH_COUNT_RSP: |
| 20759 | return WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP; |
| 20760 | case WLAN_HAL_CLEAR_PACKET_FILTER_RSP: |
| 20761 | return WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP; |
| 20762 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 20763 | |
| 20764 | case WLAN_HAL_DUMP_COMMAND_RSP: |
| 20765 | return WDI_HAL_DUMP_CMD_RESP; |
| 20766 | case WLAN_HAL_SET_POWER_PARAMS_RSP: |
| 20767 | return WDI_SET_POWER_PARAMS_RESP; |
| 20768 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 20769 | case WLAN_HAL_AGGR_ADD_TS_RSP: |
| 20770 | return WDI_AGGR_ADD_TS_RESP; |
| 20771 | #endif |
| 20772 | |
| 20773 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 20774 | case WLAN_HAL_GTK_OFFLOAD_RSP: |
| 20775 | return WDI_GTK_OFFLOAD_RESP; |
| 20776 | case WLAN_HAL_GTK_OFFLOAD_GETINFO_RSP: |
| 20777 | return WDI_GTK_OFFLOAD_GETINFO_RESP; |
| 20778 | #endif /* WLAN_FEATURE_GTK_OFFLOAD */ |
| 20779 | #ifdef WLAN_WAKEUP_EVENTS |
| 20780 | case WLAN_HAL_WAKE_REASON_IND: |
| 20781 | return WDI_HAL_WAKE_REASON_IND; |
| 20782 | #endif // WLAN_WAKEUP_EVENTS |
| 20783 | |
| 20784 | case WLAN_HAL_SET_THERMAL_MITIGATION_RSP: |
| 20785 | return WDI_SET_TM_LEVEL_RESP; |
| 20786 | case WLAN_HAL_FEATURE_CAPS_EXCHANGE_RSP: |
| 20787 | return WDI_FEATURE_CAPS_EXCHANGE_RESP; |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 20788 | #ifdef WLAN_FEATURE_11AC |
| 20789 | case WLAN_HAL_UPDATE_VHT_OP_MODE_RSP: |
| 20790 | return WDI_UPDATE_VHT_OP_MODE_RESP; |
| 20791 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20792 | default: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20793 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20794 | } |
| 20795 | |
| 20796 | }/*HAL_2_WDI_RSP_TYPE*/ |
| 20797 | |
| 20798 | |
| 20799 | /*Convert WDI driver type into HAL driver type*/ |
| 20800 | WPT_STATIC WPT_INLINE tDriverType |
| 20801 | WDI_2_HAL_DRV_TYPE |
| 20802 | ( |
| 20803 | WDI_DriverType wdiDriverType |
| 20804 | ) |
| 20805 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20806 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20807 | the chances of getting inlined*/ |
| 20808 | switch( wdiDriverType ) |
| 20809 | { |
| 20810 | case WDI_DRIVER_TYPE_PRODUCTION: |
| 20811 | return eDRIVER_TYPE_PRODUCTION; |
| 20812 | case WDI_DRIVER_TYPE_MFG: |
| 20813 | return eDRIVER_TYPE_MFG; |
| 20814 | case WDI_DRIVER_TYPE_DVT: |
| 20815 | return eDRIVER_TYPE_DVT; |
| 20816 | } |
| 20817 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20818 | return eDRIVER_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20819 | }/*WDI_2_HAL_DRV_TYPE*/ |
| 20820 | |
| 20821 | |
| 20822 | /*Convert WDI stop reason into HAL stop reason*/ |
| 20823 | WPT_STATIC WPT_INLINE tHalStopType |
| 20824 | WDI_2_HAL_STOP_REASON |
| 20825 | ( |
| 20826 | WDI_StopType wdiDriverType |
| 20827 | ) |
| 20828 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20829 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20830 | the chances of getting inlined*/ |
| 20831 | switch( wdiDriverType ) |
| 20832 | { |
| 20833 | case WDI_STOP_TYPE_SYS_RESET: |
| 20834 | return HAL_STOP_TYPE_SYS_RESET; |
| 20835 | case WDI_DRIVER_TYPE_MFG: |
| 20836 | return WDI_STOP_TYPE_SYS_DEEP_SLEEP; |
| 20837 | case WDI_STOP_TYPE_RF_KILL: |
| 20838 | return HAL_STOP_TYPE_RF_KILL; |
| 20839 | } |
| 20840 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20841 | return HAL_STOP_TYPE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20842 | }/*WDI_2_HAL_STOP_REASON*/ |
| 20843 | |
| 20844 | |
| 20845 | /*Convert WDI scan mode type into HAL scan mode type*/ |
| 20846 | WPT_STATIC WPT_INLINE eHalSysMode |
| 20847 | WDI_2_HAL_SCAN_MODE |
| 20848 | ( |
| 20849 | WDI_ScanMode wdiScanMode |
| 20850 | ) |
| 20851 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20852 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20853 | the chances of getting inlined*/ |
| 20854 | switch( wdiScanMode ) |
| 20855 | { |
| 20856 | case WDI_SCAN_MODE_NORMAL: |
| 20857 | return eHAL_SYS_MODE_NORMAL; |
| 20858 | case WDI_SCAN_MODE_LEARN: |
| 20859 | return eHAL_SYS_MODE_LEARN; |
| 20860 | case WDI_SCAN_MODE_SCAN: |
| 20861 | return eHAL_SYS_MODE_SCAN; |
| 20862 | case WDI_SCAN_MODE_PROMISC: |
| 20863 | return eHAL_SYS_MODE_PROMISC; |
| 20864 | case WDI_SCAN_MODE_SUSPEND_LINK: |
| 20865 | return eHAL_SYS_MODE_SUSPEND_LINK; |
| 20866 | } |
| 20867 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20868 | return eHAL_SYS_MODE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20869 | }/*WDI_2_HAL_SCAN_MODE*/ |
| 20870 | |
| 20871 | /*Convert WDI sec ch offset into HAL sec ch offset type*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20872 | WPT_STATIC WPT_INLINE ePhyChanBondState |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20873 | WDI_2_HAL_SEC_CH_OFFSET |
| 20874 | ( |
| 20875 | WDI_HTSecondaryChannelOffset wdiSecChOffset |
| 20876 | ) |
| 20877 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20878 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20879 | the chances of getting inlined*/ |
| 20880 | switch( wdiSecChOffset ) |
| 20881 | { |
| 20882 | case WDI_SECONDARY_CHANNEL_OFFSET_NONE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20883 | return PHY_SINGLE_CHANNEL_CENTERED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20884 | case WDI_SECONDARY_CHANNEL_OFFSET_UP: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20885 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20886 | case WDI_SECONDARY_CHANNEL_OFFSET_DOWN: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20887 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 20888 | #ifdef WLAN_FEATURE_11AC |
| 20889 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 20890 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 20891 | case WDI_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 20892 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 20893 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 20894 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 20895 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 20896 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 20897 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 20898 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 20899 | case WDI_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 20900 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 20901 | case WDI_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 20902 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 20903 | #endif |
| 20904 | default: |
| 20905 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20906 | } |
| 20907 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20908 | return PHY_CHANNEL_BONDING_STATE_MAX; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20909 | }/*WDI_2_HAL_SEC_CH_OFFSET*/ |
| 20910 | |
| 20911 | /*Convert WDI BSS type into HAL BSS type*/ |
| 20912 | WPT_STATIC WPT_INLINE tSirBssType |
| 20913 | WDI_2_HAL_BSS_TYPE |
| 20914 | ( |
| 20915 | WDI_BssType wdiBSSType |
| 20916 | ) |
| 20917 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20918 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20919 | the chances of getting inlined*/ |
| 20920 | switch( wdiBSSType ) |
| 20921 | { |
| 20922 | case WDI_INFRASTRUCTURE_MODE: |
| 20923 | return eSIR_INFRASTRUCTURE_MODE; |
| 20924 | case WDI_INFRA_AP_MODE: |
| 20925 | return eSIR_INFRA_AP_MODE; |
| 20926 | case WDI_IBSS_MODE: |
| 20927 | return eSIR_IBSS_MODE; |
| 20928 | case WDI_BTAMP_STA_MODE: |
| 20929 | return eSIR_BTAMP_STA_MODE; |
| 20930 | case WDI_BTAMP_AP_MODE: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20931 | return eSIR_BTAMP_AP_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20932 | case WDI_BSS_AUTO_MODE: |
| 20933 | return eSIR_AUTO_MODE; |
| 20934 | } |
| 20935 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20936 | return eSIR_DONOT_USE_BSS_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20937 | }/*WDI_2_HAL_BSS_TYPE*/ |
| 20938 | |
| 20939 | /*Convert WDI NW type into HAL NW type*/ |
| 20940 | WPT_STATIC WPT_INLINE tSirNwType |
| 20941 | WDI_2_HAL_NW_TYPE |
| 20942 | ( |
| 20943 | WDI_NwType wdiNWType |
| 20944 | ) |
| 20945 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20946 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20947 | the chances of getting inlined*/ |
| 20948 | switch( wdiNWType ) |
| 20949 | { |
| 20950 | case WDI_11A_NW_TYPE: |
| 20951 | return eSIR_11A_NW_TYPE; |
| 20952 | case WDI_11B_NW_TYPE: |
| 20953 | return eSIR_11B_NW_TYPE; |
| 20954 | case WDI_11G_NW_TYPE: |
| 20955 | return eSIR_11G_NW_TYPE; |
| 20956 | case WDI_11N_NW_TYPE: |
| 20957 | return eSIR_11N_NW_TYPE; |
| 20958 | } |
| 20959 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20960 | return eSIR_DONOT_USE_NW_TYPE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20961 | }/*WDI_2_HAL_NW_TYPE*/ |
| 20962 | |
| 20963 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 20964 | WPT_STATIC WPT_INLINE ePhyChanBondState |
| 20965 | WDI_2_HAL_CB_STATE |
| 20966 | ( |
| 20967 | WDI_PhyChanBondState wdiCbState |
| 20968 | ) |
| 20969 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20970 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20971 | the chances of getting inlined*/ |
| 20972 | switch ( wdiCbState ) |
| 20973 | { |
| 20974 | case WDI_PHY_SINGLE_CHANNEL_CENTERED: |
| 20975 | return PHY_SINGLE_CHANNEL_CENTERED; |
| 20976 | case WDI_PHY_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 20977 | return PHY_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 20978 | case WDI_PHY_DOUBLE_CHANNEL_CENTERED: |
| 20979 | return PHY_DOUBLE_CHANNEL_CENTERED; |
| 20980 | case WDI_PHY_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 20981 | return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 20982 | #ifdef WLAN_FEATURE_11AC |
| 20983 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED: |
| 20984 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; |
| 20985 | case WDI_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED: |
| 20986 | return PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED; |
| 20987 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED: |
| 20988 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED; |
| 20989 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 20990 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
| 20991 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 20992 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
| 20993 | case WDI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 20994 | return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
| 20995 | case WDI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 20996 | return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
| 20997 | #endif |
| 20998 | case WDI_MAX_CB_STATE: |
| 20999 | default: |
| 21000 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21001 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21002 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21003 | return PHY_CHANNEL_BONDING_STATE_MAX; |
| 21004 | }/*WDI_2_HAL_CB_STATE*/ |
| 21005 | |
| 21006 | /*Convert WDI chanel bonding type into HAL cb type*/ |
| 21007 | WPT_STATIC WPT_INLINE tSirMacHTOperatingMode |
| 21008 | WDI_2_HAL_HT_OPER_MODE |
| 21009 | ( |
| 21010 | WDI_HTOperatingMode wdiHTOperMode |
| 21011 | ) |
| 21012 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21013 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21014 | the chances of getting inlined*/ |
| 21015 | switch ( wdiHTOperMode ) |
| 21016 | { |
| 21017 | case WDI_HT_OP_MODE_PURE: |
| 21018 | return eSIR_HT_OP_MODE_PURE; |
| 21019 | case WDI_HT_OP_MODE_OVERLAP_LEGACY: |
| 21020 | return eSIR_HT_OP_MODE_OVERLAP_LEGACY; |
| 21021 | case WDI_HT_OP_MODE_NO_LEGACY_20MHZ_HT: |
| 21022 | return eSIR_HT_OP_MODE_NO_LEGACY_20MHZ_HT; |
| 21023 | case WDI_HT_OP_MODE_MIXED: |
| 21024 | return eSIR_HT_OP_MODE_MIXED; |
| 21025 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21026 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21027 | return eSIR_HT_OP_MODE_MAX; |
| 21028 | }/*WDI_2_HAL_HT_OPER_MODE*/ |
| 21029 | |
| 21030 | /*Convert WDI mimo PS type into HAL mimo PS type*/ |
| 21031 | WPT_STATIC WPT_INLINE tSirMacHTMIMOPowerSaveState |
| 21032 | WDI_2_HAL_MIMO_PS |
| 21033 | ( |
| 21034 | WDI_HTMIMOPowerSaveState wdiHTOperMode |
| 21035 | ) |
| 21036 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21037 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21038 | the chances of getting inlined*/ |
| 21039 | switch ( wdiHTOperMode ) |
| 21040 | { |
| 21041 | case WDI_HT_MIMO_PS_STATIC: |
| 21042 | return eSIR_HT_MIMO_PS_STATIC; |
| 21043 | case WDI_HT_MIMO_PS_DYNAMIC: |
| 21044 | return eSIR_HT_MIMO_PS_DYNAMIC; |
| 21045 | case WDI_HT_MIMO_PS_NA: |
| 21046 | return eSIR_HT_MIMO_PS_NA; |
| 21047 | case WDI_HT_MIMO_PS_NO_LIMIT: |
| 21048 | return eSIR_HT_MIMO_PS_NO_LIMIT; |
| 21049 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21050 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21051 | return eSIR_HT_MIMO_PS_MAX; |
| 21052 | }/*WDI_2_HAL_MIMO_PS*/ |
| 21053 | |
| 21054 | /*Convert WDI ENC type into HAL ENC type*/ |
| 21055 | WPT_STATIC WPT_INLINE tAniEdType |
| 21056 | WDI_2_HAL_ENC_TYPE |
| 21057 | ( |
| 21058 | WDI_EncryptType wdiEncType |
| 21059 | ) |
| 21060 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21061 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21062 | the chances of getting inlined*/ |
| 21063 | switch ( wdiEncType ) |
| 21064 | { |
| 21065 | case WDI_ENCR_NONE: |
| 21066 | return eSIR_ED_NONE; |
| 21067 | |
| 21068 | case WDI_ENCR_WEP40: |
| 21069 | return eSIR_ED_WEP40; |
| 21070 | |
| 21071 | case WDI_ENCR_WEP104: |
| 21072 | return eSIR_ED_WEP104; |
| 21073 | |
| 21074 | case WDI_ENCR_TKIP: |
| 21075 | return eSIR_ED_TKIP; |
| 21076 | |
| 21077 | case WDI_ENCR_CCMP: |
| 21078 | return eSIR_ED_CCMP; |
| 21079 | |
| 21080 | case WDI_ENCR_AES_128_CMAC: |
| 21081 | return eSIR_ED_AES_128_CMAC; |
| 21082 | #if defined(FEATURE_WLAN_WAPI) |
| 21083 | case WDI_ENCR_WPI: |
| 21084 | return eSIR_ED_WPI; |
| 21085 | #endif |
| 21086 | default: |
| 21087 | return eSIR_ED_NOT_IMPLEMENTED; |
| 21088 | } |
| 21089 | |
| 21090 | }/*WDI_2_HAL_ENC_TYPE*/ |
| 21091 | |
| 21092 | /*Convert WDI WEP type into HAL WEP type*/ |
| 21093 | WPT_STATIC WPT_INLINE tAniWepType |
| 21094 | WDI_2_HAL_WEP_TYPE |
| 21095 | ( |
| 21096 | WDI_WepType wdiWEPType |
| 21097 | ) |
| 21098 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21099 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21100 | the chances of getting inlined*/ |
| 21101 | switch ( wdiWEPType ) |
| 21102 | { |
| 21103 | case WDI_WEP_STATIC: |
| 21104 | return eSIR_WEP_STATIC; |
| 21105 | |
| 21106 | case WDI_WEP_DYNAMIC: |
| 21107 | return eSIR_WEP_DYNAMIC; |
| 21108 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21109 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21110 | return eSIR_WEP_MAX; |
| 21111 | }/*WDI_2_HAL_WEP_TYPE*/ |
| 21112 | |
| 21113 | WPT_STATIC WPT_INLINE tSirLinkState |
| 21114 | WDI_2_HAL_LINK_STATE |
| 21115 | ( |
| 21116 | WDI_LinkStateType wdiLinkState |
| 21117 | ) |
| 21118 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21119 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21120 | the chances of getting inlined*/ |
| 21121 | switch ( wdiLinkState ) |
| 21122 | { |
| 21123 | case WDI_LINK_IDLE_STATE: |
| 21124 | return eSIR_LINK_IDLE_STATE; |
| 21125 | |
| 21126 | case WDI_LINK_PREASSOC_STATE: |
| 21127 | return eSIR_LINK_PREASSOC_STATE; |
| 21128 | |
| 21129 | case WDI_LINK_POSTASSOC_STATE: |
| 21130 | return eSIR_LINK_POSTASSOC_STATE; |
| 21131 | |
| 21132 | case WDI_LINK_AP_STATE: |
| 21133 | return eSIR_LINK_AP_STATE; |
| 21134 | |
| 21135 | case WDI_LINK_IBSS_STATE: |
| 21136 | return eSIR_LINK_IBSS_STATE; |
| 21137 | |
| 21138 | case WDI_LINK_BTAMP_PREASSOC_STATE: |
| 21139 | return eSIR_LINK_BTAMP_PREASSOC_STATE; |
| 21140 | |
| 21141 | case WDI_LINK_BTAMP_POSTASSOC_STATE: |
| 21142 | return eSIR_LINK_BTAMP_POSTASSOC_STATE; |
| 21143 | |
| 21144 | case WDI_LINK_BTAMP_AP_STATE: |
| 21145 | return eSIR_LINK_BTAMP_AP_STATE; |
| 21146 | |
| 21147 | case WDI_LINK_BTAMP_STA_STATE: |
| 21148 | return eSIR_LINK_BTAMP_STA_STATE; |
| 21149 | |
| 21150 | case WDI_LINK_LEARN_STATE: |
| 21151 | return eSIR_LINK_LEARN_STATE; |
| 21152 | |
| 21153 | case WDI_LINK_SCAN_STATE: |
| 21154 | return eSIR_LINK_SCAN_STATE; |
| 21155 | |
| 21156 | case WDI_LINK_FINISH_SCAN_STATE: |
| 21157 | return eSIR_LINK_FINISH_SCAN_STATE; |
| 21158 | |
| 21159 | case WDI_LINK_INIT_CAL_STATE: |
| 21160 | return eSIR_LINK_INIT_CAL_STATE; |
| 21161 | |
| 21162 | case WDI_LINK_FINISH_CAL_STATE: |
| 21163 | return eSIR_LINK_FINISH_CAL_STATE; |
| 21164 | |
| 21165 | #ifdef WLAN_FEATURE_P2P |
| 21166 | case WDI_LINK_LISTEN_STATE: |
| 21167 | return eSIR_LINK_LISTEN_STATE; |
| 21168 | #endif |
| 21169 | |
| 21170 | default: |
| 21171 | return eSIR_LINK_MAX; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21172 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21173 | } |
| 21174 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21175 | /*Translate a STA Context from WDI into HAL*/ |
| 21176 | WPT_STATIC WPT_INLINE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21177 | void |
| 21178 | WDI_CopyWDIStaCtxToHALStaCtx |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21179 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21180 | tConfigStaParams* phalConfigSta, |
| 21181 | WDI_ConfigStaReqInfoType* pwdiConfigSta |
| 21182 | ) |
| 21183 | { |
| 21184 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21185 | #ifdef WLAN_FEATURE_11AC |
| 21186 | /* Get the Version 1 Handler */ |
| 21187 | tConfigStaParams_V1* phalConfigSta_V1 = NULL; |
| 21188 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 21189 | { |
| 21190 | phalConfigSta_V1 = (tConfigStaParams_V1*)phalConfigSta; |
| 21191 | } |
| 21192 | #endif |
| 21193 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21194 | the chances of getting inlined*/ |
| 21195 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21196 | wpalMemoryCopy(phalConfigSta->bssId, |
| 21197 | pwdiConfigSta->macBSSID, WDI_MAC_ADDR_LEN); |
| 21198 | |
| 21199 | wpalMemoryCopy(phalConfigSta->staMac, |
| 21200 | pwdiConfigSta->macSTA, WDI_MAC_ADDR_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21201 | |
| 21202 | phalConfigSta->assocId = pwdiConfigSta->usAssocId; |
| 21203 | phalConfigSta->staType = pwdiConfigSta->wdiSTAType; |
| 21204 | phalConfigSta->shortPreambleSupported = pwdiConfigSta->ucShortPreambleSupported; |
| 21205 | phalConfigSta->listenInterval = pwdiConfigSta->usListenInterval; |
| 21206 | phalConfigSta->wmmEnabled = pwdiConfigSta->ucWMMEnabled; |
| 21207 | phalConfigSta->htCapable = pwdiConfigSta->ucHTCapable; |
| 21208 | phalConfigSta->txChannelWidthSet = pwdiConfigSta->ucTXChannelWidthSet; |
| 21209 | phalConfigSta->rifsMode = pwdiConfigSta->ucRIFSMode; |
| 21210 | phalConfigSta->lsigTxopProtection = pwdiConfigSta->ucLSIGTxopProtection; |
| 21211 | phalConfigSta->maxAmpduSize = pwdiConfigSta->ucMaxAmpduSize; |
| 21212 | phalConfigSta->maxAmpduDensity = pwdiConfigSta->ucMaxAmpduDensity; |
| 21213 | phalConfigSta->maxAmsduSize = pwdiConfigSta->ucMaxAmsduSize; |
| 21214 | phalConfigSta->fShortGI40Mhz = pwdiConfigSta->ucShortGI40Mhz; |
| 21215 | phalConfigSta->fShortGI20Mhz = pwdiConfigSta->ucShortGI20Mhz; |
| 21216 | phalConfigSta->rmfEnabled = pwdiConfigSta->ucRMFEnabled; |
| 21217 | phalConfigSta->action = pwdiConfigSta->wdiAction; |
| 21218 | phalConfigSta->uAPSD = pwdiConfigSta->ucAPSD; |
| 21219 | phalConfigSta->maxSPLen = pwdiConfigSta->ucMaxSPLen; |
| 21220 | phalConfigSta->greenFieldCapable = pwdiConfigSta->ucGreenFieldCapable; |
| 21221 | phalConfigSta->delayedBASupport = pwdiConfigSta->ucDelayedBASupport; |
| 21222 | phalConfigSta->us32MaxAmpduDuration = pwdiConfigSta->us32MaxAmpduDuratio; |
| 21223 | phalConfigSta->fDsssCckMode40Mhz = pwdiConfigSta->ucDsssCckMode40Mhz; |
| 21224 | phalConfigSta->encryptType = pwdiConfigSta->ucEncryptType; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21225 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21226 | phalConfigSta->mimoPS = WDI_2_HAL_MIMO_PS(pwdiConfigSta->wdiMIMOPS); |
| 21227 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21228 | phalConfigSta->supportedRates.opRateMode = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21229 | pwdiConfigSta->wdiSupportedRates.opRateMode; |
| 21230 | for(i = 0; i < SIR_NUM_11B_RATES; i ++) |
| 21231 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21232 | phalConfigSta->supportedRates.llbRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21233 | pwdiConfigSta->wdiSupportedRates.llbRates[i]; |
| 21234 | } |
| 21235 | for(i = 0; i < SIR_NUM_11A_RATES; i ++) |
| 21236 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21237 | phalConfigSta->supportedRates.llaRates[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21238 | pwdiConfigSta->wdiSupportedRates.llaRates[i]; |
| 21239 | } |
| 21240 | for(i = 0; i < SIR_NUM_POLARIS_RATES; i ++) |
| 21241 | { |
| 21242 | phalConfigSta->supportedRates.aniLegacyRates[i] = |
| 21243 | pwdiConfigSta->wdiSupportedRates.aLegacyRates[i]; |
| 21244 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21245 | phalConfigSta->supportedRates.aniEnhancedRateBitmap = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21246 | pwdiConfigSta->wdiSupportedRates.uEnhancedRateBitmap; |
| 21247 | for(i = 0; i < SIR_MAC_MAX_SUPPORTED_MCS_SET; i ++) |
| 21248 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21249 | phalConfigSta->supportedRates.supportedMCSSet[i] = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21250 | pwdiConfigSta->wdiSupportedRates.aSupportedMCSSet[i]; |
| 21251 | } |
| 21252 | phalConfigSta->supportedRates.rxHighestDataRate = |
| 21253 | pwdiConfigSta->wdiSupportedRates.aRxHighestDataRate; |
| 21254 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21255 | #ifdef WLAN_FEATURE_11AC |
| 21256 | if(phalConfigSta_V1 != NULL) |
| 21257 | { |
| 21258 | phalConfigSta_V1->supportedRates.vhtRxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtRxMCSMap; |
| 21259 | phalConfigSta_V1->supportedRates.vhtRxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtRxHighestDataRate; |
| 21260 | phalConfigSta_V1->supportedRates.vhtTxMCSMap = pwdiConfigSta->wdiSupportedRates.vhtTxMCSMap; |
| 21261 | phalConfigSta_V1->supportedRates.vhtTxHighestDataRate = pwdiConfigSta->wdiSupportedRates.vhtTxHighestDataRate; |
| 21262 | } |
| 21263 | #endif |
| 21264 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21265 | #ifdef WLAN_FEATURE_P2P |
| 21266 | phalConfigSta->p2pCapableSta = pwdiConfigSta->ucP2pCapableSta ; |
| 21267 | #endif |
| 21268 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21269 | #ifdef WLAN_FEATURE_11AC |
| 21270 | if(phalConfigSta_V1 != NULL) |
| 21271 | { |
| 21272 | phalConfigSta_V1->vhtCapable = pwdiConfigSta->ucVhtCapableSta; |
| 21273 | phalConfigSta_V1->vhtTxChannelWidthSet = pwdiConfigSta->ucVhtTxChannelWidthSet; |
| 21274 | } |
| 21275 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21276 | }/*WDI_CopyWDIStaCtxToHALStaCtx*/; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21277 | |
| 21278 | /*Translate a Rate set info from WDI into HAL*/ |
| 21279 | WPT_STATIC WPT_INLINE void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21280 | WDI_CopyWDIRateSetToHALRateSet |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21281 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21282 | tSirMacRateSet* pHalRateSet, |
| 21283 | WDI_RateSet* pwdiRateSet |
| 21284 | ) |
| 21285 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21286 | wpt_uint8 i; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21287 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21288 | |
| 21289 | pHalRateSet->numRates = ( pwdiRateSet->ucNumRates <= SIR_MAC_RATESET_EID_MAX )? |
| 21290 | pwdiRateSet->ucNumRates:SIR_MAC_RATESET_EID_MAX; |
| 21291 | |
| 21292 | for ( i = 0; i < pHalRateSet->numRates; i++ ) |
| 21293 | { |
| 21294 | pHalRateSet->rate[i] = pwdiRateSet->aRates[i]; |
| 21295 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21296 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21297 | }/*WDI_CopyWDIRateSetToHALRateSet*/ |
| 21298 | |
| 21299 | |
| 21300 | /*Translate an EDCA Parameter Record from WDI into HAL*/ |
| 21301 | WPT_STATIC WPT_INLINE void |
| 21302 | WDI_CopyWDIEDCAParamsToHALEDCAParams |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21303 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21304 | tSirMacEdcaParamRecord* phalEdcaParam, |
| 21305 | WDI_EdcaParamRecord* pWDIEdcaParam |
| 21306 | ) |
| 21307 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21308 | /*Lightweight function - no sanity checks and no unecessary code to increase |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21309 | the chances of getting inlined*/ |
| 21310 | |
| 21311 | phalEdcaParam->aci.rsvd = pWDIEdcaParam->wdiACI.rsvd; |
| 21312 | phalEdcaParam->aci.aci = pWDIEdcaParam->wdiACI.aci; |
| 21313 | phalEdcaParam->aci.acm = pWDIEdcaParam->wdiACI.acm; |
| 21314 | phalEdcaParam->aci.aifsn = pWDIEdcaParam->wdiACI.aifsn; |
| 21315 | |
| 21316 | phalEdcaParam->cw.max = pWDIEdcaParam->wdiCW.max; |
| 21317 | phalEdcaParam->cw.min = pWDIEdcaParam->wdiCW.min; |
| 21318 | phalEdcaParam->txoplimit = pWDIEdcaParam->usTXOPLimit; |
| 21319 | }/*WDI_CopyWDIEDCAParamsToHALEDCAParams*/ |
| 21320 | |
| 21321 | |
| 21322 | /*Copy a management frame header from WDI fmt into HAL fmt*/ |
| 21323 | WPT_STATIC WPT_INLINE void |
| 21324 | WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr |
| 21325 | ( |
| 21326 | tSirMacMgmtHdr* pmacMgmtHdr, |
| 21327 | WDI_MacMgmtHdr* pwdiMacMgmtHdr |
| 21328 | ) |
| 21329 | { |
| 21330 | pmacMgmtHdr->fc.protVer = pwdiMacMgmtHdr->fc.protVer; |
| 21331 | pmacMgmtHdr->fc.type = pwdiMacMgmtHdr->fc.type; |
| 21332 | pmacMgmtHdr->fc.subType = pwdiMacMgmtHdr->fc.subType; |
| 21333 | pmacMgmtHdr->fc.toDS = pwdiMacMgmtHdr->fc.toDS; |
| 21334 | pmacMgmtHdr->fc.fromDS = pwdiMacMgmtHdr->fc.fromDS; |
| 21335 | pmacMgmtHdr->fc.moreFrag = pwdiMacMgmtHdr->fc.moreFrag; |
| 21336 | pmacMgmtHdr->fc.retry = pwdiMacMgmtHdr->fc.retry; |
| 21337 | pmacMgmtHdr->fc.powerMgmt = pwdiMacMgmtHdr->fc.powerMgmt; |
| 21338 | pmacMgmtHdr->fc.moreData = pwdiMacMgmtHdr->fc.moreData; |
| 21339 | pmacMgmtHdr->fc.wep = pwdiMacMgmtHdr->fc.wep; |
| 21340 | pmacMgmtHdr->fc.order = pwdiMacMgmtHdr->fc.order; |
| 21341 | |
| 21342 | pmacMgmtHdr->durationLo = pwdiMacMgmtHdr->durationLo; |
| 21343 | pmacMgmtHdr->durationHi = pwdiMacMgmtHdr->durationHi; |
| 21344 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21345 | wpalMemoryCopy(pmacMgmtHdr->da, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21346 | pwdiMacMgmtHdr->da, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21347 | wpalMemoryCopy(pmacMgmtHdr->sa, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21348 | pwdiMacMgmtHdr->sa, 6); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21349 | wpalMemoryCopy(pmacMgmtHdr->bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21350 | pwdiMacMgmtHdr->bssId, 6); |
| 21351 | |
| 21352 | pmacMgmtHdr->seqControl.fragNum = pwdiMacMgmtHdr->seqControl.fragNum; |
| 21353 | pmacMgmtHdr->seqControl.seqNumLo = pwdiMacMgmtHdr->seqControl.seqNumLo; |
| 21354 | pmacMgmtHdr->seqControl.seqNumHi = pwdiMacMgmtHdr->seqControl.seqNumHi; |
| 21355 | |
| 21356 | }/*WDI_CopyWDIMgmFrameHdrToHALMgmFrameHdr*/ |
| 21357 | |
| 21358 | |
| 21359 | /*Copy config bss parameters from WDI fmt into HAL fmt*/ |
| 21360 | WPT_STATIC WPT_INLINE void |
| 21361 | WDI_CopyWDIConfigBSSToHALConfigBSS |
| 21362 | ( |
| 21363 | tConfigBssParams* phalConfigBSS, |
| 21364 | WDI_ConfigBSSReqInfoType* pwdiConfigBSS |
| 21365 | ) |
| 21366 | { |
| 21367 | |
| 21368 | wpt_uint8 keyIndex = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21369 | #ifdef WLAN_FEATURE_11AC |
| 21370 | /* Get the Version 1 Handler */ |
| 21371 | tConfigBssParams_V1* phalConfigBSS_V1 = NULL; |
| 21372 | if (WDI_getFwWlanFeatCaps(DOT11AC)) |
| 21373 | phalConfigBSS_V1 = (tConfigBssParams_V1*)phalConfigBSS; |
| 21374 | #endif |
| 21375 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21376 | wpalMemoryCopy( phalConfigBSS->bssId, |
| 21377 | pwdiConfigBSS->macBSSID, |
| 21378 | WDI_MAC_ADDR_LEN); |
| 21379 | |
| 21380 | #ifdef HAL_SELF_STA_PER_BSS |
| 21381 | wpalMemoryCopy( phalConfigBSS->selfMacAddr, |
| 21382 | pwdiConfigBSS->macSelfAddr, |
| 21383 | WDI_MAC_ADDR_LEN); |
| 21384 | #endif |
| 21385 | |
| 21386 | phalConfigBSS->bssType = WDI_2_HAL_BSS_TYPE(pwdiConfigBSS->wdiBSSType); |
| 21387 | |
| 21388 | phalConfigBSS->operMode = pwdiConfigBSS->ucOperMode; |
| 21389 | phalConfigBSS->nwType = WDI_2_HAL_NW_TYPE(pwdiConfigBSS->wdiNWType); |
| 21390 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21391 | phalConfigBSS->shortSlotTimeSupported = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21392 | pwdiConfigBSS->ucShortSlotTimeSupported; |
| 21393 | phalConfigBSS->llaCoexist = pwdiConfigBSS->ucllaCoexist; |
| 21394 | phalConfigBSS->llbCoexist = pwdiConfigBSS->ucllbCoexist; |
| 21395 | phalConfigBSS->llgCoexist = pwdiConfigBSS->ucllgCoexist; |
| 21396 | phalConfigBSS->ht20Coexist = pwdiConfigBSS->ucHT20Coexist; |
| 21397 | phalConfigBSS->llnNonGFCoexist = pwdiConfigBSS->ucllnNonGFCoexist; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21398 | phalConfigBSS->fLsigTXOPProtectionFullSupport = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21399 | pwdiConfigBSS->ucTXOPProtectionFullSupport; |
| 21400 | phalConfigBSS->fRIFSMode = pwdiConfigBSS->ucRIFSMode; |
| 21401 | phalConfigBSS->beaconInterval = pwdiConfigBSS->usBeaconInterval; |
| 21402 | phalConfigBSS->dtimPeriod = pwdiConfigBSS->ucDTIMPeriod; |
| 21403 | phalConfigBSS->txChannelWidthSet = pwdiConfigBSS->ucTXChannelWidthSet; |
| 21404 | phalConfigBSS->currentOperChannel = pwdiConfigBSS->ucCurrentOperChannel; |
| 21405 | phalConfigBSS->currentExtChannel = pwdiConfigBSS->ucCurrentExtChannel; |
| 21406 | phalConfigBSS->action = pwdiConfigBSS->wdiAction; |
| 21407 | phalConfigBSS->htCapable = pwdiConfigBSS->ucHTCapable; |
| 21408 | phalConfigBSS->obssProtEnabled = pwdiConfigBSS->ucObssProtEnabled; |
| 21409 | phalConfigBSS->rmfEnabled = pwdiConfigBSS->ucRMFEnabled; |
| 21410 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21411 | phalConfigBSS->htOperMode = |
| 21412 | WDI_2_HAL_HT_OPER_MODE(pwdiConfigBSS->wdiHTOperMod); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21413 | |
| 21414 | phalConfigBSS->dualCTSProtection = pwdiConfigBSS->ucDualCTSProtection; |
| 21415 | phalConfigBSS->ucMaxProbeRespRetryLimit = pwdiConfigBSS->ucMaxProbeRespRetryLimit; |
| 21416 | phalConfigBSS->bHiddenSSIDEn = pwdiConfigBSS->bHiddenSSIDEn; |
| 21417 | phalConfigBSS->bProxyProbeRespEn = pwdiConfigBSS->bProxyProbeRespEn; |
| 21418 | |
| 21419 | #ifdef WLAN_FEATURE_VOWIFI |
| 21420 | phalConfigBSS->maxTxPower = pwdiConfigBSS->cMaxTxPower; |
| 21421 | #endif |
| 21422 | |
| 21423 | /*! Used 32 as magic number because that is how the ssid is declared inside the |
| 21424 | hal header - hal needs a macro for it */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21425 | phalConfigBSS->ssId.length = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21426 | (pwdiConfigBSS->wdiSSID.ucLength <= 32)? |
| 21427 | pwdiConfigBSS->wdiSSID.ucLength : 32; |
| 21428 | wpalMemoryCopy(phalConfigBSS->ssId.ssId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21429 | pwdiConfigBSS->wdiSSID.sSSID, |
| 21430 | phalConfigBSS->ssId.length); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21431 | |
| 21432 | WDI_CopyWDIStaCtxToHALStaCtx( &phalConfigBSS->staContext, |
| 21433 | &pwdiConfigBSS->wdiSTAContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21434 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21435 | WDI_CopyWDIRateSetToHALRateSet( &phalConfigBSS->rateSet, |
| 21436 | &pwdiConfigBSS->wdiRateSet); |
| 21437 | |
| 21438 | phalConfigBSS->edcaParamsValid = pwdiConfigBSS->ucEDCAParamsValid; |
| 21439 | |
| 21440 | if(phalConfigBSS->edcaParamsValid) |
| 21441 | { |
| 21442 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbe, |
| 21443 | &pwdiConfigBSS->wdiBEEDCAParams); |
| 21444 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acbk, |
| 21445 | &pwdiConfigBSS->wdiBKEDCAParams); |
| 21446 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvi, |
| 21447 | &pwdiConfigBSS->wdiVIEDCAParams); |
| 21448 | WDI_CopyWDIEDCAParamsToHALEDCAParams( &phalConfigBSS->acvo, |
| 21449 | &pwdiConfigBSS->wdiVOEDCAParams); |
| 21450 | } |
| 21451 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21452 | phalConfigBSS->halPersona = pwdiConfigBSS->ucPersona; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21453 | |
| 21454 | phalConfigBSS->bSpectrumMgtEnable = pwdiConfigBSS->bSpectrumMgtEn; |
| 21455 | |
| 21456 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 21457 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21458 | phalConfigBSS->extSetStaKeyParamValid = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21459 | pwdiConfigBSS->bExtSetStaKeyParamValid; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21460 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21461 | if( phalConfigBSS->extSetStaKeyParamValid ) |
| 21462 | { |
| 21463 | /*----------------------------------------------------------------------- |
| 21464 | Copy the STA Key parameters into the HAL message |
| 21465 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21466 | phalConfigBSS->extSetStaKeyParam.encType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21467 | WDI_2_HAL_ENC_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiEncType); |
| 21468 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21469 | phalConfigBSS->extSetStaKeyParam.wepType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21470 | WDI_2_HAL_WEP_TYPE (pwdiConfigBSS->wdiExtSetKeyParam.wdiWEPType ); |
| 21471 | |
| 21472 | phalConfigBSS->extSetStaKeyParam.staIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucSTAIdx; |
| 21473 | |
| 21474 | phalConfigBSS->extSetStaKeyParam.defWEPIdx = pwdiConfigBSS->wdiExtSetKeyParam.ucDefWEPIdx; |
| 21475 | |
| 21476 | phalConfigBSS->extSetStaKeyParam.singleTidRc = pwdiConfigBSS->wdiExtSetKeyParam.ucSingleTidRc; |
| 21477 | |
| 21478 | #ifdef WLAN_SOFTAP_FEATURE |
| 21479 | for(keyIndex = 0; keyIndex < pwdiConfigBSS->wdiExtSetKeyParam.ucNumKeys ; |
| 21480 | keyIndex++) |
| 21481 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21482 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21483 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyId; |
| 21484 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].unicast = |
| 21485 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].unicast; |
| 21486 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyDirection = |
| 21487 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyDirection; |
| 21488 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21489 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21490 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21491 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21492 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21493 | phalConfigBSS->extSetStaKeyParam.key[keyIndex].keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21494 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].keyLength; |
| 21495 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key[keyIndex].key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21496 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[keyIndex].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21497 | WDI_MAX_KEY_LENGTH); |
| 21498 | } |
| 21499 | #else |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21500 | phalConfigBSS->extSetStaKeyParam.key.keyId = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21501 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyId; |
| 21502 | phalConfigBSS->extSetStaKeyParam.key.unicast = |
| 21503 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].unicast; |
| 21504 | phalConfigBSS->extSetStaKeyParam.key.keyDirection = |
| 21505 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyDirection; |
| 21506 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.keyRsc, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21507 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyRsc, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21508 | WDI_MAX_KEY_RSC_LEN); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21509 | phalConfigBSS->extSetStaKeyParam.key.paeRole = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21510 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].paeRole; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21511 | phalConfigBSS->extSetStaKeyParam.key.keyLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21512 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].keyLength; |
| 21513 | wpalMemoryCopy(phalConfigBSS->extSetStaKeyParam.key.key, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21514 | pwdiConfigBSS->wdiExtSetKeyParam.wdiKey[0].key, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21515 | WDI_MAX_KEY_LENGTH); |
| 21516 | #endif |
| 21517 | } |
| 21518 | else/* phalConfigBSS->extSetStaKeyParamValid is not set */ |
| 21519 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21520 | wpalMemoryZero( &phalConfigBSS->extSetStaKeyParam, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21521 | sizeof(phalConfigBSS->extSetStaKeyParam) ); |
| 21522 | } |
| 21523 | |
| 21524 | #endif /*WLAN_FEATURE_VOWIFI_11R*/ |
| 21525 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21526 | #ifdef WLAN_FEATURE_11AC |
| 21527 | if(phalConfigBSS_V1 != NULL) |
| 21528 | { |
| 21529 | phalConfigBSS_V1->vhtCapable = pwdiConfigBSS->ucVhtCapableSta; |
| 21530 | phalConfigBSS_V1->vhtTxChannelWidthSet = pwdiConfigBSS->ucVhtTxChannelWidthSet; |
| 21531 | } |
| 21532 | #endif |
| 21533 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21534 | }/*WDI_CopyWDIConfigBSSToHALConfigBSS*/ |
| 21535 | |
| 21536 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21537 | /*Extract the request CB function and user data from a request structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21538 | pointed to by user data */ |
| 21539 | WPT_STATIC WPT_INLINE void |
| 21540 | WDI_ExtractRequestCBFromEvent |
| 21541 | ( |
| 21542 | WDI_EventInfoType* pEvent, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21543 | WDI_ReqStatusCb* ppfnReqCB, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21544 | void** ppUserData |
| 21545 | ) |
| 21546 | { |
| 21547 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21548 | switch ( pEvent->wdiRequest ) |
| 21549 | { |
| 21550 | case WDI_START_REQ: |
| 21551 | *ppfnReqCB = ((WDI_StartReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21552 | *ppUserData = ((WDI_StartReqParamsType*)pEvent->pEventData)->pUserData; |
| 21553 | break; |
| 21554 | case WDI_STOP_REQ: |
| 21555 | *ppfnReqCB = ((WDI_StopReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21556 | *ppUserData = ((WDI_StopReqParamsType*)pEvent->pEventData)->pUserData; |
| 21557 | break; |
| 21558 | case WDI_INIT_SCAN_REQ: |
| 21559 | *ppfnReqCB = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21560 | *ppUserData = ((WDI_InitScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21561 | break; |
| 21562 | case WDI_START_SCAN_REQ: |
| 21563 | *ppfnReqCB = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21564 | *ppUserData = ((WDI_StartScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21565 | break; |
| 21566 | case WDI_END_SCAN_REQ: |
| 21567 | *ppfnReqCB = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21568 | *ppUserData = ((WDI_EndScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21569 | break; |
| 21570 | case WDI_FINISH_SCAN_REQ: |
| 21571 | *ppfnReqCB = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21572 | *ppUserData = ((WDI_FinishScanReqParamsType*)pEvent->pEventData)->pUserData; |
| 21573 | break; |
| 21574 | case WDI_JOIN_REQ: |
| 21575 | *ppfnReqCB = ((WDI_JoinReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21576 | *ppUserData = ((WDI_JoinReqParamsType*)pEvent->pEventData)->pUserData; |
| 21577 | break; |
| 21578 | case WDI_CONFIG_BSS_REQ: |
| 21579 | *ppfnReqCB = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21580 | *ppUserData = ((WDI_ConfigBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21581 | break; |
| 21582 | case WDI_DEL_BSS_REQ: |
| 21583 | *ppfnReqCB = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21584 | *ppUserData = ((WDI_DelBSSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21585 | break; |
| 21586 | case WDI_POST_ASSOC_REQ: |
| 21587 | *ppfnReqCB = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21588 | *ppUserData = ((WDI_PostAssocReqParamsType*)pEvent->pEventData)->pUserData; |
| 21589 | break; |
| 21590 | case WDI_DEL_STA_REQ: |
| 21591 | *ppfnReqCB = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21592 | *ppUserData = ((WDI_DelSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21593 | break; |
| 21594 | case WDI_DEL_STA_SELF_REQ: |
| 21595 | *ppfnReqCB = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21596 | *ppUserData = ((WDI_DelSTASelfReqParamsType*)pEvent->pEventData)->pUserData; |
| 21597 | break; |
| 21598 | |
| 21599 | case WDI_SET_BSS_KEY_REQ: |
| 21600 | *ppfnReqCB = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21601 | *ppUserData = ((WDI_SetBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21602 | break; |
| 21603 | case WDI_RMV_BSS_KEY_REQ: |
| 21604 | *ppfnReqCB = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21605 | *ppUserData = ((WDI_RemoveBSSKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21606 | break; |
| 21607 | case WDI_SET_STA_KEY_REQ: |
| 21608 | *ppfnReqCB = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21609 | *ppUserData = ((WDI_SetSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21610 | break; |
| 21611 | case WDI_RMV_STA_KEY_REQ: |
| 21612 | *ppfnReqCB = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21613 | *ppUserData = ((WDI_RemoveSTAKeyReqParamsType*)pEvent->pEventData)->pUserData; |
| 21614 | break; |
| 21615 | case WDI_ADD_TS_REQ: |
| 21616 | *ppfnReqCB = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21617 | *ppUserData = ((WDI_AddTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21618 | break; |
| 21619 | case WDI_DEL_TS_REQ: |
| 21620 | *ppfnReqCB = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21621 | *ppUserData = ((WDI_DelTSReqParamsType*)pEvent->pEventData)->pUserData; |
| 21622 | break; |
| 21623 | case WDI_UPD_EDCA_PRMS_REQ: |
| 21624 | *ppfnReqCB = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21625 | *ppUserData = ((WDI_UpdateEDCAParamsType*)pEvent->pEventData)->pUserData; |
| 21626 | break; |
| 21627 | case WDI_ADD_BA_SESSION_REQ: |
| 21628 | *ppfnReqCB = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21629 | *ppUserData = ((WDI_AddBASessionReqParamsType*)pEvent->pEventData)->pUserData; |
| 21630 | break; |
| 21631 | case WDI_DEL_BA_REQ: |
| 21632 | *ppfnReqCB = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21633 | *ppUserData = ((WDI_DelBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21634 | break; |
| 21635 | #ifdef FEATURE_WLAN_CCX |
| 21636 | case WDI_TSM_STATS_REQ: |
| 21637 | *ppfnReqCB = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21638 | *ppUserData = ((WDI_TSMStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21639 | break; |
| 21640 | #endif |
| 21641 | case WDI_CH_SWITCH_REQ: |
| 21642 | *ppfnReqCB = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21643 | *ppUserData = ((WDI_SwitchChReqParamsType*)pEvent->pEventData)->pUserData; |
| 21644 | break; |
| 21645 | case WDI_CONFIG_STA_REQ: |
| 21646 | *ppfnReqCB = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21647 | *ppUserData = ((WDI_ConfigSTAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21648 | break; |
| 21649 | case WDI_SET_LINK_ST_REQ: |
| 21650 | *ppfnReqCB = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21651 | *ppUserData = ((WDI_SetLinkReqParamsType*)pEvent->pEventData)->pUserData; |
| 21652 | break; |
| 21653 | case WDI_GET_STATS_REQ: |
| 21654 | *ppfnReqCB = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21655 | *ppUserData = ((WDI_GetStatsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21656 | break; |
| 21657 | case WDI_UPDATE_CFG_REQ: |
| 21658 | *ppfnReqCB = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21659 | *ppUserData = ((WDI_UpdateCfgReqParamsType*)pEvent->pEventData)->pUserData; |
| 21660 | break; |
| 21661 | case WDI_ADD_BA_REQ: |
| 21662 | *ppfnReqCB = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21663 | *ppUserData = ((WDI_AddBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21664 | break; |
| 21665 | case WDI_TRIGGER_BA_REQ: |
| 21666 | *ppfnReqCB = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21667 | *ppUserData = ((WDI_TriggerBAReqParamsType*)pEvent->pEventData)->pUserData; |
| 21668 | break; |
| 21669 | case WDI_UPD_BCON_PRMS_REQ: |
| 21670 | *ppfnReqCB = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21671 | *ppUserData = ((WDI_UpdateBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 21672 | break; |
| 21673 | case WDI_SND_BCON_REQ: |
| 21674 | *ppfnReqCB = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21675 | *ppUserData = ((WDI_SendBeaconParamsType*)pEvent->pEventData)->pUserData; |
| 21676 | break; |
| 21677 | case WDI_ENTER_BMPS_REQ: |
| 21678 | *ppfnReqCB = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21679 | *ppUserData = ((WDI_EnterBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21680 | break; |
| 21681 | case WDI_EXIT_BMPS_REQ: |
| 21682 | *ppfnReqCB = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21683 | *ppUserData = ((WDI_ExitBmpsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21684 | break; |
| 21685 | case WDI_ENTER_UAPSD_REQ: |
| 21686 | *ppfnReqCB = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21687 | *ppUserData = ((WDI_EnterUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 21688 | break; |
| 21689 | case WDI_UPDATE_UAPSD_PARAM_REQ: |
| 21690 | *ppfnReqCB = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21691 | *ppUserData = ((WDI_UpdateUapsdReqParamsType*)pEvent->pEventData)->pUserData; |
| 21692 | break; |
| 21693 | case WDI_CONFIGURE_RXP_FILTER_REQ: |
| 21694 | *ppfnReqCB = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21695 | *ppUserData = ((WDI_ConfigureRxpFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 21696 | break; |
| 21697 | case WDI_SET_BEACON_FILTER_REQ: |
| 21698 | *ppfnReqCB = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21699 | *ppUserData = ((WDI_BeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
| 21700 | break; |
| 21701 | case WDI_REM_BEACON_FILTER_REQ: |
| 21702 | *ppfnReqCB = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21703 | *ppUserData = ((WDI_RemBeaconFilterReqParamsType*)pEvent->pEventData)->pUserData; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21704 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21705 | case WDI_SET_RSSI_THRESHOLDS_REQ: |
| 21706 | *ppfnReqCB = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21707 | *ppUserData = ((WDI_SetRSSIThresholdsReqParamsType*)pEvent->pEventData)->pUserData; |
| 21708 | break; |
| 21709 | case WDI_HOST_OFFLOAD_REQ: |
| 21710 | *ppfnReqCB = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21711 | *ppUserData = ((WDI_HostOffloadReqParamsType*)pEvent->pEventData)->pUserData; |
| 21712 | break; |
| 21713 | case WDI_WOWL_ADD_BC_PTRN_REQ: |
| 21714 | *ppfnReqCB = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21715 | *ppUserData = ((WDI_WowlAddBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 21716 | break; |
| 21717 | case WDI_WOWL_DEL_BC_PTRN_REQ: |
| 21718 | *ppfnReqCB = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21719 | *ppUserData = ((WDI_WowlDelBcPtrnReqParamsType*)pEvent->pEventData)->pUserData; |
| 21720 | break; |
| 21721 | case WDI_WOWL_ENTER_REQ: |
| 21722 | *ppfnReqCB = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21723 | *ppUserData = ((WDI_WowlEnterReqParamsType*)pEvent->pEventData)->pUserData; |
| 21724 | break; |
| 21725 | case WDI_CONFIGURE_APPS_CPU_WAKEUP_STATE_REQ: |
| 21726 | *ppfnReqCB = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21727 | *ppUserData = ((WDI_ConfigureAppsCpuWakeupStateReqParamsType*)pEvent->pEventData)->pUserData; |
| 21728 | break; |
| 21729 | case WDI_FLUSH_AC_REQ: |
| 21730 | *ppfnReqCB = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21731 | *ppUserData = ((WDI_FlushAcReqParamsType*)pEvent->pEventData)->pUserData; |
| 21732 | break; |
| 21733 | case WDI_BTAMP_EVENT_REQ: |
| 21734 | *ppfnReqCB = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21735 | *ppUserData = ((WDI_BtAmpEventParamsType*)pEvent->pEventData)->pUserData; |
| 21736 | break; |
| 21737 | case WDI_KEEP_ALIVE_REQ: |
| 21738 | *ppfnReqCB = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21739 | *ppUserData = ((WDI_KeepAliveReqParamsType*)pEvent->pEventData)->pUserData; |
| 21740 | break; |
| 21741 | case WDI_SET_TX_PER_TRACKING_REQ: |
| 21742 | *ppfnReqCB = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->wdiReqStatusCB; |
| 21743 | *ppUserData = ((WDI_SetTxPerTrackingReqParamsType*)pEvent->pEventData)->pUserData; |
| 21744 | default: |
| 21745 | *ppfnReqCB = NULL; |
| 21746 | *ppUserData = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21747 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21748 | } |
| 21749 | }/*WDI_ExtractRequestCBFromEvent*/ |
| 21750 | |
| 21751 | |
| 21752 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21753 | @brief WDI_IsHwFrameTxTranslationCapable checks to see if HW |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21754 | frame xtl is enabled for a particular STA. |
| 21755 | |
| 21756 | WDI_PostAssocReq must have been called. |
| 21757 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21758 | @param uSTAIdx: STA index |
| 21759 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21760 | @see WDI_PostAssocReq |
| 21761 | @return Result of the function call |
| 21762 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21763 | wpt_boolean |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21764 | WDI_IsHwFrameTxTranslationCapable |
| 21765 | ( |
| 21766 | wpt_uint8 uSTAIdx |
| 21767 | ) |
| 21768 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21769 | /*!! FIX ME - this must eventually be per station - for now just feedback |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21770 | uma value*/ |
| 21771 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21772 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21773 | ------------------------------------------------------------------------*/ |
| 21774 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 21775 | { |
| 21776 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 21777 | "WDI API call before module is initialized - Fail request"); |
| 21778 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21779 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21780 | } |
| 21781 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21782 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21783 | return gWDICb.bFrameTransEnabled; |
| 21784 | }/*WDI_IsHwFrameTxTranslationCapable*/ |
| 21785 | |
| 21786 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 21787 | /** |
| 21788 | @brief WDI_SetPreferredNetworkList |
| 21789 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21790 | @param pwdiPNOScanReqParams: the Set PNO as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21791 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21792 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21793 | wdiPNOScanCb: callback for passing back the response |
| 21794 | of the Set PNO operation received from the |
| 21795 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21796 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21797 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21798 | callback |
| 21799 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21800 | @return Result of the function call |
| 21801 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21802 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21803 | WDI_SetPreferredNetworkReq |
| 21804 | ( |
| 21805 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 21806 | WDI_PNOScanCb wdiPNOScanCb, |
| 21807 | void* pUserData |
| 21808 | ) |
| 21809 | { |
| 21810 | WDI_EventInfoType wdiEventData = {{0}}; |
| 21811 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21812 | |
| 21813 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21814 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21815 | ------------------------------------------------------------------------*/ |
| 21816 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 21817 | { |
| 21818 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 21819 | "WDI API call before module is initialized - Fail request"); |
| 21820 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21821 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21822 | } |
| 21823 | |
| 21824 | /*------------------------------------------------------------------------ |
| 21825 | Fill in Event data and post to the Main FSM |
| 21826 | ------------------------------------------------------------------------*/ |
| 21827 | wdiEventData.wdiRequest = WDI_SET_PREF_NETWORK_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21828 | wdiEventData.pEventData = pwdiPNOScanReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21829 | wdiEventData.uEventDataSize = sizeof(*pwdiPNOScanReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21830 | wdiEventData.pCBfnc = wdiPNOScanCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21831 | wdiEventData.pUserData = pUserData; |
| 21832 | |
| 21833 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 21834 | } |
| 21835 | |
| 21836 | |
| 21837 | /** |
| 21838 | @brief WDI_SetRssiFilterReq |
| 21839 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21840 | @param pwdiRssiFilterReqParams: the Set RSSI Filter as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21841 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21842 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21843 | wdiRssiFilterCb: callback for passing back the response |
| 21844 | of the Set RSSI Filter operation received from the |
| 21845 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21846 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21847 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21848 | callback |
| 21849 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21850 | @return Result of the function call |
| 21851 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21852 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21853 | WDI_SetRssiFilterReq |
| 21854 | ( |
| 21855 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams, |
| 21856 | WDI_RssiFilterCb wdiRssiFilterCb, |
| 21857 | void* pUserData |
| 21858 | ) |
| 21859 | { |
| 21860 | WDI_EventInfoType wdiEventData = {{0}}; |
| 21861 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21862 | |
| 21863 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21864 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21865 | ------------------------------------------------------------------------*/ |
| 21866 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 21867 | { |
| 21868 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 21869 | "WDI API call before module is initialized - Fail request"); |
| 21870 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21871 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21872 | } |
| 21873 | |
| 21874 | /*------------------------------------------------------------------------ |
| 21875 | Fill in Event data and post to the Main FSM |
| 21876 | ------------------------------------------------------------------------*/ |
| 21877 | wdiEventData.wdiRequest = WDI_SET_RSSI_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21878 | wdiEventData.pEventData = pwdiRssiFilterReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21879 | wdiEventData.uEventDataSize = sizeof(*pwdiRssiFilterReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21880 | wdiEventData.pCBfnc = wdiRssiFilterCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21881 | wdiEventData.pUserData = pUserData; |
| 21882 | |
| 21883 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 21884 | }/*WDI_SetRssiFilterReq*/ |
| 21885 | |
| 21886 | /** |
| 21887 | @brief WDI_UpdateScanParamsReq |
| 21888 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21889 | @param pwdiUpdateScanParamsInfoType: the Update Scan Params as specified |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21890 | by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21891 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21892 | wdiUpdateScanParamsCb: callback for passing back the response |
| 21893 | of the Set PNO operation received from the |
| 21894 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21895 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21896 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21897 | callback |
| 21898 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21899 | @return Result of the function call |
| 21900 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21901 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21902 | WDI_UpdateScanParamsReq |
| 21903 | ( |
| 21904 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParamsInfoType, |
| 21905 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb, |
| 21906 | void* pUserData |
| 21907 | ) |
| 21908 | { |
| 21909 | WDI_EventInfoType wdiEventData = {{0}}; |
| 21910 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 21911 | |
| 21912 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21913 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21914 | ------------------------------------------------------------------------*/ |
| 21915 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 21916 | { |
| 21917 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 21918 | "WDI API call before module is initialized - Fail request"); |
| 21919 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21920 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21921 | } |
| 21922 | |
| 21923 | /*------------------------------------------------------------------------ |
| 21924 | Fill in Event data and post to the Main FSM |
| 21925 | ------------------------------------------------------------------------*/ |
| 21926 | wdiEventData.wdiRequest = WDI_UPDATE_SCAN_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21927 | wdiEventData.pEventData = pwdiUpdateScanParamsInfoType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21928 | wdiEventData.uEventDataSize = sizeof(*pwdiUpdateScanParamsInfoType); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21929 | wdiEventData.pCBfnc = wdiUpdateScanParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21930 | wdiEventData.pUserData = pUserData; |
| 21931 | |
| 21932 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 21933 | } |
| 21934 | |
| 21935 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21936 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21937 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21938 | |
| 21939 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21940 | pwdiPNOScanReqParams: pointer to the info received |
| 21941 | from upper layers |
| 21942 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21943 | and its size |
| 21944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21945 | @return Result of the function call |
| 21946 | */ |
| 21947 | |
| 21948 | WDI_Status |
| 21949 | WDI_PackPreferredNetworkList |
| 21950 | ( |
| 21951 | WDI_ControlBlockType* pWDICtx, |
| 21952 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 21953 | wpt_uint8** ppSendBuffer, |
| 21954 | wpt_uint16* pSize |
| 21955 | ) |
| 21956 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21957 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21958 | wpt_uint16 usDataOffset = 0; |
| 21959 | wpt_uint16 usSendSize = 0; |
| 21960 | tPrefNetwListParams pPrefNetwListParams = {0}; |
| 21961 | wpt_uint8 i; |
| 21962 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 21963 | |
| 21964 | /*----------------------------------------------------------------------- |
| 21965 | Get message buffer |
| 21966 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21967 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21968 | sizeof(pPrefNetwListParams), |
| 21969 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 21970 | ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) ))) |
| 21971 | { |
| 21972 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 21973 | "Unable to get send buffer in Set PNO req %x ", |
| 21974 | pwdiPNOScanReqParams); |
| 21975 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21976 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21977 | } |
| 21978 | |
| 21979 | /*------------------------------------------------------------------------- |
| 21980 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 21981 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21982 | pPrefNetwListParams.enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21983 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21984 | pPrefNetwListParams.modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21985 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 21986 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21987 | pPrefNetwListParams.ucNetworksCount = |
| 21988 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21989 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21990 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21991 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 21992 | |
| 21993 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 21994 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21995 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 21996 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 21997 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 21998 | |
| 21999 | for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ ) |
| 22000 | { |
| 22001 | /*SSID of the BSS*/ |
| 22002 | pPrefNetwListParams.aNetworks[i].ssId.length |
| 22003 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 22004 | |
| 22005 | wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId, |
| 22006 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
| 22007 | pPrefNetwListParams.aNetworks[i].ssId.length); |
| 22008 | |
| 22009 | /*Authentication type for the network*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22010 | pPrefNetwListParams.aNetworks[i].authentication = |
| 22011 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22012 | |
| 22013 | /*Encryption type for the network*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22014 | pPrefNetwListParams.aNetworks[i].encryption = |
| 22015 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22016 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22017 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22018 | 0 - if all channels */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22019 | pPrefNetwListParams.aNetworks[i].ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22020 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount; |
| 22021 | |
| 22022 | wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels, |
| 22023 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
| 22024 | pPrefNetwListParams.aNetworks[i].ucChannelCount); |
| 22025 | |
| 22026 | /*Indicates the RSSI threshold for the network to be considered*/ |
| 22027 | pPrefNetwListParams.aNetworks[i].rssiThreshold = |
| 22028 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 22029 | |
| 22030 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22031 | "WDI SET PNO: SSID %d %s", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22032 | pPrefNetwListParams.aNetworks[i].ssId.length, |
| 22033 | pPrefNetwListParams.aNetworks[i].ssId.ssId); |
| 22034 | } |
| 22035 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22036 | pPrefNetwListParams.scanTimers.ucScanTimersCount = |
| 22037 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22038 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 22039 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 22040 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 22041 | |
| 22042 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22043 | "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22044 | pPrefNetwListParams.scanTimers.ucScanTimersCount, |
| 22045 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 22046 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 22047 | |
| 22048 | for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ ) |
| 22049 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22050 | pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22051 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22052 | pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22053 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 22054 | } |
| 22055 | |
| 22056 | /*Copy the probe template*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22057 | pPrefNetwListParams.us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22058 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 22059 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22060 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22061 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22062 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22063 | wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate, |
| 22064 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
| 22065 | pPrefNetwListParams.us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22066 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22067 | pPrefNetwListParams.us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22068 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 22069 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22070 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22071 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22072 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22073 | wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate, |
| 22074 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
| 22075 | pPrefNetwListParams.us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22076 | |
| 22077 | /*Pack the buffer*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22078 | wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams, |
| 22079 | sizeof(pPrefNetwListParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22080 | |
| 22081 | /*Set the output values*/ |
| 22082 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22083 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22084 | |
| 22085 | return WDI_STATUS_SUCCESS; |
| 22086 | }/*WDI_PackPreferredNetworkList*/ |
| 22087 | |
| 22088 | /** |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22089 | @brief Helper function to pack Set Preferred Network List |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22090 | Request parameters |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22091 | |
| 22092 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22093 | pwdiPNOScanReqParams: pointer to the info received |
| 22094 | from upper layers |
| 22095 | ppSendBuffer, pSize - out pointers of the packed buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22096 | and its size |
| 22097 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22098 | @return Result of the function call |
| 22099 | */ |
| 22100 | |
| 22101 | WDI_Status |
| 22102 | WDI_PackPreferredNetworkListNew |
| 22103 | ( |
| 22104 | WDI_ControlBlockType* pWDICtx, |
| 22105 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams, |
| 22106 | wpt_uint8** ppSendBuffer, |
| 22107 | wpt_uint16* pSize |
| 22108 | ) |
| 22109 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22110 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22111 | wpt_uint16 usDataOffset = 0; |
| 22112 | wpt_uint16 usSendSize = 0; |
| 22113 | tPrefNetwListParamsNew pPrefNetwListParams; |
| 22114 | wpt_uint8 i; |
| 22115 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ |
| 22116 | |
| 22117 | /*----------------------------------------------------------------------- |
| 22118 | Get message buffer |
| 22119 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22120 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22121 | sizeof(pPrefNetwListParams), |
| 22122 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22123 | ( usSendSize < (usDataOffset + sizeof(pPrefNetwListParams) ))) |
| 22124 | { |
| 22125 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22126 | "Unable to get send buffer in Set PNO req %x ", |
| 22127 | pwdiPNOScanReqParams); |
| 22128 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22129 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22130 | } |
| 22131 | |
| 22132 | /*------------------------------------------------------------------------- |
| 22133 | Fill prefNetwListParams from pwdiPNOScanReqParams->wdiPNOScanInfo |
| 22134 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22135 | pPrefNetwListParams.enable = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22136 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22137 | pPrefNetwListParams.modePNO = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22138 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO; |
| 22139 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22140 | pPrefNetwListParams.ucNetworksCount = |
| 22141 | (pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22142 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS)? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22143 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount : |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22144 | WLAN_HAL_PNO_MAX_SUPP_NETWORKS; |
| 22145 | |
| 22146 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22147 | "WDI SET PNO: Enable %d, Mode %d, Netw Count %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22148 | pwdiPNOScanReqParams->wdiPNOScanInfo.bEnable, |
| 22149 | pwdiPNOScanReqParams->wdiPNOScanInfo.wdiModePNO, |
| 22150 | pwdiPNOScanReqParams->wdiPNOScanInfo.ucNetworksCount); |
| 22151 | |
| 22152 | for ( i = 0; i < pPrefNetwListParams.ucNetworksCount; i++ ) |
| 22153 | { |
| 22154 | /*SSID of the BSS*/ |
| 22155 | pPrefNetwListParams.aNetworks[i].ssId.length |
| 22156 | = pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.ucLength; |
| 22157 | |
| 22158 | wpalMemoryCopy( pPrefNetwListParams.aNetworks[i].ssId.ssId, |
| 22159 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ssId.sSSID, |
| 22160 | pPrefNetwListParams.aNetworks[i].ssId.length); |
| 22161 | |
| 22162 | /*Authentication type for the network*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22163 | pPrefNetwListParams.aNetworks[i].authentication = |
| 22164 | (tAuthType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiAuth; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22165 | |
| 22166 | /*Encryption type for the network*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22167 | pPrefNetwListParams.aNetworks[i].encryption = |
| 22168 | (tEdType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiEncryption; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22169 | |
| 22170 | /*SSID bcast type for the network*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22171 | pPrefNetwListParams.aNetworks[i].bcastNetworkType = |
| 22172 | (tSSIDBcastType)pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].wdiBcastNetworkType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22173 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22174 | /*Indicate the channel on which the Network can be found |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22175 | 0 - if all channels */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22176 | pPrefNetwListParams.aNetworks[i].ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22177 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].ucChannelCount; |
| 22178 | |
| 22179 | wpalMemoryCopy(pPrefNetwListParams.aNetworks[i].aChannels, |
| 22180 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].aChannels, |
| 22181 | pPrefNetwListParams.aNetworks[i].ucChannelCount); |
| 22182 | |
| 22183 | /*Indicates the RSSI threshold for the network to be considered*/ |
| 22184 | pPrefNetwListParams.aNetworks[i].rssiThreshold = |
| 22185 | pwdiPNOScanReqParams->wdiPNOScanInfo.aNetworks[i].rssiThreshold; |
| 22186 | |
| 22187 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22188 | "WDI SET PNO: SSID %d %s", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22189 | pPrefNetwListParams.aNetworks[i].ssId.length, |
| 22190 | pPrefNetwListParams.aNetworks[i].ssId.ssId); |
| 22191 | } |
| 22192 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22193 | pPrefNetwListParams.scanTimers.ucScanTimersCount = |
| 22194 | (pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount < |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22195 | WLAN_HAL_PNO_MAX_SCAN_TIMERS)? |
| 22196 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.ucScanTimersCount : |
| 22197 | WLAN_HAL_PNO_MAX_SCAN_TIMERS; |
| 22198 | |
| 22199 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22200 | "WDI SET PNO: Scan timers count %d 24G P %d 5G Probe %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22201 | pPrefNetwListParams.scanTimers.ucScanTimersCount, |
| 22202 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize, |
| 22203 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize); |
| 22204 | |
| 22205 | for ( i = 0; i < pPrefNetwListParams.scanTimers.ucScanTimersCount; i++ ) |
| 22206 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22207 | pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerValue = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22208 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerValue; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22209 | pPrefNetwListParams.scanTimers.aTimerValues[i].uTimerRepeat = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22210 | pwdiPNOScanReqParams->wdiPNOScanInfo.scanTimers.aTimerValues[i].uTimerRepeat; |
| 22211 | } |
| 22212 | |
| 22213 | /*Copy the probe template*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22214 | pPrefNetwListParams.us24GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22215 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize< |
| 22216 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22217 | pwdiPNOScanReqParams->wdiPNOScanInfo.us24GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22218 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22219 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22220 | wpalMemoryCopy(pPrefNetwListParams.a24GProbeTemplate, |
| 22221 | pwdiPNOScanReqParams->wdiPNOScanInfo.a24GProbeTemplate, |
| 22222 | pPrefNetwListParams.us24GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22223 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22224 | pPrefNetwListParams.us5GProbeSize = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22225 | (pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize < |
| 22226 | WLAN_HAL_PNO_MAX_PROBE_SIZE)? |
| 22227 | pwdiPNOScanReqParams->wdiPNOScanInfo.us5GProbeSize: |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22228 | WLAN_HAL_PNO_MAX_PROBE_SIZE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22229 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22230 | wpalMemoryCopy(pPrefNetwListParams.a5GProbeTemplate, |
| 22231 | pwdiPNOScanReqParams->wdiPNOScanInfo.a5GProbeTemplate, |
| 22232 | pPrefNetwListParams.us5GProbeSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22233 | |
| 22234 | /*Pack the buffer*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22235 | wpalMemoryCopy( pSendBuffer+usDataOffset, &pPrefNetwListParams, |
| 22236 | sizeof(pPrefNetwListParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22237 | |
| 22238 | /*Set the output values*/ |
| 22239 | *ppSendBuffer = pSendBuffer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22240 | *pSize = usSendSize; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22241 | |
| 22242 | return WDI_STATUS_SUCCESS; |
| 22243 | }/*WDI_PackPreferredNetworkListNew*/ |
| 22244 | |
| 22245 | /** |
| 22246 | @brief Process Set Preferred Network List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22247 | |
| 22248 | @param pWDICtx: pointer to the WLAN DAL context |
| 22249 | pEventData: pointer to the event information structure |
| 22250 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22251 | @return Result of the function call |
| 22252 | */ |
| 22253 | WDI_Status |
| 22254 | WDI_ProcessSetPreferredNetworkReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22255 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22256 | WDI_ControlBlockType* pWDICtx, |
| 22257 | WDI_EventInfoType* pEventData |
| 22258 | ) |
| 22259 | { |
| 22260 | WDI_PNOScanReqParamsType* pwdiPNOScanReqParams = NULL; |
| 22261 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22262 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22263 | wpt_uint16 usSendSize = 0; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22264 | WDI_Status wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22265 | |
| 22266 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22267 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22268 | -------------------------------------------------------------------------*/ |
| 22269 | if (( NULL == pEventData ) || |
| 22270 | ( NULL == (pwdiPNOScanReqParams = (WDI_PNOScanReqParamsType*)pEventData->pEventData)) || |
| 22271 | ( NULL == (wdiPNOScanCb = (WDI_PNOScanCb)pEventData->pCBfnc))) |
| 22272 | { |
| 22273 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22274 | "%s: Invalid parameters", __FUNCTION__); |
| 22275 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22276 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22277 | } |
| 22278 | |
| 22279 | /*------------------------------------------------------------------------- |
| 22280 | Pack the PNO request structure based on version |
| 22281 | -------------------------------------------------------------------------*/ |
| 22282 | if ( pWDICtx->wdiPNOVersion > 0 ) |
| 22283 | { |
| 22284 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22285 | "%s: PNO new version %d ", __FUNCTION__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22286 | pWDICtx->wdiPNOVersion); |
| 22287 | |
| 22288 | wdiStatus = WDI_PackPreferredNetworkListNew( pWDICtx, pwdiPNOScanReqParams, |
| 22289 | &pSendBuffer, &usSendSize); |
| 22290 | } |
| 22291 | else |
| 22292 | { |
| 22293 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22294 | "%s: PNO old version %d ", __FUNCTION__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22295 | pWDICtx->wdiPNOVersion); |
| 22296 | |
| 22297 | wdiStatus = WDI_PackPreferredNetworkList( pWDICtx, pwdiPNOScanReqParams, |
| 22298 | &pSendBuffer, &usSendSize); |
| 22299 | } |
| 22300 | |
| 22301 | if (( WDI_STATUS_SUCCESS != wdiStatus )|| |
| 22302 | ( NULL == pSendBuffer )||( 0 == usSendSize )) |
| 22303 | { |
| 22304 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22305 | "%s: failed to pack request parameters", __FUNCTION__); |
| 22306 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22307 | return wdiStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22308 | } |
| 22309 | |
| 22310 | pWDICtx->wdiReqStatusCB = pwdiPNOScanReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22311 | pWDICtx->pReqStatusUserData = pwdiPNOScanReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22312 | |
| 22313 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22314 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22315 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22316 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22317 | wdiPNOScanCb, pEventData->pUserData, WDI_SET_PREF_NETWORK_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22318 | } |
| 22319 | |
| 22320 | /** |
| 22321 | @brief Process Set RSSI Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22322 | |
| 22323 | @param pWDICtx: pointer to the WLAN DAL context |
| 22324 | pEventData: pointer to the event information structure |
| 22325 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22326 | @see |
| 22327 | @return Result of the function call |
| 22328 | */ |
| 22329 | WDI_Status |
| 22330 | WDI_ProcessSetRssiFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22331 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22332 | WDI_ControlBlockType* pWDICtx, |
| 22333 | WDI_EventInfoType* pEventData |
| 22334 | ) |
| 22335 | { |
| 22336 | WDI_SetRssiFilterReqParamsType* pwdiRssiFilterReqParams = NULL; |
| 22337 | WDI_RssiFilterCb wdiRssiFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22338 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22339 | wpt_uint16 usDataOffset = 0; |
| 22340 | wpt_uint16 usSendSize = 0; |
| 22341 | wpt_uint8 ucRssiThreshold; |
| 22342 | |
| 22343 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22344 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22345 | -------------------------------------------------------------------------*/ |
| 22346 | if (( NULL == pEventData ) || |
| 22347 | ( NULL == (pwdiRssiFilterReqParams = (WDI_SetRssiFilterReqParamsType*)pEventData->pEventData)) || |
| 22348 | ( NULL == (wdiRssiFilterCb = (WDI_RssiFilterCb)pEventData->pCBfnc))) |
| 22349 | { |
| 22350 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22351 | "%s: Invalid parameters", __FUNCTION__); |
| 22352 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22353 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22354 | } |
| 22355 | |
| 22356 | /*----------------------------------------------------------------------- |
| 22357 | Get message buffer |
| 22358 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22359 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_PREF_NETWORK_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22360 | sizeof(ucRssiThreshold), |
| 22361 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22362 | ( usSendSize < (usDataOffset + sizeof(ucRssiThreshold) ))) |
| 22363 | { |
| 22364 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22365 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 22366 | pEventData, pwdiRssiFilterReqParams, wdiRssiFilterCb); |
| 22367 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22368 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22369 | } |
| 22370 | |
| 22371 | ucRssiThreshold = pwdiRssiFilterReqParams->rssiThreshold; |
| 22372 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22373 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22374 | &ucRssiThreshold, |
| 22375 | sizeof(ucRssiThreshold)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22376 | |
| 22377 | pWDICtx->wdiReqStatusCB = pwdiRssiFilterReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22378 | pWDICtx->pReqStatusUserData = pwdiRssiFilterReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22379 | |
| 22380 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22381 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22382 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22383 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22384 | wdiRssiFilterCb, pEventData->pUserData, WDI_SET_RSSI_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22385 | } |
| 22386 | |
| 22387 | |
| 22388 | /** |
| 22389 | @brief Process Update Scan Params function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22390 | |
| 22391 | @param pWDICtx: pointer to the WLAN DAL context |
| 22392 | pEventData: pointer to the event information structure |
| 22393 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22394 | @see |
| 22395 | @return Result of the function call |
| 22396 | */ |
| 22397 | WDI_Status |
| 22398 | WDI_ProcessUpdateScanParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22399 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22400 | WDI_ControlBlockType* pWDICtx, |
| 22401 | WDI_EventInfoType* pEventData |
| 22402 | ) |
| 22403 | { |
| 22404 | WDI_UpdateScanParamsInfoType* pwdiUpdateScanParams = NULL; |
| 22405 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22406 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22407 | wpt_uint16 usDataOffset = 0; |
| 22408 | wpt_uint16 usSendSize = 0; |
| 22409 | tUpdateScanParams updateScanParams = {0}; |
| 22410 | |
| 22411 | |
| 22412 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22413 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22414 | -------------------------------------------------------------------------*/ |
| 22415 | if (( NULL == pEventData ) || |
| 22416 | ( NULL == (pwdiUpdateScanParams = (WDI_UpdateScanParamsInfoType*)pEventData->pEventData)) || |
| 22417 | ( NULL == (wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pEventData->pCBfnc))) |
| 22418 | { |
| 22419 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22420 | "%s: Invalid parameters", __FUNCTION__); |
| 22421 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22422 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22423 | } |
| 22424 | |
| 22425 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22426 | "Begin WDI Update Scan Parameters"); |
| 22427 | /*----------------------------------------------------------------------- |
| 22428 | Get message buffer |
| 22429 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22430 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_SCAN_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22431 | sizeof(updateScanParams), |
| 22432 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22433 | ( usSendSize < (usDataOffset + sizeof(updateScanParams) ))) |
| 22434 | { |
| 22435 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22436 | "Unable to get send buffer in Update Scan Params req %x %x %x", |
| 22437 | pEventData, pwdiUpdateScanParams, wdiUpdateScanParamsCb); |
| 22438 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22439 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22440 | } |
| 22441 | |
| 22442 | // |
| 22443 | // Fill updateScanParams from pwdiUpdateScanParams->wdiUpdateScanParamsInfo |
| 22444 | // |
| 22445 | |
| 22446 | updateScanParams.b11dEnabled = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dEnabled; |
| 22447 | updateScanParams.b11dResolved = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.b11dResolved; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22448 | updateScanParams.ucChannelCount = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22449 | (pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount < |
| 22450 | WLAN_HAL_PNO_MAX_NETW_CHANNELS)? |
| 22451 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.ucChannelCount : |
| 22452 | WLAN_HAL_PNO_MAX_NETW_CHANNELS; |
| 22453 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22454 | wpalMemoryCopy( updateScanParams.aChannels, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22455 | pwdiUpdateScanParams->wdiUpdateScanParamsInfo.aChannels, |
| 22456 | updateScanParams.ucChannelCount); |
| 22457 | |
| 22458 | updateScanParams.usActiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMinChTime; |
| 22459 | updateScanParams.usActiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usActiveMaxChTime; |
| 22460 | updateScanParams.usPassiveMinChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMinChTime; |
| 22461 | updateScanParams.usPassiveMaxChTime = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.usPassiveMaxChTime; |
| 22462 | updateScanParams.cbState = pwdiUpdateScanParams->wdiUpdateScanParamsInfo.cbState; |
| 22463 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22464 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22465 | &updateScanParams, |
| 22466 | sizeof(updateScanParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22467 | |
| 22468 | pWDICtx->wdiReqStatusCB = pwdiUpdateScanParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22469 | pWDICtx->pReqStatusUserData = pwdiUpdateScanParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22470 | |
| 22471 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22472 | "End Update Scan Parameters"); |
| 22473 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22474 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22475 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22476 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 22477 | wdiUpdateScanParamsCb, pEventData->pUserData, WDI_UPDATE_SCAN_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22478 | } |
| 22479 | |
| 22480 | /** |
| 22481 | @brief Process Preferred Network Found Indication function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22482 | |
| 22483 | @param pWDICtx: pointer to the WLAN DAL context |
| 22484 | pEventData: pointer to the event information structure |
| 22485 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22486 | @see |
| 22487 | @return Result of the function call |
| 22488 | */ |
| 22489 | WDI_Status |
| 22490 | WDI_ProcessPrefNetworkFoundInd |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22491 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22492 | WDI_ControlBlockType* pWDICtx, |
| 22493 | WDI_EventInfoType* pEventData |
| 22494 | ) |
| 22495 | { |
| 22496 | WDI_LowLevelIndType wdiInd; |
| 22497 | tPrefNetwFoundInd prefNetwFoundInd = {{0}}; |
| 22498 | |
| 22499 | |
| 22500 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22501 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22502 | -------------------------------------------------------------------------*/ |
| 22503 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22504 | ( NULL == pEventData->pEventData )) |
| 22505 | { |
| 22506 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22507 | "%s: Invalid parameters", __FUNCTION__); |
| 22508 | WDI_ASSERT( 0 ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22509 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22510 | } |
| 22511 | |
| 22512 | /*------------------------------------------------------------------------- |
| 22513 | Extract indication and send it to UMAC |
| 22514 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22515 | wpalMemoryCopy( (void *)&prefNetwFoundInd.prefNetwFoundParams, |
| 22516 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22517 | sizeof(tPrefNetwFoundParams)); |
| 22518 | |
| 22519 | /*Fill in the indication parameters*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22520 | wdiInd.wdiIndicationType = WDI_PREF_NETWORK_FOUND_IND; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22521 | |
| 22522 | wpalMemoryZero(wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID,32); |
| 22523 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22524 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22525 | (prefNetwFoundInd.prefNetwFoundParams.ssId.length < 31 )? |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22526 | prefNetwFoundInd.prefNetwFoundParams.ssId.length : 31; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22527 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22528 | wpalMemoryCopy( wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 22529 | prefNetwFoundInd.prefNetwFoundParams.ssId.ssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22530 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.ucLength); |
| 22531 | |
| 22532 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi = |
| 22533 | prefNetwFoundInd.prefNetwFoundParams.rssi; |
| 22534 | |
| 22535 | // DEBUG |
| 22536 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 22537 | "[PNO WDI] PREF_NETWORK_FOUND_IND Type (%x) data (SSID=%s, RSSI=%d)", |
| 22538 | wdiInd.wdiIndicationType, |
| 22539 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.ssId.sSSID, |
| 22540 | wdiInd.wdiIndicationData.wdiPrefNetworkFoundInd.rssi ); |
| 22541 | |
| 22542 | /*Notify UMAC*/ |
| 22543 | pWDICtx->wdiLowLevelIndCB( &wdiInd, pWDICtx->pIndUserData ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22544 | |
| 22545 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22546 | } |
| 22547 | |
| 22548 | /** |
| 22549 | @brief Process PNO Rsp function (called when a |
| 22550 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22551 | |
| 22552 | @param pWDICtx: pointer to the WLAN DAL context |
| 22553 | pEventData: pointer to the event information structure |
| 22554 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22555 | @see |
| 22556 | @return Result of the function call |
| 22557 | */ |
| 22558 | WDI_Status |
| 22559 | WDI_ProcessSetPreferredNetworkRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22560 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22561 | WDI_ControlBlockType* pWDICtx, |
| 22562 | WDI_EventInfoType* pEventData |
| 22563 | ) |
| 22564 | { |
| 22565 | WDI_Status wdiStatus; |
| 22566 | eHalStatus halStatus; |
| 22567 | WDI_PNOScanCb wdiPNOScanCb = NULL; |
| 22568 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22569 | |
| 22570 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22571 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22572 | -------------------------------------------------------------------------*/ |
| 22573 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22574 | ( NULL == pEventData->pEventData )) |
| 22575 | { |
| 22576 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22577 | "%s: Invalid parameters", __FUNCTION__); |
| 22578 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22579 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22580 | } |
| 22581 | |
| 22582 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22583 | wdiPNOScanCb = (WDI_PNOScanCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22584 | |
| 22585 | /*------------------------------------------------------------------------- |
| 22586 | Extract response and send it to UMAC |
| 22587 | -------------------------------------------------------------------------*/ |
| 22588 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22589 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22590 | |
| 22591 | /*Notify UMAC*/ |
| 22592 | wdiPNOScanCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 22593 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22594 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22595 | }/*WDI_ProcessSetPreferredNetworkRsp*/ |
| 22596 | |
| 22597 | /** |
| 22598 | @brief Process RSSI Filter Rsp function (called when a |
| 22599 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22600 | |
| 22601 | @param pWDICtx: pointer to the WLAN DAL context |
| 22602 | pEventData: pointer to the event information structure |
| 22603 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22604 | @see |
| 22605 | @return Result of the function call |
| 22606 | */ |
| 22607 | WDI_Status |
| 22608 | WDI_ProcessSetRssiFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22609 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22610 | WDI_ControlBlockType* pWDICtx, |
| 22611 | WDI_EventInfoType* pEventData |
| 22612 | ) |
| 22613 | { |
| 22614 | WDI_Status wdiStatus; |
| 22615 | eHalStatus halStatus; |
| 22616 | WDI_RssiFilterCb wdiRssiFilterCb; |
| 22617 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22618 | |
| 22619 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22620 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22621 | -------------------------------------------------------------------------*/ |
| 22622 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22623 | ( NULL == pEventData->pEventData )) |
| 22624 | { |
| 22625 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22626 | "%s: Invalid parameters", __FUNCTION__); |
| 22627 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22628 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22629 | } |
| 22630 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22631 | wdiRssiFilterCb = (WDI_RssiFilterCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22632 | |
| 22633 | /*------------------------------------------------------------------------- |
| 22634 | Extract response and send it to UMAC |
| 22635 | -------------------------------------------------------------------------*/ |
| 22636 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22637 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22638 | |
| 22639 | /*Notify UMAC*/ |
| 22640 | wdiRssiFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 22641 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22642 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22643 | }/*WDI_ProcessSetRssiFilterRsp*/ |
| 22644 | |
| 22645 | /** |
| 22646 | @brief Process Update Scan Params Rsp function (called when a |
| 22647 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22648 | |
| 22649 | @param pWDICtx: pointer to the WLAN DAL context |
| 22650 | pEventData: pointer to the event information structure |
| 22651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22652 | @see |
| 22653 | @return Result of the function call |
| 22654 | */ |
| 22655 | WDI_Status |
| 22656 | WDI_ProcessUpdateScanParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22657 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22658 | WDI_ControlBlockType* pWDICtx, |
| 22659 | WDI_EventInfoType* pEventData |
| 22660 | ) |
| 22661 | { |
| 22662 | WDI_Status wdiStatus; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22663 | tUpdateScanParamsResp halUpdScanParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22664 | WDI_UpdateScanParamsCb wdiUpdateScanParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22665 | wpt_uint32 uStatus; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22666 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22667 | |
| 22668 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22669 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22670 | -------------------------------------------------------------------------*/ |
| 22671 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 22672 | ( NULL == pEventData->pEventData )) |
| 22673 | { |
| 22674 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22675 | "%s: Invalid parameters", __FUNCTION__); |
| 22676 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22677 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22678 | } |
| 22679 | |
| 22680 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22681 | "Process UPD scan params ptr : %x", __FUNCTION__); |
| 22682 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22683 | wdiUpdateScanParamsCb = (WDI_UpdateScanParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22684 | |
| 22685 | /*------------------------------------------------------------------------- |
| 22686 | Extract response and send it to UMAC |
| 22687 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22688 | wpalMemoryCopy( (void *)&halUpdScanParams.status, |
| 22689 | pEventData->pEventData, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22690 | sizeof(halUpdScanParams.status)); |
| 22691 | |
| 22692 | uStatus = halUpdScanParams.status; |
| 22693 | |
| 22694 | /*Extract PNO version - 1st bit of the status */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22695 | pWDICtx->wdiPNOVersion = (uStatus & WDI_PNO_VERSION_MASK)? 1:0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22696 | |
| 22697 | /*Remove version bit*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22698 | uStatus = uStatus & ( ~(WDI_PNO_VERSION_MASK)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22699 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22700 | wdiStatus = WDI_HAL_2_WDI_STATUS(uStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22701 | |
| 22702 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22703 | "UPD Scan Parameters rsp with status: %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22704 | halUpdScanParams.status); |
| 22705 | |
| 22706 | /*Notify UMAC*/ |
| 22707 | wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 22708 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22709 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22710 | } |
| 22711 | #endif // FEATURE_WLAN_SCAN_PNO |
| 22712 | |
| 22713 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22714 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22715 | WDI_8023MulticastListReq |
| 22716 | ( |
| 22717 | WDI_RcvFltPktSetMcListReqParamsType* pwdiRcvFltPktSetMcListReqInfo, |
| 22718 | WDI_8023MulticastListCb wdi8023MulticastListCallback, |
| 22719 | void* pUserData |
| 22720 | ) |
| 22721 | { |
| 22722 | WDI_EventInfoType wdiEventData; |
| 22723 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22724 | |
| 22725 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22726 | "%s", __FUNCTION__); |
| 22727 | |
| 22728 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22729 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22730 | ------------------------------------------------------------------------*/ |
| 22731 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22732 | { |
| 22733 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22734 | "WDI API call before module is initialized - Fail request"); |
| 22735 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22736 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22737 | } |
| 22738 | |
| 22739 | /*------------------------------------------------------------------------ |
| 22740 | Fill in Event data and post to the Main FSM |
| 22741 | ------------------------------------------------------------------------*/ |
| 22742 | wdiEventData.wdiRequest = WDI_8023_MULTICAST_LIST_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22743 | wdiEventData.pEventData = pwdiRcvFltPktSetMcListReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22744 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktSetMcListReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22745 | wdiEventData.pCBfnc = wdi8023MulticastListCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22746 | wdiEventData.pUserData = pUserData; |
| 22747 | |
| 22748 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22749 | } |
| 22750 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22751 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22752 | WDI_ReceiveFilterSetFilterReq |
| 22753 | ( |
| 22754 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo, |
| 22755 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCallback, |
| 22756 | void* pUserData |
| 22757 | ) |
| 22758 | { |
| 22759 | WDI_EventInfoType wdiEventData; |
| 22760 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22761 | |
| 22762 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22763 | "%s",__FUNCTION__); |
| 22764 | |
| 22765 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22766 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22767 | ------------------------------------------------------------------------*/ |
| 22768 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22769 | { |
| 22770 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22771 | "WDI API call before module is initialized - Fail request"); |
| 22772 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22773 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22774 | } |
| 22775 | |
| 22776 | /*------------------------------------------------------------------------ |
| 22777 | Fill in Event data and post to the Main FSM |
| 22778 | ------------------------------------------------------------------------*/ |
| 22779 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_SET_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22780 | wdiEventData.pEventData = pwdiSetRcvPktFilterReqInfo; |
| 22781 | wdiEventData.uEventDataSize = sizeof(*pwdiSetRcvPktFilterReqInfo) + |
| 22782 | (pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22783 | * sizeof(WDI_RcvPktFilterFieldParams) - 1); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22784 | wdiEventData.pCBfnc = wdiReceiveFilterSetFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22785 | wdiEventData.pUserData = pUserData; |
| 22786 | |
| 22787 | |
| 22788 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22789 | } |
| 22790 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22791 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22792 | WDI_FilterMatchCountReq |
| 22793 | ( |
| 22794 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqInfo, |
| 22795 | WDI_FilterMatchCountCb wdiFilterMatchCountCallback, |
| 22796 | void* pUserData |
| 22797 | ) |
| 22798 | { |
| 22799 | WDI_EventInfoType wdiEventData; |
| 22800 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22801 | |
| 22802 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22803 | "%s",__FUNCTION__); |
| 22804 | |
| 22805 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22806 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22807 | ------------------------------------------------------------------------*/ |
| 22808 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22809 | { |
| 22810 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22811 | "WDI API call before module is initialized - Fail request"); |
| 22812 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22813 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22814 | } |
| 22815 | |
| 22816 | /*------------------------------------------------------------------------ |
| 22817 | Fill in Event data and post to the Main FSM |
| 22818 | ------------------------------------------------------------------------*/ |
| 22819 | wdiEventData.wdiRequest = WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22820 | wdiEventData.pEventData = pwdiRcvFltPktMatchCntReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22821 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktMatchCntReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22822 | wdiEventData.pCBfnc = wdiFilterMatchCountCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22823 | wdiEventData.pUserData = pUserData; |
| 22824 | |
| 22825 | |
| 22826 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22827 | } |
| 22828 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22829 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22830 | WDI_ReceiveFilterClearFilterReq |
| 22831 | ( |
| 22832 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqInfo, |
| 22833 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCallback, |
| 22834 | void* pUserData |
| 22835 | ) |
| 22836 | { |
| 22837 | WDI_EventInfoType wdiEventData; |
| 22838 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 22839 | |
| 22840 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22841 | "%s",__FUNCTION__); |
| 22842 | |
| 22843 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22844 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22845 | ------------------------------------------------------------------------*/ |
| 22846 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 22847 | { |
| 22848 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22849 | "WDI API call before module is initialized - Fail request"); |
| 22850 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22851 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22852 | } |
| 22853 | |
| 22854 | /*------------------------------------------------------------------------ |
| 22855 | Fill in Event data and post to the Main FSM |
| 22856 | ------------------------------------------------------------------------*/ |
| 22857 | wdiEventData.wdiRequest = WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22858 | wdiEventData.pEventData = pwdiRcvFltPktClearReqInfo; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22859 | wdiEventData.uEventDataSize = sizeof(*pwdiRcvFltPktClearReqInfo); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22860 | wdiEventData.pCBfnc = wdiReceiveFilterClearFilterCallback; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22861 | wdiEventData.pUserData = pUserData; |
| 22862 | |
| 22863 | |
| 22864 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 22865 | } |
| 22866 | |
| 22867 | /** |
| 22868 | @brief Process 8023 Multicast List Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22869 | |
| 22870 | @param pWDICtx: pointer to the WLAN DAL context |
| 22871 | pEventData: pointer to the event information structure |
| 22872 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22873 | @see |
| 22874 | @return Result of the function call |
| 22875 | */ |
| 22876 | WDI_Status |
| 22877 | WDI_Process8023MulticastListReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22878 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22879 | WDI_ControlBlockType* pWDICtx, |
| 22880 | WDI_EventInfoType* pEventData |
| 22881 | ) |
| 22882 | { |
| 22883 | WDI_RcvFltPktSetMcListReqParamsType* pwdiFltPktSetMcListReqParamsType = NULL; |
| 22884 | WDI_8023MulticastListCb wdi8023MulticastListCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22885 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22886 | wpt_uint16 usDataOffset = 0; |
| 22887 | wpt_uint16 usSendSize = 0; |
| 22888 | tHalRcvFltMcAddrListType rcvFltMcAddrListType; |
| 22889 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22890 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 22891 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22892 | |
| 22893 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22894 | "%s",__FUNCTION__); |
| 22895 | |
| 22896 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22897 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22898 | -------------------------------------------------------------------------*/ |
| 22899 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22900 | ( NULL == (pwdiFltPktSetMcListReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22901 | (WDI_RcvFltPktSetMcListReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22902 | ( NULL == (wdi8023MulticastListCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22903 | (WDI_8023MulticastListCb)pEventData->pCBfnc))) |
| 22904 | { |
| 22905 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22906 | "%s: Invalid parameters", __FUNCTION__); |
| 22907 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22908 | return WDI_STATUS_E_FAILURE; |
| 22909 | } |
| 22910 | |
| 22911 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 22912 | pwdiFltPktSetMcListReqParamsType->mcAddrList.bssId, |
| 22913 | &pBSSSes); |
| 22914 | if ( NULL == pBSSSes ) |
| 22915 | { |
| 22916 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 22917 | " %s : Association for this BSSID does not exist",__FUNCTION__); |
| 22918 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22919 | } |
| 22920 | |
| 22921 | /*----------------------------------------------------------------------- |
| 22922 | Get message buffer |
| 22923 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22924 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 22925 | WDI_8023_MULTICAST_LIST_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22926 | sizeof(tHalRcvFltMcAddrListType), |
| 22927 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 22928 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltMcAddrListType)))) |
| 22929 | { |
| 22930 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 22931 | "Unable to get send buffer in " |
| 22932 | "WDI_Process8023MulticastListReq() %x %x %x", |
| 22933 | pEventData, pwdiFltPktSetMcListReqParamsType, |
| 22934 | wdi8023MulticastListCb); |
| 22935 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22936 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22937 | } |
| 22938 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22939 | rcvFltMcAddrListType.cMulticastAddr = |
| 22940 | pwdiFltPktSetMcListReqParamsType->mcAddrList.ulMulticastAddrCnt; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22941 | for( i = 0; i < rcvFltMcAddrListType.cMulticastAddr; i++ ) |
| 22942 | { |
| 22943 | wpalMemoryCopy(rcvFltMcAddrListType.multicastAddr[i], |
| 22944 | pwdiFltPktSetMcListReqParamsType->mcAddrList.multicastAddr[i], |
| 22945 | sizeof(tSirMacAddr)); |
| 22946 | } |
| 22947 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22948 | rcvFltMcAddrListType.bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22949 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 22950 | &rcvFltMcAddrListType, |
| 22951 | sizeof(rcvFltMcAddrListType)); |
| 22952 | |
| 22953 | pWDICtx->wdiReqStatusCB = pwdiFltPktSetMcListReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22954 | pWDICtx->pReqStatusUserData = pwdiFltPktSetMcListReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22955 | |
| 22956 | |
| 22957 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22958 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22959 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22960 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22961 | wdi8023MulticastListCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22962 | WDI_8023_MULTICAST_LIST_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22963 | } |
| 22964 | |
| 22965 | /** |
| 22966 | @brief Process Receive Filter Set Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22967 | |
| 22968 | @param pWDICtx: pointer to the WLAN DAL context |
| 22969 | pEventData: pointer to the event information structure |
| 22970 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22971 | @see |
| 22972 | @return Result of the function call |
| 22973 | */ |
| 22974 | WDI_Status |
| 22975 | WDI_ProcessReceiveFilterSetFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22976 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22977 | WDI_ControlBlockType* pWDICtx, |
| 22978 | WDI_EventInfoType* pEventData |
| 22979 | ) |
| 22980 | { |
| 22981 | WDI_SetRcvPktFilterReqParamsType* pwdiSetRcvPktFilterReqInfo = NULL; |
| 22982 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22983 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22984 | wpt_uint16 usDataOffset = 0; |
| 22985 | wpt_uint16 usSendSize = 0; |
| 22986 | wpt_uint32 usRcvPktFilterCfgSize; |
| 22987 | tHalRcvPktFilterCfgType *pRcvPktFilterCfg; |
| 22988 | wpt_uint8 i; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22989 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 22990 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22991 | |
| 22992 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 22993 | "%s",__FUNCTION__); |
| 22994 | |
| 22995 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22996 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22997 | -------------------------------------------------------------------------*/ |
| 22998 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 22999 | ( NULL == (pwdiSetRcvPktFilterReqInfo = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23000 | (WDI_SetRcvPktFilterReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23001 | ( NULL == (wdiReceiveFilterSetFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23002 | (WDI_ReceiveFilterSetFilterCb)pEventData->pCBfnc))) |
| 23003 | { |
| 23004 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23005 | "%s: Invalid parameters", __FUNCTION__); |
| 23006 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23007 | return WDI_STATUS_E_FAILURE; |
| 23008 | } |
| 23009 | |
| 23010 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23011 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.bssId, |
| 23012 | &pBSSSes); |
| 23013 | if ( NULL == pBSSSes ) |
| 23014 | { |
| 23015 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23016 | " %s : Association for this BSSID does not exist",__FUNCTION__); |
| 23017 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23018 | } |
| 23019 | |
| 23020 | usRcvPktFilterCfgSize = sizeof(tHalRcvPktFilterCfgType) + |
| 23021 | ((pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams - 1) |
| 23022 | * sizeof(tHalRcvPktFilterParams)); |
| 23023 | |
| 23024 | pRcvPktFilterCfg = (tHalRcvPktFilterCfgType *)wpalMemoryAllocate( |
| 23025 | usRcvPktFilterCfgSize); |
| 23026 | |
| 23027 | if(NULL == pRcvPktFilterCfg) |
| 23028 | { |
| 23029 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23030 | "%s: Failed to allocate memory for " |
| 23031 | "tHalRcvPktFilterCfgType: %x %x %x ", |
| 23032 | __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData); |
| 23033 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23034 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23035 | } |
| 23036 | |
| 23037 | wpalMemoryZero(pRcvPktFilterCfg, usRcvPktFilterCfgSize); |
| 23038 | |
| 23039 | /*----------------------------------------------------------------------- |
| 23040 | Get message buffer |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23041 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23042 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23043 | 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] | 23044 | usRcvPktFilterCfgSize, |
| 23045 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23046 | ( usSendSize < (usDataOffset + usRcvPktFilterCfgSize))) |
| 23047 | { |
| 23048 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23049 | "Unable to get send buffer in " |
| 23050 | "WDI_ProcessReceiveFilterSetFilterReq() %x %x %x", |
| 23051 | pEventData, pwdiSetRcvPktFilterReqInfo, |
| 23052 | wdiReceiveFilterSetFilterCb); |
| 23053 | WDI_ASSERT(0); |
| 23054 | wpalMemoryFree(pRcvPktFilterCfg); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23055 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23056 | } |
| 23057 | |
| 23058 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23059 | "UsData Off %d UsSend %d cfg %d",usDataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23060 | usSendSize,usRcvPktFilterCfgSize); |
| 23061 | |
| 23062 | pRcvPktFilterCfg->filterId = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterId; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23063 | pRcvPktFilterCfg->filterType = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.filterType; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23064 | pRcvPktFilterCfg->numParams = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.numFieldParams; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23065 | pRcvPktFilterCfg->coalesceTime = pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.coalesceTime; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23066 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23067 | //pRcvPktFilterCfg->bssIdx = pBSSSes->ucBSSIdx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23068 | |
| 23069 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23070 | "Out: FID %d FT %d",pRcvPktFilterCfg->filterId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23071 | pRcvPktFilterCfg->filterType); |
| 23072 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23073 | "NParams %d CT %d",pRcvPktFilterCfg->numParams, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23074 | pRcvPktFilterCfg->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23075 | |
| 23076 | for ( i = 0; i < pRcvPktFilterCfg->numParams; i++ ) |
| 23077 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23078 | pRcvPktFilterCfg->paramsData[i].protocolLayer = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23079 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].protocolLayer; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23080 | pRcvPktFilterCfg->paramsData[i].cmpFlag = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23081 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].cmpFlag; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23082 | pRcvPktFilterCfg->paramsData[i].dataOffset = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23083 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataOffset; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23084 | pRcvPktFilterCfg->paramsData[i].dataLength = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23085 | pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataLength; |
| 23086 | |
| 23087 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].compareData, |
| 23088 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].compareData, |
| 23089 | 8); |
| 23090 | wpalMemoryCopy(&pRcvPktFilterCfg->paramsData[i].dataMask, |
| 23091 | &pwdiSetRcvPktFilterReqInfo->wdiPktFilterCfg.paramsData[i].dataMask, |
| 23092 | 8); |
| 23093 | |
| 23094 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23095 | "Out:Proto %d Comp Flag %d \n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23096 | pRcvPktFilterCfg->paramsData[i].protocolLayer, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23097 | pRcvPktFilterCfg->paramsData[i].cmpFlag); |
| 23098 | |
| 23099 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23100 | "Data Offset %d Data Len %d\n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23101 | pRcvPktFilterCfg->paramsData[i].dataOffset, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23102 | pRcvPktFilterCfg->paramsData[i].dataLength); |
| 23103 | |
| 23104 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23105 | "CData: %d:%d:%d:%d:%d:%d\n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23106 | pRcvPktFilterCfg->paramsData[i].compareData[0], |
| 23107 | pRcvPktFilterCfg->paramsData[i].compareData[1], |
| 23108 | pRcvPktFilterCfg->paramsData[i].compareData[2], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23109 | pRcvPktFilterCfg->paramsData[i].compareData[3], |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23110 | pRcvPktFilterCfg->paramsData[i].compareData[4], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23111 | pRcvPktFilterCfg->paramsData[i].compareData[5]); |
| 23112 | |
| 23113 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23114 | "MData: %d:%d:%d:%d:%d:%d\n", |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23115 | pRcvPktFilterCfg->paramsData[i].dataMask[0], |
| 23116 | pRcvPktFilterCfg->paramsData[i].dataMask[1], |
| 23117 | pRcvPktFilterCfg->paramsData[i].dataMask[2], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23118 | pRcvPktFilterCfg->paramsData[i].dataMask[3], |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23119 | pRcvPktFilterCfg->paramsData[i].dataMask[4], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23120 | pRcvPktFilterCfg->paramsData[i].dataMask[5]); |
| 23121 | } |
| 23122 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23123 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23124 | pRcvPktFilterCfg, |
| 23125 | usRcvPktFilterCfgSize); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23126 | |
| 23127 | |
| 23128 | pWDICtx->wdiReqStatusCB = pwdiSetRcvPktFilterReqInfo->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23129 | pWDICtx->pReqStatusUserData = pwdiSetRcvPktFilterReqInfo->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23130 | |
| 23131 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23132 | "%s",__FUNCTION__); |
| 23133 | wpalMemoryFree(pRcvPktFilterCfg); |
| 23134 | |
| 23135 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23136 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23137 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23138 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23139 | wdiReceiveFilterSetFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23140 | WDI_RECEIVE_FILTER_SET_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23141 | } |
| 23142 | |
| 23143 | /** |
| 23144 | @brief Process Packet Filter Match Count Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23145 | |
| 23146 | @param pWDICtx: pointer to the WLAN DAL context |
| 23147 | pEventData: pointer to the event information structure |
| 23148 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23149 | @see |
| 23150 | @return Result of the function call |
| 23151 | */ |
| 23152 | WDI_Status |
| 23153 | WDI_ProcessFilterMatchCountReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23154 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23155 | WDI_ControlBlockType* pWDICtx, |
| 23156 | WDI_EventInfoType* pEventData |
| 23157 | ) |
| 23158 | { |
| 23159 | WDI_RcvFltPktMatchCntReqParamsType* pwdiRcvFltPktMatchCntReqParamsType = |
| 23160 | NULL; |
| 23161 | WDI_FilterMatchCountCb wdiFilterMatchCountCb = |
| 23162 | NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23163 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23164 | wpt_uint16 usDataOffset = 0; |
| 23165 | wpt_uint16 usSendSize = 0; |
| 23166 | |
| 23167 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23168 | "%s",__FUNCTION__); |
| 23169 | |
| 23170 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23171 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23172 | -------------------------------------------------------------------------*/ |
| 23173 | if (( NULL == pEventData ) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23174 | ( NULL == (pwdiRcvFltPktMatchCntReqParamsType = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23175 | (WDI_RcvFltPktMatchCntReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23176 | ( NULL == (wdiFilterMatchCountCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23177 | (WDI_FilterMatchCountCb)pEventData->pCBfnc))) |
| 23178 | { |
| 23179 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23180 | "%s: Invalid parameters", __FUNCTION__); |
| 23181 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23182 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23183 | } |
| 23184 | |
| 23185 | /*----------------------------------------------------------------------- |
| 23186 | Get message buffer |
| 23187 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23188 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 23189 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23190 | 0, |
| 23191 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23192 | ( usSendSize < usDataOffset)) |
| 23193 | { |
| 23194 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23195 | "Unable to get send buffer in " |
| 23196 | "WDI_ProcessFilterMatchCountReq() %x %x %x", |
| 23197 | pEventData, pwdiRcvFltPktMatchCntReqParamsType, |
| 23198 | wdiFilterMatchCountCb); |
| 23199 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23200 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23201 | } |
| 23202 | |
| 23203 | // |
| 23204 | // Don't need to fill send buffer other than header |
| 23205 | // |
| 23206 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktMatchCntReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23207 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktMatchCntReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23208 | |
| 23209 | |
| 23210 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23211 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23212 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23213 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23214 | wdiFilterMatchCountCb, |
| 23215 | pEventData->pUserData, |
| 23216 | WDI_PACKET_COALESCING_FILTER_MATCH_COUNT_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23217 | } |
| 23218 | |
| 23219 | /** |
| 23220 | @brief Process Receive Filter Clear Filter Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23221 | |
| 23222 | @param pWDICtx: pointer to the WLAN DAL context |
| 23223 | pEventData: pointer to the event information structure |
| 23224 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23225 | @see |
| 23226 | @return Result of the function call |
| 23227 | */ |
| 23228 | WDI_Status |
| 23229 | WDI_ProcessReceiveFilterClearFilterReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23230 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23231 | WDI_ControlBlockType* pWDICtx, |
| 23232 | WDI_EventInfoType* pEventData |
| 23233 | ) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23234 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23235 | WDI_RcvFltPktClearReqParamsType* pwdiRcvFltPktClearReqParamsType = NULL; |
| 23236 | WDI_ReceiveFilterClearFilterCb wdiRcvFltPktClearFilterCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23237 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23238 | wpt_uint16 usDataOffset = 0; |
| 23239 | wpt_uint16 usSendSize = 0; |
| 23240 | tHalRcvFltPktClearParam rcvFltPktClearParam; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23241 | wpt_uint8 ucCurrentBSSSesIdx = 0; |
| 23242 | WDI_BSSSessionType* pBSSSes = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23243 | |
| 23244 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23245 | "%s",__FUNCTION__); |
| 23246 | |
| 23247 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23248 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23249 | -------------------------------------------------------------------------*/ |
| 23250 | if (( NULL == pEventData ) || |
| 23251 | ( NULL == (pwdiRcvFltPktClearReqParamsType = |
| 23252 | (WDI_RcvFltPktClearReqParamsType*)pEventData->pEventData)) || |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23253 | ( NULL == (wdiRcvFltPktClearFilterCb = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23254 | (WDI_ReceiveFilterClearFilterCb)pEventData->pCBfnc))) |
| 23255 | { |
| 23256 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23257 | "%s: Invalid parameters", __FUNCTION__); |
| 23258 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23259 | return WDI_STATUS_E_FAILURE; |
| 23260 | } |
| 23261 | |
| 23262 | ucCurrentBSSSesIdx = WDI_FindAssocSession( pWDICtx, |
| 23263 | pwdiRcvFltPktClearReqParamsType->filterClearParam.bssId, |
| 23264 | &pBSSSes); |
| 23265 | if ( NULL == pBSSSes ) |
| 23266 | { |
| 23267 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23268 | " %s : Association for this BSSID does not exist",__FUNCTION__); |
| 23269 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23270 | } |
| 23271 | |
| 23272 | /*----------------------------------------------------------------------- |
| 23273 | Get message buffer |
| 23274 | -----------------------------------------------------------------------*/ |
| 23275 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23276 | WDI_RECEIVE_FILTER_CLEAR_FILTER_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23277 | sizeof(tHalRcvFltPktClearParam), |
| 23278 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23279 | ( usSendSize < (usDataOffset + sizeof(tHalRcvFltPktClearParam)))) |
| 23280 | { |
| 23281 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23282 | "Unable to get send buffer in " |
| 23283 | "WDI_ProcessReceiveFilterClearFilterReq() %x %x %x", |
| 23284 | pEventData, pwdiRcvFltPktClearReqParamsType, |
| 23285 | wdiRcvFltPktClearFilterCb); |
| 23286 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23287 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23288 | } |
| 23289 | |
| 23290 | |
| 23291 | rcvFltPktClearParam.status = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23292 | filterClearParam.status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23293 | rcvFltPktClearParam.filterId = pwdiRcvFltPktClearReqParamsType-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23294 | filterClearParam.filterId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23295 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23296 | rcvFltPktClearParam.bssIdx = pBSSSes->ucBSSIdx; |
| 23297 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23298 | &rcvFltPktClearParam, |
| 23299 | sizeof(rcvFltPktClearParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23300 | |
| 23301 | pWDICtx->wdiReqStatusCB = pwdiRcvFltPktClearReqParamsType->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23302 | pWDICtx->pReqStatusUserData = pwdiRcvFltPktClearReqParamsType->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23303 | |
| 23304 | |
| 23305 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23306 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23307 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23308 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23309 | wdiRcvFltPktClearFilterCb, pEventData->pUserData, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23310 | WDI_RECEIVE_FILTER_CLEAR_FILTER_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23311 | } |
| 23312 | |
| 23313 | /** |
| 23314 | @brief Process 8023 Multicast List Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23315 | |
| 23316 | @param pWDICtx: pointer to the WLAN DAL context |
| 23317 | pEventData: pointer to the event information structure |
| 23318 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23319 | @see |
| 23320 | @return Result of the function call |
| 23321 | */ |
| 23322 | WDI_Status |
| 23323 | WDI_Process8023MulticastListRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23324 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23325 | WDI_ControlBlockType* pWDICtx, |
| 23326 | WDI_EventInfoType* pEventData |
| 23327 | ) |
| 23328 | { |
| 23329 | WDI_Status wdiStatus; |
| 23330 | eHalStatus halStatus; |
| 23331 | WDI_8023MulticastListCb wdi8023MulticastListCb; |
| 23332 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23333 | |
| 23334 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23335 | "%s",__FUNCTION__); |
| 23336 | |
| 23337 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23338 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23339 | -------------------------------------------------------------------------*/ |
| 23340 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23341 | ( NULL == pEventData->pEventData )) |
| 23342 | { |
| 23343 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23344 | "%s: Invalid parameters", __FUNCTION__); |
| 23345 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23346 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23347 | } |
| 23348 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23349 | wdi8023MulticastListCb = (WDI_8023MulticastListCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23350 | |
| 23351 | /*------------------------------------------------------------------------- |
| 23352 | Extract response and send it to UMAC |
| 23353 | -------------------------------------------------------------------------*/ |
| 23354 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23355 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23356 | |
| 23357 | /*Notify UMAC*/ |
| 23358 | wdi8023MulticastListCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23359 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23360 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23361 | } |
| 23362 | |
| 23363 | /** |
| 23364 | @brief Process Set Rsp function (called when a |
| 23365 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23366 | |
| 23367 | @param pWDICtx: pointer to the WLAN DAL context |
| 23368 | pEventData: pointer to the event information structure |
| 23369 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23370 | @see |
| 23371 | @return Result of the function call |
| 23372 | */ |
| 23373 | WDI_Status |
| 23374 | WDI_ProcessReceiveFilterSetFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23375 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23376 | WDI_ControlBlockType* pWDICtx, |
| 23377 | WDI_EventInfoType* pEventData |
| 23378 | ) |
| 23379 | { |
| 23380 | WDI_Status wdiStatus; |
| 23381 | eHalStatus halStatus; |
| 23382 | WDI_ReceiveFilterSetFilterCb wdiReceiveFilterSetFilterCb; |
| 23383 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23384 | |
| 23385 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23386 | "%s",__FUNCTION__); |
| 23387 | |
| 23388 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23389 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23390 | -------------------------------------------------------------------------*/ |
| 23391 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23392 | ( NULL == pEventData->pEventData )) |
| 23393 | { |
| 23394 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23395 | "%s: Invalid parameters", __FUNCTION__); |
| 23396 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23397 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23398 | } |
| 23399 | |
| 23400 | wdiReceiveFilterSetFilterCb = (WDI_ReceiveFilterSetFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23401 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23402 | |
| 23403 | /*------------------------------------------------------------------------- |
| 23404 | Extract response and send it to UMAC |
| 23405 | -------------------------------------------------------------------------*/ |
| 23406 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23407 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23408 | |
| 23409 | /*Notify UMAC*/ |
| 23410 | wdiReceiveFilterSetFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23411 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23412 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23413 | } |
| 23414 | |
| 23415 | /** |
| 23416 | @brief Process Packet Filter Match Count Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23417 | |
| 23418 | @param pWDICtx: pointer to the WLAN DAL context |
| 23419 | pEventData: pointer to the event information structure |
| 23420 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23421 | @see |
| 23422 | @return Result of the function call |
| 23423 | */ |
| 23424 | WDI_Status |
| 23425 | WDI_ProcessFilterMatchCountRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23426 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23427 | WDI_ControlBlockType* pWDICtx, |
| 23428 | WDI_EventInfoType* pEventData |
| 23429 | ) |
| 23430 | { |
| 23431 | WDI_Status wdiStatus; |
| 23432 | eHalStatus halStatus; |
| 23433 | |
| 23434 | WDI_FilterMatchCountCb wdiFilterMatchCountCb; |
| 23435 | |
| 23436 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23437 | |
| 23438 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23439 | "%s",__FUNCTION__); |
| 23440 | |
| 23441 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23442 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23443 | -------------------------------------------------------------------------*/ |
| 23444 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23445 | ( NULL == pEventData->pEventData )) |
| 23446 | { |
| 23447 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23448 | "%s: Invalid parameters", __FUNCTION__); |
| 23449 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23450 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23451 | } |
| 23452 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23453 | wdiFilterMatchCountCb = (WDI_FilterMatchCountCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23454 | |
| 23455 | /*------------------------------------------------------------------------- |
| 23456 | Extract response and send it to UMAC |
| 23457 | -------------------------------------------------------------------------*/ |
| 23458 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23459 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23460 | |
| 23461 | /*Notify UMAC*/ |
| 23462 | wdiFilterMatchCountCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23463 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23464 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23465 | } |
| 23466 | |
| 23467 | /** |
| 23468 | @brief Process Receive Filter Clear Filter Response function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23469 | |
| 23470 | @param pWDICtx: pointer to the WLAN DAL context |
| 23471 | pEventData: pointer to the event information structure |
| 23472 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23473 | @see |
| 23474 | @return Result of the function call |
| 23475 | */ |
| 23476 | WDI_Status |
| 23477 | WDI_ProcessReceiveFilterClearFilterRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23478 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23479 | WDI_ControlBlockType* pWDICtx, |
| 23480 | WDI_EventInfoType* pEventData |
| 23481 | ) |
| 23482 | { |
| 23483 | WDI_Status wdiStatus; |
| 23484 | eHalStatus halStatus; |
| 23485 | WDI_ReceiveFilterClearFilterCb wdiReceiveFilterClearFilterCb; |
| 23486 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23487 | |
| 23488 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 23489 | "%s",__FUNCTION__); |
| 23490 | |
| 23491 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23492 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23493 | -------------------------------------------------------------------------*/ |
| 23494 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23495 | ( NULL == pEventData->pEventData )) |
| 23496 | { |
| 23497 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23498 | "%s: Invalid parameters", __FUNCTION__); |
| 23499 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23500 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23501 | } |
| 23502 | |
| 23503 | wdiReceiveFilterClearFilterCb = (WDI_ReceiveFilterClearFilterCb)pWDICtx-> |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23504 | pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23505 | |
| 23506 | /*------------------------------------------------------------------------- |
| 23507 | Extract response and send it to UMAC |
| 23508 | -------------------------------------------------------------------------*/ |
| 23509 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23510 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23511 | |
| 23512 | /*Notify UMAC*/ |
| 23513 | wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23514 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23515 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23516 | } |
| 23517 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 23518 | |
| 23519 | /** |
| 23520 | @brief Process Shutdown Rsp function |
| 23521 | There is no shutdown response comming from HAL |
| 23522 | - function just kept for simmetry |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23523 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23524 | @param pWDICtx: pointer to the WLAN DAL context |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23525 | pEventData: pointer to the event information structure |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23526 | |
| 23527 | @see |
| 23528 | @return Result of the function call |
| 23529 | */ |
| 23530 | WDI_Status |
| 23531 | WDI_ProcessShutdownRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23532 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23533 | WDI_ControlBlockType* pWDICtx, |
| 23534 | WDI_EventInfoType* pEventData |
| 23535 | ) |
| 23536 | { |
| 23537 | /*There is no shutdown response comming from HAL - function just kept for |
| 23538 | simmetry */ |
| 23539 | WDI_ASSERT(0); |
| 23540 | return WDI_STATUS_SUCCESS; |
| 23541 | }/*WDI_ProcessShutdownRsp*/ |
| 23542 | |
| 23543 | /** |
| 23544 | @brief WDI_SetPowerParamsReq |
| 23545 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23546 | @param pwdiPowerParamsReqParams: the Set Power Params as |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23547 | specified by the Device Interface |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23548 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23549 | wdiPowerParamsCb: callback for passing back the response |
| 23550 | of the Set Power Params operation received from the |
| 23551 | device |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23552 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23553 | pUserData: user data will be passed back with the |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23554 | callback |
| 23555 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23556 | @return Result of the function call |
| 23557 | */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23558 | WDI_Status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23559 | WDI_SetPowerParamsReq |
| 23560 | ( |
| 23561 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams, |
| 23562 | WDI_SetPowerParamsCb wdiPowerParamsCb, |
| 23563 | void* pUserData |
| 23564 | ) |
| 23565 | { |
| 23566 | WDI_EventInfoType wdiEventData; |
| 23567 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23568 | |
| 23569 | /*------------------------------------------------------------------------ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23570 | Sanity Check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23571 | ------------------------------------------------------------------------*/ |
| 23572 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23573 | { |
| 23574 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23575 | "WDI API call before module is initialized - Fail request"); |
| 23576 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23577 | return WDI_STATUS_E_NOT_ALLOWED; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23578 | } |
| 23579 | |
| 23580 | /*------------------------------------------------------------------------ |
| 23581 | Fill in Event data and post to the Main FSM |
| 23582 | ------------------------------------------------------------------------*/ |
| 23583 | wdiEventData.wdiRequest = WDI_SET_POWER_PARAMS_REQ; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23584 | wdiEventData.pEventData = pwdiPowerParamsReqParams; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23585 | wdiEventData.uEventDataSize = sizeof(*pwdiPowerParamsReqParams); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23586 | wdiEventData.pCBfnc = wdiPowerParamsCb; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23587 | wdiEventData.pUserData = pUserData; |
| 23588 | |
| 23589 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23590 | }/*WDI_SetPowerParamsReq*/ |
| 23591 | |
| 23592 | /** |
| 23593 | @brief Process Set Power Params Request function |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23594 | |
| 23595 | @param pWDICtx: pointer to the WLAN DAL context |
| 23596 | pEventData: pointer to the event information structure |
| 23597 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23598 | @see |
| 23599 | @return Result of the function call |
| 23600 | */ |
| 23601 | WDI_Status |
| 23602 | WDI_ProcessSetPowerParamsReq |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23603 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23604 | WDI_ControlBlockType* pWDICtx, |
| 23605 | WDI_EventInfoType* pEventData |
| 23606 | ) |
| 23607 | { |
| 23608 | WDI_SetPowerParamsReqParamsType* pwdiPowerParamsReqParams = NULL; |
| 23609 | WDI_SetPowerParamsCb wdiPowerParamsCb = NULL; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23610 | wpt_uint8* pSendBuffer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23611 | wpt_uint16 usDataOffset = 0; |
| 23612 | wpt_uint16 usSendSize = 0; |
| 23613 | tSetPowerParamsType powerParams; |
| 23614 | |
| 23615 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23616 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23617 | -------------------------------------------------------------------------*/ |
| 23618 | if (( NULL == pEventData ) || |
| 23619 | ( NULL == (pwdiPowerParamsReqParams = (WDI_SetPowerParamsReqParamsType*)pEventData->pEventData)) || |
| 23620 | ( NULL == (wdiPowerParamsCb = (WDI_SetPowerParamsCb)pEventData->pCBfnc))) |
| 23621 | { |
| 23622 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23623 | "%s: Invalid parameters", __FUNCTION__); |
| 23624 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23625 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23626 | } |
| 23627 | |
| 23628 | /*----------------------------------------------------------------------- |
| 23629 | Get message buffer |
| 23630 | -----------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23631 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_POWER_PARAMS_REQ, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23632 | sizeof(powerParams), |
| 23633 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23634 | ( usSendSize < (usDataOffset + sizeof(powerParams) ))) |
| 23635 | { |
| 23636 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23637 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 23638 | pEventData, pwdiPowerParamsReqParams, wdiPowerParamsCb); |
| 23639 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23640 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23641 | } |
| 23642 | |
| 23643 | /* Ignore DTIM */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23644 | powerParams.uIgnoreDTIM = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23645 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uIgnoreDTIM; |
| 23646 | |
| 23647 | /*DTIM Period*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23648 | powerParams.uDTIMPeriod = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23649 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uDTIMPeriod; |
| 23650 | |
| 23651 | /* Listen Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23652 | powerParams.uListenInterval= |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23653 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uListenInterval; |
| 23654 | |
| 23655 | /* Broadcast Multicas Filter */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23656 | powerParams.uBcastMcastFilter = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23657 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBcastMcastFilter; |
| 23658 | |
| 23659 | /* Beacon Early Termination */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23660 | powerParams.uEnableBET = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23661 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uEnableBET; |
| 23662 | |
| 23663 | /* Beacon Early Termination Interval */ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23664 | powerParams.uBETInterval = |
| 23665 | pwdiPowerParamsReqParams->wdiSetPowerParamsInfo.uBETInterval; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23666 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23667 | |
| 23668 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23669 | &powerParams, |
| 23670 | sizeof(powerParams)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23671 | |
| 23672 | pWDICtx->wdiReqStatusCB = pwdiPowerParamsReqParams->wdiReqStatusCB; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23673 | pWDICtx->pReqStatusUserData = pwdiPowerParamsReqParams->pUserData; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23674 | |
| 23675 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23676 | Send Get STA Request to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23677 | -------------------------------------------------------------------------*/ |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23678 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23679 | wdiPowerParamsCb, pEventData->pUserData, WDI_SET_POWER_PARAMS_RESP); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23680 | } |
| 23681 | |
| 23682 | /** |
| 23683 | @brief Process Power Params Rsp function (called when a |
| 23684 | response is being received over the bus from HAL) |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23685 | |
| 23686 | @param pWDICtx: pointer to the WLAN DAL context |
| 23687 | pEventData: pointer to the event information structure |
| 23688 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23689 | @see |
| 23690 | @return Result of the function call |
| 23691 | */ |
| 23692 | WDI_Status |
| 23693 | WDI_ProcessSetPowerParamsRsp |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23694 | ( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23695 | WDI_ControlBlockType* pWDICtx, |
| 23696 | WDI_EventInfoType* pEventData |
| 23697 | ) |
| 23698 | { |
| 23699 | WDI_Status wdiStatus; |
| 23700 | eHalStatus halStatus; |
| 23701 | WDI_SetPowerParamsCb wdiPowerParamsCb; |
| 23702 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23703 | |
| 23704 | /*------------------------------------------------------------------------- |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23705 | Sanity check |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23706 | -------------------------------------------------------------------------*/ |
| 23707 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 23708 | ( NULL == pEventData->pEventData )) |
| 23709 | { |
| 23710 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23711 | "%s: Invalid parameters", __FUNCTION__); |
| 23712 | WDI_ASSERT(0); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23713 | return WDI_STATUS_E_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23714 | } |
| 23715 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23716 | wdiPowerParamsCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23717 | |
| 23718 | /*------------------------------------------------------------------------- |
| 23719 | Extract response and send it to UMAC |
| 23720 | -------------------------------------------------------------------------*/ |
| 23721 | halStatus = *((eHalStatus*)pEventData->pEventData); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23722 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23723 | |
| 23724 | /*Notify UMAC*/ |
| 23725 | wdiPowerParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 23726 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 23727 | return WDI_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23728 | }/*WDI_ProcessSetPowerParamsRsp*/ |
| 23729 | |
| 23730 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 23731 | /** |
| 23732 | @brief WDI_GTKOffloadReq will be called when the upper MAC |
| 23733 | wants to set GTK Rekey Counter while in power save. Upon |
| 23734 | the call of this API the WLAN DAL will pack and send a |
| 23735 | HAL GTK offload request message to the lower RIVA |
| 23736 | sub-system if DAL is in state STARTED. |
| 23737 | |
| 23738 | In state BUSY this request will be queued. Request won't |
| 23739 | be allowed in any other state. |
| 23740 | |
| 23741 | WDI_PostAssocReq must have been called. |
| 23742 | |
| 23743 | @param pwdiGtkOffloadParams: the GTK offload as specified |
| 23744 | by the Device Interface |
| 23745 | |
| 23746 | wdiGtkOffloadCb: callback for passing back the response |
| 23747 | of the GTK offload operation received from the device |
| 23748 | |
| 23749 | pUserData: user data will be passed back with the |
| 23750 | callback |
| 23751 | |
| 23752 | @see WDI_PostAssocReq |
| 23753 | @return Result of the function call |
| 23754 | */ |
| 23755 | WDI_Status |
| 23756 | WDI_GTKOffloadReq |
| 23757 | ( |
| 23758 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg, |
| 23759 | WDI_GtkOffloadCb wdiGtkOffloadCb, |
| 23760 | void* pUserData |
| 23761 | ) |
| 23762 | { |
| 23763 | WDI_EventInfoType wdiEventData = {0}; |
| 23764 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23765 | |
| 23766 | /*------------------------------------------------------------------------ |
| 23767 | Sanity Check |
| 23768 | ------------------------------------------------------------------------*/ |
| 23769 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23770 | { |
| 23771 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23772 | "WDI API call before module is initialized - Fail request"); |
| 23773 | |
| 23774 | return WDI_STATUS_E_NOT_ALLOWED; |
| 23775 | } |
| 23776 | |
| 23777 | /*------------------------------------------------------------------------ |
| 23778 | Fill in Event data and post to the Main FSM |
| 23779 | ------------------------------------------------------------------------*/ |
| 23780 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_REQ; |
| 23781 | wdiEventData.pEventData = pwdiGtkOffloadReqMsg; |
| 23782 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadReqMsg);; |
| 23783 | wdiEventData.pCBfnc = wdiGtkOffloadCb; |
| 23784 | wdiEventData.pUserData = pUserData; |
| 23785 | |
| 23786 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23787 | } |
| 23788 | |
| 23789 | |
| 23790 | /** |
| 23791 | @brief WDI_GTKOffloadGetInfoReq will be called when the upper |
| 23792 | MAC wants to get GTK Rekey Counter while in power save. |
| 23793 | Upon the call of this API the WLAN DAL will pack and |
| 23794 | send a HAL GTK offload request message to the lower RIVA |
| 23795 | sub-system if DAL is in state STARTED. |
| 23796 | |
| 23797 | In state BUSY this request will be queued. Request won't |
| 23798 | be allowed in any other state. |
| 23799 | |
| 23800 | WDI_PostAssocReq must have been called. |
| 23801 | |
| 23802 | @param pwdiGtkOffloadGetInfoReqMsg: the GTK Offload |
| 23803 | Information Message as specified by the |
| 23804 | Device Interface |
| 23805 | |
| 23806 | wdiGtkOffloadGetInfoCb: callback for passing back the |
| 23807 | response of the GTK offload operation received from the |
| 23808 | device |
| 23809 | |
| 23810 | pUserData: user data will be passed back with the |
| 23811 | callback |
| 23812 | |
| 23813 | @see WDI_PostAssocReq |
| 23814 | @return Result of the function call |
| 23815 | */ |
| 23816 | WDI_Status |
| 23817 | WDI_GTKOffloadGetInfoReq |
| 23818 | ( |
| 23819 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg, |
| 23820 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb, |
| 23821 | void* pUserData |
| 23822 | ) |
| 23823 | { |
| 23824 | WDI_EventInfoType wdiEventData = {0}; |
| 23825 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23826 | |
| 23827 | /*------------------------------------------------------------------------ |
| 23828 | Sanity Check |
| 23829 | ------------------------------------------------------------------------*/ |
| 23830 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 23831 | { |
| 23832 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 23833 | "WDI API call before module is initialized - Fail request"); |
| 23834 | |
| 23835 | return WDI_STATUS_E_NOT_ALLOWED; |
| 23836 | } |
| 23837 | |
| 23838 | /*------------------------------------------------------------------------ |
| 23839 | Fill in Event data and post to the Main FSM |
| 23840 | ------------------------------------------------------------------------*/ |
| 23841 | wdiEventData.wdiRequest = WDI_GTK_OFFLOAD_GETINFO_REQ; |
| 23842 | wdiEventData.pEventData = pwdiGtkOffloadGetInfoReqMsg; |
| 23843 | wdiEventData.uEventDataSize = sizeof(*pwdiGtkOffloadGetInfoReqMsg); |
| 23844 | wdiEventData.pCBfnc = wdiGtkOffloadGetInfoCb; |
| 23845 | wdiEventData.pUserData = pUserData; |
| 23846 | |
| 23847 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 23848 | } |
| 23849 | |
| 23850 | |
| 23851 | /** |
| 23852 | @brief Process set GTK Offload Request function |
| 23853 | |
| 23854 | @param pWDICtx: pointer to the WLAN DAL context |
| 23855 | pEventData: pointer to the event information structure |
| 23856 | |
| 23857 | @see |
| 23858 | @return Result of the function call |
| 23859 | */ |
| 23860 | WDI_Status |
| 23861 | WDI_ProcessGTKOffloadReq |
| 23862 | ( |
| 23863 | WDI_ControlBlockType* pWDICtx, |
| 23864 | WDI_EventInfoType* pEventData |
| 23865 | ) |
| 23866 | { |
| 23867 | WDI_GtkOffloadReqMsg* pwdiGtkOffloadReqMsg = NULL; |
| 23868 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
| 23869 | wpt_uint8* pSendBuffer = NULL; |
| 23870 | wpt_uint16 usDataOffset = 0; |
| 23871 | wpt_uint16 usSendSize = 0; |
| 23872 | tHalGtkOffloadReqParams gtkOffloadReqParams = {0}; |
| 23873 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 23874 | |
| 23875 | /*------------------------------------------------------------------------- |
| 23876 | Sanity check |
| 23877 | -------------------------------------------------------------------------*/ |
| 23878 | if (( NULL == pEventData ) || |
| 23879 | ( NULL == (pwdiGtkOffloadReqMsg = (WDI_GtkOffloadReqMsg*)pEventData->pEventData)) || |
| 23880 | ( NULL == (wdiGtkOffloadCb = (WDI_GtkOffloadCb)pEventData->pCBfnc))) |
| 23881 | { |
| 23882 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23883 | "%s: Invalid parameters", __FUNCTION__); |
| 23884 | WDI_ASSERT(0); |
| 23885 | return WDI_STATUS_E_FAILURE; |
| 23886 | } |
| 23887 | |
| 23888 | /*----------------------------------------------------------------------- |
| 23889 | Get message buffer |
| 23890 | -----------------------------------------------------------------------*/ |
| 23891 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_REQ, |
| 23892 | sizeof(gtkOffloadReqParams), |
| 23893 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23894 | ( usSendSize < (usDataOffset + sizeof(gtkOffloadReqParams) ))) |
| 23895 | { |
| 23896 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23897 | "Unable to get send buffer in GTK offload req %x %x %x", |
| 23898 | pEventData, pwdiGtkOffloadReqMsg, wdiGtkOffloadCb); |
| 23899 | WDI_ASSERT(0); |
| 23900 | return WDI_STATUS_E_FAILURE; |
| 23901 | } |
| 23902 | |
| 23903 | // |
| 23904 | // Fill gtkOffloadReqParams from pwdiGtkOffloadReqMsg->gtkOffloadReqParams |
| 23905 | // |
| 23906 | gtkOffloadReqParams.ulFlags = pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ulFlags; |
| 23907 | // Copy KCK |
| 23908 | wpalMemoryCopy(&(gtkOffloadReqParams.aKCK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKCK[0]), 16); |
| 23909 | // Copy KEK |
| 23910 | wpalMemoryCopy(&(gtkOffloadReqParams.aKEK[0]), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.aKEK[0]), 16); |
| 23911 | // Copy KeyReplayCounter |
| 23912 | wpalMemoryCopy(&(gtkOffloadReqParams.ullKeyReplayCounter), &(pwdiGtkOffloadReqMsg->gtkOffloadReqParams.ullKeyReplayCounter), sizeof(v_U64_t)); |
| 23913 | |
| 23914 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 23915 | >kOffloadReqParams, |
| 23916 | sizeof(gtkOffloadReqParams)); |
| 23917 | |
| 23918 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadReqMsg->wdiReqStatusCB; |
| 23919 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadReqMsg->pUserData; |
| 23920 | |
| 23921 | /*------------------------------------------------------------------------- |
| 23922 | Send Get STA Request to HAL |
| 23923 | -------------------------------------------------------------------------*/ |
| 23924 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23925 | wdiGtkOffloadCb, pEventData->pUserData, WDI_GTK_OFFLOAD_RESP); |
| 23926 | } |
| 23927 | |
| 23928 | |
| 23929 | /** |
| 23930 | @brief Process GTK Offload Get Information Request function |
| 23931 | |
| 23932 | @param pWDICtx: pointer to the WLAN DAL context |
| 23933 | pEventData: pointer to the event information structure |
| 23934 | |
| 23935 | @see |
| 23936 | @return Result of the function call |
| 23937 | */ |
| 23938 | WDI_Status |
| 23939 | WDI_ProcessGTKOffloadGetInfoReq |
| 23940 | ( |
| 23941 | WDI_ControlBlockType* pWDICtx, |
| 23942 | WDI_EventInfoType* pEventData |
| 23943 | ) |
| 23944 | { |
| 23945 | WDI_GtkOffloadGetInfoReqMsg* pwdiGtkOffloadGetInfoReqMsg = NULL; |
| 23946 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
| 23947 | wpt_uint8* pSendBuffer = NULL; |
| 23948 | wpt_uint16 usDataOffset = 0; |
| 23949 | wpt_uint16 usSendSize = 0; |
| 23950 | |
| 23951 | /*------------------------------------------------------------------------- |
| 23952 | Sanity check |
| 23953 | -------------------------------------------------------------------------*/ |
| 23954 | if (( NULL == pEventData ) || |
| 23955 | ( NULL == (pwdiGtkOffloadGetInfoReqMsg = (WDI_GtkOffloadGetInfoReqMsg*)pEventData->pEventData)) || |
| 23956 | ( NULL == (wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pEventData->pCBfnc))) |
| 23957 | { |
| 23958 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23959 | "%s: Invalid parameters", __FUNCTION__); |
| 23960 | WDI_ASSERT(0); |
| 23961 | return WDI_STATUS_E_FAILURE; |
| 23962 | } |
| 23963 | |
| 23964 | /*----------------------------------------------------------------------- |
| 23965 | Get message buffer |
| 23966 | -----------------------------------------------------------------------*/ |
| 23967 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_GTK_OFFLOAD_GETINFO_REQ, |
| 23968 | 0, |
| 23969 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 23970 | ( usSendSize < usDataOffset)) |
| 23971 | { |
| 23972 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 23973 | "Unable to get send buffer in WDI_ProcessGTKOffloadGetInfoReq() %x %x %x", |
| 23974 | pEventData, pwdiGtkOffloadGetInfoReqMsg, wdiGtkOffloadGetInfoCb); |
| 23975 | WDI_ASSERT(0); |
| 23976 | return WDI_STATUS_E_FAILURE; |
| 23977 | } |
| 23978 | |
| 23979 | // |
| 23980 | // Don't need to fill send buffer other than header |
| 23981 | // |
| 23982 | |
| 23983 | pWDICtx->wdiReqStatusCB = pwdiGtkOffloadGetInfoReqMsg->wdiReqStatusCB; |
| 23984 | pWDICtx->pReqStatusUserData = pwdiGtkOffloadGetInfoReqMsg->pUserData; |
| 23985 | |
| 23986 | /*------------------------------------------------------------------------- |
| 23987 | Send Get STA Request to HAL |
| 23988 | -------------------------------------------------------------------------*/ |
| 23989 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 23990 | wdiGtkOffloadGetInfoCb, pEventData->pUserData, WDI_GTK_OFFLOAD_GETINFO_RESP); |
| 23991 | } |
| 23992 | |
| 23993 | /** |
| 23994 | @brief Process host offload Rsp function (called when a |
| 23995 | response is being received over the bus from HAL) |
| 23996 | |
| 23997 | @param pWDICtx: pointer to the WLAN DAL context |
| 23998 | pEventData: pointer to the event information structure |
| 23999 | |
| 24000 | @see |
| 24001 | @return Result of the function call |
| 24002 | */ |
| 24003 | WDI_Status |
| 24004 | WDI_ProcessGtkOffloadRsp |
| 24005 | ( |
| 24006 | WDI_ControlBlockType* pWDICtx, |
| 24007 | WDI_EventInfoType* pEventData |
| 24008 | ) |
| 24009 | { |
| 24010 | WDI_Status wdiStatus; |
| 24011 | eHalStatus halStatus; |
| 24012 | WDI_GtkOffloadCb wdiGtkOffloadCb = NULL; |
| 24013 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24014 | |
| 24015 | wdiGtkOffloadCb = (WDI_GtkOffloadCb)pWDICtx->pfncRspCB; |
| 24016 | |
| 24017 | /*------------------------------------------------------------------------- |
| 24018 | Sanity check |
| 24019 | -------------------------------------------------------------------------*/ |
| 24020 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24021 | ( NULL == pEventData->pEventData)) |
| 24022 | { |
| 24023 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24024 | "%s: Invalid parameters", __FUNCTION__); |
| 24025 | WDI_ASSERT(0); |
| 24026 | return WDI_STATUS_E_FAILURE; |
| 24027 | } |
| 24028 | |
| 24029 | /*------------------------------------------------------------------------- |
| 24030 | Extract response and send it to UMAC |
| 24031 | -------------------------------------------------------------------------*/ |
| 24032 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24033 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24034 | |
| 24035 | /*Notify UMAC*/ |
| 24036 | wdiGtkOffloadCb( wdiStatus, pWDICtx->pRspCBUserData); |
| 24037 | |
| 24038 | return WDI_STATUS_SUCCESS; |
| 24039 | } |
| 24040 | |
| 24041 | /** |
| 24042 | @brief Process GTK Offload Get Information Response function |
| 24043 | |
| 24044 | @param pWDICtx: pointer to the WLAN DAL context |
| 24045 | pEventData: pointer to the event information structure |
| 24046 | |
| 24047 | @see |
| 24048 | @return Result of the function call |
| 24049 | */ |
| 24050 | WDI_Status |
| 24051 | WDI_ProcessGTKOffloadGetInfoRsp |
| 24052 | ( |
| 24053 | WDI_ControlBlockType* pWDICtx, |
| 24054 | WDI_EventInfoType* pEventData |
| 24055 | ) |
| 24056 | { |
| 24057 | WDI_Status wdiStatus; |
| 24058 | eHalStatus halStatus; |
| 24059 | |
| 24060 | WDI_GtkOffloadGetInfoCb wdiGtkOffloadGetInfoCb = NULL; |
| 24061 | |
| 24062 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24063 | |
| 24064 | wdiGtkOffloadGetInfoCb = (WDI_GtkOffloadGetInfoCb)pWDICtx->pfncRspCB; |
| 24065 | |
| 24066 | /*------------------------------------------------------------------------- |
| 24067 | Sanity check |
| 24068 | -------------------------------------------------------------------------*/ |
| 24069 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24070 | ( NULL == pEventData->pEventData )) |
| 24071 | { |
| 24072 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24073 | "%s: Invalid parameters", __FUNCTION__); |
| 24074 | WDI_ASSERT(0); |
| 24075 | return WDI_STATUS_E_FAILURE; |
| 24076 | } |
| 24077 | |
| 24078 | /*------------------------------------------------------------------------- |
| 24079 | Extract response and send it to UMAC |
| 24080 | -------------------------------------------------------------------------*/ |
| 24081 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24082 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24083 | |
| 24084 | /*Notify UMAC*/ |
| 24085 | //wdiUpdateScanParamsCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24086 | //wdiReceiveFilterClearFilterCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24087 | wdiGtkOffloadGetInfoCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24088 | |
| 24089 | return WDI_STATUS_SUCCESS; |
| 24090 | } |
| 24091 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 24092 | |
| 24093 | #ifdef WLAN_WAKEUP_EVENTS |
| 24094 | WDI_Status |
| 24095 | WDI_ProcessWakeReasonInd |
| 24096 | ( |
| 24097 | WDI_ControlBlockType* pWDICtx, |
| 24098 | WDI_EventInfoType* pEventData |
| 24099 | ) |
| 24100 | { |
| 24101 | WDI_LowLevelIndType *pWdiInd; |
| 24102 | tpWakeReasonParams pWakeReasonParams; |
| 24103 | wpt_uint32 allocSize = 0; |
| 24104 | |
| 24105 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24106 | "+%s", __FUNCTION__); |
| 24107 | |
| 24108 | /*------------------------------------------------------------------------- |
| 24109 | Sanity check |
| 24110 | -------------------------------------------------------------------------*/ |
| 24111 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24112 | ( NULL == pEventData->pEventData )) |
| 24113 | { |
| 24114 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24115 | "%s: Invalid parameters", __FUNCTION__); |
| 24116 | WDI_ASSERT( 0 ); |
| 24117 | return WDI_STATUS_E_FAILURE; |
| 24118 | } |
| 24119 | |
| 24120 | /*------------------------------------------------------------------------- |
| 24121 | Extract indication and send it to UMAC |
| 24122 | -------------------------------------------------------------------------*/ |
| 24123 | pWakeReasonParams = (tpWakeReasonParams)(pEventData->pEventData); |
| 24124 | |
| 24125 | allocSize = sizeof(WDI_LowLevelIndType) + (pWakeReasonParams->ulStoredDataLen - 1); |
| 24126 | |
| 24127 | //Allocate memory for WDI_WakeReasonIndType structure |
| 24128 | pWdiInd = wpalMemoryAllocate(allocSize) ; |
| 24129 | |
| 24130 | if(NULL == pWdiInd) |
| 24131 | { |
| 24132 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24133 | "%s: Failed to allocate memory for WDI_WakeReasonIndType: %x %x %x ", |
| 24134 | __FUNCTION__, pWDICtx, pEventData, pEventData->pEventData); |
| 24135 | WDI_ASSERT(0); |
| 24136 | return WDI_STATUS_E_FAILURE; |
| 24137 | } |
| 24138 | |
| 24139 | wpalMemoryZero(pWdiInd, allocSize); |
| 24140 | |
| 24141 | /* Fill in the indication parameters*/ |
| 24142 | // Fill wdiInd.wdiIndicationData.wakeReasonInd structure from wakeReasonInd.wakeReasonParams |
| 24143 | pWdiInd->wdiIndicationType = WDI_WAKE_REASON_IND; |
| 24144 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReason = pWakeReasonParams->ulReason; |
| 24145 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulReasonArg = pWakeReasonParams->ulReasonArg; |
| 24146 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulStoredDataLen = pWakeReasonParams->ulStoredDataLen; |
| 24147 | pWdiInd->wdiIndicationData.wdiWakeReasonInd.ulActualDataLen = pWakeReasonParams->ulActualDataLen; |
| 24148 | wpalMemoryCopy( (void *)&(pWdiInd->wdiIndicationData.wdiWakeReasonInd.aDataStart[0]), |
| 24149 | &(pWakeReasonParams->aDataStart[0]), |
| 24150 | pWakeReasonParams->ulStoredDataLen); |
| 24151 | |
| 24152 | /*Notify UMAC*/ |
| 24153 | pWDICtx->wdiLowLevelIndCB( pWdiInd, pWDICtx->pIndUserData ); |
| 24154 | |
| 24155 | //Free memory allocated for WDI_WakeReasonIndType structure |
| 24156 | wpalMemoryFree(pWdiInd); |
| 24157 | |
| 24158 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24159 | "-%s", __FUNCTION__); |
| 24160 | |
| 24161 | return WDI_STATUS_SUCCESS; |
| 24162 | } |
| 24163 | #endif // WLAN_WAKEUP_EVENTS |
| 24164 | |
| 24165 | void WDI_GetWcnssCompiledApiVersion |
| 24166 | ( |
| 24167 | WDI_WlanVersionType *pWcnssApiVersion |
| 24168 | ) |
| 24169 | { |
| 24170 | pWcnssApiVersion->major = WLAN_HAL_VER_MAJOR; |
| 24171 | pWcnssApiVersion->minor = WLAN_HAL_VER_MINOR; |
| 24172 | pWcnssApiVersion->version = WLAN_HAL_VER_VERSION; |
| 24173 | pWcnssApiVersion->revision = WLAN_HAL_VER_REVISION; |
| 24174 | } |
| 24175 | |
| 24176 | /** |
| 24177 | @brief Process Set TM Level Rsp function (called when a |
| 24178 | response is being received over the bus from HAL) |
| 24179 | |
| 24180 | @param pWDICtx: pointer to the WLAN DAL context |
| 24181 | pEventData: pointer to the event information structure |
| 24182 | |
| 24183 | @see |
| 24184 | @return Result of the function call |
| 24185 | */ |
| 24186 | WDI_Status |
| 24187 | WDI_ProcessSetTmLevelRsp |
| 24188 | ( |
| 24189 | WDI_ControlBlockType* pWDICtx, |
| 24190 | WDI_EventInfoType* pEventData |
| 24191 | ) |
| 24192 | { |
| 24193 | WDI_Status wdiStatus; |
| 24194 | eHalStatus halStatus; |
| 24195 | WDI_SetTmLevelCb wdiSetTmLevelCb; |
| 24196 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24197 | |
| 24198 | /*------------------------------------------------------------------------- |
| 24199 | Sanity check |
| 24200 | -------------------------------------------------------------------------*/ |
| 24201 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24202 | ( NULL == pEventData->pEventData )) |
| 24203 | { |
| 24204 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24205 | "%s: Invalid parameters", __FUNCTION__); |
| 24206 | WDI_ASSERT(0); |
| 24207 | return WDI_STATUS_E_FAILURE; |
| 24208 | } |
| 24209 | |
| 24210 | wdiSetTmLevelCb = (WDI_SetPowerParamsCb)pWDICtx->pfncRspCB; |
| 24211 | |
| 24212 | /*------------------------------------------------------------------------- |
| 24213 | Extract response and send it to UMAC |
| 24214 | -------------------------------------------------------------------------*/ |
| 24215 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24216 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24217 | |
| 24218 | /*Notify UMAC*/ |
| 24219 | wdiSetTmLevelCb(wdiStatus, pWDICtx->pRspCBUserData); |
| 24220 | |
| 24221 | return WDI_STATUS_SUCCESS; |
| 24222 | }/*WDI_ProcessSetTmLevelRsp*/ |
| 24223 | |
| 24224 | /** |
| 24225 | @brief Process Set Thermal Mitigation level Changed request |
| 24226 | |
| 24227 | @param pWDICtx: pointer to the WLAN DAL context |
| 24228 | pEventData: pointer to the event information structure |
| 24229 | |
| 24230 | @see |
| 24231 | @return Result of the function call |
| 24232 | */ |
| 24233 | WDI_Status |
| 24234 | WDI_ProcessSetTmLevelReq |
| 24235 | ( |
| 24236 | WDI_ControlBlockType* pWDICtx, |
| 24237 | WDI_EventInfoType* pEventData |
| 24238 | ) |
| 24239 | { |
| 24240 | WDI_SetTmLevelReqType *pwdiSetTmLevelReq = NULL; |
| 24241 | WDI_SetTmLevelCb wdiSetTmLevelCb = NULL; |
| 24242 | wpt_uint8* pSendBuffer = NULL; |
| 24243 | wpt_uint16 usDataOffset = 0; |
| 24244 | wpt_uint16 usSendSize = 0; |
| 24245 | tSetThermalMitgationType halTmMsg; |
| 24246 | |
| 24247 | /*------------------------------------------------------------------------- |
| 24248 | Sanity check |
| 24249 | -------------------------------------------------------------------------*/ |
| 24250 | if (( NULL == pEventData ) || |
| 24251 | ( NULL == (pwdiSetTmLevelReq = (WDI_SetTmLevelReqType*)pEventData->pEventData)) || |
| 24252 | ( NULL == (wdiSetTmLevelCb = (WDI_SetTmLevelCb)pEventData->pCBfnc))) |
| 24253 | { |
| 24254 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24255 | "%s: Invalid parameters", __FUNCTION__); |
| 24256 | WDI_ASSERT(0); |
| 24257 | return WDI_STATUS_E_FAILURE; |
| 24258 | } |
| 24259 | |
| 24260 | /*----------------------------------------------------------------------- |
| 24261 | Get message buffer |
| 24262 | -----------------------------------------------------------------------*/ |
| 24263 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_SET_TM_LEVEL_REQ, |
| 24264 | sizeof(halTmMsg), |
| 24265 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24266 | ( usSendSize < (usDataOffset + sizeof(halTmMsg) ))) |
| 24267 | { |
| 24268 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24269 | "Unable to get send buffer in Set PNO req %x %x %x", |
| 24270 | pEventData, pwdiSetTmLevelReq, wdiSetTmLevelCb); |
| 24271 | WDI_ASSERT(0); |
| 24272 | return WDI_STATUS_E_FAILURE; |
| 24273 | } |
| 24274 | |
| 24275 | halTmMsg.thermalMitMode = pwdiSetTmLevelReq->tmMode; |
| 24276 | halTmMsg.thermalMitLevel = pwdiSetTmLevelReq->tmLevel; |
| 24277 | |
| 24278 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24279 | &halTmMsg, |
| 24280 | sizeof(halTmMsg)); |
| 24281 | |
| 24282 | pWDICtx->pReqStatusUserData = pwdiSetTmLevelReq->pUserData; |
| 24283 | pWDICtx->pfncRspCB = NULL; |
| 24284 | /*------------------------------------------------------------------------- |
| 24285 | Send Get STA Request to HAL |
| 24286 | -------------------------------------------------------------------------*/ |
| 24287 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24288 | wdiSetTmLevelCb, pEventData->pUserData, WDI_SET_TM_LEVEL_RESP); |
| 24289 | } |
| 24290 | |
| 24291 | /* Fill the value from the global features enabled array to the global capabilities |
| 24292 | * bitmap struct |
| 24293 | */ |
| 24294 | static void |
| 24295 | FillAllFeatureCaps(tWlanFeatCaps *fCaps, placeHolderInCapBitmap *enabledFeat, wpt_int8 len) |
| 24296 | { |
| 24297 | wpt_int8 i; |
| 24298 | for (i=0; i<len; i++) |
| 24299 | { |
| 24300 | setFeatCaps(fCaps, enabledFeat[i]); |
| 24301 | } |
| 24302 | } |
| 24303 | |
| 24304 | /** |
| 24305 | @brief WDI_featureCapsExchangeReq |
| 24306 | Post feature capability bitmap exchange event. |
| 24307 | Host will send its own capability to FW in this req and |
| 24308 | expect FW to send its capability back as a bitmap in Response |
| 24309 | |
| 24310 | @param |
| 24311 | |
| 24312 | wdiFeatureCapsExchangeCb: callback called on getting the response. |
| 24313 | It is kept to mantain similarity between WDI reqs and if needed, can |
| 24314 | be used in future. Currently, It is set to NULL |
| 24315 | |
| 24316 | pUserData: user data will be passed back with the |
| 24317 | callback |
| 24318 | |
| 24319 | @see |
| 24320 | @return Result of the function call |
| 24321 | */ |
| 24322 | WDI_Status |
| 24323 | WDI_featureCapsExchangeReq |
| 24324 | ( |
| 24325 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb, |
| 24326 | void* pUserData |
| 24327 | ) |
| 24328 | { |
| 24329 | WDI_EventInfoType wdiEventData; |
| 24330 | wpt_int32 fCapsStructSize; |
| 24331 | |
| 24332 | /*------------------------------------------------------------------------ |
| 24333 | Sanity Check |
| 24334 | ------------------------------------------------------------------------*/ |
| 24335 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24336 | { |
| 24337 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24338 | "WDI API call before module is initialized - Fail request"); |
| 24339 | |
| 24340 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24341 | } |
| 24342 | |
| 24343 | /* Allocate memory separately for global variable carrying FW caps */ |
| 24344 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 24345 | gpHostWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 24346 | if ( NULL == gpHostWlanFeatCaps ) |
| 24347 | { |
| 24348 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24349 | "Cannot allocate memory for host capability info\n"); |
| 24350 | WDI_ASSERT(0); |
| 24351 | return WDI_STATUS_MEM_FAILURE; |
| 24352 | } |
| 24353 | |
| 24354 | wpalMemoryZero(gpHostWlanFeatCaps, fCapsStructSize); |
| 24355 | |
| 24356 | /*------------------------------------------------------------------------ |
| 24357 | Fill in Event data and post to the Main FSM |
| 24358 | ------------------------------------------------------------------------*/ |
| 24359 | FillAllFeatureCaps(gpHostWlanFeatCaps, supportEnabledFeatures, |
| 24360 | (sizeof(supportEnabledFeatures)/sizeof(supportEnabledFeatures[0]))); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24361 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24362 | "Host caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24363 | gpHostWlanFeatCaps->featCaps[0], |
| 24364 | gpHostWlanFeatCaps->featCaps[1], |
| 24365 | gpHostWlanFeatCaps->featCaps[2], |
| 24366 | gpHostWlanFeatCaps->featCaps[3] |
| 24367 | ); |
| 24368 | |
| 24369 | wdiEventData.wdiRequest = WDI_FEATURE_CAPS_EXCHANGE_REQ; |
| 24370 | wdiEventData.pEventData = gpHostWlanFeatCaps; |
| 24371 | wdiEventData.uEventDataSize = fCapsStructSize; |
| 24372 | wdiEventData.pCBfnc = wdiFeatureCapsExchangeCb; |
| 24373 | wdiEventData.pUserData = pUserData; |
| 24374 | |
| 24375 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24376 | } |
| 24377 | |
| 24378 | /** |
| 24379 | @brief Process Host-FW Capability Exchange Request function |
| 24380 | |
| 24381 | @param pWDICtx: pointer to the WLAN DAL context |
| 24382 | pEventData: pointer to the event information structure |
| 24383 | |
| 24384 | @see |
| 24385 | @return Result of the function call |
| 24386 | */ |
| 24387 | WDI_Status |
| 24388 | WDI_ProcessFeatureCapsExchangeReq |
| 24389 | ( |
| 24390 | WDI_ControlBlockType* pWDICtx, |
| 24391 | WDI_EventInfoType* pEventData |
| 24392 | ) |
| 24393 | { |
| 24394 | wpt_uint8* pSendBuffer = NULL; |
| 24395 | wpt_uint16 usDataOffset = 0; |
| 24396 | wpt_uint16 usSendSize = 0; |
| 24397 | wpt_uint16 usLen = 0; |
| 24398 | |
| 24399 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24400 | |
| 24401 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24402 | "%s", __FUNCTION__); |
| 24403 | |
| 24404 | /*------------------------------------------------------------------------- |
| 24405 | Sanity check |
| 24406 | -------------------------------------------------------------------------*/ |
| 24407 | /* Call back function is NULL since not required for cap exchange req */ |
| 24408 | if (( NULL == pEventData ) || |
| 24409 | ( NULL == (tWlanFeatCaps *)pEventData->pEventData)) |
| 24410 | { |
| 24411 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 24412 | "%s: Invalid parameters", __FUNCTION__); |
| 24413 | WDI_ASSERT(0); |
| 24414 | return WDI_STATUS_E_FAILURE; |
| 24415 | } |
| 24416 | |
| 24417 | /*----------------------------------------------------------------------- |
| 24418 | Get message buffer |
| 24419 | -----------------------------------------------------------------------*/ |
| 24420 | usLen = sizeof(tWlanFeatCaps); |
| 24421 | |
| 24422 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, |
| 24423 | WDI_FEATURE_CAPS_EXCHANGE_REQ, |
| 24424 | usLen, |
| 24425 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24426 | ( usSendSize < (usDataOffset + usLen ))) |
| 24427 | { |
| 24428 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_FATAL, |
| 24429 | "Unable to get send buffer in feat caps exchange req %x %x", |
| 24430 | pEventData, (tWlanFeatCaps *)pEventData->pEventData); |
| 24431 | WDI_ASSERT(0); |
| 24432 | return WDI_STATUS_E_FAILURE; |
| 24433 | } |
| 24434 | |
| 24435 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24436 | "Host Caps - %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24437 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[0], |
| 24438 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[1], |
| 24439 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[2], |
| 24440 | ((tWlanFeatCaps *)pEventData->pEventData)->featCaps[3] |
| 24441 | ); |
| 24442 | |
| 24443 | /* Copy host caps after the offset in the send buffer */ |
| 24444 | wpalMemoryCopy( pSendBuffer+usDataOffset, |
| 24445 | (tWlanFeatCaps *)pEventData->pEventData, |
| 24446 | usLen); |
| 24447 | |
| 24448 | /*------------------------------------------------------------------------- |
| 24449 | Send Start Request to HAL |
| 24450 | -------------------------------------------------------------------------*/ |
| 24451 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24452 | (WDI_StartRspCb)pEventData->pCBfnc, |
| 24453 | pEventData->pUserData, WDI_FEATURE_CAPS_EXCHANGE_RESP); |
| 24454 | |
| 24455 | }/*WDI_ProcessFeatureCapsExchangeReq*/ |
| 24456 | |
| 24457 | /** |
| 24458 | @brief Process Host-FW Capability Exchange Response function |
| 24459 | |
| 24460 | @param pWDICtx: pointer to the WLAN DAL context |
| 24461 | pEventData: pointer to the event information structure |
| 24462 | |
| 24463 | @see |
| 24464 | @return Result of the function call |
| 24465 | */ |
| 24466 | WDI_Status |
| 24467 | WDI_ProcessFeatureCapsExchangeRsp |
| 24468 | ( |
| 24469 | WDI_ControlBlockType* pWDICtx, |
| 24470 | WDI_EventInfoType* pEventData |
| 24471 | ) |
| 24472 | { |
| 24473 | WDI_featureCapsExchangeCb wdiFeatureCapsExchangeCb; |
| 24474 | wpt_int32 fCapsStructSize; |
| 24475 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24476 | |
| 24477 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24478 | "%s", __FUNCTION__); |
| 24479 | |
| 24480 | /*------------------------------------------------------------------------- |
| 24481 | Sanity check |
| 24482 | -------------------------------------------------------------------------*/ |
| 24483 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24484 | ( NULL == pEventData->pEventData )) |
| 24485 | { |
| 24486 | /* It will go here when riva is old (doesn't understand this msg) and host is new */ |
| 24487 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24488 | "%s: Invalid parameters", __FUNCTION__); |
| 24489 | WDI_ASSERT(0); |
| 24490 | return WDI_STATUS_E_FAILURE; |
| 24491 | } |
| 24492 | |
| 24493 | /* Allocate memory separately for global variable carrying FW caps */ |
| 24494 | fCapsStructSize = sizeof(tWlanFeatCaps); |
| 24495 | gpFwWlanFeatCaps = wpalMemoryAllocate(fCapsStructSize); |
| 24496 | if ( NULL == gpFwWlanFeatCaps ) |
| 24497 | { |
| 24498 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24499 | "Cannot allocate memory for host capability info\n"); |
| 24500 | WDI_ASSERT(0); |
| 24501 | return WDI_STATUS_MEM_FAILURE; |
| 24502 | } |
| 24503 | |
| 24504 | /*------------------------------------------------------------------------- |
| 24505 | Unpack HAL Response Message - the header was already extracted by the |
| 24506 | main Response Handling procedure |
| 24507 | -------------------------------------------------------------------------*/ |
| 24508 | /*------------------------------------------------------------------------- |
| 24509 | Extract response and send it to UMAC |
| 24510 | -------------------------------------------------------------------------*/ |
| 24511 | |
| 24512 | wpalMemoryCopy(gpFwWlanFeatCaps,(tWlanFeatCaps *) pEventData -> pEventData, |
| 24513 | fCapsStructSize); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24514 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24515 | "FW caps %x %x %x %x\n", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24516 | gpFwWlanFeatCaps->featCaps[0], |
| 24517 | gpFwWlanFeatCaps->featCaps[1], |
| 24518 | gpFwWlanFeatCaps->featCaps[2], |
| 24519 | gpFwWlanFeatCaps->featCaps[3] |
| 24520 | ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 24521 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24522 | wdiFeatureCapsExchangeCb = (WDI_featureCapsExchangeCb) pWDICtx -> pfncRspCB; |
| 24523 | |
| 24524 | /*Notify UMAC - there is no callback right now but can be used in future if reqd */ |
| 24525 | if (wdiFeatureCapsExchangeCb != NULL) |
| 24526 | wdiFeatureCapsExchangeCb(NULL, NULL); |
| 24527 | |
| 24528 | return WDI_STATUS_SUCCESS; |
| 24529 | } |
| 24530 | |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 24531 | #ifdef WLAN_FEATURE_11AC |
| 24532 | WDI_Status |
| 24533 | WDI_ProcessUpdateVHTOpModeRsp |
| 24534 | ( |
| 24535 | WDI_ControlBlockType* pWDICtx, |
| 24536 | WDI_EventInfoType* pEventData |
| 24537 | ) |
| 24538 | { |
| 24539 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 24540 | WDI_Status wdiStatus; |
| 24541 | eHalStatus halStatus; |
| 24542 | |
| 24543 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24544 | |
| 24545 | /*------------------------------------------------------------------------- |
| 24546 | Sanity check |
| 24547 | -------------------------------------------------------------------------*/ |
| 24548 | if (( NULL == pWDICtx ) || ( NULL == pEventData ) || |
| 24549 | ( NULL == pEventData->pEventData)) |
| 24550 | { |
| 24551 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24552 | "%s: Invalid parameters", __FUNCTION__); |
| 24553 | WDI_ASSERT(0); |
| 24554 | return WDI_STATUS_E_FAILURE; |
| 24555 | } |
| 24556 | wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc; |
| 24557 | |
| 24558 | /*------------------------------------------------------------------------- |
| 24559 | Extract response and send it to UMAC |
| 24560 | -------------------------------------------------------------------------*/ |
| 24561 | halStatus = *((eHalStatus*)pEventData->pEventData); |
| 24562 | wdiStatus = WDI_HAL_2_WDI_STATUS(halStatus); |
| 24563 | |
| 24564 | /*Notify UMAC*/ |
| 24565 | wdiVHTOpModeCb( wdiStatus, pEventData->pUserData); |
| 24566 | |
| 24567 | return WDI_STATUS_SUCCESS; |
| 24568 | } |
| 24569 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 24570 | /** |
| 24571 | @brief WDI_getHostWlanFeatCaps |
| 24572 | WDI API that returns whether the feature passed to it as enum value in |
| 24573 | "placeHolderInCapBitmap" is supported by Host or not. It uses WDI global |
| 24574 | variable storing host capability bitmap to find this. This can be used by |
| 24575 | other moduels to decide certain things like call different APIs based on |
| 24576 | whether a particular feature is supported. |
| 24577 | |
| 24578 | @param |
| 24579 | |
| 24580 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap in wlan_hal_msg.h. |
| 24581 | |
| 24582 | @see |
| 24583 | @return |
| 24584 | 0 - if the feature is NOT supported in host |
| 24585 | any non-zero value - if the feature is SUPPORTED in host. |
| 24586 | */ |
| 24587 | wpt_uint8 WDI_getHostWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 24588 | { |
| 24589 | wpt_uint8 featSupported = 0; |
| 24590 | if (gpHostWlanFeatCaps != NULL) |
| 24591 | { |
| 24592 | getFeatCaps(gpHostWlanFeatCaps, feat_enum_value, featSupported); |
| 24593 | } |
| 24594 | else |
| 24595 | { |
| 24596 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame^] | 24597 | "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] | 24598 | } |
| 24599 | return featSupported; |
| 24600 | } |
| 24601 | |
| 24602 | /** |
| 24603 | @brief WDI_getFwWlanFeatCaps |
| 24604 | WDI API that returns whether the feature passed to it as enum value in |
| 24605 | "placeHolderInCapBitmap" is supported by FW or not. It uses WDI global |
| 24606 | variable storing host capability bitmap to find this. This can be used by |
| 24607 | other moduels to decide certain things like call different APIs based on |
| 24608 | whether a particular feature is supported. |
| 24609 | |
| 24610 | @param |
| 24611 | |
| 24612 | feat_enum_value: enum value for the feature as in placeHolderInCapBitmap |
| 24613 | in wlan_hal_msg.h. |
| 24614 | |
| 24615 | @see |
| 24616 | @return |
| 24617 | 0 - if the feature is NOT supported in FW |
| 24618 | any non-zero value - if the feature is SUPPORTED in FW. |
| 24619 | */ |
| 24620 | wpt_uint8 WDI_getFwWlanFeatCaps(wpt_uint8 feat_enum_value) |
| 24621 | { |
| 24622 | wpt_uint8 featSupported = 0; |
| 24623 | if (gpFwWlanFeatCaps != NULL) |
| 24624 | { |
| 24625 | getFeatCaps(gpFwWlanFeatCaps, feat_enum_value, featSupported); |
| 24626 | } |
| 24627 | else |
| 24628 | { |
| 24629 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 8bdd311 | 2012-09-24 13:55:14 -0700 | [diff] [blame^] | 24630 | "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] | 24631 | } |
| 24632 | return featSupported; |
| 24633 | } |
Mohit Khanna | 4a70d26 | 2012-09-11 16:30:12 -0700 | [diff] [blame] | 24634 | |
| 24635 | #ifdef WLAN_FEATURE_11AC |
| 24636 | WDI_Status |
| 24637 | WDI_ProcessUpdateVHTOpModeReq |
| 24638 | ( |
| 24639 | WDI_ControlBlockType* pWDICtx, |
| 24640 | WDI_EventInfoType* pEventData |
| 24641 | ) |
| 24642 | { |
| 24643 | WDI_UpdateVHTOpMode* pwdiVHTOpModeParams = NULL; |
| 24644 | WDI_UpdateVHTOpModeCb wdiVHTOpModeCb = NULL; |
| 24645 | wpt_uint8* pSendBuffer = NULL; |
| 24646 | wpt_uint16 usDataOffset = 0; |
| 24647 | wpt_uint16 usSendSize = 0; |
| 24648 | |
| 24649 | /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ |
| 24650 | |
| 24651 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_INFO, |
| 24652 | "%s", __FUNCTION__); |
| 24653 | |
| 24654 | /*------------------------------------------------------------------------- |
| 24655 | Sanity check |
| 24656 | -------------------------------------------------------------------------*/ |
| 24657 | if (( NULL == pEventData ) || |
| 24658 | ( NULL == (pwdiVHTOpModeParams = (WDI_UpdateVHTOpMode*)pEventData->pEventData)) || |
| 24659 | ( NULL == (wdiVHTOpModeCb = (WDI_UpdateVHTOpModeCb)pEventData->pCBfnc))) |
| 24660 | { |
| 24661 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24662 | "%s: Invalid parameters", __FUNCTION__); |
| 24663 | WDI_ASSERT(0); |
| 24664 | return WDI_STATUS_E_FAILURE; |
| 24665 | } |
| 24666 | |
| 24667 | /*----------------------------------------------------------------------- |
| 24668 | Get message buffer |
| 24669 | -----------------------------------------------------------------------*/ |
| 24670 | if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx, WDI_UPDATE_VHT_OP_MODE_REQ, |
| 24671 | sizeof(WDI_UpdateVHTOpMode), |
| 24672 | &pSendBuffer, &usDataOffset, &usSendSize))|| |
| 24673 | ( usSendSize < (usDataOffset + sizeof(WDI_UpdateVHTOpMode) ))) |
| 24674 | { |
| 24675 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24676 | "Unable to get send buffer in update vht opMode req"); |
| 24677 | WDI_ASSERT(0); |
| 24678 | return WDI_STATUS_E_FAILURE; |
| 24679 | } |
| 24680 | |
| 24681 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24682 | "pwdiVHTOpModeParams->opMode=%d, pwdiVHTOpModeParams->staId=%d\n", pwdiVHTOpModeParams->opMode, pwdiVHTOpModeParams->staId); |
| 24683 | |
| 24684 | wpalMemoryCopy( pSendBuffer+usDataOffset, pwdiVHTOpModeParams, |
| 24685 | sizeof(WDI_UpdateVHTOpMode)); |
| 24686 | |
| 24687 | /*------------------------------------------------------------------------- |
| 24688 | Send Start Request to HAL |
| 24689 | -------------------------------------------------------------------------*/ |
| 24690 | return WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize, |
| 24691 | wdiVHTOpModeCb, |
| 24692 | pEventData->pUserData, WDI_UPDATE_VHT_OP_MODE_RESP); |
| 24693 | |
| 24694 | } |
| 24695 | |
| 24696 | WDI_Status |
| 24697 | WDI_UpdateVHTOpModeReq |
| 24698 | ( |
| 24699 | WDI_UpdateVHTOpMode *pData, |
| 24700 | WDI_UpdateVHTOpModeCb wdiUpdateVHTOpModeCb, |
| 24701 | void* pUserData |
| 24702 | ) |
| 24703 | { |
| 24704 | WDI_EventInfoType wdiEventData; |
| 24705 | |
| 24706 | /*------------------------------------------------------------------------ |
| 24707 | Sanity Check |
| 24708 | ------------------------------------------------------------------------*/ |
| 24709 | if ( eWLAN_PAL_FALSE == gWDIInitialized ) |
| 24710 | { |
| 24711 | WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR, |
| 24712 | "WDI API call before module is initialized - Fail request"); |
| 24713 | |
| 24714 | return WDI_STATUS_E_NOT_ALLOWED; |
| 24715 | } |
| 24716 | |
| 24717 | /*------------------------------------------------------------------------ |
| 24718 | Fill in Event data and post to the Main FSM |
| 24719 | ------------------------------------------------------------------------*/ |
| 24720 | wdiEventData.wdiRequest = WDI_UPDATE_VHT_OP_MODE_REQ; |
| 24721 | wdiEventData.pEventData = pData; |
| 24722 | wdiEventData.uEventDataSize = sizeof(WDI_UpdateVHTOpMode); |
| 24723 | wdiEventData.pCBfnc = wdiUpdateVHTOpModeCb; |
| 24724 | wdiEventData.pUserData = pUserData; |
| 24725 | |
| 24726 | WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN, |
| 24727 | "pData->opMode=%d, pData->staId=%d\n", pData->opMode, pData->staId); |
| 24728 | |
| 24729 | return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData); |
| 24730 | |
| 24731 | } |
| 24732 | #endif |